@opengis/fastify-table 2.5.38 → 2.5.39

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.
Files changed (46) hide show
  1. package/dist/index.d.ts.map +1 -1
  2. package/dist/index.js +10 -2
  3. package/dist/server/migrations/users.sql +14 -33
  4. package/dist/server/plugins/auth/funcs/verifyPassword.d.ts.map +1 -1
  5. package/dist/server/plugins/auth/funcs/verifyPassword.js +11 -2
  6. package/dist/server/routes/access/index.d.ts.map +1 -1
  7. package/dist/server/routes/access/index.js +16 -6
  8. package/dist/server/routes/auth/index.d.ts.map +1 -1
  9. package/dist/server/routes/auth/index.js +4 -3
  10. package/dist/server/routes/cron/index.d.ts +1 -1
  11. package/dist/server/routes/cron/index.d.ts.map +1 -1
  12. package/dist/server/routes/cron/index.js +8 -2
  13. package/dist/server/routes/crud/index.d.ts.map +1 -1
  14. package/dist/server/routes/crud/index.js +25 -4
  15. package/dist/server/routes/dblist/index.d.ts.map +1 -1
  16. package/dist/server/routes/dblist/index.js +2 -1
  17. package/dist/server/routes/file/index.d.ts.map +1 -1
  18. package/dist/server/routes/file/index.js +9 -4
  19. package/dist/server/routes/grpc/index.d.ts +1 -1
  20. package/dist/server/routes/grpc/index.d.ts.map +1 -1
  21. package/dist/server/routes/grpc/index.js +5 -2
  22. package/dist/server/routes/logger/index.d.ts +1 -1
  23. package/dist/server/routes/logger/index.d.ts.map +1 -1
  24. package/dist/server/routes/logger/index.js +5 -2
  25. package/dist/server/routes/menu/index.d.ts.map +1 -1
  26. package/dist/server/routes/menu/index.js +3 -2
  27. package/dist/server/routes/notifications/index.d.ts.map +1 -1
  28. package/dist/server/routes/notifications/index.js +6 -1
  29. package/dist/server/routes/properties/index.d.ts.map +1 -1
  30. package/dist/server/routes/properties/index.js +9 -2
  31. package/dist/server/routes/table/index.d.ts.map +1 -1
  32. package/dist/server/routes/table/index.js +27 -13
  33. package/dist/server/routes/templates/index.d.ts.map +1 -1
  34. package/dist/server/routes/templates/index.js +2 -1
  35. package/dist/server/routes/upload/index.d.ts.map +1 -1
  36. package/dist/server/routes/upload/index.js +7 -3
  37. package/dist/server/routes/usercls/index.d.ts.map +1 -1
  38. package/dist/server/routes/usercls/index.js +6 -5
  39. package/dist/server/routes/util/controllers/api.list.d.ts +2 -1
  40. package/dist/server/routes/util/controllers/api.list.d.ts.map +1 -1
  41. package/dist/server/routes/util/controllers/api.list.js +9 -3
  42. package/dist/server/routes/util/index.d.ts.map +1 -1
  43. package/dist/server/routes/util/index.js +9 -8
  44. package/dist/server/routes/widget/index.d.ts.map +1 -1
  45. package/dist/server/routes/widget/index.js +5 -1
  46. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AA8FA,iBAAe,MAAM,CAAC,OAAO,EAAE,GAAG,iBA2OjC;;AACD,wBAEG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AA8FA,iBAAe,MAAM,CAAC,OAAO,EAAE,GAAG,iBAmPjC;;AACD,wBAEG"}
