@opengis/fastify-table 2.2.7 → 2.2.9

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 (28) hide show
  1. package/dist/server/helpers/core/buttonHelper.js +4 -4
  2. package/dist/server/helpers/list/tableList.js +1 -1
  3. package/dist/server/helpers/list/utils/button.d.ts +1 -1
  4. package/dist/server/helpers/list/utils/button.d.ts.map +1 -1
  5. package/dist/server/helpers/list/utils/button.js +9 -2
  6. package/dist/server/helpers/list/utils/buttonDel.d.ts +1 -1
  7. package/dist/server/helpers/list/utils/buttonDel.d.ts.map +1 -1
  8. package/dist/server/helpers/list/utils/buttonDel.js +9 -2
  9. package/dist/server/helpers/list/utils/buttonEdit.d.ts +1 -1
  10. package/dist/server/helpers/list/utils/buttonEdit.d.ts.map +1 -1
  11. package/dist/server/helpers/list/utils/buttonEdit.js +9 -2
  12. package/dist/server/helpers/utils/button.d.ts +1 -1
  13. package/dist/server/helpers/utils/button.d.ts.map +1 -1
  14. package/dist/server/helpers/utils/button.js +9 -2
  15. package/dist/server/helpers/utils/buttonAdd.d.ts +1 -1
  16. package/dist/server/helpers/utils/buttonAdd.d.ts.map +1 -1
  17. package/dist/server/helpers/utils/buttonAdd.js +25 -4
  18. package/dist/server/helpers/utils/buttonDel.d.ts +1 -1
  19. package/dist/server/helpers/utils/buttonDel.d.ts.map +1 -1
  20. package/dist/server/helpers/utils/buttonDel.js +14 -7
  21. package/dist/server/helpers/utils/buttonEdit.d.ts +1 -1
  22. package/dist/server/helpers/utils/buttonEdit.d.ts.map +1 -1
  23. package/dist/server/helpers/utils/buttonEdit.js +13 -6
  24. package/dist/server/plugins/pg/funcs/init.d.ts.map +1 -1
  25. package/dist/server/plugins/pg/funcs/init.js +3 -1
  26. package/dist/server/plugins/policy/funcs/checkJWT.d.ts.map +1 -1
  27. package/dist/server/plugins/policy/funcs/checkJWT.js +4 -2
  28. package/package.json +1 -1
@@ -8,13 +8,13 @@ export default function buttonHelper(data, opt) {
8
8
  if (!hash.token)
9
9
  return 'token empty';
10
10
  if (hash.add) {
11
- return buttonAdd(hash.token, hash.title);
11
+ return buttonAdd(hash.token, hash.title, hash.permission);
12
12
  }
13
13
  if (hash.del) {
14
- return buttonDel(hash.token, hash.title, hash.icon);
14
+ return buttonDel(hash.token, hash.title, hash.icon, hash.permission);
15
15
  }
16
16
  if (hash.edit) {
17
- return buttonEdit(hash.token, hash.title, hash.icon);
17
+ return buttonEdit(hash.token, hash.title, hash.icon, hash.permission);
18
18
  }
19
- return button(hash.token, hash.title);
19
+ return button(hash.token, hash.title, hash.permission);
20
20
  }
