@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.
- package/dist/server/plugins/table/funcs/getFilterSQLParametrized/formatValue.js +1 -1
- package/dist/server/routes/table/schema.js +1 -1
- package/package.json +1 -1
- package/dist/server/plugins/access/funcs/getAdminAccess.d.ts +0 -5
- package/dist/server/plugins/access/funcs/getAdminAccess.d.ts.map +0 -1
- package/dist/server/plugins/access/funcs/getAdminAccess.js +0 -12
- package/dist/server/routes/crud/index.d.ts +0 -3
- package/dist/server/routes/crud/index.d.ts.map +0 -1
- package/dist/server/routes/crud/index.js +0 -55
package/package.json
CHANGED
|
@@ -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 +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;
|