adminforth 1.3.54-next.9 → 1.3.55-next.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 (250) hide show
  1. package/dist/auth.d.ts +31 -0
  2. package/dist/auth.d.ts.map +1 -0
  3. package/dist/auth.js +42 -56
  4. package/dist/auth.js.map +1 -0
  5. package/dist/basePlugin.d.ts +18 -0
  6. package/dist/basePlugin.d.ts.map +1 -0
  7. package/dist/basePlugin.js +1 -0
  8. package/dist/basePlugin.js.map +1 -0
  9. package/dist/dataConnectors/baseConnector.d.ts +94 -0
  10. package/dist/dataConnectors/baseConnector.d.ts.map +1 -0
  11. package/dist/dataConnectors/baseConnector.js +108 -122
  12. package/dist/dataConnectors/baseConnector.js.map +1 -0
  13. package/dist/dataConnectors/clickhouse.d.ts +92 -0
  14. package/dist/dataConnectors/clickhouse.d.ts.map +1 -0
  15. package/dist/dataConnectors/clickhouse.js +132 -149
  16. package/dist/dataConnectors/clickhouse.js.map +1 -0
  17. package/dist/dataConnectors/mongo.d.ts +93 -0
  18. package/dist/dataConnectors/mongo.d.ts.map +1 -0
  19. package/dist/dataConnectors/mongo.js +75 -101
  20. package/dist/dataConnectors/mongo.js.map +1 -0
  21. package/dist/dataConnectors/postgres.d.ts +71 -0
  22. package/dist/dataConnectors/postgres.d.ts.map +1 -0
  23. package/dist/dataConnectors/postgres.js +124 -143
  24. package/dist/dataConnectors/postgres.js.map +1 -0
  25. package/dist/dataConnectors/sqlite.d.ts +67 -0
  26. package/dist/dataConnectors/sqlite.d.ts.map +1 -0
  27. package/dist/dataConnectors/sqlite.js +113 -130
  28. package/dist/dataConnectors/sqlite.js.map +1 -0
  29. package/dist/index.d.ts +92 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +197 -217
  32. package/dist/index.js.map +1 -0
  33. package/dist/modules/codeInjector.d.ts +35 -0
  34. package/dist/modules/codeInjector.d.ts.map +1 -0
  35. package/dist/modules/codeInjector.js +480 -486
  36. package/dist/modules/codeInjector.js.map +1 -0
  37. package/dist/modules/configValidator.d.ts +12 -0
  38. package/dist/modules/configValidator.d.ts.map +1 -0
  39. package/dist/modules/configValidator.js +31 -22
  40. package/dist/modules/configValidator.js.map +1 -0
  41. package/dist/modules/operationalResource.d.ts +17 -0
  42. package/dist/modules/operationalResource.d.ts.map +1 -0
  43. package/dist/modules/operationalResource.js +50 -70
  44. package/dist/modules/operationalResource.js.map +1 -0
  45. package/dist/modules/restApi.d.ts +10 -0
  46. package/dist/modules/restApi.d.ts.map +1 -0
  47. package/dist/modules/restApi.js +104 -116
  48. package/dist/modules/restApi.js.map +1 -0
  49. package/dist/modules/styleGenerator.d.ts +9 -0
  50. package/dist/modules/styleGenerator.d.ts.map +1 -0
  51. package/dist/modules/styleGenerator.js +1 -0
  52. package/dist/modules/styleGenerator.js.map +1 -0
  53. package/dist/modules/styles.d.ts +96 -0
  54. package/dist/modules/styles.d.ts.map +1 -0
  55. package/dist/modules/styles.js +1 -0
  56. package/dist/modules/styles.js.map +1 -0
  57. package/dist/modules/utils.d.ts +39 -0
  58. package/dist/modules/utils.d.ts.map +1 -0
  59. package/dist/modules/utils.js +1 -0
  60. package/dist/modules/utils.js.map +1 -0
  61. package/dist/plugins/audit-log/types.d.ts +35 -0
  62. package/dist/plugins/audit-log/types.d.ts.map +1 -0
  63. package/dist/plugins/audit-log/types.js +2 -0
  64. package/dist/plugins/audit-log/types.js.map +1 -0
  65. package/dist/plugins/chat-gpt/types.d.ts +82 -0
  66. package/dist/plugins/chat-gpt/types.d.ts.map +1 -0
  67. package/dist/plugins/chat-gpt/types.js +2 -0
  68. package/dist/plugins/chat-gpt/types.js.map +1 -0
  69. package/dist/plugins/email-password-reset/types.d.ts +28 -0
  70. package/dist/plugins/email-password-reset/types.d.ts.map +1 -0
  71. package/dist/plugins/email-password-reset/types.js +2 -0
  72. package/dist/plugins/email-password-reset/types.js.map +1 -0
  73. package/dist/plugins/foreign-inline-list/types.d.ts +19 -0
  74. package/dist/plugins/foreign-inline-list/types.d.ts.map +1 -0
  75. package/dist/plugins/foreign-inline-list/types.js +2 -0
  76. package/dist/plugins/foreign-inline-list/types.js.map +1 -0
  77. package/dist/plugins/import-export/types.d.ts +3 -0
  78. package/dist/plugins/import-export/types.d.ts.map +1 -0
  79. package/dist/plugins/import-export/types.js +2 -0
  80. package/dist/plugins/import-export/types.js.map +1 -0
  81. package/dist/plugins/rich-editor/custom/async-queue.d.ts +8 -0
  82. package/dist/plugins/rich-editor/custom/async-queue.d.ts.map +1 -0
  83. package/dist/plugins/rich-editor/custom/async-queue.js +29 -0
  84. package/dist/plugins/rich-editor/custom/async-queue.js.map +1 -0
  85. package/dist/plugins/rich-editor/dist/custom/async-queue.d.ts +8 -0
  86. package/dist/plugins/rich-editor/dist/custom/async-queue.d.ts.map +1 -0
  87. package/dist/plugins/rich-editor/dist/custom/async-queue.js +29 -0
  88. package/dist/plugins/rich-editor/dist/custom/async-queue.js.map +1 -0
  89. package/dist/plugins/rich-editor/types.d.ts +153 -0
  90. package/dist/plugins/rich-editor/types.d.ts.map +1 -0
  91. package/dist/plugins/rich-editor/types.js +16 -0
  92. package/dist/plugins/rich-editor/types.js.map +1 -0
  93. package/dist/plugins/two-factors-auth/types.d.ts +18 -0
  94. package/dist/plugins/two-factors-auth/types.d.ts.map +1 -0
  95. package/dist/plugins/two-factors-auth/types.js +2 -0
  96. package/dist/plugins/two-factors-auth/types.js.map +1 -0
  97. package/dist/plugins/upload/types.d.ts +132 -0
  98. package/dist/plugins/upload/types.d.ts.map +1 -0
  99. package/dist/plugins/upload/types.js +2 -0
  100. package/dist/plugins/upload/types.js.map +1 -0
  101. package/dist/servers/express.d.ts +18 -0
  102. package/dist/servers/express.d.ts.map +1 -0
  103. package/dist/servers/express.js +30 -42
  104. package/dist/servers/express.js.map +1 -0
  105. package/dist/types/AdminForthConfig.d.ts +1619 -0
  106. package/dist/types/AdminForthConfig.d.ts.map +1 -0
  107. package/dist/types/AdminForthConfig.js +1 -0
  108. package/dist/types/AdminForthConfig.js.map +1 -0
  109. package/{types/FrontendAPI.ts → dist/types/FrontendAPI.d.ts} +27 -52
  110. package/dist/types/FrontendAPI.d.ts.map +1 -0
  111. package/dist/types/FrontendAPI.js +1 -0
  112. package/dist/types/FrontendAPI.js.map +1 -0
  113. package/package.json +15 -5
  114. package/auth.ts +0 -140
  115. package/basePlugin.ts +0 -70
  116. package/dataConnectors/baseConnector.ts +0 -216
  117. package/dataConnectors/clickhouse.ts +0 -338
  118. package/dataConnectors/mongo.ts +0 -202
  119. package/dataConnectors/postgres.ts +0 -306
  120. package/dataConnectors/sqlite.ts +0 -254
  121. package/dist/spa/.eslintrc.cjs +0 -14
  122. package/dist/spa/README.md +0 -39
  123. package/dist/spa/env.d.ts +0 -1
  124. package/dist/spa/index.html +0 -23
  125. package/dist/spa/package-lock.json +0 -4573
  126. package/dist/spa/package.json +0 -49
  127. package/dist/spa/postcss.config.js +0 -6
  128. package/dist/spa/public/assets/favicon.png +0 -0
  129. package/dist/spa/src/App.vue +0 -314
  130. package/dist/spa/src/assets/base.css +0 -2
  131. package/dist/spa/src/assets/logo.svg +0 -19
  132. package/dist/spa/src/components/AcceptModal.vue +0 -45
  133. package/dist/spa/src/components/Breadcrumbs.vue +0 -41
  134. package/dist/spa/src/components/BreadcrumbsWithButtons.vue +0 -26
  135. package/dist/spa/src/components/CustomDatePicker.vue +0 -176
  136. package/dist/spa/src/components/CustomDateRangePicker.vue +0 -218
  137. package/dist/spa/src/components/CustomRangePicker.vue +0 -152
  138. package/dist/spa/src/components/Dropdown.vue +0 -168
  139. package/dist/spa/src/components/Filters.vue +0 -222
  140. package/dist/spa/src/components/HelloWorld.vue +0 -17
  141. package/dist/spa/src/components/MenuLink.vue +0 -24
  142. package/dist/spa/src/components/ResourceForm.vue +0 -294
  143. package/dist/spa/src/components/ResourceListTable.vue +0 -394
  144. package/dist/spa/src/components/SingleSkeletLoader.vue +0 -13
  145. package/dist/spa/src/components/SkeleteLoader.vue +0 -23
  146. package/dist/spa/src/components/Toast.vue +0 -77
  147. package/dist/spa/src/components/ValueRenderer.vue +0 -66
  148. package/dist/spa/src/components/icons/IconCalendar.vue +0 -5
  149. package/dist/spa/src/components/icons/IconCommunity.vue +0 -7
  150. package/dist/spa/src/components/icons/IconDocumentation.vue +0 -7
  151. package/dist/spa/src/components/icons/IconEcosystem.vue +0 -7
  152. package/dist/spa/src/components/icons/IconSupport.vue +0 -7
  153. package/dist/spa/src/components/icons/IconTime.vue +0 -5
  154. package/dist/spa/src/components/icons/IconTooling.vue +0 -19
  155. package/dist/spa/src/composables/useFrontendApi.ts +0 -26
  156. package/dist/spa/src/composables/useStores.ts +0 -127
  157. package/dist/spa/src/index.scss +0 -27
  158. package/dist/spa/src/main.ts +0 -18
  159. package/dist/spa/src/router/index.ts +0 -63
  160. package/dist/spa/src/spa_types/core.ts +0 -51
  161. package/dist/spa/src/stores/core.ts +0 -144
  162. package/dist/spa/src/stores/filters.ts +0 -22
  163. package/dist/spa/src/stores/modal.ts +0 -48
  164. package/dist/spa/src/stores/toast.ts +0 -15
  165. package/dist/spa/src/stores/user.ts +0 -72
  166. package/dist/spa/src/types/AdminForthConfig.ts +0 -1477
  167. package/dist/spa/src/types/FrontendAPI.ts +0 -121
  168. package/dist/spa/src/utils.ts +0 -103
  169. package/dist/spa/src/views/CreateView.vue +0 -156
  170. package/dist/spa/src/views/EditView.vue +0 -157
  171. package/dist/spa/src/views/ListView.vue +0 -258
  172. package/dist/spa/src/views/LoginView.vue +0 -160
  173. package/dist/spa/src/views/ResourceParent.vue +0 -17
  174. package/dist/spa/src/views/ShowView.vue +0 -184
  175. package/dist/spa/tailwind.config.js +0 -17
  176. package/dist/spa/tsconfig.app.json +0 -14
  177. package/dist/spa/tsconfig.json +0 -11
  178. package/dist/spa/tsconfig.node.json +0 -19
  179. package/dist/spa/vite.config.ts +0 -56
  180. package/index.ts +0 -428
  181. package/modules/codeInjector.ts +0 -736
  182. package/modules/configValidator.ts +0 -571
  183. package/modules/operationalResource.ts +0 -98
  184. package/modules/restApi.ts +0 -718
  185. package/modules/styleGenerator.ts +0 -55
  186. package/modules/styles.ts +0 -126
  187. package/modules/utils.ts +0 -472
  188. package/servers/express.ts +0 -259
  189. package/spa/.eslintrc.cjs +0 -14
  190. package/spa/README.md +0 -39
  191. package/spa/env.d.ts +0 -1
  192. package/spa/index.html +0 -23
  193. package/spa/package-lock.json +0 -4602
  194. package/spa/package.json +0 -51
  195. package/spa/postcss.config.js +0 -6
  196. package/spa/public/assets/favicon.png +0 -0
  197. package/spa/src/App.vue +0 -418
  198. package/spa/src/assets/base.css +0 -2
  199. package/spa/src/assets/logo.svg +0 -19
  200. package/spa/src/components/AcceptModal.vue +0 -45
  201. package/spa/src/components/Breadcrumbs.vue +0 -41
  202. package/spa/src/components/BreadcrumbsWithButtons.vue +0 -26
  203. package/spa/src/components/CustomDatePicker.vue +0 -176
  204. package/spa/src/components/CustomDateRangePicker.vue +0 -218
  205. package/spa/src/components/CustomRangePicker.vue +0 -156
  206. package/spa/src/components/Dropdown.vue +0 -168
  207. package/spa/src/components/Filters.vue +0 -222
  208. package/spa/src/components/HelloWorld.vue +0 -17
  209. package/spa/src/components/MenuLink.vue +0 -27
  210. package/spa/src/components/ResourceForm.vue +0 -290
  211. package/spa/src/components/ResourceListTable.vue +0 -466
  212. package/spa/src/components/SingleSkeletLoader.vue +0 -13
  213. package/spa/src/components/SkeleteLoader.vue +0 -23
  214. package/spa/src/components/ThreeDotsMenu.vue +0 -43
  215. package/spa/src/components/Toast.vue +0 -78
  216. package/spa/src/components/ValueRenderer.vue +0 -114
  217. package/spa/src/components/icons/IconCalendar.vue +0 -5
  218. package/spa/src/components/icons/IconCommunity.vue +0 -7
  219. package/spa/src/components/icons/IconDocumentation.vue +0 -7
  220. package/spa/src/components/icons/IconEcosystem.vue +0 -7
  221. package/spa/src/components/icons/IconSupport.vue +0 -7
  222. package/spa/src/components/icons/IconTime.vue +0 -5
  223. package/spa/src/components/icons/IconTooling.vue +0 -19
  224. package/spa/src/composables/useFrontendApi.ts +0 -26
  225. package/spa/src/composables/useStores.ts +0 -131
  226. package/spa/src/index.scss +0 -31
  227. package/spa/src/main.ts +0 -18
  228. package/spa/src/renderers/CompactUUID.vue +0 -48
  229. package/spa/src/renderers/CountryFlag.vue +0 -69
  230. package/spa/src/router/index.ts +0 -59
  231. package/spa/src/spa_types/core.ts +0 -53
  232. package/spa/src/stores/core.ts +0 -148
  233. package/spa/src/stores/filters.ts +0 -27
  234. package/spa/src/stores/modal.ts +0 -48
  235. package/spa/src/stores/toast.ts +0 -31
  236. package/spa/src/stores/user.ts +0 -72
  237. package/spa/src/utils.ts +0 -160
  238. package/spa/src/views/CreateView.vue +0 -167
  239. package/spa/src/views/EditView.vue +0 -170
  240. package/spa/src/views/ListView.vue +0 -352
  241. package/spa/src/views/LoginView.vue +0 -192
  242. package/spa/src/views/ResourceParent.vue +0 -17
  243. package/spa/src/views/ShowView.vue +0 -186
  244. package/spa/tailwind.config.js +0 -17
  245. package/spa/tsconfig.app.json +0 -14
  246. package/spa/tsconfig.json +0 -11
  247. package/spa/tsconfig.node.json +0 -19
  248. package/spa/vite.config.ts +0 -56
  249. package/tsconfig.json +0 -112
  250. package/types/AdminForthConfig.ts +0 -1762