@@ -11,7 +11,7 @@ function format(d, key, data, hash) {
11
11
  if (d === false)
12
12
  return "Ні";
13
13
  if (key === "actions") {
14
- return `<div class="flex items-center gap-2">${(hash.form ? buttonEdit(d) : "") + buttonDel(d)}</div>`;
14
+ return `<div class="flex items-center gap-2">${(hash.form ? buttonEdit(d, hash?.permission) : "") + buttonDel(d, hash?.permission)}</div>`;
15
15
  }
16
16
  if (key.startsWith("{{")) {
17
17
  return handlebars.compile(key)(data);
@@ -1,2 +1,2 @@
1
- export default function button(token: any, title: any): string;
1
+ export default function button(token: any, title: any, permission?: string): string;
2
2
  //# sourceMappingURL=button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../../server/helpers/list/utils/button.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,UAGpD"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../../server/helpers/list/utils/button.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,GAAE,MAAW,UAY7E"}
@@ -1,4 +1,11 @@
1
- export default function button(token, title) {
2
- return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
1
+ export default function button(token, title, permission = '') {
2
+ const handlePermission = permission
3
+ .split(',')
4
+ .find(e => e.trim().includes('create'))
5
+ ?.trim();
6
+ const permissionAttr = handlePermission
7
+ ? `v-permission="${handlePermission}"`
8
+ : '';
9
+ return `<button ${permissionAttr} onclick="window.v3plugin.$form({ token: '${token}' })"
3
10
  class="inline-flex items-center px-2 py-1 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white">${title || 'Додати'}</button>`;
4
11
  }
@@ -1,2 +1,2 @@
1
- export default function button(token: any): string;
1
+ export default function button(token: any, permission?: string): string;
2
2
  //# sourceMappingURL=buttonDel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buttonDel.d.ts","sourceRoot":"","sources":["../../../../../server/helpers/list/utils/buttonDel.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,UAKxC"}
1
+ {"version":3,"file":"buttonDel.d.ts","sourceRoot":"","sources":["../../../../../server/helpers/list/utils/buttonDel.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,GAAE,MAAW,UAcjE"}
@@ -3,8 +3,15 @@
3
3
  // class="inline-flex items-center px-2 py-1 text-sm font-medium text-white duration-300 bg-red-600 border border-transparent rounded-lg gap-x-2 hover:bg-red-700 hover:text-white">${title || 'Вилучити'}</button>`;
4
4
  // }
5
5
  const newColor = 'red';
6
- export default function button(token) {
7
- return `<button onclick="window.v3plugin.$api({ api: '/api/table/${token}', method:'delete',confirm: { title:'Підтвердити операцію', text: 'Ви впевнені що хочете вилучити запис?', cancel: 'Скасувати', confirm : 'Виконати'} })"
6
+ export default function button(token, permission = '') {
7
+ const handlePermission = permission
8
+ .split(',')
9
+ .find(e => e.trim().includes('delete'))
10
+ ?.trim();
11
+ const permissionAttr = handlePermission
12
+ ? `v-permission="${handlePermission}"`
13
+ : '';
14
+ return `<button ${permissionAttr} onclick="window.v3plugin.$api({ api: '/api/table/${token}', method:'delete',confirm: { title:'Підтвердити операцію', text: 'Ви впевнені що хочете вилучити запис?', cancel: 'Скасувати', confirm : 'Виконати'} })"
8
15
  class="group px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-100 hover:bg-${newColor}-500 focus:ring-${newColor}-500">
9
16
  <svg class="group-hover:fill-white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="13" height="13" fill="#ef4444"><path d="M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"/></svg>
10
17
  </button>`;
@@ -1,2 +1,2 @@
1
- export default function button(token: any): string;
1
+ export default function button(token: any, permission?: string): string;
2
2
  //# sourceMappingURL=buttonEdit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buttonEdit.d.ts","sourceRoot":"","sources":["../../../../../server/helpers/list/utils/buttonEdit.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,UAKxC"}
1
+ {"version":3,"file":"buttonEdit.d.ts","sourceRoot":"","sources":["../../../../../server/helpers/list/utils/buttonEdit.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,GAAE,MAAW,UAcjE"}
@@ -3,8 +3,15 @@
3
3
  // class="inline-flex items-center px-2 py-1 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white">${title || 'Редагувати'}</button>`;
4
4
  // }
5
5
  const newColor = 'blue';
6
- export default function button(token) {
7
- return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
6
+ export default function button(token, permission = '') {
7
+ const handlePermission = permission
8
+ .split(',')
9
+ .find(e => e.trim().includes('update'))
10
+ ?.trim();
11
+ const permissionAttr = handlePermission
12
+ ? `v-permission="${handlePermission}"`
13
+ : '';
14
+ return `<button ${permissionAttr} onclick="window.v3plugin.$form({ token: '${token}' })"
8
15
  class="group px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-100 hover:bg-${newColor}-500 focus:ring-${newColor}-500">
9
16
  <svg class="group-hover:fill-white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="13" height="13" fill="#3b82f6"><path d="M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3 172.4 241.7zM96 64C43 64 0 107 0 160L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 64z"/></svg>
10
17
  </button>`;
@@ -1,2 +1,2 @@
1
- export default function button(token: any, title: any): string;
1
+ export default function button(token: any, title: any, permission?: string): string;
2
2
  //# sourceMappingURL=button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../server/helpers/utils/button.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,UAGpD"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../server/helpers/utils/button.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,GAAE,MAAW,UAY7E"}
@@ -1,4 +1,11 @@
1
- export default function button(token, title) {
2
- return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
1
+ export default function button(token, title, permission = '') {
2
+ const handlePermission = permission
3
+ .split(',')
4
+ .find(e => e.trim().includes('create'))
5
+ ?.trim();
6
+ const permissionAttr = handlePermission
7
+ ? `v-permission="${handlePermission}"`
8
+ : '';
9
+ return `<button ${permissionAttr} onclick="window.v3plugin.$form({ token: '${token}' })"
3
10
  class="inline-flex items-center px-2 py-1 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white">${title || 'Редагувати'}</button>`;
4
11
  }
@@ -1,2 +1,2 @@
1
- export default function button(token: any, title: any): string;
1
+ export default function button(token: any, title?: any, permission?: string): string;
2
2
  //# sourceMappingURL=buttonAdd.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buttonAdd.d.ts","sourceRoot":"","sources":["../../../../server/helpers/utils/buttonAdd.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,UAGpD"}
1
+ {"version":3,"file":"buttonAdd.d.ts","sourceRoot":"","sources":["../../../../server/helpers/utils/buttonAdd.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,GAAE,GAAc,EAAE,UAAU,GAAE,MAAW,UA0BxF"}
@@ -1,5 +1,26 @@
1
- const newColor = 'blue';
2
- export default function button(token, title) {
3
- return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
4
- class="px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-500 hover:bg-${newColor}-500 focus:ring-${newColor}-500">${title || 'Додати'}</button>`;
1
+ const COLOR = 'blue';
2
+ export default function button(token, title = 'Додати', permission = '') {
3
+ const handlePermission = permission
4
+ .split(',')
5
+ .find(e => e.trim().includes('create'))
6
+ ?.trim();
7
+ const permissionAttr = handlePermission
8
+ ? `v-permission="${handlePermission}"`
9
+ : '';
10
+ return `
11
+ <button
12
+ ${permissionAttr}
13
+ onclick="window.v3plugin.$form({ token: '${token}' })"
14
+ class="
15
+ px-2 py-1 inline-flex justify-center items-center gap-2
16
+ rounded-md border border-transparent font-semibold text-sm
17
+ transition-all focus:outline-none ring-offset-white
18
+ bg-${COLOR}-100 text-${COLOR}-500
19
+ hover:bg-${COLOR}-500 hover:text-white
20
+ focus:ring-${COLOR}-500
21
+ "
22
+ >
23
+ ${title}
24
+ </button>
25
+ `;
5
26
  }
@@ -1,2 +1,2 @@
1
- export default function button(token: any, title: any, icon?: boolean): string;
1
+ export default function button(token: any, title: any, icon?: boolean, permission?: string): string;
2
2
  //# sourceMappingURL=buttonDel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buttonDel.d.ts","sourceRoot":"","sources":["../../../../server/helpers/utils/buttonDel.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,OAAO,UAuBpE"}
1
+ {"version":3,"file":"buttonDel.d.ts","sourceRoot":"","sources":["../../../../server/helpers/utils/buttonDel.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,UAAU,GAAE,MAAW,UAgC7F"}
@@ -1,5 +1,12 @@
1
- const newColor = "red";
2
- export default function button(token, title, icon) {
1
+ const COLOR = "red";
2
+ export default function button(token, title, icon, permission = '') {
3
+ const handlePermission = permission
4
+ .split(',')
5
+ .find(e => e.trim().includes('delete'))
6
+ ?.trim();
7
+ const permissionAttr = handlePermission
8
+ ? `v-permission="${handlePermission}"`
9
+ : '';
3
10
  const apiCall = `window.v3plugin.$api({
4
11
  api: '/api/table/${token}',
5
12
  method: 'delete',
@@ -11,12 +18,12 @@ export default function button(token, title, icon) {
11
18
  }
12
19
  })`;
13
20
  const buttonClass = icon
14
- ? `size-8 inline-flex justify-center items-center gap-x-2 rounded-e-lg border border-stone-200 bg-${newColor}-100 text-stone-800 shadow-sm hover:bg-${newColor}-200 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700`
15
- : `px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-500 hover:bg-${newColor}-500 focus:ring-${newColor}-500`;
21
+ ? `size-8 inline-flex justify-center items-center gap-x-2 rounded-e-lg border border-stone-200 bg-${COLOR}-100 text-stone-800 shadow-sm hover:bg-${COLOR}-200 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700`
22
+ : `px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${COLOR}-100 text-${COLOR}-500 hover:bg-${COLOR}-500 focus:ring-${COLOR}-500`;
16
23
  const buttonContent = icon
17
- ? `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="${newColor}" class="size-3.5">
18
- <path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/>
24
+ ? `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="${COLOR}" class="size-3.5">
25
+ <path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.₀₂₂-.₁₆₅m₀ ₀a48.₁₁ 48.₁₁ ₃.₄₇₈-.₃₉₇m7.5 ₀v-.916c₀-1.₁₈-.9₁-₂.₁₆₄-₂.₀₉-₂.₂₀₁a51.964 51.964 ₀-3.3₂ ₀c-1.₁₈.₀₃₇-₂.…
19
26
  </svg>`
20
27
  : `${title || "Вилучити"}`;
21
- return `<button onclick="${apiCall}" class="${buttonClass}">${buttonContent}</button>`;
28
+ return `<button ${permissionAttr} onclick="${apiCall}" class="${buttonClass}">${buttonContent}</button>`;
22
29
  }
@@ -1,2 +1,2 @@
1
- export default function button(token: any, title: any, icon?: boolean): string;
1
+ export default function button(token: any, title: any, icon?: boolean, permission?: string): string;
2
2
  //# sourceMappingURL=buttonEdit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buttonEdit.d.ts","sourceRoot":"","sources":["../../../../server/helpers/utils/buttonEdit.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,OAAO,UAepE"}
1
+ {"version":3,"file":"buttonEdit.d.ts","sourceRoot":"","sources":["../../../../server/helpers/utils/buttonEdit.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,UAAU,GAAE,MAAW,UAwB7F"}
@@ -1,14 +1,21 @@
1
- const newColor = "blue";
2
- export default function button(token, title, icon) {
1
+ const COLOR = "blue";
2
+ export default function button(token, title, icon, permission = '') {
3
+ const handlePermission = permission
4
+ .split(',')
5
+ .find(e => e.trim().includes('update'))
6
+ ?.trim();
7
+ const permissionAttr = handlePermission
8
+ ? `v-permission="${handlePermission}"`
9
+ : '';
3
10
  const formCall = `window.v3plugin.$form({ token: '${token}' })`;
4
11
  const buttonClass = icon
5
- ? `size-8 inline-flex justify-center items-center gap-x-2 font-medium rounded-s-lg border border-stone-200 bg-${newColor}-100 text-stone-800 shadow-sm hover:bg-${newColor}-200 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-${newColor}-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 `
6
- : `px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-500 hover:bg-${newColor}-500 focus:ring-${newColor}-500`;
12
+ ? `size-8 inline-flex justify-center items-center gap-x-2 font-medium rounded-s-lg border border-stone-200 bg-${COLOR}-100 text-stone-800 shadow-sm hover:bg-${COLOR}-200 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-${COLOR}-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 `
13
+ : `px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${COLOR}-100 text-${COLOR}-500 hover:bg-${COLOR}-500 focus:ring-${COLOR}-500`;
7
14
  const buttonContent = icon
8
- ? `<svg class="shrink-0 size-3.5" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="${newColor}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
15
+ ? `<svg class="shrink-0 size-3.5" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="${COLOR}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
9
16
  <path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"></path>
10
17
  <path d="m15 5 4 4"></path>
11
18
  </svg>`
12
19
  : `${title || "Редагувати"}`;
13
- return `<button onclick="${formCall}" class="${buttonClass}">${buttonContent}</button>`;
20
+ return `<button ${permissionAttr} onclick="${formCall}" class="${buttonClass}">${buttonContent}</button>`;
14
21
  }
@@ -1 +1 @@
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;AAIpD,iBAAe,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,iBA0NtC;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;AAIpD,iBAAe,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,iBA6NtC;AAGD,eAAe,IAAI,CAAC"}
@@ -176,7 +176,9 @@ async function init(client) {
176
176
  queryNotice,
177
177
  querySafe,
178
178
  });
179
- console.log("New client init finished", client.database, new Date().toISOString());
179
+ if (config.trace) {
180
+ console.log("New client init finished", client.database, new Date().toISOString());
181
+ }
180
182
  logger.file("pg", {
181
183
  message: "client init finished",
182
184
  database: client.database,
@@ -1 +1 @@
1
- {"version":3,"file":"checkJWT.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/policy/funcs/checkJWT.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAMhC,wBAA8B,QAAQ,CAAC,GAAG,EAAE,eAAe;;;;;;;;;;;;;;UAkG1D"}
1
+ {"version":3,"file":"checkJWT.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/policy/funcs/checkJWT.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAMhC,wBAA8B,QAAQ,CAAC,GAAG,EAAE,eAAe;;;;;;;;;;;;;;UAoG1D"}
@@ -42,6 +42,7 @@ export default async function checkJWT(req) {
42
42
  method,
43
43
  message: isRevoked ? "token is revoked" : "token is expired",
44
44
  ip,
45
+ jwtToken: jwtToken.slice(-6),
45
46
  uid: user?.uid,
46
47
  });
47
48
  return { error: "forbidden", code: 403 };
@@ -53,6 +54,7 @@ export default async function checkJWT(req) {
53
54
  method,
54
55
  message: tokenHash ? "scrypt verification failed" : "token not found",
55
56
  ip,
57
+ clientId,
56
58
  uid: user?.uid,
57
59
  });
58
60
  return { error: "forbidden", code: 403 };
@@ -69,9 +71,9 @@ export default async function checkJWT(req) {
69
71
  logger.file("policy/jwt", {
70
72
  path,
71
73
  method,
72
- message: "forbidden",
73
- error,
74
+ message: error || "forbidden",
74
75
  ip,
76
+ clientId,
75
77
  uid: user?.uid,
76
78
  });
77
79
  return { error: "forbidden", code: 403 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.2.7",
3
+ "version": "2.2.9",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [