adminforth 1.4.3-next.8 → 1.5.1

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 (142) hide show
  1. package/dist/basePlugin.d.ts.map +1 -1
  2. package/dist/basePlugin.js +2 -3
  3. package/dist/basePlugin.js.map +1 -1
  4. package/dist/dataConnectors/postgres.d.ts.map +1 -1
  5. package/dist/dataConnectors/postgres.js +29 -9
  6. package/dist/dataConnectors/postgres.js.map +1 -1
  7. package/dist/dataConnectors/sqlite.d.ts.map +1 -1
  8. package/dist/dataConnectors/sqlite.js +12 -5
  9. package/dist/dataConnectors/sqlite.js.map +1 -1
  10. package/dist/index.d.ts +4 -3
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +18 -5
  13. package/dist/index.js.map +1 -1
  14. package/dist/modules/codeInjector.d.ts +4 -2
  15. package/dist/modules/codeInjector.d.ts.map +1 -1
  16. package/dist/modules/codeInjector.js +98 -79
  17. package/dist/modules/codeInjector.js.map +1 -1
  18. package/dist/modules/configValidator.d.ts.map +1 -1
  19. package/dist/modules/configValidator.js +5 -4
  20. package/dist/modules/configValidator.js.map +1 -1
  21. package/dist/modules/operationalResource.d.ts.map +1 -1
  22. package/dist/modules/operationalResource.js.map +1 -1
  23. package/dist/modules/restApi.d.ts +8 -3
  24. package/dist/modules/restApi.d.ts.map +1 -1
  25. package/dist/modules/restApi.js +112 -39
  26. package/dist/modules/restApi.js.map +1 -1
  27. package/dist/modules/socketBroker.d.ts +16 -0
  28. package/dist/modules/socketBroker.d.ts.map +1 -0
  29. package/dist/modules/socketBroker.js +99 -0
  30. package/dist/modules/socketBroker.js.map +1 -0
  31. package/dist/modules/utils.d.ts +2 -1
  32. package/dist/modules/utils.d.ts.map +1 -1
  33. package/dist/modules/utils.js +5 -2
  34. package/dist/modules/utils.js.map +1 -1
  35. package/dist/servers/common.d.ts +21 -0
  36. package/dist/servers/common.d.ts.map +1 -0
  37. package/dist/servers/common.js +13 -0
  38. package/dist/servers/common.js.map +1 -0
  39. package/dist/servers/express.d.ts +5 -0
  40. package/dist/servers/express.d.ts.map +1 -1
  41. package/dist/servers/express.js +54 -7
  42. package/dist/servers/express.js.map +1 -1
  43. package/dist/spa/package-lock.json +59 -0
  44. package/dist/spa/package.json +1 -0
  45. package/dist/spa/src/App.vue +58 -36
  46. package/dist/spa/src/afcl/Button.vue +8 -1
  47. package/dist/spa/src/afcl/Input.vue +41 -0
  48. package/dist/spa/src/afcl/LinkButton.vue +23 -0
  49. package/dist/spa/src/afcl/Select.vue +8 -7
  50. package/dist/spa/src/afcl/index.ts +3 -0
  51. package/dist/spa/src/components/Filters.vue +0 -1
  52. package/dist/spa/src/components/GroupsTable.vue +4 -4
  53. package/dist/spa/src/components/ResourceListTable.vue +21 -21
  54. package/dist/spa/src/components/ValueRenderer.vue +3 -1
  55. package/dist/spa/src/composables/useStores.ts +4 -1
  56. package/dist/spa/src/renderers/CompactField.vue +4 -4
  57. package/dist/spa/src/renderers/CompactUUID.vue +4 -4
  58. package/dist/spa/src/renderers/CountryFlag.vue +3 -3
  59. package/dist/spa/src/renderers/HumanNumber.vue +5 -4
  60. package/dist/spa/src/renderers/RelativeTime.vue +5 -4
  61. package/dist/spa/src/router/index.ts +2 -0
  62. package/dist/spa/src/stores/core.ts +39 -6
  63. package/dist/spa/src/types/Back.ts +102 -9
  64. package/dist/spa/src/types/Common.ts +6 -1
  65. package/dist/spa/src/types/FrontendAPI.ts +7 -0
  66. package/dist/spa/src/views/EditView.vue +1 -0
  67. package/dist/spa/src/views/ListView.vue +2 -2
  68. package/dist/spa/src/views/LoginView.vue +7 -7
  69. package/dist/spa/src/views/PageNotFound.vue +20 -0
  70. package/dist/spa/src/views/ResourceParent.vue +0 -1
  71. package/dist/spa/src/views/ShowView.vue +1 -0
  72. package/dist/spa/src/websocket.ts +84 -0
  73. package/dist/spa/vite.config.ts +16 -34
  74. package/dist/types/Back.d.ts +70 -4
  75. package/dist/types/Back.d.ts.map +1 -1
  76. package/dist/types/Back.js.map +1 -1
  77. package/dist/types/Common.d.ts +4 -0
  78. package/dist/types/Common.d.ts.map +1 -1
  79. package/dist/types/FrontendAPI.d.ts +6 -0
  80. package/dist/types/FrontendAPI.d.ts.map +1 -1
  81. package/dist/types/FrontendAPI.js.map +1 -1
  82. package/package.json +5 -3
  83. package/dist/plugins/audit-log/types.d.ts +0 -35
  84. package/dist/plugins/audit-log/types.d.ts.map +0 -1
  85. package/dist/plugins/audit-log/types.js +0 -2
  86. package/dist/plugins/audit-log/types.js.map +0 -1
  87. package/dist/plugins/chat-gpt/types.d.ts +0 -82
  88. package/dist/plugins/chat-gpt/types.d.ts.map +0 -1
  89. package/dist/plugins/chat-gpt/types.js +0 -2
  90. package/dist/plugins/chat-gpt/types.js.map +0 -1
  91. package/dist/plugins/email-password-reset/types.d.ts +0 -28
  92. package/dist/plugins/email-password-reset/types.d.ts.map +0 -1
  93. package/dist/plugins/email-password-reset/types.js +0 -2
  94. package/dist/plugins/email-password-reset/types.js.map +0 -1
  95. package/dist/plugins/foreign-inline-list/types.d.ts +0 -19
  96. package/dist/plugins/foreign-inline-list/types.d.ts.map +0 -1
  97. package/dist/plugins/foreign-inline-list/types.js +0 -2
  98. package/dist/plugins/foreign-inline-list/types.js.map +0 -1
  99. package/dist/plugins/import-export/types.d.ts +0 -3
  100. package/dist/plugins/import-export/types.d.ts.map +0 -1
  101. package/dist/plugins/import-export/types.js +0 -2
  102. package/dist/plugins/import-export/types.js.map +0 -1
  103. package/dist/plugins/rich-editor/custom/async-queue.d.ts +0 -8
  104. package/dist/plugins/rich-editor/custom/async-queue.d.ts.map +0 -1
  105. package/dist/plugins/rich-editor/custom/async-queue.js +0 -29
  106. package/dist/plugins/rich-editor/custom/async-queue.js.map +0 -1
  107. package/dist/plugins/rich-editor/dist/custom/async-queue.d.ts +0 -8
  108. package/dist/plugins/rich-editor/dist/custom/async-queue.d.ts.map +0 -1
  109. package/dist/plugins/rich-editor/dist/custom/async-queue.js +0 -29
  110. package/dist/plugins/rich-editor/dist/custom/async-queue.js.map +0 -1
  111. package/dist/plugins/rich-editor/types.d.ts +0 -153
  112. package/dist/plugins/rich-editor/types.d.ts.map +0 -1
  113. package/dist/plugins/rich-editor/types.js +0 -16
  114. package/dist/plugins/rich-editor/types.js.map +0 -1
  115. package/dist/plugins/two-factors-auth/types.d.ts +0 -18
  116. package/dist/plugins/two-factors-auth/types.d.ts.map +0 -1
  117. package/dist/plugins/two-factors-auth/types.js +0 -2
  118. package/dist/plugins/two-factors-auth/types.js.map +0 -1
  119. package/dist/plugins/upload/types.d.ts +0 -132
  120. package/dist/plugins/upload/types.d.ts.map +0 -1
  121. package/dist/plugins/upload/types.js +0 -2
  122. package/dist/plugins/upload/types.js.map +0 -1
  123. package/dist/spa/src/acl/Button.vue +0 -21
  124. package/dist/spa/src/acl/Link.vue +0 -9
  125. package/dist/spa/src/components/Dropdown.vue +0 -167
  126. package/dist/spa/src/types/AdminForthConfig.js +0 -150
  127. package/dist/spa/src/types/AdminForthConfig.ts +0 -1816
  128. package/dist/spa/src/types/Commons.ts +0 -702
  129. package/dist/spa/src/types/FrontAndBack.ts +0 -698
  130. package/dist/types/AdminForthConfig.d.ts +0 -1665
  131. package/dist/types/AdminForthConfig.d.ts.map +0 -1
  132. package/dist/types/AdminForthConfig.js +0 -146
  133. package/dist/types/AdminForthConfig.js.map +0 -1
  134. package/dist/types/Commons.d.ts +0 -616
  135. package/dist/types/Commons.d.ts.map +0 -1
  136. package/dist/types/Commons.js +0 -65
  137. package/dist/types/Commons.js.map +0 -1
  138. package/dist/types/FrontAndBack.d.ts +0 -613
  139. package/dist/types/FrontAndBack.d.ts.map +0 -1
  140. package/dist/types/FrontAndBack.js +0 -62
  141. package/dist/types/FrontAndBack.js.map +0 -1
  142. /package/dist/spa/src/{components/AfTooltip.vue → afcl/Tooltip.vue} +0 -0
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class AsyncQueue {
4
- constructor() {
5
- this.queue = [];
6
- this.processing = false;
7
- }
8
- async add(task) {
9
- this.queue.push(task);
10
- if (!this.processing) {
11
- this.process();
12
- }
13
- }
14
- async process() {
15
- this.processing = true;
16
- while (this.queue.length > 0) {
17
- const task = this.queue.shift();
18
- try {
19
- await task();
20
- }
21
- catch (error) {
22
- console.error('Task encountered an error:', error);
23
- }
24
- }
25
- this.processing = false;
26
- }
27
- }
28
- exports.default = AsyncQueue;
29
- //# sourceMappingURL=async-queue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-queue.js","sourceRoot":"","sources":["../../../../plugins/rich-editor/custom/async-queue.ts"],"names":[],"mappings":";;AAEA,MAAqB,UAAU;IAI7B;QACE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAwB;QAChC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAG,CAAC;YACjC,IAAI,CAAC;gBACH,MAAM,IAAI,EAAE,CAAC;YACf,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;CACF;AA5BD,6BA4BC"}
@@ -1,8 +0,0 @@
1
- export default class AsyncQueue {
2
- queue: (() => Promise<any>)[];
3
- processing: boolean;
4
- constructor();
5
- add(task: () => Promise<any>): Promise<void>;
6
- process(): Promise<void>;
7
- }
8
- //# sourceMappingURL=async-queue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-queue.d.ts","sourceRoot":"","sources":["../../../../../plugins/rich-editor/dist/custom/async-queue.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,KAAK,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;IAC9B,UAAU,EAAE,OAAO,CAAC;;IAOd,GAAG,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC;IAO5B,OAAO;CAYd"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class AsyncQueue {
4
- constructor() {
5
- this.queue = [];
6
- this.processing = false;
7
- }
8
- async add(task) {
9
- this.queue.push(task);
10
- if (!this.processing) {
11
- this.process();
12
- }
13
- }
14
- async process() {
15
- this.processing = true;
16
- while (this.queue.length > 0) {
17
- const task = this.queue.shift();
18
- try {
19
- await task();
20
- }
21
- catch (error) {
22
- console.error('Task encountered an error:', error);
23
- }
24
- }
25
- this.processing = false;
26
- }
27
- }
28
- exports.default = AsyncQueue;
29
- //# sourceMappingURL=async-queue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-queue.js","sourceRoot":"","sources":["../../../../../plugins/rich-editor/dist/custom/async-queue.ts"],"names":[],"mappings":";;AAEA,MAAqB,UAAU;IAI7B;QACE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAwB;QAChC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAG,CAAC;YACjC,IAAI,CAAC;gBACH,MAAM,IAAI,EAAE,CAAC;YACf,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;CACF;AA5BD,6BA4BC"}
@@ -1,153 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,16 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,18 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../plugins/two-factors-auth/types.ts"],"names":[],"mappings":""}
@@ -1,132 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../plugins/upload/types.ts"],"names":[],"mappings":""}
@@ -1,21 +0,0 @@
1
- <template>
2
- <button
3
- v-bind="$attrs"
4
- type="submit"
5
- class="flex items-center justify-center gap-1 text-lightPrimaryContrast bg-lightPrimary dark:bg-darkPrimary hover:brightness-110
6
- focus:ring-4 focus:outline-none focus:ring-lightPrimary focus:ring-opacity-50 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:focus:ring-darkPrimary dark:focus:ring-opacity-50"
7
- >
8
- <svg v-if="props.loader"
9
- aria-hidden="true" class="w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/><path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/></svg>
10
- <slot></slot>
11
- </button>
12
- </template>
13
-
14
- <script setup>
15
- import { ref } from 'vue';
16
-
17
- const props = defineProps({
18
- loader: Boolean,
19
- });
20
-
21
- </script>
@@ -1,9 +0,0 @@
1
- <template>
2
- <router-link
3
- v-bind="$attrs"
4
- class="text-lightPrimary underline dark:text-darkPrimary hover:no-underline hover:brightness-110
5
- cursor-pointer"
6
- >
7
- <slot></slot>
8
- </router-link>
9
- </template>
@@ -1,167 +0,0 @@
1
- <template>
2
- <div class="relative inline-block w-full" id="dropd">
3
- <div class="relative">
4
- <input
5
- type="text"
6
- v-model="search"
7
- @focus="showDropdown = true"
8
- class="block w-full pl-3 pr-10 py-2 border border-gray-300 rounded-md leading-5 bg-white placeholder-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 sm:text-sm transition duration-150 ease-in-out dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
9
- :placeholder="selectedItems.length ? '' : placeholder || 'Select...'"
10
- />
11
- <div class="absolute inset-y-0 left-2 flex items-center pr-2 flex-wrap">
12
- <div v-for="item in selectedItems" :key="item?.name" class="bg-lightPrimaryOpacity text-lightPrimary text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-darkPrimaryOpacity dark:text-darkPrimary">
13
- <span>{{ item.label }}</span>
14
- <button
15
- type="button"
16
- @click="toogleItem(item)"
17
- class="z-index-100 flex-shrink-0 ml-1 h-4 w-4 -mr-1 rounded-full inline-flex items-center justify-center text-gray-400 hover:text-gray-500 focus:outline-none focus:text-gray-500 focus:bg-gray-100"
18
- >
19
- <span class="sr-only">Remove item</span>
20
- <svg class="h-2 w-2" stroke="currentColor" fill="none" viewBox="0 0 8 8">
21
- <path
22
- stroke-linecap="round"
23
- stroke-linejoin="round"
24
- stroke-width="1.5"
25
- d="M1 1l6 6m0-6L1 7"
26
- />
27
- </svg>
28
- </button>
29
- </div>
30
- </div>
31
- <div class="absolute inset-y-0 right-2 flex items-center pointer-events-none">
32
- <!-- triangle icon -->
33
- <IconCaretDownSolid v-if="!showDropdown" class="h-5 w-5 text-gray-400" />
34
- <IconCaretUpSolid v-else class="h-5 w-5 text-gray-400" />
35
- </div>
36
- </div>
37
- <div v-if="showDropdown" class="absolute z-10 mt-1 w-full bg-white shadow-lg dark:shadow-black dark:bg-gray-700 dark:border-gray-600 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm">
38
- <div
39
- v-for="item in filteredItems"
40
- :key="item.value"
41
- class="px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-600"
42
- :class="{ 'bg-lightPrimaryOpacity': selectedItems.includes(item) }"
43
- @click="toogleItem(item)"
44
- >
45
- <label :for="item.value">{{ item.label }}</label>
46
- </div>
47
- </div>
48
- </div>
49
- </template>
50
-
51
- <script setup>
52
- import { ref, computed, onMounted, onUnmounted, watch } from 'vue';
53
- import { IconCaretDownSolid, IconCaretUpSolid } from '@iconify-prerendered/vue-flowbite';
54
-
55
-
56
- const props = defineProps({
57
- options: Array,
58
- modelValue: {
59
- default: undefined,
60
- },
61
- allowCustom: {
62
- type: Boolean,
63
- default: false,
64
- },
65
- single: {
66
- type: Boolean,
67
- default: false,
68
- },
69
- placeholder: {
70
- type: String,
71
- default: '',
72
-
73
- },
74
- });
75
-
76
- const emit = defineEmits(['update:modelValue']);
77
-
78
- const search = ref('');
79
- const showDropdown = ref(false);
80
-
81
- const selectedItems = ref([]);
82
-
83
- function updateFromProps() {
84
- if (props.modelValue !== undefined) {
85
- if (props.single) {
86
- const el = props.options.find(item => item.value === props.modelValue);
87
- if (el) {
88
- selectedItems.value = [el];
89
- } else {
90
- selectedItems.value = [];
91
- }
92
- } else {
93
- selectedItems.value = props.options.filter(item => props.modelValue.includes(item.value));
94
- }
95
- }
96
- }
97
-
98
- onMounted(() => {
99
- updateFromProps();
100
-
101
- watch(() => props.modelValue, (value) => {
102
- updateFromProps();
103
- });
104
-
105
- watch(() => props.options, () => {
106
- updateFromProps();
107
- });
108
-
109
- addClickListener();
110
-
111
- });
112
-
113
- const filteredItems = computed(() => {
114
- return props.options.filter(item =>
115
- item.label.toLowerCase().includes(search.value.toLowerCase())
116
- );
117
- });
118
-
119
- const handleClickOutside = (event) => {
120
- if (!event.target.closest('#dropd')) {
121
- showDropdown.value = false;
122
- }
123
- };
124
-
125
- const addClickListener = () => {
126
- document.addEventListener('click', handleClickOutside);
127
- };
128
-
129
- const removeClickListener = () => {
130
- document.removeEventListener('click', handleClickOutside);
131
- };
132
-
133
- const toogleItem = (item) => {
134
- if (selectedItems.value.includes(item)) {
135
- selectedItems.value = selectedItems.value.filter(i => i !== item);
136
- } else {
137
- if (props.single) {
138
- selectedItems.value = [item];
139
- } else {
140
- selectedItems.value = [...selectedItems.value, item];
141
- }
142
- }
143
- if (props.single) {
144
- showDropdown.value = false;
145
- }
146
-
147
-
148
- const list = selectedItems.value.map(item => item.value);
149
- const updValue = list.length ? list : null;
150
- let emitValue;
151
- if (props.single) {
152
- emitValue = updValue ? updValue[0] : null;
153
- } else {
154
- emitValue = updValue;
155
- }
156
- console.log('⚡ emit', emitValue)
157
- emit('update:modelValue', emitValue);
158
-
159
- };
160
-
161
-
162
- onUnmounted(() => {
163
- removeClickListener();
164
- });
165
-
166
-
167
- </script>