@sonicjs-cms/core 2.19.0 → 3.0.0-beta.11

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 (230) hide show
  1. package/README.md +52 -52
  2. package/dist/admin-documents-form.template-DDSH6ROU.js +6 -0
  3. package/dist/{admin-layout-catalyst.template-UMTIN66R.js.map → admin-documents-form.template-DDSH6ROU.js.map} +1 -1
  4. package/dist/admin-documents-form.template-LSZKGA5J.cjs +19 -0
  5. package/dist/{admin-layout-catalyst.template-HFD37TY5.cjs.map → admin-documents-form.template-LSZKGA5J.cjs.map} +1 -1
  6. package/dist/{filter-bar.template-DlVYMk-T.d.cts → admin-layout-catalyst.template-DrwDUfsE.d.cts} +25 -1
  7. package/dist/{filter-bar.template-DlVYMk-T.d.ts → admin-layout-catalyst.template-DrwDUfsE.d.ts} +25 -1
  8. package/dist/admin-layout-catalyst.template-KDHKVLXR.cjs +21 -0
  9. package/dist/admin-layout-catalyst.template-KDHKVLXR.cjs.map +1 -0
  10. package/dist/admin-layout-catalyst.template-YQ4EMF2J.js +7 -0
  11. package/dist/admin-layout-catalyst.template-YQ4EMF2J.js.map +1 -0
  12. package/dist/app-Bo0X1OWX.d.ts +1268 -0
  13. package/dist/app-Do66yCcV.d.cts +1268 -0
  14. package/dist/cache-DDARE4QE.js +4 -0
  15. package/dist/cache-DDARE4QE.js.map +1 -0
  16. package/dist/cache-LVYS4BPL.cjs +33 -0
  17. package/dist/cache-LVYS4BPL.cjs.map +1 -0
  18. package/dist/chunk-2CB4KY7I.cjs +771 -0
  19. package/dist/chunk-2CB4KY7I.cjs.map +1 -0
  20. package/dist/{chunk-4NPCDK6B.js → chunk-3PU4WVU6.js} +557 -90
  21. package/dist/chunk-3PU4WVU6.js.map +1 -0
  22. package/dist/chunk-4BTBSXMR.cjs +912 -0
  23. package/dist/chunk-4BTBSXMR.cjs.map +1 -0
  24. package/dist/{chunk-55RDMDOP.js → chunk-5V62WT6M.js} +181 -57
  25. package/dist/chunk-5V62WT6M.js.map +1 -0
  26. package/dist/chunk-6H66MSSL.js +273 -0
  27. package/dist/chunk-6H66MSSL.js.map +1 -0
  28. package/dist/chunk-AI663NBO.js +821 -0
  29. package/dist/chunk-AI663NBO.js.map +1 -0
  30. package/dist/chunk-BLMTL57B.js +767 -0
  31. package/dist/chunk-BLMTL57B.js.map +1 -0
  32. package/dist/{chunk-4ZSNJDLS.cjs → chunk-CRGUD4KC.cjs} +9 -9
  33. package/dist/chunk-CRGUD4KC.cjs.map +1 -0
  34. package/dist/chunk-GCDZZNIN.js +192 -0
  35. package/dist/chunk-GCDZZNIN.js.map +1 -0
  36. package/dist/chunk-HIKBY7MS.cjs +70 -0
  37. package/dist/chunk-HIKBY7MS.cjs.map +1 -0
  38. package/dist/chunk-HPAJKZAQ.js +387 -0
  39. package/dist/chunk-HPAJKZAQ.js.map +1 -0
  40. package/dist/chunk-IESEVHXL.js +66 -0
  41. package/dist/chunk-IESEVHXL.js.map +1 -0
  42. package/dist/chunk-IVPRUGTY.js +242 -0
  43. package/dist/chunk-IVPRUGTY.js.map +1 -0
  44. package/dist/{chunk-JZVHLLSI.cjs → chunk-IXUHXTHW.cjs} +2 -151
  45. package/dist/chunk-IXUHXTHW.cjs.map +1 -0
  46. package/dist/chunk-J6JTWD2A.cjs +100 -0
  47. package/dist/chunk-J6JTWD2A.cjs.map +1 -0
  48. package/dist/chunk-JEQ7FLOD.cjs +199 -0
  49. package/dist/chunk-JEQ7FLOD.cjs.map +1 -0
  50. package/dist/{chunk-ON5ZMSU4.js → chunk-JQISFW6U.js} +3 -3
  51. package/dist/chunk-JQISFW6U.js.map +1 -0
  52. package/dist/chunk-K25XHMM3.js +566 -0
  53. package/dist/chunk-K25XHMM3.js.map +1 -0
  54. package/dist/{chunk-R4FOLLFB.cjs → chunk-K342JMA3.cjs} +8730 -11520
  55. package/dist/chunk-K342JMA3.cjs.map +1 -0
  56. package/dist/{chunk-UYJ6TJHX.cjs → chunk-K623Q6WD.cjs} +181 -56
  57. package/dist/chunk-K623Q6WD.cjs.map +1 -0
  58. package/dist/chunk-KV3CM5RK.cjs +158 -0
  59. package/dist/chunk-KV3CM5RK.cjs.map +1 -0
  60. package/dist/{chunk-ABB34XUS.cjs → chunk-MKKGA3C4.cjs} +667 -19
  61. package/dist/chunk-MKKGA3C4.cjs.map +1 -0
  62. package/dist/chunk-N32OWET6.cjs +327 -0
  63. package/dist/chunk-N32OWET6.cjs.map +1 -0
  64. package/dist/chunk-NUKJ54GA.cjs +245 -0
  65. package/dist/chunk-NUKJ54GA.cjs.map +1 -0
  66. package/dist/{chunk-XWIA3HVX.js → chunk-OBA2RYZN.js} +6 -1249
  67. package/dist/chunk-OBA2RYZN.js.map +1 -0
  68. package/dist/chunk-ORF4CT74.cjs +276 -0
  69. package/dist/chunk-ORF4CT74.cjs.map +1 -0
  70. package/dist/{chunk-TFNTM3OA.js → chunk-PDYRDYXI.js} +645 -15
  71. package/dist/chunk-PDYRDYXI.js.map +1 -0
  72. package/dist/{chunk-OHYBNCVL.cjs → chunk-PXNTCCPE.cjs} +10 -1256
  73. package/dist/chunk-PXNTCCPE.cjs.map +1 -0
  74. package/dist/{chunk-E4YFJBM2.cjs → chunk-QJNKSFDJ.cjs} +876 -829
  75. package/dist/chunk-QJNKSFDJ.cjs.map +1 -0
  76. package/dist/chunk-QLFTG3QJ.js +1828 -0
  77. package/dist/chunk-QLFTG3QJ.js.map +1 -0
  78. package/dist/{chunk-BU7SFHGP.js → chunk-QZGABF2M.js} +3 -149
  79. package/dist/chunk-QZGABF2M.js.map +1 -0
  80. package/dist/chunk-RMRJGMDE.js +323 -0
  81. package/dist/chunk-RMRJGMDE.js.map +1 -0
  82. package/dist/chunk-RNZFGN4R.js +88 -0
  83. package/dist/chunk-RNZFGN4R.js.map +1 -0
  84. package/dist/chunk-RQ6N3FTV.js +900 -0
  85. package/dist/chunk-RQ6N3FTV.js.map +1 -0
  86. package/dist/{chunk-OCL3HMEG.js → chunk-SXLVXD2X.js} +7004 -9807
  87. package/dist/chunk-SXLVXD2X.js.map +1 -0
  88. package/dist/chunk-UHRHZXVR.cjs +408 -0
  89. package/dist/chunk-UHRHZXVR.cjs.map +1 -0
  90. package/dist/chunk-YA3TJ65D.cjs +575 -0
  91. package/dist/chunk-YA3TJ65D.cjs.map +1 -0
  92. package/dist/{chunk-7A4CB7T3.cjs → chunk-YJEBDJDV.cjs} +561 -91
  93. package/dist/chunk-YJEBDJDV.cjs.map +1 -0
  94. package/dist/chunk-YP7GW2G5.cjs +866 -0
  95. package/dist/chunk-YP7GW2G5.cjs.map +1 -0
  96. package/dist/chunk-ZUEIQFE5.js +154 -0
  97. package/dist/chunk-ZUEIQFE5.js.map +1 -0
  98. package/dist/{collection-config-B4PG-AaF.d.cts → collection-config-JgHOpFCG.d.cts} +30 -2
  99. package/dist/{collection-config-B4PG-AaF.d.ts → collection-config-JgHOpFCG.d.ts} +30 -2
  100. package/dist/config-HFXANXCC.js +6 -0
  101. package/dist/config-HFXANXCC.js.map +1 -0
  102. package/dist/config-ON6FNMYX.cjs +19 -0
  103. package/dist/config-ON6FNMYX.cjs.map +1 -0
  104. package/dist/define-plugin-BzNHc1ZI.d.ts +1321 -0
  105. package/dist/define-plugin-IWDKYaVm.d.cts +1321 -0
  106. package/dist/document-projection-TDWRJX3Z.cjs +13 -0
  107. package/dist/document-projection-TDWRJX3Z.cjs.map +1 -0
  108. package/dist/document-projection-YYMC6I4U.js +4 -0
  109. package/dist/document-projection-YYMC6I4U.js.map +1 -0
  110. package/dist/index.cjs +13739 -4328
  111. package/dist/index.cjs.map +1 -1
  112. package/dist/index.d.cts +331 -493
  113. package/dist/index.d.ts +331 -493
  114. package/dist/index.js +13456 -4067
  115. package/dist/index.js.map +1 -1
  116. package/dist/middleware.cjs +38 -32
  117. package/dist/middleware.d.cts +50 -7
  118. package/dist/middleware.d.ts +50 -7
  119. package/dist/middleware.js +9 -3
  120. package/dist/migrations-XQLBY7E5.js +4 -0
  121. package/dist/{migrations-H5IXZNCO.js.map → migrations-XQLBY7E5.js.map} +1 -1
  122. package/dist/migrations-ZXJEUTFA.cjs +13 -0
  123. package/dist/{migrations-566IIPS2.cjs.map → migrations-ZXJEUTFA.cjs.map} +1 -1
  124. package/dist/{plugin-bootstrap-DfVerYV4.d.cts → plugin-bootstrap-B8ThJU21.d.cts} +4315 -1661
  125. package/dist/{plugin-bootstrap-P_ciLp_C.d.ts → plugin-bootstrap-qu8hJgUt.d.ts} +4315 -1661
  126. package/dist/plugins.cjs +171 -12
  127. package/dist/plugins.d.cts +36 -2
  128. package/dist/plugins.d.ts +36 -2
  129. package/dist/plugins.js +5 -2
  130. package/dist/rbac-O73MFKDA.js +5 -0
  131. package/dist/rbac-O73MFKDA.js.map +1 -0
  132. package/dist/rbac-VONLJJKB.cjs +14 -0
  133. package/dist/rbac-VONLJJKB.cjs.map +1 -0
  134. package/dist/routes.cjs +42 -46
  135. package/dist/routes.d.cts +56 -146
  136. package/dist/routes.d.ts +56 -146
  137. package/dist/routes.js +18 -10
  138. package/dist/services.cjs +43 -76
  139. package/dist/services.d.cts +93 -55
  140. package/dist/services.d.ts +93 -55
  141. package/dist/services.js +6 -3
  142. package/dist/{telemetry-B9vIV4wh.d.cts → telemetry-Cku1ax74.d.cts} +1 -1
  143. package/dist/{telemetry-B9vIV4wh.d.ts → telemetry-Cku1ax74.d.ts} +1 -1
  144. package/dist/templates.cjs +17 -29
  145. package/dist/templates.d.cts +2 -89
  146. package/dist/templates.d.ts +2 -89
  147. package/dist/templates.js +3 -3
  148. package/dist/types-Dea1eNxU.d.cts +286 -0
  149. package/dist/types-Dea1eNxU.d.ts +286 -0
  150. package/dist/types.d.cts +2 -2
  151. package/dist/types.d.ts +2 -2
  152. package/dist/utils.cjs +21 -20
  153. package/dist/utils.d.cts +2 -2
  154. package/dist/utils.d.ts +2 -2
  155. package/dist/utils.js +3 -2
  156. package/migrations/0001_core.sql +184 -0
  157. package/migrations/0002_documents.sql +163 -0
  158. package/package.json +12 -7
  159. package/dist/admin-layout-catalyst.template-HFD37TY5.cjs +0 -17
  160. package/dist/admin-layout-catalyst.template-UMTIN66R.js +0 -7
  161. package/dist/app-C9esKLmh.d.cts +0 -112
  162. package/dist/app-C9esKLmh.d.ts +0 -112
  163. package/dist/chunk-4NPCDK6B.js.map +0 -1
  164. package/dist/chunk-4ZSNJDLS.cjs.map +0 -1
  165. package/dist/chunk-55RDMDOP.js.map +0 -1
  166. package/dist/chunk-635JAMSE.cjs +0 -653
  167. package/dist/chunk-635JAMSE.cjs.map +0 -1
  168. package/dist/chunk-7A4CB7T3.cjs.map +0 -1
  169. package/dist/chunk-ABB34XUS.cjs.map +0 -1
  170. package/dist/chunk-BU7SFHGP.js.map +0 -1
  171. package/dist/chunk-E4YFJBM2.cjs.map +0 -1
  172. package/dist/chunk-EXNEW5US.js +0 -648
  173. package/dist/chunk-EXNEW5US.js.map +0 -1
  174. package/dist/chunk-JZV22DEV.js +0 -1783
  175. package/dist/chunk-JZV22DEV.js.map +0 -1
  176. package/dist/chunk-JZVHLLSI.cjs.map +0 -1
  177. package/dist/chunk-OCL3HMEG.js.map +0 -1
  178. package/dist/chunk-OHYBNCVL.cjs.map +0 -1
  179. package/dist/chunk-ON5ZMSU4.js.map +0 -1
  180. package/dist/chunk-QFWHAFEO.js +0 -1843
  181. package/dist/chunk-QFWHAFEO.js.map +0 -1
  182. package/dist/chunk-R4FOLLFB.cjs.map +0 -1
  183. package/dist/chunk-RLMUFFUD.cjs +0 -2219
  184. package/dist/chunk-RLMUFFUD.cjs.map +0 -1
  185. package/dist/chunk-TFNTM3OA.js.map +0 -1
  186. package/dist/chunk-UYJ6TJHX.cjs.map +0 -1
  187. package/dist/chunk-WAEQXGCX.cjs +0 -1898
  188. package/dist/chunk-WAEQXGCX.cjs.map +0 -1
  189. package/dist/chunk-XWIA3HVX.js.map +0 -1
  190. package/dist/chunk-ZYAYUIZE.js +0 -2217
  191. package/dist/chunk-ZYAYUIZE.js.map +0 -1
  192. package/dist/migrations-566IIPS2.cjs +0 -13
  193. package/dist/migrations-H5IXZNCO.js +0 -4
  194. package/dist/plugin-manager-BoM3Q7o7.d.cts +0 -328
  195. package/dist/plugin-manager-Efx9RyDX.d.ts +0 -328
  196. package/migrations/001_initial_schema.sql +0 -170
  197. package/migrations/002_faq_plugin.sql +0 -86
  198. package/migrations/003_stage5_enhancements.sql +0 -121
  199. package/migrations/004_stage6_user_management.sql +0 -183
  200. package/migrations/005_stage7_workflow_automation.sql +0 -294
  201. package/migrations/006_plugin_system.sql +0 -155
  202. package/migrations/007_demo_login_plugin.sql +0 -23
  203. package/migrations/008_fix_slug_validation.sql +0 -22
  204. package/migrations/009_system_logging.sql +0 -57
  205. package/migrations/011_config_managed_collections.sql +0 -15
  206. package/migrations/012_testimonials_plugin.sql +0 -80
  207. package/migrations/013_code_examples_plugin.sql +0 -177
  208. package/migrations/014_fix_plugin_registry.sql +0 -88
  209. package/migrations/015_add_remaining_plugins.sql +0 -89
  210. package/migrations/016_remove_duplicate_cache_plugin.sql +0 -17
  211. package/migrations/017_auth_configurable_fields.sql +0 -49
  212. package/migrations/018_settings_table.sql +0 -23
  213. package/migrations/019_remove_blog_posts_collection.sql +0 -15
  214. package/migrations/020_add_email_plugin.sql +0 -22
  215. package/migrations/021_add_magic_link_auth_plugin.sql +0 -42
  216. package/migrations/022_add_tinymce_plugin.sql +0 -25
  217. package/migrations/023_add_easy_mdx_plugin.sql +0 -25
  218. package/migrations/024_add_quill_editor_plugin.sql +0 -25
  219. package/migrations/025_add_easymde_plugin.sql +0 -25
  220. package/migrations/026_add_otp_login.sql +0 -42
  221. package/migrations/027_fix_slug_field_type.sql +0 -18
  222. package/migrations/028_fix_slug_field_type_in_schemas.sql +0 -30
  223. package/migrations/029_add_forms_system.sql +0 -184
  224. package/migrations/030_add_turnstile_to_forms.sql +0 -14
  225. package/migrations/031_ai_search_plugin.sql +0 -45
  226. package/migrations/032_user_profiles.sql +0 -37
  227. package/migrations/033_form_content_integration.sql +0 -19
  228. package/migrations/034_security_audit_plugin.sql +0 -27
  229. package/migrations/035_user_profiles_data_column.sql +0 -16
  230. package/migrations/036_analytics_events.sql +0 -22