@@ -0,0 +1,153 @@
1
+ export interface PluginOptions {
2
+ /**
3
+ * Field where plugin will auto-complete text. Should be string or text field.
4
+ */
5
+ htmlFieldName: string;
6
+ /**
7
+ * Quill toolbar setting, full toolbar:
8
+ *
9
+ * ```
10
+ * [
11
+ * ['bold', 'italic', 'underline', 'strike'], // toggled buttons
12
+ * ['blockquote', 'code-block', 'link'],
13
+ * // [ 'image', 'video', 'formula' ],
14
+ *
15
+ * [{ 'header': 2 }, { 'header': 3 }], // custom button values
16
+ * [{ 'list': 'ordered'}, { 'list': 'bullet' }, { 'list': 'check' }],
17
+ * // [{ 'script': 'sub'}, { 'script': 'super' }], // superscript/subscript
18
+ * // [{ 'indent': '-1'}, { 'indent': '+1' }], // outdent/indent
19
+ * // [{ 'direction': 'rtl' }], // text direction
20
+ * // [{ 'size': ['small', false, 'large', 'huge'] }], // custom dropdown
21
+ * // [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
22
+ * // [{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme
23
+ * // [{ 'font': [] }],
24
+ * [{ 'align': [] }],
25
+ *
26
+ * ['clean']
27
+ * ]
28
+ *```
29
+ */
30
+ toolbar?: any[];
31
+ /**
32
+ * The completion section is used to define the completion provider and its parameters.
33
+ */
34
+ completion?: {
35
+ /**
36
+ * The provider is the name of the plugin that will be used to provide completions.
37
+ */
38
+ provider: string;
39
+ /**
40
+ * The params are the parameters that will be passed to the completion provider.
41
+ */
42
+ params: {
43
+ /**
44
+ * OpenAI API key. Go to https://platform.openai.com/, go to Dashboard -> API keys -> Create new secret key
45
+ * Paste value in your .env file OPENAI_API_KEY=your_key
46
+ * Set openAiApiKey: process.env.OPENAI_API_KEY to access it
47
+ */
48
+ apiKey: string;
49
+ /**
50
+ * Model name. Go to https://platform.openai.com/docs/models, select model and copy name.
51
+ * Default is `gpt-4o-mini`. Use e.g. more expensive `gpt-4o` for more powerful model.
52
+ */
53
+ model?: string;
54
+ };
55
+ /**
56
+ * Expert settings
57
+ */
58
+ expert?: {
59
+ /**
60
+ * Number of tokens to generate. Default is 50. 1 token ~= ¾ words
61
+ */
62
+ maxTokens?: number;
63
+ /**
64
+ * Temperature (0-1). Lower is more deterministic, higher is more unpredicted creative. Default is 0.7.
65
+ */
66
+ temperature?: number;
67
+ /**
68
+ * Maximum number of last characters which will be used for completion for target field. Default is 500.
69
+ * Higher value will give better context but will cost more.
70
+ */
71
+ promptInputLimit?: number;
72
+ /**
73
+ * Time in ms to wait after user stops typing before sending request to completion provider. Default is 300 ms.
74
+ */
75
+ debounceTime?: number;
76
+ /**
77
+ * Stop completion on these characters. Default is ['.']
78
+ */
79
+ stop?: string[];
80
+ /**
81
+ * When completion is made, this plugin passes non-empty fields of the record to the LLM model for record context understanding.
82
+ */
83
+ recordContext?: {
84
+ /**
85
+ * Using this field you can limit number of fields passed to the model.
86
+ * Default is 5.
87
+ * Completion field is not included in this limit.
88
+ * Set to 0 to disable context passing at all.
89
+ * If count of fields exceeds this number, longest fields will be selected.
90
+ * If some of values will exceed maxFieldLength, it will be smartly truncated by splitting ito splitParts, taking their
91
+ * starting substring and joining back with '...'.
92
+ */
93
+ maxFields?: number;
94
+ /**
95
+ * Limit of input field value. Default is 300. If field is longer, it will be truncated.
96
+ */
97
+ maxFieldLength?: number;
98
+ /**
99
+ * How many parts to split field value if it exceeds maxFieldLength. Default is 5.
100
+ */
101
+ splitParts?: number;
102
+ };
103
+ };
104
+ /**
105
+ * Since AI generation can be expensive, we can limit the number of requests per IP.
106
+ * Completion will simply stop working when limit is reached so user will not be bothered with error messages.
107
+ */
108
+ rateLimit?: {
109
+ /**
110
+ * E.g. 5/1d - 5 requests per day
111
+ * 3/1h - 3 requests per hour
112
+ */
113
+ limit: string;
114
+ /**
115
+ * Not used now
116
+ * Message shown to user when rate limit is reached
117
+ */
118
+ errorMessage: string;
119
+ };
120
+ };
121
+ /**
122
+ * Allows to attach images to the HTML text
123
+ * Requires to have a separate resource with Upload Plugin installed on attachment field.
124
+ * Each attachment used in HTML will create one record in the attachment resource.
125
+ */
126
+ attachments?: {
127
+ /**
128
+ * Resource name where images are stored. Should point to the existing resource.
129
+ */
130
+ attachmentResource: string;
131
+ /**
132
+ * Field name in the attachment resource where image is stored. Should point to the existing field in the attachment resource.
133
+ * Also there should be upload plugin installed on this field.
134
+ */
135
+ attachmentFieldName: string;
136
+ /**
137
+ * When attachment is created, it will be linked to the record, by storing id of the record with editor in attachment resource.
138
+ * Here you define the field name where this id will be stored.
139
+ *
140
+ * Linking is needed to remove all attachments when record is deleted.
141
+ *
142
+ * For example when RichEditor installed on description field of apartment resource,
143
+ * field in attachment resource described hear will store id of apartment record.
144
+ */
145
+ attachmentRecordIdFieldName: string;
146
+ /**
147
+ * When attachment is created, it will be linked to the resource, by storing id of the resource with editor in attachment resource.
148
+ * For example when RichEditor installed on description field of apartment resource, it will store id of apartment resource.
149
+ */
150
+ attachmentResourceIdFieldName: string;
151
+ };
152
+ }
153
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../plugins/rich-editor/types.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,aAAa;IAE5B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAGtB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAEhB;;OAEG;IACH,UAAU,CAAC,EAAE;QACX;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,MAAM,EAAE;YACN;;;;eAIG;YACH,MAAM,EAAE,MAAM,CAAC;YAEf;;;eAGG;YACH,KAAK,CAAC,EAAE,MAAM,CAAC;SAChB,CAAA;QAED;;WAEG;QACH,MAAM,CAAC,EAAE;YACL;;eAEG;YACH,SAAS,CAAC,EAAE,MAAM,CAAC;YAEnB;;eAEG;YACH,WAAW,CAAC,EAAE,MAAM,CAAC;YAErB;;;eAGG;YACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;YAE1B;;eAEG;YACH,YAAY,CAAC,EAAE,MAAM,CAAC;YAEtB;;eAEG;YACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;YAEhB;;eAEG;YACH,aAAa,CAAC,EAAE;gBACd;;;;;;;;mBAQG;gBACH,SAAS,CAAC,EAAE,MAAM,CAAC;gBAEnB;;mBAEG;gBACH,cAAc,CAAC,EAAE,MAAM,CAAC;gBAExB;;mBAEG;gBACH,UAAU,CAAC,EAAE,MAAM,CAAC;aAErB,CAAA;SACJ,CAAA;QAED;;;WAGG;QACH,SAAS,CAAC,EAAE;YAEV;;;eAGG;YACH,KAAK,EAAE,MAAM,CAAC;YAEd;;;eAGG;YACH,YAAY,EAAE,MAAM,CAAC;SACtB,CAAC;KAEH,CAAA;IAED;;;;OAIG;IACH,WAAW,CAAC,EAAE;QACZ;;WAEG;QACH,kBAAkB,EAAE,MAAM,CAAC;QAE3B;;;WAGG;QACH,mBAAmB,EAAE,MAAM,CAAC;QAE5B;;;;;;;;WAQG;QACH,2BAA2B,EAAE,MAAM,CAAC;QAEpC;;;WAGG;QACH,6BAA6B,EAAE,MAAM,CAAC;KACvC,CAAC;CACH"}
@@ -0,0 +1,16 @@
1
+ // example options ussage:
2
+ //{
3
+ // htmlFieldName: 'description',
4
+ // completion: {
5
+ // provider: 'openai-chat-gpt',
6
+ // params: {
7
+ // apiKey: process.env.OPENAI_API_KEY as string,
8
+ // model: 'gpt-4o',
9
+ // },
10
+ // expert: {
11
+ // debounceTime: 250,
12
+ // }
13
+ // }
14
+ //}
15
+ export {};
16
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../plugins/rich-editor/types.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,GAAG;AACH,iCAAiC;AACjC,iBAAiB;AACjB,kCAAkC;AAClC,eAAe;AACf,qDAAqD;AACrD,wBAAwB;AACxB,QAAQ;AACR,eAAe;AACf,0BAA0B;AAC1B,OAAO;AACP,KAAK;AACL,GAAG"}
@@ -0,0 +1,18 @@
1
+ import { AdminUser } from "adminforth";
2
+ export type PluginOptions = {
3
+ /**
4
+ * Name of the field in the auth resource which will store 2FA secret.
5
+ *
6
+ * Resource mandatory should have one columns which defined {@link AdminForthResourceColumn} which
7
+ * name should be equal to the value .
8
+ */
9
+ twoFaSecretFieldName: string;
10
+ /**
11
+ * Optional function to filter users to apply 2FA.
12
+ * Should return true if 2FA should be applied to the user and false if AdminForth should not challenge the user with 2FA.
13
+ * @param adminUser
14
+ * @returns true if 2FA should be applied to the user and false if AdminForth should not challenge the user with 2FA.
15
+ */
16
+ usersFilterToApply: (adminUser: AdminUser) => boolean;
17
+ };
18
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../plugins/two-factors-auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG;IAExB;;;;;OAKG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;;;OAKG;IACH,kBAAkB,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC;CACzD,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../plugins/two-factors-auth/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,132 @@
1
+ export type PluginOptions = {
2
+ /**
3
+ * The name of the column where the path to the uploaded file is stored.
4
+ * On place of this column, a file upload field will be shown.
5
+ */
6
+ pathColumnName: string;
7
+ /**
8
+ * the list of allowed file extensions
9
+ */
10
+ allowedFileExtensions?: string[];
11
+ /**
12
+ * the maximum file size in bytes
13
+ */
14
+ maxFileSize?: number;
15
+ /**
16
+ * S3 bucket name where we will upload the files, e.g. 'my-bucket'
17
+ */
18
+ s3Bucket: string;
19
+ /**
20
+ * S3 region, e.g. 'us-east-1'
21
+ */
22
+ s3Region: string;
23
+ /**
24
+ * S3 access key id
25
+ */
26
+ s3AccessKeyId: string;
27
+ /**
28
+ * S3 secret access key
29
+ */
30
+ s3SecretAccessKey: string;
31
+ /**
32
+ * ACL which will be set to uploaded file, e.g. 'public-read'.
33
+ * If you want to use 'public-read', it is your responsibility to set the "ACL Enabled" to true in the S3 bucket policy and Uncheck "Block all public access" in the bucket settings.
34
+ */
35
+ s3ACL?: string;
36
+ /**
37
+ * The path where the file will be uploaded to the S3 bucket, same path will be stored in the database
38
+ * in the column specified in {@link pathColumnName}
39
+ *
40
+ * example:
41
+ *
42
+ * ```typescript
43
+ * s3Path: ({record, originalFilename}) => `/aparts/${record.id}/${originalFilename}`
44
+ * ```
45
+ *
46
+ */
47
+ s3Path: ({ originalFilename, originalExtension, contentType }: {
48
+ originalFilename: any;
49
+ originalExtension: any;
50
+ contentType: any;
51
+ }) => string;
52
+ preview: {
53
+ /**
54
+ * Whether to show preview of image instead of path in list field
55
+ * By default true
56
+ */
57
+ showInList?: boolean;
58
+ /**
59
+ * Whether to show preview of image instead of path in list field
60
+ * By default true
61
+ */
62
+ showInShow?: boolean;
63
+ /**
64
+ * Used to display preview (if it is image) in list and show views.
65
+ * Defaulted to the AWS S3 presigned URL if resource is private or public URL if resource is public.
66
+ * Can be used to generate custom e.g. CDN(e.g. Cloudflare) URL to worm up cache and deliver preview faster.
67
+ *
68
+ * Example:
69
+ *
70
+ * ```typescript
71
+ * previewUrl: ({record, path}) => `https://my-bucket.s3.amazonaws.com/${path}`,
72
+ * ```
73
+ *
74
+ */
75
+ previewUrl?: ({ s3Path }: {
76
+ s3Path: any;
77
+ }) => string;
78
+ };
79
+ /**
80
+ * AI image generation options
81
+ */
82
+ generation?: {
83
+ /**
84
+ * The provider to use for image generation
85
+ * for now only 'openai-dall-e' is supported
86
+ */
87
+ provider: string;
88
+ /**
89
+ * The number of images to generate
90
+ * in one request
91
+ */
92
+ countToGenerate: number;
93
+ /**
94
+ * Options for OpenAI
95
+ */
96
+ openAiOptions: {
97
+ /**
98
+ * The model to use, e.g. 'dall-e-3'
99
+ */
100
+ model: string;
101
+ /**
102
+ * The size of the image to generate, e.g. '1792x1024'
103
+ */
104
+ size: string;
105
+ /**
106
+ * The OpenAI API key
107
+ */
108
+ apiKey: string;
109
+ };
110
+ /**
111
+ * Fields of record to use for context. if supplied must be array of valid column names for resource
112
+ * where plugin is used.
113
+ */
114
+ fieldsForContext?: string[];
115
+ /**
116
+ * Since AI generation can be expensive, we can limit the number of requests per IP.
117
+ */
118
+ rateLimit?: {
119
+ /**
120
+ * E.g. 5/1d - 5 requests per day
121
+ * 3/1h - 3 requests per hour
122
+ */
123
+ limit: string;
124
+ /**
125
+ * !Not used now
126
+ * Message shown to user when rate limit is reached
127
+ */
128
+ errorMessage: string;
129
+ };
130
+ };
131
+ };
132
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../plugins/upload/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,aAAa,GAAG;IAE1B;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;;;;OAUG;IACH,MAAM,EAAE,CAAC,EAAC,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,EAAC;;;;KAAA,KAAK,MAAM,CAAC;IAGvE,OAAO,EAAE;QAEP;;;WAGG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;QAErB;;;WAGG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;QAErB;;;;;;;;;;;WAWG;QACH,UAAU,CAAC,EAAE,CAAC,EAAC,MAAM,EAAC;;SAAA,KAAK,MAAM,CAAC;KACnC,CAAA;IAGD;;OAEG;IACH,UAAU,CAAC,EAAE;QACX;;;WAGG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;;WAGG;QACH,eAAe,EAAE,MAAM,CAAC;QAExB;;WAEG;QACH,aAAa,EAAE;YACb;;eAEG;YACH,KAAK,EAAE,MAAM,CAAC;YAEd;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YAEb;;eAEG;YACH,MAAM,EAAE,MAAM,CAAC;SAChB,CAAC;QAEF;;;WAGG;QACH,gBAAgB,CAAC,EAAG,MAAM,EAAE,CAAC;QAG7B;;WAEG;QACH,SAAS,CAAC,EAAE;YAEV;;;eAGG;YACH,KAAK,EAAE,MAAM,CAAC;YAEd;;;eAGG;YACH,YAAY,EAAE,MAAM,CAAC;SACtB,CAAC;KACH,CAAA;CAEF,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../plugins/upload/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import { Express } from 'express';
2
+ import { IAdminForth, IExpressHttpServer } from '../types/AdminForthConfig.js';
3
+ declare class ExpressServer implements IExpressHttpServer {
4
+ expressApp: Express;
5
+ adminforth: IAdminForth;
6
+ constructor(adminforth: IAdminForth);
7
+ setupSpaServer(): void;
8
+ serve(app: any): void;
9
+ authorize(handler: any): (req: any, res: any, next: any) => Promise<void>;
10
+ endpoint({ method, path, handler, noAuth }: {
11
+ method?: string;
12
+ path: any;
13
+ handler: any;
14
+ noAuth?: boolean;
15
+ }): void;
16
+ }
17
+ export default ExpressServer;
18
+ //# sourceMappingURL=express.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../servers/express.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AA4E/E,cAAM,aAAc,YAAW,kBAAkB;IAE/C,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,WAAW,CAAC;gBAEZ,UAAU,EAAE,WAAW;IAInC,cAAc;IA2Dd,KAAK,CAAC,GAAG,KAAA;IAMT,SAAS,CAAC,OAAO,KAAA;IA0BjB,QAAQ,CAAC,EAAE,MAAY,EAAE,IAAI,EAAE,OAAO,EAAE,MAAY,EAAE;;;;;KAAA;CA0EvD;AAED,eAAe,aAAa,CAAC"}
@@ -1,12 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import path from 'path';
11
2
  import fs from 'fs';
