adminforth 2.17.0-next.8 → 2.17.0

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 (106) hide show
  1. package/commands/callTsProxy.js +2 -1
  2. package/commands/createApp/templates/adminuser.ts.hbs +2 -1
  3. package/commands/createApp/templates/index.ts.hbs +3 -2
  4. package/commands/createCustomComponent/main.js +0 -3
  5. package/commands/createCustomComponent/templates/customCrud/afterBreadcrumbs.vue.hbs +4 -2
  6. package/commands/createCustomComponent/templates/customCrud/beforeActionButtons.vue.hbs +3 -2
  7. package/commands/createCustomComponent/templates/customCrud/beforeBreadcrumbs.vue.hbs +4 -2
  8. package/commands/createCustomComponent/templates/customCrud/bottom.vue.hbs +4 -2
  9. package/commands/createCustomComponent/templates/customCrud/threeDotsDropdownItems.vue.hbs +4 -2
  10. package/commands/createPlugin/templates/index.ts.hbs +4 -0
  11. package/dist/auth.d.ts +2 -2
  12. package/dist/auth.d.ts.map +1 -1
  13. package/dist/auth.js +17 -10
  14. package/dist/auth.js.map +1 -1
  15. package/dist/basePlugin.d.ts +1 -0
  16. package/dist/basePlugin.d.ts.map +1 -1
  17. package/dist/basePlugin.js +6 -2
  18. package/dist/basePlugin.js.map +1 -1
  19. package/dist/dataConnectors/baseConnector.d.ts +1 -0
  20. package/dist/dataConnectors/baseConnector.d.ts.map +1 -1
  21. package/dist/dataConnectors/baseConnector.js +100 -14
  22. package/dist/dataConnectors/baseConnector.js.map +1 -1
  23. package/dist/dataConnectors/clickhouse.d.ts +2 -0
  24. package/dist/dataConnectors/clickhouse.d.ts.map +1 -1
  25. package/dist/dataConnectors/clickhouse.js +15 -4
  26. package/dist/dataConnectors/clickhouse.js.map +1 -1
  27. package/dist/dataConnectors/mongo.d.ts +8 -1
  28. package/dist/dataConnectors/mongo.d.ts.map +1 -1
  29. package/dist/dataConnectors/mongo.js +72 -28
  30. package/dist/dataConnectors/mongo.js.map +1 -1
  31. package/dist/dataConnectors/mysql.d.ts +2 -0
  32. package/dist/dataConnectors/mysql.d.ts.map +1 -1
  33. package/dist/dataConnectors/mysql.js +22 -23
  34. package/dist/dataConnectors/mysql.js.map +1 -1
  35. package/dist/dataConnectors/postgres.d.ts +2 -0
  36. package/dist/dataConnectors/postgres.d.ts.map +1 -1
  37. package/dist/dataConnectors/postgres.js +23 -26
  38. package/dist/dataConnectors/postgres.js.map +1 -1
  39. package/dist/dataConnectors/sqlite.d.ts +2 -0
  40. package/dist/dataConnectors/sqlite.d.ts.map +1 -1
  41. package/dist/dataConnectors/sqlite.js +19 -19
  42. package/dist/dataConnectors/sqlite.js.map +1 -1
  43. package/dist/index.d.ts +10 -4
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +60 -54
  46. package/dist/index.js.map +1 -1
  47. package/dist/modules/codeInjector.d.ts.map +1 -1
  48. package/dist/modules/codeInjector.js +45 -63
  49. package/dist/modules/codeInjector.js.map +1 -1
  50. package/dist/modules/configValidator.d.ts.map +1 -1
  51. package/dist/modules/configValidator.js +14 -9
  52. package/dist/modules/configValidator.js.map +1 -1
  53. package/dist/modules/logger.d.ts +5 -0
  54. package/dist/modules/logger.d.ts.map +1 -0
  55. package/dist/modules/logger.js +16 -0
  56. package/dist/modules/logger.js.map +1 -0
  57. package/dist/modules/restApi.d.ts.map +1 -1
  58. package/dist/modules/restApi.js +21 -23
  59. package/dist/modules/restApi.js.map +1 -1
  60. package/dist/modules/socketBroker.d.ts.map +1 -1
  61. package/dist/modules/socketBroker.js +6 -5
  62. package/dist/modules/socketBroker.js.map +1 -1
  63. package/dist/modules/styles.js +1 -1
  64. package/dist/servers/express.d.ts.map +1 -1
  65. package/dist/servers/express.js +11 -11
  66. package/dist/servers/express.js.map +1 -1
  67. package/dist/spa/src/App.vue +6 -3
  68. package/dist/spa/src/adminforth.ts +60 -1
  69. package/dist/spa/src/afcl/DatePicker.vue +0 -1
  70. package/dist/spa/src/afcl/Dropzone.vue +6 -4
  71. package/dist/spa/src/afcl/Tooltip.vue +38 -4
  72. package/dist/spa/src/components/ColumnValueInput.vue +14 -1
  73. package/dist/spa/src/components/CustomDateRangePicker.vue +0 -2
  74. package/dist/spa/src/components/CustomRangePicker.vue +9 -6
  75. package/dist/spa/src/components/Filters.vue +4 -4
  76. package/dist/spa/src/components/ListActionsThreeDots.vue +235 -0
  77. package/dist/spa/src/components/ResourceForm.vue +4 -4
  78. package/dist/spa/src/components/ResourceListTable.vue +30 -16
  79. package/dist/spa/src/components/ResourceListTableVirtual.vue +34 -18
  80. package/dist/spa/src/components/Sidebar.vue +4 -2
  81. package/dist/spa/src/components/ThreeDotsMenu.vue +35 -20
  82. package/dist/spa/src/composables/useFrontendApi.ts +8 -4
  83. package/dist/spa/src/renderers/CompactField.vue +3 -2
  84. package/dist/spa/src/renderers/CompactUUID.vue +3 -2
  85. package/dist/spa/src/stores/core.ts +3 -2
  86. package/dist/spa/src/types/Back.ts +34 -11
  87. package/dist/spa/src/types/Common.ts +7 -14
  88. package/dist/spa/src/types/FrontendAPI.ts +25 -10
  89. package/dist/spa/src/views/CreateView.vue +23 -31
  90. package/dist/spa/src/views/EditView.vue +27 -31
  91. package/dist/spa/src/views/ListView.vue +20 -10
  92. package/dist/spa/src/views/SettingsView.vue +3 -2
  93. package/dist/spa/src/views/ShowView.vue +7 -6
  94. package/dist/types/Back.d.ts +27 -5
  95. package/dist/types/Back.d.ts.map +1 -1
  96. package/dist/types/Back.js +6 -0
  97. package/dist/types/Back.js.map +1 -1
  98. package/dist/types/Common.d.ts +8 -15
  99. package/dist/types/Common.d.ts.map +1 -1
  100. package/dist/types/Common.js +2 -0
  101. package/dist/types/Common.js.map +1 -1
  102. package/dist/types/FrontendAPI.d.ts +32 -10
  103. package/dist/types/FrontendAPI.d.ts.map +1 -1
  104. package/dist/types/FrontendAPI.js.map +1 -1
  105. package/package.json +4 -1
  106. package/commands/createCustomComponent/templates/customCrud/saveButton.vue.hbs +0 -28