@@ -1,177 +0,0 @@
1
- -- Code Examples Plugin Migration
2
- -- Creates code_examples table for the code examples plugin
3
- -- This demonstrates a code-based collection for storing and managing code snippets
4
-
5
- CREATE TABLE IF NOT EXISTS code_examples (
6
- id INTEGER PRIMARY KEY AUTOINCREMENT,
7
- title TEXT NOT NULL,
8
- description TEXT,
9
- code TEXT NOT NULL,
10
- language TEXT NOT NULL,
11
- category TEXT,
12
- tags TEXT,
13
- isPublished INTEGER NOT NULL DEFAULT 1,
14
- sortOrder INTEGER NOT NULL DEFAULT 0,
15
- created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')),
16
- updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now'))
17
- );
18
-
19
- -- Create indexes for better performance
20
- CREATE INDEX IF NOT EXISTS idx_code_examples_published ON code_examples(isPublished);
21
- CREATE INDEX IF NOT EXISTS idx_code_examples_sort_order ON code_examples(sortOrder);
22
- CREATE INDEX IF NOT EXISTS idx_code_examples_language ON code_examples(language);
23
- CREATE INDEX IF NOT EXISTS idx_code_examples_category ON code_examples(category);
24
-
25
- -- Create trigger to update updated_at timestamp
26
- CREATE TRIGGER IF NOT EXISTS code_examples_updated_at
27
- AFTER UPDATE ON code_examples
28
- BEGIN
29
- UPDATE code_examples SET updated_at = strftime('%s', 'now') WHERE id = NEW.id;
30
- END;
31
-
32
- -- Insert plugin record
33
- INSERT OR IGNORE INTO plugins (name, display_name, description, version, status, category, settings) VALUES
34
- ('code-examples',
35
- 'Code Examples',
36
- 'Manage code snippets and examples with syntax highlighting support. Perfect for documentation and tutorials.',
37
- '1.0.0',
38
- 'active',
39
- 'content',
40
- '{"defaultPublished": true, "supportedLanguages": ["javascript", "typescript", "python", "go", "rust", "java", "php", "ruby", "sql"]}');
41
-
42
- -- Insert sample code examples
43
- INSERT OR IGNORE INTO code_examples (title, description, code, language, category, tags, isPublished, sortOrder) VALUES
44
- ('React useState Hook',
45
- 'Basic example of using the useState hook in React for managing component state.',
46
- 'import { useState } from ''react'';
47
-
48
- function Counter() {
49
- const [count, setCount] = useState(0);
50
-
51
- return (
52
- <div>
53
- <p>Count: {count}</p>
54
- <button onClick={() => setCount(count + 1)}>
55
- Increment
56
- </button>
57
- </div>
58
- );
59
- }
60
-
61
- export default Counter;',
62
- 'javascript',
63
- 'frontend',
64
- 'react,hooks,state',
65
- 1,
66
- 1),
67
-
68
- ('TypeScript Interface Example',
69
- 'Defining a TypeScript interface for type-safe objects.',
70
- 'interface User {
71
- id: string;
72
- email: string;
73
- name: string;
74
- role: ''admin'' | ''editor'' | ''viewer'';
75
- createdAt: Date;
76
- }
77
-
78
- function greetUser(user: User): string {
79
- return `Hello, ${user.name}!`;
80
- }
81
-
82
- const user: User = {
83
- id: ''123'',
84
- email: ''user@example.com'',
85
- name: ''John Doe'',
86
- role: ''admin'',
87
- createdAt: new Date()
88
- };
89
-
90
- console.log(greetUser(user));',
91
- 'typescript',
92
- 'backend',
93
- 'typescript,types,interface',
94
- 1,
95
- 2),
96
-
97
- ('Python List Comprehension',
98
- 'Elegant way to create lists in Python using list comprehensions.',
99
- '# Basic list comprehension
100
- squares = [x**2 for x in range(10)]
101
- print(squares) # [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
102
-
103
- # With condition
104
- even_squares = [x**2 for x in range(10) if x % 2 == 0]
105
- print(even_squares) # [0, 4, 16, 36, 64]
106
-
107
- # Nested list comprehension
108
- matrix = [[i+j for j in range(3)] for i in range(3)]
109
- print(matrix) # [[0, 1, 2], [1, 2, 3], [2, 3, 4]]',
110
- 'python',
111
- 'general',
112
- 'python,lists,comprehension',
113
- 1,
114
- 3),
115
-
116
- ('SQL Join Example',
117
- 'Common SQL JOIN patterns for combining data from multiple tables.',
118
- '-- INNER JOIN: Returns only matching rows
119
- SELECT users.name, orders.total
120
- FROM users
121
- INNER JOIN orders ON users.id = orders.user_id;
122
-
123
- -- LEFT JOIN: Returns all users, even without orders
124
- SELECT users.name, orders.total
125
- FROM users
126
- LEFT JOIN orders ON users.id = orders.user_id;
127
-
128
- -- Multiple JOINs
129
- SELECT
130
- users.name,
131
- orders.order_date,
132
- products.name AS product_name
133
- FROM users
134
- INNER JOIN orders ON users.id = orders.user_id
135
- INNER JOIN order_items ON orders.id = order_items.order_id
136
- INNER JOIN products ON order_items.product_id = products.id;',
137
- 'sql',
138
- 'database',
139
- 'sql,joins,queries',
140
- 1,
141
- 4),
142
-
143
- ('Go Error Handling',
144
- 'Idiomatic error handling pattern in Go.',
145
- 'package main
146
-
147
- import (
148
- "errors"
149
- "fmt"
150
- )
151
-
152
- func divide(a, b float64) (float64, error) {
153
- if b == 0 {
154
- return 0, errors.New("division by zero")
155
- }
156
- return a / b, nil
157
- }
158
-
159
- func main() {
160
- result, err := divide(10, 2)
161
- if err != nil {
162
- fmt.Println("Error:", err)
163
- return
164
- }
165
- fmt.Printf("Result: %.2f\n", result)
166
-
167
- // This will error
168
- _, err = divide(10, 0)
169
- if err != nil {
170
- fmt.Println("Error:", err)
171
- }
172
- }',
173
- 'go',
174
- 'backend',
175
- 'go,error-handling,functions',
176
- 1,
177
- 5);
@@ -1,88 +0,0 @@
1
- -- Fix Plugin Registry
2
- -- Migration: 014_fix_plugin_registry
3
- -- Description: Add missing plugins and fix plugin name mismatches
4
-
5
- -- Note: Cannot easily update plugin names as they may be referenced elsewhere
6
- -- Instead we'll add the missing plugins with correct names
7
-
8
- -- Insert missing plugins
9
-
10
- -- Core Analytics Plugin
11
- INSERT OR IGNORE INTO plugins (
12
- id, name, display_name, description, version, author, category, icon,
13
- status, is_core, permissions, installed_at, last_updated
14
- ) VALUES (
15
- 'core-analytics',
16
- 'core-analytics',
17
- 'Analytics & Tracking',
18
- 'Core analytics tracking and reporting plugin with page views and event tracking',
19
- '1.0.0',
20
- 'SonicJS Team',
21
- 'seo',
22
- '📊',
23
- 'active',
24
- TRUE,
25
- '["view:analytics", "manage:tracking"]',
26
- unixepoch(),
27
- unixepoch()
28
- );
29
-
30
- -- FAQ Plugin
31
- INSERT OR IGNORE INTO plugins (
32
- id, name, display_name, description, version, author, category, icon,
33
- status, is_core, permissions, installed_at, last_updated
34
- ) VALUES (
35
- 'faq-plugin',
36
- 'faq-plugin',
37
- 'FAQ Management',
38
- 'Frequently Asked Questions management plugin with categories, search, and custom styling',
39
- '1.0.0',
40
- 'SonicJS',
41
- 'content',
42
- '❓',
43
- 'active',
44
- FALSE,
45
- '["manage:faqs"]',
46
- unixepoch(),
47
- unixepoch()
48
- );
49
-
50
- -- Seed Data Plugin
51
- INSERT OR IGNORE INTO plugins (
52
- id, name, display_name, description, version, author, category, icon,
53
- status, is_core, permissions, installed_at, last_updated
54
- ) VALUES (
55
- 'seed-data',
56
- 'seed-data',
57
- 'Seed Data Generator',
58
- 'Generate realistic example users and content for testing and development',
59
- '1.0.0',
60
- 'SonicJS Team',
61
- 'development',
62
- '🌱',
63
- 'inactive',
64
- FALSE,
65
- '["admin"]',
66
- unixepoch(),
67
- unixepoch()
68
- );
69
-
70
- -- Database Tools Plugin
71
- INSERT OR IGNORE INTO plugins (
72
- id, name, display_name, description, version, author, category, icon,
73
- status, is_core, permissions, installed_at, last_updated
74
- ) VALUES (
75
- 'database-tools',
76
- 'database-tools',
77
- 'Database Tools',
78
- 'Database management tools including truncate, backup, and validation',
79
- '1.0.0',
80
- 'SonicJS Team',
81
- 'system',
82
- '🗄️',
83
- 'active',
84
- FALSE,
85
- '["manage:database", "admin"]',
86
- unixepoch(),
87
- unixepoch()
88
- );
@@ -1,89 +0,0 @@
1
- -- Add Remaining Plugins
2
- -- Migration: 015_add_remaining_plugins
3
- -- Description: Add all remaining core plugins that were missing from the registry
4
-
5
- -- Testimonials Plugin (with correct name)
6
- INSERT OR IGNORE INTO plugins (
7
- id, name, display_name, description, version, author, category, icon,
8
- status, is_core, permissions, dependencies, settings, installed_at, last_updated
9
- ) VALUES (
10
- 'testimonials-plugin',
11
- 'testimonials-plugin',
12
- 'Customer Testimonials',
13
- 'Manage customer testimonials and reviews with rating support',
14
- '1.0.0',
15
- 'SonicJS',
16
- 'content',
17
- '⭐',
18
- 'active',
19
- FALSE,
20
- '["manage:testimonials"]',
21
- '[]',
22
- '{"defaultPublished": true, "requireRating": false}',
23
- unixepoch(),
24
- unixepoch()
25
- );
26
-
27
- -- Code Examples Plugin (with correct name)
28
- INSERT OR IGNORE INTO plugins (
29
- id, name, display_name, description, version, author, category, icon,
30
- status, is_core, permissions, dependencies, settings, installed_at, last_updated
31
- ) VALUES (
32
- 'code-examples-plugin',
33
- 'code-examples-plugin',
34
- 'Code Examples',
35
- 'Manage code snippets and examples with syntax highlighting support',
36
- '1.0.0',
37
- 'SonicJS',
38
- 'content',
39
- '💻',
40
- 'active',
41
- FALSE,
42
- '["manage:code-examples"]',
43
- '[]',
44
- '{"defaultPublished": true, "supportedLanguages": ["javascript", "typescript", "python", "go", "rust", "java", "php", "ruby", "sql"]}',
45
- unixepoch(),
46
- unixepoch()
47
- );
48
-
49
- -- Workflow Plugin (with correct name)
50
- INSERT OR IGNORE INTO plugins (
51
- id, name, display_name, description, version, author, category, icon,
52
- status, is_core, permissions, dependencies, installed_at, last_updated
53
- ) VALUES (
54
- 'workflow-plugin',
55
- 'workflow-plugin',
56
- 'Workflow Engine',
57
- 'Content workflow management with approval chains, scheduling, and automation',
58
- '1.0.0',
59
- 'SonicJS Team',
60
- 'content',
61
- '🔄',
62
- 'active',
63
- TRUE,
64
- '["manage:workflows", "approve:content"]',
65
- '[]',
66
- unixepoch(),
67
- unixepoch()
68
- );
69
-
70
- -- Demo Login Plugin (already exists with correct name from migration 007, but let's ensure it's there)
71
- INSERT OR IGNORE INTO plugins (
72
- id, name, display_name, description, version, author, category, icon,
73
- status, is_core, permissions, dependencies, installed_at, last_updated
74
- ) VALUES (
75
- 'demo-login-plugin',
76
- 'demo-login-plugin',
77
- 'Demo Login Prefill',
78
- 'Prefills login form with demo credentials for easy site demonstration',
79
- '1.0.0',
80
- 'SonicJS',
81
- 'demo',
82
- '🎯',
83
- 'active',
84
- FALSE,
85
- '[]',
86
- '[]',
87
- unixepoch(),
88
- unixepoch()
89
- );
@@ -1,17 +0,0 @@
1
- -- Migration: Remove duplicate cache plugin entry
2
- -- Description: Removes the old 'cache' plugin (id: 'cache') that is a duplicate of 'core-cache'
3
- -- This fixes the issue where Cache System appears twice in the plugins list
4
- -- Created: 2025-10-14
5
-
6
- -- Remove the old 'cache' plugin entry if it exists
7
- -- The correct plugin is 'core-cache' which is managed by plugin-bootstrap.ts
8
- DELETE FROM plugins WHERE id = 'cache' AND name = 'cache';
9
-
10
- -- Clean up any related entries in plugin activity log
11
- DELETE FROM plugin_activity_log WHERE plugin_id = 'cache';
12
-
13
- -- Clean up any related entries in plugin hooks
14
- DELETE FROM plugin_hooks WHERE plugin_id = 'cache';
15
-
16
- -- Clean up any related entries in plugin routes
17
- DELETE FROM plugin_routes WHERE plugin_id = 'cache';
@@ -1,49 +0,0 @@
1
- -- Migration: Make authentication fields configurable
2
- -- This migration updates the core-auth plugin to support configurable required fields
3
-
4
- -- The settings will be stored in the plugins table as JSON
5
- -- Default settings for core-auth plugin include:
6
- -- {
7
- -- "requiredFields": {
8
- -- "email": { "required": true, "minLength": 5 },
9
- -- "password": { "required": true, "minLength": 8 },
10
- -- "username": { "required": true, "minLength": 3 },
11
- -- "firstName": { "required": true, "minLength": 1 },
12
- -- "lastName": { "required": true, "minLength": 1 }
13
- -- },
14
- -- "validation": {
15
- -- "emailFormat": true,
16
- -- "allowDuplicateUsernames": false
17
- -- }
18
- -- }
19
-
20
- -- Update core-auth plugin settings with configurable field requirements
21
- UPDATE plugins
22
- SET settings = json_object(
23
- 'requiredFields', json_object(
24
- 'email', json_object('required', 1, 'minLength', 5, 'label', 'Email', 'type', 'email'),
25
- 'password', json_object('required', 1, 'minLength', 8, 'label', 'Password', 'type', 'password'),
26
- 'username', json_object('required', 1, 'minLength', 3, 'label', 'Username', 'type', 'text'),
27
- 'firstName', json_object('required', 1, 'minLength', 1, 'label', 'First Name', 'type', 'text'),
28
- 'lastName', json_object('required', 1, 'minLength', 1, 'label', 'Last Name', 'type', 'text')
29
- ),
30
- 'validation', json_object(
31
- 'emailFormat', 1,
32
- 'allowDuplicateUsernames', 0,
33
- 'passwordRequirements', json_object(
34
- 'requireUppercase', 0,
35
- 'requireLowercase', 0,
36
- 'requireNumbers', 0,
37
- 'requireSpecialChars', 0
38
- )
39
- ),
40
- 'registration', json_object(
41
- 'enabled', 1,
42
- 'requireEmailVerification', 0,
43
- 'defaultRole', 'viewer'
44
- )
45
- )
46
- WHERE id = 'core-auth';
47
-
48
- -- If core-auth plugin doesn't exist, this migration will be handled by bootstrap
49
- -- No need to insert here as plugin bootstrap handles initial plugin creation
@@ -1,23 +0,0 @@
1
- -- Create settings table for storing application settings
2
- CREATE TABLE IF NOT EXISTS settings (
3
- id TEXT PRIMARY KEY,
4
- category TEXT NOT NULL, -- 'general', 'appearance', 'security', etc.
5
- key TEXT NOT NULL,
6
- value TEXT NOT NULL, -- JSON value
7
- created_at INTEGER NOT NULL,
8
- updated_at INTEGER NOT NULL,
9
- UNIQUE(category, key)
10
- );
11
-
12
- -- Insert default general settings
13
- INSERT OR IGNORE INTO settings (id, category, key, value, created_at, updated_at)
14
- VALUES
15
- (lower(hex(randomblob(16))), 'general', 'siteName', '"SonicJS AI"', unixepoch() * 1000, unixepoch() * 1000),
16
- (lower(hex(randomblob(16))), 'general', 'siteDescription', '"A modern headless CMS powered by AI"', unixepoch() * 1000, unixepoch() * 1000),
17
- (lower(hex(randomblob(16))), 'general', 'timezone', '"UTC"', unixepoch() * 1000, unixepoch() * 1000),
18
- (lower(hex(randomblob(16))), 'general', 'language', '"en"', unixepoch() * 1000, unixepoch() * 1000),
19
- (lower(hex(randomblob(16))), 'general', 'maintenanceMode', 'false', unixepoch() * 1000, unixepoch() * 1000);
20
-
21
- -- Create index for faster lookups
22
- CREATE INDEX IF NOT EXISTS idx_settings_category ON settings(category);
23
- CREATE INDEX IF NOT EXISTS idx_settings_category_key ON settings(category, key);
@@ -1,15 +0,0 @@
1
- -- Migration: Remove blog_posts from database-managed collections
2
- -- Description: Remove blog-posts-collection from the database so it can be managed by code-based collection
3
- -- Created: 2025-11-04
4
-
5
- -- Delete content associated with blog-posts-collection
6
- DELETE FROM content WHERE collection_id = 'blog-posts-collection';
7
-
8
- -- Delete content fields for blog-posts-collection
9
- DELETE FROM content_fields WHERE collection_id = 'blog-posts-collection';
10
-
11
- -- Delete the blog-posts collection itself
12
- DELETE FROM collections WHERE id = 'blog-posts-collection';
13
-
14
- -- The blog-posts collection will now be managed by the code-based collection
15
- -- in src/collections/blog-posts.collection.ts
@@ -1,22 +0,0 @@
1
- -- Add Email Plugin
2
- -- Migration: 020_add_email_plugin
3
- -- Description: Add email plugin for transactional emails via Resend
4
-
5
- INSERT OR IGNORE INTO plugins (
6
- id, name, display_name, description, version, author, category, icon,
7
- status, is_core, permissions, installed_at, last_updated
8
- ) VALUES (
9
- 'email',
10
- 'email',
11
- 'Email',
12
- 'Send transactional emails using Resend',
13
- '1.0.0-beta.1',
14
- 'SonicJS Team',
15
- 'utilities',
16
- '📧',
17
- 'inactive',
18
- TRUE,
19
- '["email:manage", "email:send", "email:view-logs"]',
20
- unixepoch(),
21
- unixepoch()
22
- );
@@ -1,42 +0,0 @@
1
- -- Add Magic Link Authentication Plugin
2
- -- Migration: 021_add_magic_link_auth_plugin
3
- -- Description: Add magic link authentication plugin for passwordless login
4
-
5
- -- Create magic_links table
6
- CREATE TABLE IF NOT EXISTS magic_links (
7
- id TEXT PRIMARY KEY,
8
- user_email TEXT NOT NULL,
9
- token TEXT NOT NULL UNIQUE,
10
- expires_at INTEGER NOT NULL,
11
- used INTEGER DEFAULT 0,
12
- used_at INTEGER,
13
- ip_address TEXT,
14
- user_agent TEXT,
15
- created_at INTEGER NOT NULL
16
- );
17
-
18
- -- Create indexes for performance
19
- CREATE INDEX IF NOT EXISTS idx_magic_links_token ON magic_links(token);
20
- CREATE INDEX IF NOT EXISTS idx_magic_links_email ON magic_links(user_email);
21
- CREATE INDEX IF NOT EXISTS idx_magic_links_expires ON magic_links(expires_at);
22
-
23
- -- Register the plugin
24
- INSERT OR IGNORE INTO plugins (
25
- id, name, display_name, description, version, author, category, icon,
26
- status, is_core, permissions, dependencies, installed_at, last_updated
27
- ) VALUES (
28
- 'magic-link-auth',
29
- 'magic-link-auth',
30
- 'Magic Link Authentication',
31
- 'Passwordless authentication via email magic links. Users receive a secure one-time link to sign in without entering a password.',
32
- '1.0.0',
33
- 'SonicJS Team',
34
- 'security',
35
- '🔗',
36
- 'inactive',
37
- FALSE,
38
- '["auth:manage", "auth:magic-link"]',
39
- '["email"]',
40
- unixepoch(),
41
- unixepoch()
42
- );
@@ -1,25 +0,0 @@
1
- -- Add TinyMCE Rich Text Editor Plugin
2
- -- Migration: 022_add_tinymce_plugin
3
- -- Description: Add TinyMCE plugin for WYSIWYG rich text editing
4
-
5
- -- Register the plugin (active by default since it replaces hardcoded TinyMCE)
6
- INSERT OR IGNORE INTO plugins (
7
- id, name, display_name, description, version, author, category, icon,
8
- status, is_core, permissions, dependencies, settings, installed_at, last_updated
9
- ) VALUES (
10
- 'tinymce-plugin',
11
- 'tinymce-plugin',
12
- 'TinyMCE Rich Text Editor',
13
- 'Powerful WYSIWYG rich text editor for content creation. Provides a full-featured editor with formatting, media embedding, and customizable toolbars for richtext fields.',
14
- '1.0.0',
15
- 'SonicJS Team',
16
- 'editor',
17
- '✏️',
18
- 'active',
19
- FALSE,
20
- '[]',
21
- '[]',
22
- '{"apiKey":"no-api-key","defaultHeight":300,"defaultToolbar":"full","skin":"oxide-dark"}',
23
- unixepoch(),
24
- unixepoch()
25
- );
@@ -1,25 +0,0 @@
1
- -- Add EasyMDE Markdown Editor Plugin
2
- -- Migration: 023_add_easy_mdx_plugin
3
- -- Description: Add EasyMDE plugin for lightweight markdown editing
4
-
5
- -- Register the plugin (active by default)
6
- INSERT OR IGNORE INTO plugins (
7
- id, name, display_name, description, version, author, category, icon,
8
- status, is_core, permissions, dependencies, settings, installed_at, last_updated
9
- ) VALUES (
10
- 'easy-mdx',
11
- 'easy-mdx',
12
- 'EasyMDE Markdown Editor',
13
- 'Lightweight markdown editor with live preview. Provides a simple and efficient editor with markdown support for richtext fields.',
14
- '1.0.0',
15
- 'SonicJS Team',
16
- 'editor',
17
- '📝',
18
- 'active',
19
- FALSE,
20
- '[]',
21
- '[]',
22
- '{"defaultHeight":400,"theme":"dark","toolbar":"full","placeholder":"Start writing your content..."}',
23
- unixepoch(),
24
- unixepoch()
25
- );
@@ -1,25 +0,0 @@
1
- -- Add Quill Rich Text Editor Plugin
2
- -- Migration: 024_add_quill_editor_plugin
3
- -- Description: Add Quill plugin for modern rich text editing
4
-
5
- -- Register the plugin (active by default)
6
- INSERT OR IGNORE INTO plugins (
7
- id, name, display_name, description, version, author, category, icon,
8
- status, is_core, permissions, dependencies, settings, installed_at, last_updated
9
- ) VALUES (
10
- 'quill-editor',
11
- 'quill-editor',
12
- 'Quill Rich Text Editor',
13
- 'Modern rich text editor for content creation. Provides a clean, intuitive WYSIWYG editor with customizable toolbars for richtext fields.',
14
- '1.0.0',
15
- 'SonicJS Team',
16
- 'editor',
17
- '✍️',
18
- 'active',
19
- FALSE,
20
- '[]',
21
- '[]',
22
- '{"theme":"snow","defaultHeight":300,"defaultToolbar":"full","placeholder":"Start writing your content..."}',
23
- unixepoch(),
24
- unixepoch()
25
- );
@@ -1,25 +0,0 @@
1
- -- Add EasyMDE Rich Text Editor Plugin
2
- -- Migration: 025_add_easymde_plugin
3
- -- Description: Add EasyMDE plugin for markdown-based rich text editing
4
-
5
- -- Register the plugin (inactive by default, replacing MDXEditor)
6
- INSERT OR IGNORE INTO plugins (
7
- id, name, display_name, description, version, author, category, icon,
8
- status, is_core, permissions, dependencies, settings, installed_at, last_updated
9
- ) VALUES (
10
- 'easymde-editor',
11
- 'easymde-editor',
12
- 'EasyMDE Editor',
13
- 'Lightweight markdown editor for content creation. Simple, elegant WYSIWYG markdown editor with live preview, toolbar, and dark mode support for richtext fields.',
14
- '1.0.0',
15
- 'SonicJS Team',
16
- 'editor',
17
- '✍️',
18
- 'inactive',
19
- TRUE,
20
- '[]',
21
- '[]',
22
- '{"theme":"dark","defaultHeight":300,"toolbar":"full","spellChecker":false,"placeholder":"Start writing your content..."}',
23
- unixepoch(),
24
- unixepoch()
25
- );
@@ -1,42 +0,0 @@
1
- -- Add OTP Login Plugin
2
- -- Migration: 021_add_otp_login
3
- -- Description: Add OTP login plugin for passwordless authentication via email codes
4
-
5
- -- Create table for OTP codes
6
- CREATE TABLE IF NOT EXISTS otp_codes (
7
- id TEXT PRIMARY KEY,
8
- user_email TEXT NOT NULL,
9
- code TEXT NOT NULL,
10
- expires_at INTEGER NOT NULL,
11
- used INTEGER DEFAULT 0,
12
- used_at INTEGER,
13
- ip_address TEXT,
14
- user_agent TEXT,
15
- attempts INTEGER DEFAULT 0,
16
- created_at INTEGER NOT NULL
17
- );
18
-
19
- -- Create indexes for performance
20
- CREATE INDEX IF NOT EXISTS idx_otp_email_code ON otp_codes(user_email, code);
21
- CREATE INDEX IF NOT EXISTS idx_otp_expires ON otp_codes(expires_at);
22
- CREATE INDEX IF NOT EXISTS idx_otp_used ON otp_codes(used);
23
-
24
- -- Add plugin record
25
- INSERT OR IGNORE INTO plugins (
26
- id, name, display_name, description, version, author, category, icon,
27
- status, is_core, permissions, installed_at, last_updated
28
- ) VALUES (
29
- 'otp-login',
30
- 'otp-login',
31
- 'OTP Login',
32
- 'Passwordless authentication via email one-time codes',
33
- '1.0.0-beta.1',
34
- 'SonicJS Team',
35
- 'security',
36
- '🔢',
37
- 'inactive',
38
- TRUE,
39
- '["otp:manage", "otp:request", "otp:verify"]',
40
- unixepoch(),
41
- unixepoch()
42
- );