12
3
  import CodeInjector from '../modules/codeInjector.js';
@@ -17,27 +8,23 @@ function replaceAtStart(string, substring) {
17
8
  }
18
9
  return string;
19
10
  }
20
- function proxyTo(url, res) {
21
- return __awaiter(this, void 0, void 0, function* () {
22
- const actual = yield fetch(url);
23
- actual.headers.forEach((v, n) => res.setHeader(n, v));
24
- actual.body.pipe(res);
25
- });
11
+ async function proxyTo(url, res) {
12
+ const actual = await fetch(url);
13
+ actual.headers.forEach((v, n) => res.setHeader(n, v));
14
+ actual.body.pipe(res);
26
15
  }
27
- function parseExpressCookie(req) {
28
- return __awaiter(this, void 0, void 0, function* () {
29
- const cookies = req.headers.cookie;
30
- if (!cookies) {
31
- return [];
32
- }
33
- const parts = cookies.split('; ');
34
- const result = [];
35
- parts.forEach(part => {
36
- const [key, value] = part.split('=');
37
- result.push({ key, value });
38
- });
39
- return result;
16
+ async function parseExpressCookie(req) {
17
+ const cookies = req.headers.cookie;
18
+ if (!cookies) {
19
+ return [];
20
+ }
21
+ const parts = cookies.split('; ');
22
+ const result = [];
23
+ parts.forEach(part => {
24
+ const [key, value] = part.split('=');
25
+ result.push({ key, value });
40
26
  });
27
+ return result;
41
28
  }
42
29
  const respondNoServer = (title, explanation) => {
43
30
  return `
@@ -86,17 +73,17 @@ class ExpressServer {
86
73
  const prefix = this.adminforth.config.baseUrl;
87
74
  const slashedPrefix = prefix.endsWith('/') ? prefix : `${prefix}/`;
88
75
  if (this.adminforth.runningHotReload) {
89
- const handler = (req, res) => __awaiter(this, void 0, void 0, function* () {
76
+ const handler = async (req, res) => {
90
77
  // proxy using fetch to webpack dev server
91
78
  try {
92
- yield proxyTo(`http://localhost:5173${req.url}`, res);
79
+ await proxyTo(`http://localhost:5173${req.url}`, res);
93
80
  }
94
81
  catch (e) {
95
82
  // console.log('Failed to proxy', e);
96
83
  res.status(500).send(respondNoServer('AdminForth SPA is not ready yet', 'Vite is still starting up. Please wait a moment...'));
97
84
  return;
98
85
  }
99
- });
86
+ };
100
87
  this.expressApp.get(`${slashedPrefix}assets/*`, handler);
101
88
  this.expressApp.get(`${prefix}*`, handler);
102
89
  }