package/dist/index.js CHANGED
@@ -67,15 +67,17 @@ async function plugin(fastify) {
67
67
  const opt = { prefix: "/api" };
68
68
  // await new Promise(resolve => setTimeout(resolve, 50000)); // ! for debug, simulate Plugin did not start in time
69
69
  if (config.disableCors) {
70
- fastify.addHook("onSend", async (request, reply) => {
70
+ fastify.addHook("onSend", async (_, reply) => {
71
71
  reply.header("Access-Control-Allow-Origin", "*");
72
72
  });
73
73
  }
74
74
  const apiListSchema = {
75
75
  querystring: {
76
76
  type: "object",
77
+ additionalProperties: false,
77
78
  properties: {
78
79
  package: { type: "string" },
80
+ exclude_package: { type: "string" },
79
81
  subdir: { type: "string" },
80
82
  md: { type: "string", pattern: "^1$" },
81
83
  tags: { type: "string", pattern: "^[a-zA-Z0-9_,]+$" },
@@ -85,12 +87,17 @@ async function plugin(fastify) {
85
87
  };
86
88
  if (!fastify.hasRoute({ method: "GET", url: "/api/list" })) {
87
89
  fastify.get(`${opt.prefix || "/api"}/list`, {
88
- config: { tags: ["core", "util"], role: "admin" },
90
+ config: {
91
+ tags: ["core", "util"],
92
+ package: "fastify-table",
93
+ role: "admin",
94
+ },
89
95
  schema: apiListSchema,
90
96
  }, function apiList(req, reply) {
91
97
  const result = apiListService({
92
98
  includeTags: req.query.tags,
93
99
  excludeTags: req.query.exclude_tags,
100
+ excludePackage: req.query.exclude_package,
94
101
  packageName: req.query.package,
95
102
  subdir: req.query.subdir,
96
103
  md: req.query.md,
@@ -121,6 +128,7 @@ async function plugin(fastify) {
121
128
  package: r.config?.package,
122
129
  tags: Array.isArray(r.config?.tags) ? r.config?.tags : undefined,
123
130
  description: r.config?.description,
131
+ summary: r.config?.summary,
124
132
  query,
125
133
  roles: r.config?.role?.split?.("|"),
126
134
  policy: (Array.isArray(r.config?.policy)
@@ -58,16 +58,8 @@ COMMENT ON COLUMN admin.users.twofa IS 'Двофакторна авториза
58
58
 
59
59
  CREATE EXTENSION if not exists pgcrypto SCHEMA public VERSION "1.3";
60
60
 
61
- CREATE OR REPLACE FUNCTION admin.crypt(pass TEXT,salt TEXT)
62
- RETURNS text AS
63
- $BODY$
64
- DECLARE
65
- BEGIN
66
- return public.crypt(pass, salt);
67
- END;
68
- $BODY$
69
- LANGUAGE plpgsql VOLATILE
70
- COST 100;
61
+ alter table admin.users add column if not exists password_new_hash_algorithm boolean;
62
+ update admin.users set password_new_hash_algorithm = false where password_new_hash_algorithm is null;
71
63
 
72
64
  -- DROP FUNCTION admin.insert_update_user_before();
73
65
  CREATE OR REPLACE FUNCTION admin.insert_update_user_before()
@@ -80,30 +72,19 @@ iterations int;
80
72
  hash character varying;
81
73
 
82
74
  BEGIN
75
+ -- new passwords would use more secure hashing algorithm
76
+ IF TG_OP = 'INSERT' OR (TG_OP = 'UPDATE' AND NEW.password <> OLD.password) THEN
77
+
78
+ NEW.salt = public.gen_salt('bf', 12);
79
+
80
+ IF length(NEW.password) > 0 THEN
81
+ NEW.password = public.crypt(NEW.password, NEW.salt);
82
+ NEW.password_new_hash_algorithm = true;
83
+ END IF;
84
+
85
+ END IF;
83
86
 
84
- if(TG_OP='INSERT' or (TG_OP='UPDATE' and new.password<>old.password)) then
85
- if(char_length(new.password) <> 0 and char_length(new.password) < 8) then
86
- --raise exception 'password must be longer than 8 characters';
87
- end if;
88
- new.salt=md5(now()::text);
89
- --raise exception '%','change pass';
90
- if(new.salt ='') then
91
- new.salt=gen_salt('md5');
92
- end if;
93
- iterations = 10;
94
- hash='';
95
-
96
- loop
97
- if iterations=0 then
98
- exit;
99
- end if;
100
- hash = md5(new.password||hash||new.salt);
101
- iterations=iterations-1;
102
- end loop;
103
- new.password=admin.crypt(hash,new.salt);
104
-
105
- end if;
106
- RETURN new;
87
+ RETURN new;
107
88
  END
108
89
  $BODY$
109
90
 
@@ -1 +1 @@
1
- {"version":3,"file":"verifyPassword.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/auth/funcs/verifyPassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAWpD,wBAA8B,cAAc,CAAC,EAC3C,EAAE,EACF,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,EAAE,EAAE,UAAU,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;;;;;;eAiCA"}
1
+ {"version":3,"file":"verifyPassword.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/auth/funcs/verifyPassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAWpD,wBAA8B,cAAc,CAAC,EAC3C,EAAE,EACF,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,EAAE,EAAE,UAAU,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;;;;;;eA2CA"}
@@ -11,12 +11,21 @@ export default async function verifyPassword({ pg, username, password, }) {
11
11
  return { message: "not enough params: username" };
12
12
  if (!password || password === "")
13
13
  return { message: "not enough params: password" };
14
- const query = "select * from admin.users where $1 in (login,email,phone) and enabled limit 1";
14
+ const query = "select * from admin.users where $1 in (login,email,phone) and enabled and salt is not null limit 1";
15
15
  const json = await pg
16
16
  .query(query, [username])
17
- .then((el) => el.rows?.[0] || {});
17
+ .then((r) => r.rows?.[0] || {});
18
18
  if (!json)
19
19
  return { message: "user not found" };
20
+ if (json.password_new_hash_algorithm === true) {
21
+ const hash = await pg
22
+ .query(`SELECT public.crypt($1, $2)`, [password, json.salt])
23
+ .then((r) => r.rows?.[0]?.crypt);
24
+ if (json.password === hash) {
25
+ return { user: json };
26
+ }
27
+ return { message: "Wrong password" };
28
+ }
20
29
  let hash = "";
21
30
  for (let i = 0; i < 10; i += 1) {
22
31
  hash = md5(password + hash + json.salt);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/access/index.ts"],"names":[],"mappings":"AAkBA,wBAA8B,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,iBAqC9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/access/index.ts"],"names":[],"mappings":"AAmBA,wBAA8B,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,iBA8C9D"}
@@ -6,17 +6,27 @@ import accessInterface from "./controllers/access.interface.js";
6
6
  import { publicResourcesList } from "../../plugins/access/funcs/getResources.js";
7
7
  import { accessGroupPostSchema, accessGroupSchema, accessInterfaceSchema, accessUserPostSchema, accessUserSchema, } from "./schema.js";
8
8
  const tags = ["core", "access"];
9
+ const packageName = "fastify-table";
9
10
  export default async function route(fastify, opt = {}) {
10
- fastify.get("/access-group/:id", { config: { tags, role: "admin" }, schema: accessGroupSchema }, accessGroup);
11
- fastify.post("/access-group/:id", { config: { tags, role: "admin" }, schema: accessGroupPostSchema }, accessGroupPost);
11
+ fastify.get("/access-group/:id", {
12
+ config: { tags, package: packageName, role: "admin" },
13
+ schema: accessGroupSchema,
14
+ }, accessGroup);
15
+ fastify.post("/access-group/:id", {
16
+ config: { tags, package: packageName, role: "admin" },
17
+ schema: accessGroupPostSchema,
18
+ }, accessGroupPost);
12
19
  fastify.get("/access-user/:id", {
13
- config: { tags, permission: "admin.users.read" },
20
+ config: { tags, package: packageName, permission: "admin.users.read" },
14
21
  schema: accessUserSchema,
15
22
  }, accessUser);
16
23
  fastify.post("/access-user/:id", {
17
- config: { tags, permission: "admin.users.update" },
24
+ config: { tags, package: packageName, permission: "admin.users.update" },
18
25
  schema: accessUserPostSchema,
19
26
  }, accessUserPost);
20
- fastify.get("/access-interface/:name", { config: { tags, role: "admin" }, schema: accessInterfaceSchema }, accessInterface);
21
- fastify.get("/resources", { config: { tags, policy: "L0" } }, async () => publicResourcesList);
27
+ fastify.get("/access-interface/:name", {
28
+ config: { tags, package: packageName, role: "admin" },
29
+ schema: accessInterfaceSchema,
30
+ }, accessInterface);
31
+ fastify.get("/resources", { config: { tags, package: packageName, policy: "L0" } }, async () => publicResourcesList);
22
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/auth/index.ts"],"names":[],"mappings":"AA+CA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QA+FtC;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/auth/index.ts"],"names":[],"mappings":"AAgDA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAmGtC;AAED,eAAe,MAAM,CAAC"}
@@ -21,7 +21,8 @@ import oauthAuthorize from "./controllers/jwt/authorize.js";
21
21
  import oauthToken from "./controllers/jwt/token.js";
22
22
  import qrCode from "./controllers/2factor/qrcode.js";
23
23
  const tags = ["core", "auth"];
24
- const params = { config: { policy: "L0", tags } };
24
+ const packageName = "fastify-table";
25
+ const params = { config: { policy: "L0", tags, package: packageName } };
25
26
  const registrationSchema = {
26
27
  body: {
27
28
  type: "object",
@@ -68,14 +69,14 @@ function plugin(app, opt = {}) {
68
69
  app.get("/2factor/recovery", params, recovery);
69
70
  }
70
71
  if (!app.hasRoute({ method: "GET", url: "/2factor/reset" })) {
71
- app.get("/2factor/reset", { config: { tags, role: "admin" } }, reset);
72
+ app.get("/2factor/reset", { config: { tags, package: packageName, role: "admin" } }, reset);
72
73
  }
73
74
  // get/edit user info
74
75
  if (!app.hasRoute({ method: "GET", url: "/user" })) {
75
76
  app.get("/user", params, getUserInfo);
76
77
  }
77
78
  if (!app.hasRoute({ method: "POST", url: "/user" })) {
78
- app.post("/user", { config: { tags, auth: "creds" } }, updateUserInfo);
79
+ app.post("/user", { config: { tags, package: packageName, auth: "creds" } }, updateUserInfo);
79
80
  }
80
81
  // jwt
81
82
  if (!app.hasRoute({ method: "GET", url: "/oauth/authorize" })) {
@@ -1,3 +1,3 @@
1
- declare function plugin(app: any, opt?: any): void;
1
+ declare function plugin(app: any): void;
2
2
  export default plugin;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/cron/index.ts"],"names":[],"mappings":"AAUA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAMtC;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/cron/index.ts"],"names":[],"mappings":"AAmBA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,QAEvB;AAED,eAAe,MAAM,CAAC"}
@@ -1,4 +1,6 @@
1
1
  import cronApi from "./controllers/cronApi.js";
2
+ const tags = ["core", "cron"];
3
+ const packageName = "fastify-table";
2
4
  const cronSchema = {
3
5
  params: {
4
6
  type: "object",
@@ -7,7 +9,11 @@ const cronSchema = {
7
9
  },
8
10
  },
9
11
  };
10
- function plugin(app, opt = {}) {
11
- app.get("/cron/:name", { config: { role: "admin", tags: ["core", "cron"] }, schema: cronSchema }, cronApi);
12
+ const adminParams = {
13
+ config: { role: "admin", tags, package: packageName },
14
+ schema: cronSchema,
15
+ };
16
+ function plugin(app) {
17
+ app.get("/cron/:name", adminParams, cronApi);
12
18
  }
13
19
  export default plugin;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/crud/index.ts"],"names":[],"mappings":"AAkBA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAiCtC;AAED,eAAe,MAAM,CAAC"}
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"}
@@ -13,21 +13,42 @@ const tableSchema = {
13
13
  };
14
14
  const policy = "L0";
15
15
  const tags = ["core", "crud"];
16
+ const packageName = "fastify-table";
16
17
  function plugin(app, opt = {}) {
17
18
  app.put("/table/:table/:id?", {
18
- config: { tags, policy, description: "Edit table data" },
19
+ config: {
20
+ tags,
21
+ package: packageName,
22
+ policy,
23
+ summary: "Edit table data",
24
+ },
19
25
  schema: tableSchema,
20
26
  }, update);
21
27
  app.delete("/table/:table/:id?", {
22
- config: { tags, policy, description: "Delete table data" },
28
+ config: {
29
+ tags,
30
+ package: packageName,
31
+ policy,
32
+ summary: "Delete table data",
33
+ },
23
34
  schema: tableSchema,
24
35
  }, deleteCrud);
25
36
  app.post("/table/:table/:id?", {
26
- config: { tags, policy, description: "Add table data" },
37
+ config: {
38
+ tags,
39
+ package: packageName,
40
+ policy,
41
+ summary: "Add table data",
42
+ },
27
43
  schema: tableSchema,
28
44
  }, insert);
29
45
  app.get("/table/:table/:id?", {
30
- config: { tags, policy, description: "Get table data" },
46
+ config: {
47
+ tags,
48
+ package: packageName,
49
+ policy,
50
+ summary: "Get table data",
51
+ },
31
52
  schema: tableSchema,
32
53
  }, table);
33
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/dblist/index.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,GAAG,EAAE,GAAG,QAiBtC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/dblist/index.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,GAAG,EAAE,GAAG,QAiBtC"}
@@ -1,7 +1,8 @@
1
1
  import readItemList from "./controllers/readItems.js";
2
2
  import setItem from "./controllers/setItem.js";
3
+ const packageName = "fastify-table";
3
4
  const params = {
4
- config: { policy: "L0", tags: ["core", "dblist"] },
5
+ config: { policy: "L0", tags: ["core", "dblist"], package: packageName },
5
6
  };
6
7
  export default function plugin(app) {
7
8
  if (!app.hasRoute({ method: "GET", url: "/db-list" })) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/file/index.ts"],"names":[],"mappings":"AAoBA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAqCtC;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/file/index.ts"],"names":[],"mappings":"AAyBA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAqCtC;AAED,eAAe,MAAM,CAAC"}
@@ -9,9 +9,14 @@ import uploadImage from "./controllers/uploadImage.js";
9
9
  import deleteFileAPI from "./controllers/delete.js";
10
10
  import { resizeSchema, exportSchema } from "./schema.js";
11
11
  const tags = ["core", "file"];
12
+ const packageName = "fastify-table";
12
13
  const { uploadPolicy = "L1" } = config;
13
- const publicParams = { config: { tags, policy: "L0" } };
14
- const privateParams = { config: { tags, policy: uploadPolicy } };
14
+ const publicParams = {
15
+ config: { tags, policy: "L0", package: packageName },
16
+ };
17
+ const privateParams = {
18
+ config: { tags, policy: uploadPolicy, package: packageName },
19
+ };
15
20
  function plugin(app, opt = {}) {
16
21
  app.get("/files/*", publicParams, files);
17
22
  if (!app.hasRoute({ method: "GET", url: "/file/resize" })) {
@@ -19,7 +24,7 @@ function plugin(app, opt = {}) {
19
24
  method: "GET",
20
25
  url: "/file/resize",
21
26
  config: {
22
- ...publicParams,
27
+ ...publicParams.config,
23
28
  rateLimit: config.rateLimit
24
29
  ? {
25
30
  max: +(config.rateLimit?.resize?.max || 1000),
@@ -34,7 +39,7 @@ function plugin(app, opt = {}) {
34
39
  app.route({
35
40
  method: "GET",
36
41
  url: "/api/resize-all",
37
- config: { tags, role: "admin" },
42
+ config: { tags, package: packageName, role: "admin" },
38
43
  schema: resizeSchema,
39
44
  handler: resizeAll,
40
45
  });
@@ -1,3 +1,3 @@
1
- declare function plugin(app: any, opts?: any): void;
1
+ declare function plugin(app: any): void;
2
2
  export default plugin;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/grpc/index.ts"],"names":[],"mappings":"AAKA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,QAGnC;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/grpc/index.ts"],"names":[],"mappings":"AAQA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,QAGvB;AAED,eAAe,MAAM,CAAC"}
@@ -1,7 +1,10 @@
1
1
  import file2geojson from "./controllers/file2geojson.js";
2
2
  import filePreview from "./controllers/filePreview.js";
3
- const publicParams = { config: { policy: "L0", tags: ["core", "grpc"] } };
4
- function plugin(app, opts) {
3
+ const packageName = "fastify-table";
4
+ const publicParams = {
5
+ config: { policy: "L0", tags: ["core", "grpc"], package: packageName },
6
+ };
7
+ function plugin(app) {
5
8
  app.post("/file2geojson", publicParams, file2geojson);
6
9
  app.get("/file-preview", publicParams, filePreview);
7
10
  }
@@ -1,3 +1,3 @@
1
- declare function plugin(app: any, opt?: any): void;
1
+ declare function plugin(app: any): void;
2
2
  export default plugin;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/logger/index.ts"],"names":[],"mappings":"AAoBA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAOtC;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/logger/index.ts"],"names":[],"mappings":"AAuBA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,QAOvB;AAED,eAAe,MAAM,CAAC"}
@@ -2,7 +2,10 @@ import loggerFile from "./controllers/logger.file.js";
2
2
  import loggerMetrics from "./controllers/logger.metrics.js";
3
3
  // import loggerTest from './controllers/logger.test.api.js';
4
4
  const tags = ["core", "logger"];
5
- const publicParams = { config: { tags, policy: "L0", rateLimit: false } };
5
+ const packageName = "fastify-table";
6
+ const publicParams = {
7
+ config: { tags, package: packageName, policy: "L0", rateLimit: false },
8
+ };
6
9
  const loggerSchema = {
7
10
  querystring: {
8
11
  type: "object",
@@ -15,7 +18,7 @@ const loggerSchema = {
15
18
  additionalProperties: false,
16
19
  },
17
20
  };
18
- function plugin(app, opt = {}) {
21
+ function plugin(app) {
19
22
  app.get("/logger-file/*", { ...publicParams, schema: loggerSchema }, loggerFile);
20
23
  app.get("/logger-metrics", publicParams, loggerMetrics);
21
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/menu/index.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAGpD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/menu/index.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAGpD"}
@@ -1,11 +1,12 @@
1
1
  import getMenu from "./controllers/getMenu.js";
2
2
  import interfaces from "./controllers/interfaces.js";
3
3
  const tags = ["core", "menu"];
4
+ const packageName = "fastify-table";
4
5
  const publicParams = {
5
- config: { tags },
6
+ config: { tags, package: packageName },
6
7
  };
7
8
  const params = {
8
- config: { tags, role: "admin" },
9
+ config: { tags, package: packageName, role: "admin" },
9
10
  };
10
11
  export default function route(app, opt = {}) {
11
12
  app.get("/user-menu", publicParams, getMenu);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/notifications/index.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAG,EAAE,GAAG,QAgBrC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/notifications/index.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAG,EAAE,GAAG,QAgBrC"}
@@ -3,8 +3,13 @@ import userNotifications from "./controllers/userNotifications.js"; // check all
3
3
  import addUserNotification from "./controllers/addUserNotification.js"; // add user notification
4
4
  import editUserNotification from "./controllers/editUserNotification.js"; // edit unread user notification
5
5
  import deleteUserNotification from "./controllers/deleteUserNotification.js"; // delete user notification
6
+ const packageName = "fastify-table";
6
7
  const params = {
7
- config: { policy: "L1", tags: ["core", "notifications"] },
8
+ config: {
9
+ policy: "L1",
10
+ tags: ["core", "notifications"],
11
+ package: packageName,
12
+ },
8
13
  };
9
14
  export default function route(app) {
10
15
  if (!app.hasRoute({ method: "GET", url: "/notification" })) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/properties/index.ts"],"names":[],"mappings":"AAcA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAWtC;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/properties/index.ts"],"names":[],"mappings":"AAeA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAiBtC;AAED,eAAe,MAAM,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import getAppSettings from "./controllers/properties.get.js";
2
2
  import postAppSettings from "./controllers/properties.post.js";
3
3
  const tags = ["core", "properties"];
4
+ const packageName = "fastify-table";
4
5
  const propertiesSchema = {
5
6
  params: {
6
7
  type: "object",
@@ -10,7 +11,13 @@ const propertiesSchema = {
10
11
  },
11
12
  };
12
13
  function plugin(app, opt = {}) {
13
- app.get("/settings-app/:entity?", { config: { tags, policy: "L0" }, schema: propertiesSchema }, getAppSettings);
14
- app.post("/settings-app/:entity?", { config: { tags, role: "admin" }, schema: propertiesSchema }, postAppSettings);
14
+ app.get("/settings-app/:entity?", {
15
+ config: { tags, package: packageName, policy: "L0" },
16
+ schema: propertiesSchema,
17
+ }, getAppSettings);
18
+ app.post("/settings-app/:entity?", {
19
+ config: { tags, package: packageName, role: "admin" },
20
+ schema: propertiesSchema,
21
+ }, postAppSettings);
15
22
  }
16
23
  export default plugin;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/table/index.ts"],"names":[],"mappings":"AAgCA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAiFtC;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/table/index.ts"],"names":[],"mappings":"AAiCA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAsGtC;AAED,eAAe,MAAM,CAAC"}
@@ -14,14 +14,16 @@ import form from "./controllers/getFormByTable.js";
14
14
  import loadTemplatePath from "../../plugins/table/funcs/loadTemplatePath.js";
15
15
  import { tableDataSchema, tableSchema, searchSchema, suggestSchema, formSchema, filterSchema, cardTabDataSchema, tableDataIdSchema, } from "./schema.js";
16
16
  const policy = "L0";
17
+ const packageName = "fastify-table";
17
18
  const tags = ["core", "table"];
18
19
  function plugin(app, opt = {}) {
19
- app.get("/token-info/:token", { config: { tags, role: "admin" } }, tokenInfo);
20
- app.get("/table-filter/:table", { config: { tags, policy }, schema: filterSchema }, filter);
21
- app.get("/table-info/:table/:id?", { config: { tags, policy }, schema: tableDataSchema }, tableInfo);
20
+ app.get("/token-info/:token", { config: { tags, package: packageName, role: "admin" } }, tokenInfo);
21
+ app.get("/table-filter/:table", { config: { tags, package: packageName, policy }, schema: filterSchema }, filter);
22
+ app.get("/table-info/:table/:id?", { config: { tags, package: packageName, policy }, schema: tableDataSchema }, tableInfo);
22
23
  app.get("/suggest/:data", {
23
24
  config: {
24
25
  tags,
26
+ package: packageName,
25
27
  policy,
26
28
  rateLimit: config.rateLimit
27
29
  ? {
@@ -32,15 +34,27 @@ function plugin(app, opt = {}) {
32
34
  },
33
35
  schema: suggestSchema,
34
36
  }, suggest);
35
- app.get("/data/:table/:id?", { config: { tags, policy }, schema: tableSchema }, data);
36
- app.get("/table-data/:table", { config: { tags, auth: "creds", policy: "L2" }, schema: tableDataSchema }, data);
37
- app.get("/table-data/:table/:id", { config: { tags, policy }, schema: tableDataIdSchema }, cardData);
38
- app.get("/data-info/:id?", { config: { tags, policy }, schema: tableSchema }, dataInfo);
39
- app.get("/card-data/:token", { config: { tags, policy }, schema: cardTabDataSchema }, cardTabData);
40
- app.get("/card/:table/:id", { config: { tags, policy }, schema: tableSchema }, card);
41
- app.get("/search", { config: { tags, policy }, schema: searchSchema }, search);
42
- app.get("/templates", { config: { tags } }, () => loadTemplatePath);
43
- app.get("/filter/:table", { config: { tags, policy }, schema: filterSchema }, filter);
44
- app.get("/form/:name/:id?", { config: { tags, auth: "creds", policy: "L2" }, schema: formSchema }, form);
37
+ app.get("/data/:table/:id?", { config: { tags, package: packageName, policy }, schema: tableSchema }, data);
38
+ app.get("/table-data/:table", {
39
+ config: { tags, package: packageName, auth: "creds", policy: "L2" },
40
+ schema: tableDataSchema,
41
+ }, data);
42
+ app.get("/table-data/:table/:id", {
43
+ config: { tags, package: packageName, policy },
44
+ schema: tableDataIdSchema,
45
+ }, cardData);
46
+ app.get("/data-info/:id?", { config: { tags, package: packageName, policy }, schema: tableSchema }, dataInfo);
47
+ app.get("/card-data/:token", {
48
+ config: { tags, package: packageName, policy },
49
+ schema: cardTabDataSchema,
50
+ }, cardTabData);
51
+ app.get("/card/:table/:id", { config: { tags, package: packageName, policy }, schema: tableSchema }, card);
52
+ app.get("/search", { config: { tags, package: packageName, policy }, schema: searchSchema }, search);
53
+ app.get("/templates", { config: { tags, package: packageName } }, () => loadTemplatePath);
54
+ app.get("/filter/:table", { config: { tags, package: packageName, policy }, schema: filterSchema }, filter);
55
+ app.get("/form/:name/:id?", {
56
+ config: { tags, package: packageName, auth: "creds", policy: "L2" },
57
+ schema: formSchema,
58
+ }, form);
45
59
  }
46
60
  export default plugin;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/templates/index.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAQpD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/templates/index.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAQpD"}
@@ -1,12 +1,13 @@
1
1
  import getTemplateApi from "./controllers/getTemplate.js";
2
2
  import { getTemplateSchema } from "./schema.js";
3
3
  const policy = "L0";
4
+ const packageName = "fastify-table";
4
5
  const tags = ["core", "templates"];
5
6
  export default function route(app, opt = {}) {
6
7
  app.route({
7
8
  method: "GET",
8
9
  url: "/template/:type/:name",
9
- config: { tags, policy },
10
+ config: { tags, package: packageName, policy },
10
11
  schema: getTemplateSchema,
11
12
  handler: getTemplateApi,
12
13
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/upload/index.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,GAAG,EAAE,GAAG,QA2GtC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/upload/index.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,GAAG,EAAE,GAAG,QA8GtC"}
@@ -6,12 +6,14 @@ import uploadChunk from "../../plugins/upload/uploadChunk.js";
6
6
  import getUploadStatus from "../../plugins/upload/getUploadStatus.js";
7
7
  import { BadRequestError, LengthRequiredError } from "../../../errors.js";
8
8
  const tags = ["core", "upload"];
9
+ const packageName = "fastify-table";
9
10
  export default function plugin(app) {
10
11
  // provide server with metadata for chunked upload
11
12
  app.post(`/${prefix}/start`, {
12
13
  config: {
13
14
  tags,
14
- description: "Init chunked upload",
15
+ package: packageName,
16
+ summary: "Init chunked upload",
15
17
  policy: uploadPolicy,
16
18
  },
17
19
  }, async (req) => {
@@ -35,7 +37,8 @@ export default function plugin(app) {
35
37
  app.patch(`/${prefix}/:id`, {
36
38
  config: {
37
39
  tags,
38
- description: "Upload chunk of data",
40
+ package: packageName,
41
+ summary: "Upload chunk of data",
39
42
  policy: uploadPolicy,
40
43
  rateLimit: config.rateLimit
41
44
  ? {
@@ -72,7 +75,8 @@ export default function plugin(app) {
72
75
  app.get(`/${prefix}/:id`, {
73
76
  config: {
74
77
  tags,
75
- description: "Check chunked upload status",
78
+ package: packageName,
79
+ summary: "Check chunked upload status",
76
80
  policy: uploadPolicy,
77
81
  },
78
82
  }, async (req) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/usercls/index.ts"],"names":[],"mappings":"AAmCA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,GAAG,EAAE,GAAG,QAkDtC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/usercls/index.ts"],"names":[],"mappings":"AAoCA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,GAAG,EAAE,GAAG,QAsDtC"}
@@ -28,19 +28,20 @@ import addUserCls from "./controllers/addUserCls.js";
28
28
  import editUserCls from "./controllers/editUserCls.js";
29
29
  import deleteUserCls from "./controllers/deleteUserCls.js";
30
30
  const tags = ["core", "usercls"];
31
+ const packageName = "fastify-table";
31
32
  export default function plugin(app) {
32
33
  if (!app.hasRoute({ method: "GET", url: "/api/user-cls" })) {
33
- app.get("/user-cls", { config: { tags, policy: "L1" } }, getUserCls);
34
+ app.get("/user-cls", { config: { tags, package: packageName, policy: "L1" } }, getUserCls);
34
35
  }
35
36
  if (!app.hasRoute({ method: "POST", url: "/api/user-cls" })) {
36
37
  app.post("/user-cls", {
37
- config: { tags, policy: "L1" },
38
+ config: { tags, package: packageName, policy: "L1" },
38
39
  schema: { body: addUserClsBodySchema },
39
40
  }, addUserCls);
40
41
  }
41
42
  if (!app.hasRoute({ method: "PUT", url: "/api/user-cls/:name" })) {
42
43
  app.put("/user-cls/:name", {
43
- config: { tags, policy: "L1" },
44
+ config: { tags, package: packageName, policy: "L1" },
44
45
  schema: {
45
46
  params: userClsParamsSchema,
46
47
  body: editUserClsBodySchema,
@@ -49,13 +50,13 @@ export default function plugin(app) {
49
50
  }
50
51
  if (!app.hasRoute({ method: "DELETE", url: "/api/user-cls/:name" })) {
51
52
  app.delete("/user-cls/:name", {
52
- config: { tags, policy: "L1" },
53
+ config: { tags, package: packageName, policy: "L1" },
53
54
  schema: { params: userClsParamsSchema },
54
55
  }, deleteUserCls);
55
56
  }
56
57
  if (!app.hasRoute({ method: "DELETE", url: "/api/user-cls/:name/:code" })) {
57
58
  app.delete("/user-cls/:name/:code", {
58
- config: { tags, policy: "L1" },
59
+ config: { tags, package: packageName, policy: "L1" },
59
60
  schema: { params: userClsParamsSchema },
60
61
  }, deleteUserCls);
61
62
  }
@@ -1,6 +1,7 @@
1
- export default function apiListService({ includeTags: queryIncludeTags, excludeTags: queryExcludeTags, packageName, subdir, md, routes, }: {
1
+ export default function apiListService({ includeTags: queryIncludeTags, excludeTags: queryExcludeTags, excludePackage: queryExcludePackage, packageName, subdir, md, routes, }: {
2
2
  includeTags?: any;
3
3
  excludeTags?: any;
4
+ excludePackage?: any;
4
5
  packageName?: string;
5
6
  subdir?: string;
6
7
  md?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"api.list.d.ts","sourceRoot":"","sources":["../../../../../server/routes/util/controllers/api.list.ts"],"names":[],"mappings":"AAuCA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,WAAW,EAAE,gBAAgB,EAC7B,WAAW,EAAE,gBAAgB,EAC7B,WAAW,EACX,MAAM,EACN,EAAE,EACF,MAAM,GACP,EAAE;IACD,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,GAAG,EAAE,CAAC;CACf;;;;;;;;;;EA2CA"}
1
+ {"version":3,"file":"api.list.d.ts","sourceRoot":"","sources":["../../../../../server/routes/util/controllers/api.list.ts"],"names":[],"mappings":"AAuCA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,WAAW,EAAE,gBAAgB,EAC7B,WAAW,EAAE,gBAAgB,EAC7B,cAAc,EAAE,mBAAmB,EACnC,WAAW,EACX,MAAM,EACN,EAAE,EACF,MAAM,GACP,EAAE;IACD,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,GAAG,EAAE,CAAC;CACf;;;;;;;;;;EAmDA"}
@@ -26,13 +26,16 @@ function toMarkdownTable(data, columns) {
26
26
  });
27
27
  return [header, separator, ...rows].join("\n");
28
28
  }
29
- export default function apiListService({ includeTags: queryIncludeTags, excludeTags: queryExcludeTags, packageName, subdir, md, routes, }) {
29
+ export default function apiListService({ includeTags: queryIncludeTags, excludeTags: queryExcludeTags, excludePackage: queryExcludePackage, packageName, subdir, md, routes, }) {
30
30
  const includeTags = queryIncludeTags
31
31
  ? new Set(queryIncludeTags?.split("|"))
32
32
  : undefined;
33
33
  const excludeTags = queryExcludeTags
34
34
  ? new Set(queryExcludeTags?.split("|"))
35
35
  : undefined;
36
+ const excludePackage = queryExcludePackage
37
+ ? new Set(queryExcludePackage?.split("|"))
38
+ : undefined;
36
39
  const filteredRoutes = excludeTags
37
40
  ? routes.filter((r) => !r.tags || !r.tags.find((tag) => excludeTags.has(tag)))
38
41
  : routes;
@@ -45,8 +48,11 @@ export default function apiListService({ includeTags: queryIncludeTags, excludeT
45
48
  const filteredRoutes3 = packageName
46
49
  ? filteredRoutes2.filter((r) => r.package === packageName)
47
50
  : filteredRoutes2;
51
+ const filteredRoutes4 = excludePackage
52
+ ? filteredRoutes3.filter((r) => !excludePackage.has(r.package))
53
+ : filteredRoutes3;
48
54
  if (md) {
49
- const markdownStr = toMarkdownTable(filteredRoutes3, Array.isArray(columns) ? columns : columns.split("|"));
55
+ const markdownStr = toMarkdownTable(filteredRoutes4, Array.isArray(columns) ? columns : columns.split("|"));
50
56
  return {
51
57
  headers: {
52
58
  "Content-Type": "text/markdown; charset=utf-8",
@@ -54,5 +60,5 @@ export default function apiListService({ includeTags: queryIncludeTags, excludeT
54
60
  data: markdownStr,
55
61
  };
56
62
  }
57
- return { rows: filteredRoutes3 };
63
+ return { rows: filteredRoutes4 };
58
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/util/index.ts"],"names":[],"mappings":"AAYA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAoCtC;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/util/index.ts"],"names":[],"mappings":"AAaA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QA4CtC;AAED,eAAe,MAAM,CAAC"}
@@ -6,17 +6,18 @@ import codeGenerator from "./controllers/code.generator.js";
6
6
  import dependencies from "./controllers/dependencies.js";
7
7
  import apiCheck from "./controllers/api.check.js";
8
8
  const tags = ["core", "util"];
9
+ const packageName = "fastify-table";
9
10
  function plugin(app, opt = {}) {
10
- app.get("/next-id", { config: { tags, policy: "L0" } }, nextId);
11
- app.get("/check", { config: { tags, role: "admin" } }, apiCheck);
12
- app.get("/status-monitor", { config: { tags, role: "admin" } }, statusMonitor);
13
- app.get("/user-tokens/:token", { config: { tags, role: "admin|regular" } }, userTokens);
14
- app.get("/code-gen/:token/:column/:id?", { config: { tags, role: "admin|regular" } }, codeGenerator);
15
- app.get("/test-proxy", { config: { tags, policy: "L0" } }, (req) => ({
11
+ app.get("/next-id", { config: { tags, package: packageName, policy: "L0" } }, nextId);
12
+ app.get("/check", { config: { tags, package: packageName, role: "admin" } }, apiCheck);
13
+ app.get("/status-monitor", { config: { tags, package: packageName, role: "admin" } }, statusMonitor);
14
+ app.get("/user-tokens/:token", { config: { tags, package: packageName, role: "admin|regular" } }, userTokens);
15
+ app.get("/code-gen/:token/:column/:id?", { config: { tags, package: packageName, role: "admin|regular" } }, codeGenerator);
16
+ app.get("/test-proxy", { config: { tags, package: packageName, policy: "L0" } }, (req) => ({
16
17
  ...(req.headers || {}),
17
18
  sessionId: req.session?.sessionId,
18
19
  }));
19
- app.get("/config", { config: { tags, policy: "L0" /*role: "admin"*/ } }, apiConfig);
20
- app.get("/dependencies", { config: { tags, policy: "L1", role: "admin" } }, dependencies);
20
+ app.get("/config", { config: { tags, package: packageName, policy: "L0" /*role: "admin"*/ } }, apiConfig);
21
+ app.get("/dependencies", { config: { tags, package: packageName, policy: "L1", role: "admin" } }, dependencies);
21
22
  }
22
23
  export default plugin;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/widget/index.ts"],"names":[],"mappings":"AAoDA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAG,EAAE,GAAG,QAiIrC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/widget/index.ts"],"names":[],"mappings":"AAwDA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAG,EAAE,GAAG,QAiIrC"}
@@ -11,6 +11,7 @@ import widgetEntityDel from "./services/widget.entity.del.js";
11
11
  import uploadMultiPart from "../../plugins/file/uploadMultiPart.js";
12
12
  import { UnauthorizedError } from "../../../errors.js";
13
13
  const tags = ["core", "widget"];
14
+ const packageName = "fastify-table";
14
15
  const { uploadPolicy = "L1" } = config;
15
16
  const tableSchema = {
16
17
  params: {
@@ -40,7 +41,10 @@ const tableSchema = {
40
41
  },
41
42
  };
42
43
  addHook("onWidgetSet", onWidgetSet);
43
- const publicParams = { config: { tags, policy: "L0" }, schema: tableSchema };
44
+ const publicParams = {
45
+ config: { tags, package: packageName, policy: "L0" },
46
+ schema: tableSchema,
47
+ };
44
48
  export default function route(app) {
45
49
  app.get("/v2/widget/:type/:entityType/:objectid", publicParams, async (req) => {
46
50
  const result = await widgetEntityGet({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.5.38",
3
+ "version": "2.5.39",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [