@opengis/fastify-table 2.0.73 → 2.0.75

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.
@@ -33,8 +33,8 @@ ALTER TABLE admin.users add column if not exists twofa boolean not null DEFAULT
33
33
  ALTER TABLE admin.users add CONSTRAINT admin_user_uid_pkey PRIMARY KEY (uid);
34
34
  ALTER TABLE admin.users add CONSTRAINT admin_user_user_rnokpp UNIQUE (user_rnokpp);
35
35
 
36
- update admin.users set user_type='regular' where user_type not in ('viewer', 'regular','admin','superadmin');
37
- ALTER TABLE admin.users add constraint admin_user_type_check CHECK (user_type=any(array['viewer', 'regular','admin','superadmin']));
36
+ -- update admin.users set user_type='regular' where user_type not in ('viewer', 'regular','admin','superadmin');
37
+ -- ALTER TABLE admin.users add constraint admin_user_type_check CHECK (user_type=any(array['viewer', 'regular','admin','superadmin']));
38
38
  insert into admin.users (uid,login,password,user_type,enabled)values('viewer','viewer','viewer','viewer', false) on conflict (uid) do update set enabled=excluded.enabled;
39
39
  -- update admin.users set enabled=true where uid='viewer';
40
40
 
@@ -6,10 +6,10 @@ export default async function readNotifications(req, reply) {
6
6
  }
7
7
  const ids = pg && pg.pk?.["crm.notifications"]
8
8
  ? await pg
9
- .query(`update crm.notifications
10
- set read=true
11
- where read is not true
12
- and addressee_id=$1
9
+ .query(`update crm.notifications
10
+ set read=true
11
+ where read is not true
12
+ and addressee_id=$1
13
13
  and ${params.id ? "notification_id=$2" : "1=1"} returning notification_id`, [user.uid, params?.id].filter(Boolean))
14
14
  .then((el) => el.rows?.map((row) => row.notification_id) || [])
15
15
  : [];
@@ -1,9 +1,9 @@
1
1
  import pgClients from "../../../plugins/pg/pgClients.js";
2
2
  import getSelectVal from "../../../plugins/table/funcs/metaFormat/getSelectVal.js";
3
3
  const maxLimit = 100;
4
- const q = `select notification_id as id, subject, body, created_at,
5
- author_id, read, link, entity_id, (select avatar from admin.users where uid=a.author_id limit 1) as avatar
6
- from crm.notifications a
4
+ const q = `select notification_id as id, subject, body, created_at,
5
+ author_id, read, link, entity_id, (select avatar from admin.users where uid=a.author_id limit 1) as avatar
6
+ from crm.notifications a
7
7
  where addressee_id=$1 order by created_at desc limit $2 offset $3`;
8
8
  export default async function userNotifications(req, reply) {
9
9
  const { pg = pgClients.client, query, user, } = req;
@@ -1 +1 @@
1
- {"version":3,"file":"getFormByTable.d.ts","sourceRoot":"","sources":["../../../../../server/routes/table/controllers/getFormByTable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAc5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAUzD,wBAA8B,OAAO,CACnC,EACE,EAAqB,EACrB,MAAM,EACN,IAAS,EACT,KAAU,GACX,EAAE;IACD,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;CACvB,EACD,KAAK,EAAE,YAAY,gBAuJpB"}
1
+ {"version":3,"file":"getFormByTable.d.ts","sourceRoot":"","sources":["../../../../../server/routes/table/controllers/getFormByTable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAc5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAUzD,wBAA8B,OAAO,CACnC,EACE,EAAqB,EACrB,MAAM,EACN,IAAS,EACT,KAAU,GACX,EAAE;IACD,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;CACvB,EACD,KAAK,EAAE,YAAY,gBAkKpB"}
@@ -45,6 +45,13 @@ export default async function getForm({ pg = pgClients.client, params, user = {}
45
45
  schema[key].options = arr;
46
46
  }
47
47
  }));
48
+ if (loadTemplate && tokenData.obj) {
49
+ const obj = tokenData.obj.split("#").reduce((p, el) => ({
50
+ ...p,
51
+ [el.split("=")[0] || ""]: el.split("=")[1],
52
+ }), {});
53
+ Object.assign(loadTemplate, { obj });
54
+ }
48
55
  const res = { mode: "form", time: 0, ...loadTemplate, schema };
49
56
  if (user.uid) {
50
57
  // form in form addToken
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.0.73",
3
+ "version": "2.0.75",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [