@opengis/fastify-table 2.5.48 → 2.5.50

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.
@@ -248,7 +248,7 @@ export default function formatValue({ table, filter = {}, name, value, dataTypeI
248
248
  return {
249
249
  op: "=",
250
250
  query,
251
- values: [value],
251
+ values: [value.split(",")],
252
252
  };
253
253
  }
254
254
  const query = `${name}::text=any($${args.length})`;
@@ -46,7 +46,7 @@ const tableSchema = {
46
46
  params: {
47
47
  type: "object",
48
48
  properties: {
49
- id: { type: "string", pattern: "^([\\d\\w]+)$" },
49
+ id: { type: "string", pattern: "^([\\d\\w_.-]+)$" },
50
50
  table: { type: "string", pattern: "^([\\d\\w_.-]+)$" },
51
51
  },
52
52
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.5.48",
3
+ "version": "2.5.50",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [
@@ -1,5 +0,0 @@
1
- export default function getAdminAccess({ id, user, }: {
2
- id?: string;
3
- user?: Record<string, string> | undefined;
4
- }): Promise<null>;
5
- //# sourceMappingURL=getAdminAccess.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getAdminAccess.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/access/funcs/getAdminAccess.ts"],"names":[],"mappings":"AAGA,wBAA8B,cAAc,CAAC,EAC3C,EAAE,EACF,IAAI,GACL,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CAC3C,iBAYA"}
@@ -1,12 +0,0 @@
1
- import config from "../../../../config.js";
2
- import { BadRequestError, ForbiddenError } from "../../../../errors.js";
3
- export default async function getAdminAccess({ id, user, }) {
4
- if (!id) {
5
- throw BadRequestError("not enough params: id");
6
- }
7
- if (!config?.local &&
8
- !["admin"].includes(user?.user_type || user?.type || "")) {
9
- throw new ForbiddenError("access restricted: admin");
10
- }
11
- return null;
12
- }
@@ -1,3 +0,0 @@
1
- declare function plugin(app: any, opt?: any): void;
2
- export default plugin;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/crud/index.ts"],"names":[],"mappings":"AAmBA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAqDtC;AAED,eAAe,MAAM,CAAC"}
@@ -1,55 +0,0 @@
1
- import update from "./controllers/update.js";
2
- import insert from "./controllers/insert.js";
3
- import deleteCrud from "./controllers/deleteCrud.js";
4
- import table from "./controllers/table.js";
5
- const tableSchema = {
6
- params: {
7
- type: "object",
8
- properties: {
9
- id: { type: "string", pattern: "^([\\w\\d_.]+)$" },
10
- table: { type: "string", pattern: "^([\\w\\d_.]+)$" },
11
- },
12
- },
13
- };
14
- const policy = "L0";
15
- const tags = ["core", "crud"];
16
- const packageName = "fastify-table";
17
- function plugin(app, opt = {}) {
18
- app.put("/table/:table/:id?", {
19
- config: {
20
- tags,
21
- package: packageName,
22
- policy,
23
- summary: "Edit table data",
24
- },
25
- schema: tableSchema,
26
- }, update);
27
- app.delete("/table/:table/:id?", {
28
- config: {
29
- tags,
30
- package: packageName,
31
- policy,
32
- summary: "Delete table data",
33
- },
34
- schema: tableSchema,
35
- }, deleteCrud);
36
- app.post("/table/:table/:id?", {
37
- config: {
38
- tags,
39
- package: packageName,
40
- policy,
41
- summary: "Add table data",
42
- },
43
- schema: tableSchema,
44
- }, insert);
45
- app.get("/table/:table/:id?", {
46
- config: {
47
- tags,
48
- package: packageName,
49
- policy,
50
- summary: "Get table data",
51
- },
52
- schema: tableSchema,
53
- }, table);
54
- }
55
- export default plugin;