@@ -8,9 +8,10 @@ export interface FrontendAPIInterface {
8
8
  * Example:
9
9
  *
10
10
  * ```ts
11
- * import adminforth from '@/adminforth'
11
+ *import { useAdminforth } from '@/adminforth';
12
12
  *
13
- * const isConfirmed = await adminforth.confirm({message: 'Are you sure?', yes: 'Yes', no: 'No'})
13
+ * const { confirm } = useAdminforth();
14
+ * const isConfirmed = await confirm({message: 'Are you sure?', yes: 'Yes', no: 'No'})
14
15
  * if (isConfirmed) {
15
16
  * your code...
16
17
  * }
@@ -28,9 +29,10 @@ export interface FrontendAPIInterface {
28
29
  * Example:
29
30
  *
30
31
  * ```ts
31
- * import adminforth from '@/adminforth'
32
+ * import { useAdminforth } from '@/adminforth';
33
+ * const { alert } = useAdminforth();
32
34
  *
33
- * adminforth.alert({message: 'Hello', variant: 'success'})
35
+ * alert({message: 'Hello', variant: 'success'})
34
36
  * ```
35
37
  *
36
38
  * @param params - The parameters of the alert
@@ -72,13 +74,14 @@ export interface FrontendAPIInterface {
72
74
  * Example:
73
75
  *
74
76
  * ```ts
75
- * import adminforth from '@/adminforth'
77
+ * import { useAdminforth } from '@/adminforth';
76
78
  *
79
+ * const { list } = useAdminforth();
77
80
  * // Regular filter (will show in badge if column.showIn.filter !== false)
78
- * adminforth.list.setFilter({field: 'name', operator: 'ilike', value: 'john'})
81
+ * list.setFilter({field: 'name', operator: 'ilike', value: 'john'})
79
82
  *
80
83
  * // Hidden filter (won't show in badge if column.showIn.filter === false)
81
- * adminforth.list.setFilter({field: 'internal_status', operator: 'eq', value: 'active'})
84
+ * list.setFilter({field: 'internal_status', operator: 'eq', value: 'active'})
82
85
  * ```
83
86
  *
84
87
  * Please note that you can set/update filter even for fields which have showIn.filter=false in resource configuration.
@@ -97,9 +100,9 @@ export interface FrontendAPIInterface {
97
100
  * Example:
98
101
  *
99
102
  * ```ts
100
- * import adminforth from '@/adminforth';
101
- *
102
- * adminforth.list.updateFilter({field: 'name', operator: 'ilike', value: 'john'})
103
+ * import { useAdminforth } from '@/adminforth';
104
+ * const { list } = useAdminforth();
105
+ * list.updateFilter({field: 'name', operator: 'ilike', value: 'john'})
103
106
  * ```
104
107
  *
105
108
  * @param filter - The filter to update
@@ -127,6 +130,25 @@ export interface FrontendAPIInterface {
127
130
  * Close the user menu dropdown
128
131
  */
129
132
  closeUserMenuDropdown(): void;
133
+ /**
134
+ * Run save interceptors for a specific resource or all resources if no resourceId is provided
135
+ */
136
+ runSaveInterceptors(params: {
137
+ action: 'create' | 'edit';
138
+ values: any;
139
+ resource: any;
140
+ resourceId: string;
141
+ }): Promise<{
142
+ ok: boolean;
143
+ error?: string | null;
144
+ extra?: object;
145
+ }>;
146
+ /**
147
+ * Clear save interceptors for a specific resource or all resources if no resourceId is provided
148
+ *
149
+ * @param resourceId - The resource ID to clear interceptors for
150
+ */
151
+ clearSaveInterceptors(resourceId?: string): void;
130
152
  }
131
153
  export type ConfirmParams = {
132
154
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"FrontendAPI.d.ts","sourceRoot":"","sources":["../../types/FrontendAPI.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3E,MAAM,WAAW,oBAAoB;IAEjC;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEjD;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,EAAC,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAG3D,IAAI,EAAE;QAEF;;WAEG;QACH,OAAO,IAAI,OAAO,CAAC;YAAE,KAAK,CAAC,EAAG,MAAM,CAAA;SAAE,CAAC,CAAC;QAExC;;;;WAIG;QACH,aAAa,IAAI,OAAO,CAAC;YAAE,KAAK,CAAC,EAAG,MAAM,CAAA;SAAE,CAAC,CAAC;QAE9C;;WAEG;QACH,gBAAgB,CAAE,EAAE,EAAE,GAAG,GAAG,OAAO,CAAC;YAAE,KAAK,CA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CAAA;AACf,CAAC,EALS,YAAY,KAAZ,YAAY,QAKrB"}
1
+ {"version":3,"file":"FrontendAPI.js","sourceRoot":"","sources":["../../types/FrontendAPI.ts"],"names":[],"mappings":"AA0MA,MAAM,CAAN,IAAY,YAKT;AALH,WAAY,YAAY;IACpB,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,6BAAa,CAAA;AACf,CAAC,EALS,YAAY,KAAZ,YAAY,QAKrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.17.0-next.8",
3
+ "version": "2.17.0",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -82,6 +82,9 @@
82
82
  "mysql2": "^3.14.2",
83
83
  "node-fetch": "^3.3.2",
84
84
  "pg": "^8.11.5",
85
+ "pino": "^10.1.0",
86
+ "pino-pretty": "^13.1.3",
87
+ "private-ip": "^3.0.2",
85
88
  "rate-limiter-flexible": "^8.1.0",
86
89
  "recast": "^0.23.11",
87
90
  "ws": "^8.18.0"
@@ -1,28 +0,0 @@
1
- <template>
2
- <button
3
- class="px-4 py-2 border border-blue-500 text-blue-600 rounded hover:bg-blue-50 disabled:opacity-50"
4
- :disabled="props.disabled || props.saving || !props.isValid"
5
- @click="props.saveRecord()"
6
- >
7
- <span v-if="props.saving">Saving…</span>
8
- <span v-else>Save</span>
9
- </button>
10
- </template>
11
-
12
- <script setup lang="ts">
13
-
14
- const props = defineProps<{
15
- record: any
16
- resource: any
17
- adminUser: any
18
- meta: any
19
- saving: boolean
20
- validating: boolean
21
- isValid: boolean
22
- disabled: boolean
23
- saveRecord: () => Promise<void>
24
- }>();
25
- </script>
26
-
27
- <style scoped>
28
- </style>