@@ -111,11 +98,11 @@ class ExpressServer {
111
98
  }
112
99
  });
113
100
  });
114
- this.expressApp.get(`${prefix}*`, (req, res) => __awaiter(this, void 0, void 0, function* () {
101
+ this.expressApp.get(`${prefix}*`, async (req, res) => {
115
102
  const fullPath = path.join(CodeInjector.SPA_TMP_PATH, 'dist', 'index.html');
116
103
  let fileExists = true;
117
104
  try {
118
- yield fs.promises.access(fullPath, fs.constants.F_OK);
105
+ await fs.promises.access(fullPath, fs.constants.F_OK);
119
106
  }
120
107
  catch (e) {
121
108
  fileExists = false;
@@ -133,7 +120,7 @@ class ExpressServer {
133
120
  'Expires': '0'
134
121
  }
135
122
  });
136
- }));
123
+ });
137
124
  }
138
125
  }
139
126
  serve(app) {
@@ -142,9 +129,9 @@ class ExpressServer {
142
129
  this.setupSpaServer();
143
130
  }
144
131
  authorize(handler) {
145
- return (req, res, next) => __awaiter(this, void 0, void 0, function* () {
132
+ return async (req, res, next) => {
146
133
  var _a;
147
- const cookies = yield parseExpressCookie(req);
134
+ const cookies = await parseExpressCookie(req);
148
135
  // check if multiple adminforth_jwt providerd and show warning
149
136
  const jwts = cookies.filter(({ key }) => key === 'adminforth_jwt');
150
137
  if (jwts.length > 1) {
@@ -155,7 +142,7 @@ class ExpressServer {
155
142
  res.status(401).send('Unauthorized by AdminForth');
156
143
  return;
157
144
  }
158
- const adminforthUser = yield this.adminforth.auth.verify(jwt, 'auth');
145
+ const adminforthUser = await this.adminforth.auth.verify(jwt, 'auth');
159
146
  if (!adminforthUser) {
160
147
  res.status(401).send('Unauthorized by AdminForth');
161
148
  }
@@ -163,14 +150,14 @@ class ExpressServer {
163
150
  req.adminUser = adminforthUser;
164
151
  handler(req, res, next);
165
152
  }
166
- });
153
+ };
167
154
  }
168
155
  endpoint({ method = 'GET', path, handler, noAuth = false }) {
169
156
  if (!path.startsWith('/')) {
170
157
  throw new Error(`Path must start with /, got: ${path}`);
171
158
  }
172
159
  const fullPath = `${this.adminforth.config.baseUrl}/adminapi/v1${path}`;
173
- const expressHandler = (req, res) => __awaiter(this, void 0, void 0, function* () {
160
+ const expressHandler = async (req, res) => {
174
161
  let body = req.body || {};
175
162
  if (typeof body === 'string') {
176
163
  try {
@@ -185,7 +172,7 @@ class ExpressServer {
185
172
  const adminUser = req.adminUser;
186
173
  // lower request headers
187
174
  const headers = req.headers;
188
- const cookies = yield parseExpressCookie(req);
175
+ const cookies = await parseExpressCookie(req);
189
176
  const response = {
190
177
  headers: [],
191
178
  status: 200,
@@ -205,7 +192,7 @@ class ExpressServer {
205
192
  const input = { body, query, headers, cookies, adminUser, response, _raw_express_req: req, _raw_express_res: res };
206
193
  let output;
207
194
  try {
208
- output = yield handler(input);
195
+ output = await handler(input);
209
196
  }
210
197
  catch (e) {
211
198
  console.error('Error in handler', e);
@@ -227,9 +214,10 @@ class ExpressServer {
227
214
  return;
228
215
  }
229
216
  res.json(output);
230
- });
217
+ };
231
218
  console.log(`Adding endpoint ${method} ${fullPath}`);
232
219
  this.expressApp[method.toLowerCase()](fullPath, noAuth ? expressHandler : this.authorize(expressHandler));
233
220
  }
234
221
  }
235
222
  export default ExpressServer;
223
+ //# sourceMappingURL=express.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express.js","sourceRoot":"","sources":["../../servers/express.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,YAAY,MAAM,4BAA4B,CAAC;AAEtD,OAAO,KAAK,MAAM,YAAY,CAAC;AAI/B,SAAS,cAAc,CAAC,MAAM,EAAE,SAAS;IACvC,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,GAAG,EAAE,GAAG;IAC7B,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAED,KAAK,UAAU,kBAAkB,CAAC,GAAG;IAMnC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;IACnC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG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