@sonicjs-cms/core 2.18.1 → 3.0.0-beta.2
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.
- package/README.md +4 -3
- package/dist/admin-documents-form.template-KN7JF66Q.cjs +19 -0
- package/dist/{admin-layout-catalyst.template-UMTIN66R.js.map → admin-documents-form.template-KN7JF66Q.cjs.map} +1 -1
- package/dist/admin-documents-form.template-NLSI6Z42.js +6 -0
- package/dist/{admin-layout-catalyst.template-HFD37TY5.cjs.map → admin-documents-form.template-NLSI6Z42.js.map} +1 -1
- package/dist/admin-layout-catalyst.template-WHJGSWWD.js +7 -0
- package/dist/admin-layout-catalyst.template-WHJGSWWD.js.map +1 -0
- package/dist/admin-layout-catalyst.template-ZK5HD545.cjs +17 -0
- package/dist/admin-layout-catalyst.template-ZK5HD545.cjs.map +1 -0
- package/dist/app-Bo0X1OWX.d.ts +1268 -0
- package/dist/app-Do66yCcV.d.cts +1268 -0
- package/dist/cache-DDARE4QE.js +4 -0
- package/dist/cache-DDARE4QE.js.map +1 -0
- package/dist/cache-LVYS4BPL.cjs +33 -0
- package/dist/cache-LVYS4BPL.cjs.map +1 -0
- package/dist/chunk-2CB4KY7I.cjs +771 -0
- package/dist/chunk-2CB4KY7I.cjs.map +1 -0
- package/dist/{chunk-55RDMDOP.js → chunk-3TB6AT6X.js} +148 -55
- package/dist/chunk-3TB6AT6X.js.map +1 -0
- package/dist/{chunk-ON5ZMSU4.js → chunk-6JQOUUOB.js} +3 -3
- package/dist/chunk-6JQOUUOB.js.map +1 -0
- package/dist/chunk-6OUHGKFD.js +387 -0
- package/dist/chunk-6OUHGKFD.js.map +1 -0
- package/dist/{chunk-DSUJ5YQH.cjs → chunk-AAWNRBRB.cjs} +537 -92
- package/dist/chunk-AAWNRBRB.cjs.map +1 -0
- package/dist/chunk-AI663NBO.js +821 -0
- package/dist/chunk-AI663NBO.js.map +1 -0
- package/dist/chunk-BDDABDAB.cjs +1149 -0
- package/dist/chunk-BDDABDAB.cjs.map +1 -0
- package/dist/chunk-BLMTL57B.js +767 -0
- package/dist/chunk-BLMTL57B.js.map +1 -0
- package/dist/chunk-DNQCEKUK.cjs +327 -0
- package/dist/chunk-DNQCEKUK.cjs.map +1 -0
- package/dist/chunk-DSA4UX5B.cjs +276 -0
- package/dist/chunk-DSA4UX5B.cjs.map +1 -0
- package/dist/chunk-EF2NQUIQ.js +323 -0
- package/dist/chunk-EF2NQUIQ.js.map +1 -0
- package/dist/chunk-GCDZZNIN.js +192 -0
- package/dist/chunk-GCDZZNIN.js.map +1 -0
- package/dist/{chunk-ABB34XUS.cjs → chunk-H2AXVCLS.cjs} +667 -19
- package/dist/chunk-H2AXVCLS.cjs.map +1 -0
- package/dist/{chunk-XWIA3HVX.js → chunk-HDWE5FRJ.js} +6 -1249
- package/dist/chunk-HDWE5FRJ.js.map +1 -0
- package/dist/chunk-HIKBY7MS.cjs +70 -0
- package/dist/chunk-HIKBY7MS.cjs.map +1 -0
- package/dist/chunk-IESEVHXL.js +66 -0
- package/dist/chunk-IESEVHXL.js.map +1 -0
- package/dist/chunk-IVPRUGTY.js +242 -0
- package/dist/chunk-IVPRUGTY.js.map +1 -0
- package/dist/{chunk-SQ6FNXU2.cjs → chunk-IXUHXTHW.cjs} +2 -151
- package/dist/chunk-IXUHXTHW.cjs.map +1 -0
- package/dist/chunk-J6JTWD2A.cjs +100 -0
- package/dist/chunk-J6JTWD2A.cjs.map +1 -0
- package/dist/chunk-JEQ7FLOD.cjs +199 -0
- package/dist/chunk-JEQ7FLOD.cjs.map +1 -0
- package/dist/chunk-K25XHMM3.js +566 -0
- package/dist/chunk-K25XHMM3.js.map +1 -0
- package/dist/chunk-LRZIAW7U.cjs +158 -0
- package/dist/chunk-LRZIAW7U.cjs.map +1 -0
- package/dist/{chunk-OHYBNCVL.cjs → chunk-MVIZJOO5.cjs} +10 -1256
- package/dist/chunk-MVIZJOO5.cjs.map +1 -0
- package/dist/{chunk-UYJ6TJHX.cjs → chunk-NAVPFIG5.cjs} +148 -55
- package/dist/chunk-NAVPFIG5.cjs.map +1 -0
- package/dist/chunk-NLJVSER2.js +273 -0
- package/dist/chunk-NLJVSER2.js.map +1 -0
- package/dist/chunk-NMPEMSU4.js +154 -0
- package/dist/chunk-NMPEMSU4.js.map +1 -0
- package/dist/chunk-NUKJ54GA.cjs +245 -0
- package/dist/chunk-NUKJ54GA.cjs.map +1 -0
- package/dist/{chunk-T3Q5V33G.cjs → chunk-QAYFOER6.cjs} +621 -829
- package/dist/chunk-QAYFOER6.cjs.map +1 -0
- package/dist/{chunk-MGFRZO24.js → chunk-QZGABF2M.js} +3 -149
- package/dist/chunk-QZGABF2M.js.map +1 -0
- package/dist/chunk-RNZFGN4R.js +88 -0
- package/dist/chunk-RNZFGN4R.js.map +1 -0
- package/dist/chunk-RZ6H7OZK.js +1134 -0
- package/dist/chunk-RZ6H7OZK.js.map +1 -0
- package/dist/{chunk-XXDFQERJ.js → chunk-VD2EA3WT.js} +7192 -9806
- package/dist/chunk-VD2EA3WT.js.map +1 -0
- package/dist/{chunk-SXXTQETM.cjs → chunk-VXE42MYF.cjs} +8722 -11323
- package/dist/chunk-VXE42MYF.cjs.map +1 -0
- package/dist/{chunk-4ZSNJDLS.cjs → chunk-WULONYGB.cjs} +9 -9
- package/dist/chunk-WULONYGB.cjs.map +1 -0
- package/dist/chunk-XW56B23A.cjs +408 -0
- package/dist/chunk-XW56B23A.cjs.map +1 -0
- package/dist/chunk-YA3TJ65D.cjs +575 -0
- package/dist/chunk-YA3TJ65D.cjs.map +1 -0
- package/dist/{chunk-TFNTM3OA.js → chunk-YHSQVQXX.js} +645 -15
- package/dist/chunk-YHSQVQXX.js.map +1 -0
- package/dist/chunk-YP7GW2G5.cjs +866 -0
- package/dist/chunk-YP7GW2G5.cjs.map +1 -0
- package/dist/{chunk-QFWHAFEO.js → chunk-ZEZ245PW.js} +148 -858
- package/dist/chunk-ZEZ245PW.js.map +1 -0
- package/dist/{chunk-EW5NOBVU.js → chunk-ZGGXCFR6.js} +611 -817
- package/dist/chunk-ZGGXCFR6.js.map +1 -0
- package/dist/{collection-config-B4PG-AaF.d.cts → collection-config-JgHOpFCG.d.cts} +30 -2
- package/dist/{collection-config-B4PG-AaF.d.ts → collection-config-JgHOpFCG.d.ts} +30 -2
- package/dist/config-HFXANXCC.js +6 -0
- package/dist/config-HFXANXCC.js.map +1 -0
- package/dist/config-ON6FNMYX.cjs +19 -0
- package/dist/config-ON6FNMYX.cjs.map +1 -0
- package/dist/define-plugin-BzNHc1ZI.d.ts +1321 -0
- package/dist/define-plugin-IWDKYaVm.d.cts +1321 -0
- package/dist/document-projection-TDWRJX3Z.cjs +13 -0
- package/dist/document-projection-TDWRJX3Z.cjs.map +1 -0
- package/dist/document-projection-YYMC6I4U.js +4 -0
- package/dist/document-projection-YYMC6I4U.js.map +1 -0
- package/dist/index.cjs +13735 -4329
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +329 -492
- package/dist/index.d.ts +329 -492
- package/dist/index.js +13386 -3999
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +36 -32
- package/dist/middleware.d.cts +69 -7
- package/dist/middleware.d.ts +69 -7
- package/dist/middleware.js +7 -3
- package/dist/migrations-NJJWQUKK.cjs +13 -0
- package/dist/{migrations-IYNTWDC6.cjs.map → migrations-NJJWQUKK.cjs.map} +1 -1
- package/dist/migrations-WCAVBD7C.js +4 -0
- package/dist/{migrations-R337UD46.js.map → migrations-WCAVBD7C.js.map} +1 -1
- package/dist/{plugin-bootstrap-DfVerYV4.d.cts → plugin-bootstrap-B8ThJU21.d.cts} +4315 -1661
- package/dist/{plugin-bootstrap-P_ciLp_C.d.ts → plugin-bootstrap-qu8hJgUt.d.ts} +4315 -1661
- package/dist/plugins.cjs +171 -12
- package/dist/plugins.d.cts +36 -2
- package/dist/plugins.d.ts +36 -2
- package/dist/plugins.js +5 -2
- package/dist/rbac-O73MFKDA.js +5 -0
- package/dist/rbac-O73MFKDA.js.map +1 -0
- package/dist/rbac-VONLJJKB.cjs +14 -0
- package/dist/rbac-VONLJJKB.cjs.map +1 -0
- package/dist/routes.cjs +41 -45
- package/dist/routes.d.cts +56 -146
- package/dist/routes.d.ts +56 -146
- package/dist/routes.js +17 -9
- package/dist/services.cjs +39 -72
- package/dist/services.d.cts +79 -54
- package/dist/services.d.ts +79 -54
- package/dist/services.js +6 -3
- package/dist/templates.cjs +17 -29
- package/dist/templates.d.cts +1 -66
- package/dist/templates.d.ts +1 -66
- package/dist/templates.js +3 -3
- package/dist/types-Dea1eNxU.d.cts +286 -0
- package/dist/types-Dea1eNxU.d.ts +286 -0
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils.cjs +18 -17
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -1
- package/migrations/0001_core.sql +184 -0
- package/migrations/0002_documents.sql +163 -0
- package/package.json +12 -7
- package/dist/admin-layout-catalyst.template-HFD37TY5.cjs +0 -17
- package/dist/admin-layout-catalyst.template-UMTIN66R.js +0 -7
- package/dist/app-C9esKLmh.d.cts +0 -112
- package/dist/app-C9esKLmh.d.ts +0 -112
- package/dist/chunk-4R3NOOL3.js +0 -2217
- package/dist/chunk-4R3NOOL3.js.map +0 -1
- package/dist/chunk-4ZSNJDLS.cjs.map +0 -1
- package/dist/chunk-55RDMDOP.js.map +0 -1
- package/dist/chunk-635JAMSE.cjs +0 -653
- package/dist/chunk-635JAMSE.cjs.map +0 -1
- package/dist/chunk-ABB34XUS.cjs.map +0 -1
- package/dist/chunk-C54YUA23.cjs +0 -2219
- package/dist/chunk-C54YUA23.cjs.map +0 -1
- package/dist/chunk-DSUJ5YQH.cjs.map +0 -1
- package/dist/chunk-EW5NOBVU.js.map +0 -1
- package/dist/chunk-EXNEW5US.js +0 -648
- package/dist/chunk-EXNEW5US.js.map +0 -1
- package/dist/chunk-I2H5NGJQ.js +0 -692
- package/dist/chunk-I2H5NGJQ.js.map +0 -1
- package/dist/chunk-MGFRZO24.js.map +0 -1
- package/dist/chunk-OHYBNCVL.cjs.map +0 -1
- package/dist/chunk-ON5ZMSU4.js.map +0 -1
- package/dist/chunk-QFWHAFEO.js.map +0 -1
- package/dist/chunk-SQ6FNXU2.cjs.map +0 -1
- package/dist/chunk-SXXTQETM.cjs.map +0 -1
- package/dist/chunk-T3Q5V33G.cjs.map +0 -1
- package/dist/chunk-TFNTM3OA.js.map +0 -1
- package/dist/chunk-UYJ6TJHX.cjs.map +0 -1
- package/dist/chunk-WAEQXGCX.cjs +0 -1898
- package/dist/chunk-WAEQXGCX.cjs.map +0 -1
- package/dist/chunk-XWIA3HVX.js.map +0 -1
- package/dist/chunk-XXDFQERJ.js.map +0 -1
- package/dist/migrations-IYNTWDC6.cjs +0 -13
- package/dist/migrations-R337UD46.js +0 -4
- package/dist/plugin-manager-BoM3Q7o7.d.cts +0 -328
- package/dist/plugin-manager-Efx9RyDX.d.ts +0 -328
- package/migrations/001_initial_schema.sql +0 -170
- package/migrations/002_faq_plugin.sql +0 -86
- package/migrations/003_stage5_enhancements.sql +0 -121
- package/migrations/004_stage6_user_management.sql +0 -183
- package/migrations/005_stage7_workflow_automation.sql +0 -294
- package/migrations/006_plugin_system.sql +0 -155
- package/migrations/007_demo_login_plugin.sql +0 -23
- package/migrations/008_fix_slug_validation.sql +0 -22
- package/migrations/009_system_logging.sql +0 -57
- package/migrations/011_config_managed_collections.sql +0 -15
- package/migrations/012_testimonials_plugin.sql +0 -80
- package/migrations/013_code_examples_plugin.sql +0 -177
- package/migrations/014_fix_plugin_registry.sql +0 -88
- package/migrations/015_add_remaining_plugins.sql +0 -89
- package/migrations/016_remove_duplicate_cache_plugin.sql +0 -17
- package/migrations/017_auth_configurable_fields.sql +0 -49
- package/migrations/018_settings_table.sql +0 -23
- package/migrations/019_remove_blog_posts_collection.sql +0 -15
- package/migrations/020_add_email_plugin.sql +0 -22
- package/migrations/021_add_magic_link_auth_plugin.sql +0 -42
- package/migrations/022_add_tinymce_plugin.sql +0 -25
- package/migrations/023_add_easy_mdx_plugin.sql +0 -25
- package/migrations/024_add_quill_editor_plugin.sql +0 -25
- package/migrations/025_add_easymde_plugin.sql +0 -25
- package/migrations/026_add_otp_login.sql +0 -42
- package/migrations/027_fix_slug_field_type.sql +0 -18
- package/migrations/028_fix_slug_field_type_in_schemas.sql +0 -30
- package/migrations/029_add_forms_system.sql +0 -184
- package/migrations/030_add_turnstile_to_forms.sql +0 -14
- package/migrations/031_ai_search_plugin.sql +0 -45
- package/migrations/032_user_profiles.sql +0 -37
- package/migrations/033_form_content_integration.sql +0 -19
- package/migrations/034_security_audit_plugin.sql +0 -27
- package/migrations/035_user_profiles_data_column.sql +0 -16
- package/migrations/036_analytics_events.sql +0 -22
package/dist/middleware.cjs
CHANGED
|
@@ -1,128 +1,132 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var chunkAAWNRBRB_cjs = require('./chunk-AAWNRBRB.cjs');
|
|
4
|
+
require('./chunk-2CB4KY7I.cjs');
|
|
5
|
+
require('./chunk-JEQ7FLOD.cjs');
|
|
6
|
+
require('./chunk-QAYFOER6.cjs');
|
|
7
|
+
require('./chunk-DSA4UX5B.cjs');
|
|
8
|
+
require('./chunk-J6JTWD2A.cjs');
|
|
6
9
|
require('./chunk-RCQ2HIQD.cjs');
|
|
10
|
+
require('./chunk-MNWKYY5E.cjs');
|
|
7
11
|
require('./chunk-IGJUBJBW.cjs');
|
|
8
12
|
|
|
9
13
|
|
|
10
14
|
|
|
11
15
|
Object.defineProperty(exports, "AuthManager", {
|
|
12
16
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkAAWNRBRB_cjs.AuthManager; }
|
|
14
18
|
});
|
|
15
19
|
Object.defineProperty(exports, "PermissionManager", {
|
|
16
20
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkAAWNRBRB_cjs.PermissionManager; }
|
|
18
22
|
});
|
|
19
23
|
Object.defineProperty(exports, "bootstrapMiddleware", {
|
|
20
24
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkAAWNRBRB_cjs.bootstrapMiddleware; }
|
|
22
26
|
});
|
|
23
27
|
Object.defineProperty(exports, "cacheHeaders", {
|
|
24
28
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkAAWNRBRB_cjs.cacheHeaders; }
|
|
26
30
|
});
|
|
27
31
|
Object.defineProperty(exports, "compressionMiddleware", {
|
|
28
32
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkAAWNRBRB_cjs.compressionMiddleware; }
|
|
30
34
|
});
|
|
31
35
|
Object.defineProperty(exports, "csrfProtection", {
|
|
32
36
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkAAWNRBRB_cjs.csrfProtection; }
|
|
34
38
|
});
|
|
35
39
|
Object.defineProperty(exports, "detailedLoggingMiddleware", {
|
|
36
40
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunkAAWNRBRB_cjs.detailedLoggingMiddleware; }
|
|
38
42
|
});
|
|
39
43
|
Object.defineProperty(exports, "generateCsrfToken", {
|
|
40
44
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkAAWNRBRB_cjs.generateCsrfToken; }
|
|
42
46
|
});
|
|
43
47
|
Object.defineProperty(exports, "getActivePlugins", {
|
|
44
48
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkAAWNRBRB_cjs.getActivePlugins; }
|
|
46
50
|
});
|
|
47
51
|
Object.defineProperty(exports, "getJwtExpirySeconds", {
|
|
48
52
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunkAAWNRBRB_cjs.getJwtExpirySeconds; }
|
|
50
54
|
});
|
|
51
55
|
Object.defineProperty(exports, "getJwtExpirySecondsFromDb", {
|
|
52
56
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunkAAWNRBRB_cjs.getJwtExpirySecondsFromDb; }
|
|
54
58
|
});
|
|
55
59
|
Object.defineProperty(exports, "getJwtRefreshGraceSecondsFromDb", {
|
|
56
60
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunkAAWNRBRB_cjs.getJwtRefreshGraceSecondsFromDb; }
|
|
58
62
|
});
|
|
59
63
|
Object.defineProperty(exports, "isPluginActive", {
|
|
60
64
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunkAAWNRBRB_cjs.isPluginActive; }
|
|
62
66
|
});
|
|
63
67
|
Object.defineProperty(exports, "logActivity", {
|
|
64
68
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunkAAWNRBRB_cjs.logActivity; }
|
|
66
70
|
});
|
|
67
71
|
Object.defineProperty(exports, "loggingMiddleware", {
|
|
68
72
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunkAAWNRBRB_cjs.loggingMiddleware; }
|
|
70
74
|
});
|
|
71
75
|
Object.defineProperty(exports, "metricsMiddleware", {
|
|
72
76
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkAAWNRBRB_cjs.metricsMiddleware; }
|
|
74
78
|
});
|
|
75
79
|
Object.defineProperty(exports, "optionalAuth", {
|
|
76
80
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunkAAWNRBRB_cjs.optionalAuth; }
|
|
78
82
|
});
|
|
79
83
|
Object.defineProperty(exports, "performanceLoggingMiddleware", {
|
|
80
84
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunkAAWNRBRB_cjs.performanceLoggingMiddleware; }
|
|
82
86
|
});
|
|
83
87
|
Object.defineProperty(exports, "rateLimit", {
|
|
84
88
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkAAWNRBRB_cjs.rateLimit; }
|
|
86
90
|
});
|
|
87
91
|
Object.defineProperty(exports, "requireActivePlugin", {
|
|
88
92
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkAAWNRBRB_cjs.requireActivePlugin; }
|
|
90
94
|
});
|
|
91
95
|
Object.defineProperty(exports, "requireActivePlugins", {
|
|
92
96
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkAAWNRBRB_cjs.requireActivePlugins; }
|
|
94
98
|
});
|
|
95
99
|
Object.defineProperty(exports, "requireAnyPermission", {
|
|
96
100
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkAAWNRBRB_cjs.requireAnyPermission; }
|
|
98
102
|
});
|
|
99
103
|
Object.defineProperty(exports, "requireAuth", {
|
|
100
104
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkAAWNRBRB_cjs.requireAuth; }
|
|
102
106
|
});
|
|
103
107
|
Object.defineProperty(exports, "requirePermission", {
|
|
104
108
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunkAAWNRBRB_cjs.requirePermission; }
|
|
106
110
|
});
|
|
107
111
|
Object.defineProperty(exports, "requireRole", {
|
|
108
112
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunkAAWNRBRB_cjs.requireRole; }
|
|
110
114
|
});
|
|
111
115
|
Object.defineProperty(exports, "securityHeaders", {
|
|
112
116
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunkAAWNRBRB_cjs.securityHeadersMiddleware; }
|
|
114
118
|
});
|
|
115
119
|
Object.defineProperty(exports, "securityLoggingMiddleware", {
|
|
116
120
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunkAAWNRBRB_cjs.securityLoggingMiddleware; }
|
|
118
122
|
});
|
|
119
123
|
Object.defineProperty(exports, "validateCsrfToken", {
|
|
120
124
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunkAAWNRBRB_cjs.validateCsrfToken; }
|
|
122
126
|
});
|
|
123
127
|
Object.defineProperty(exports, "verifySecurityConfig", {
|
|
124
128
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunkAAWNRBRB_cjs.verifySecurityConfig; }
|
|
126
130
|
});
|
|
127
131
|
//# sourceMappingURL=middleware.cjs.map
|
|
128
132
|
//# sourceMappingURL=middleware.cjs.map
|
package/dist/middleware.d.cts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import * as hono from 'hono';
|
|
2
2
|
import { Context, Next, MiddlewareHandler } from 'hono';
|
|
3
|
-
import { S as SonicJSConfig } from './app-
|
|
4
|
-
import '@cloudflare/workers-types';
|
|
3
|
+
import { S as SonicJSConfig } from './app-Do66yCcV.cjs';
|
|
4
|
+
import { D1Database as D1Database$1 } from '@cloudflare/workers-types';
|
|
5
|
+
import 'better-auth/client';
|
|
6
|
+
import 'better-auth/plugins/email-otp';
|
|
7
|
+
import 'better-auth';
|
|
8
|
+
import 'better-auth/plugins/magic-link';
|
|
9
|
+
import 'better-call';
|
|
10
|
+
import 'zod/v4/core';
|
|
11
|
+
import 'zod';
|
|
12
|
+
import './types-Dea1eNxU.cjs';
|
|
5
13
|
|
|
6
14
|
type Bindings = {
|
|
7
15
|
DB: D1Database;
|
|
@@ -22,6 +30,9 @@ declare function verifySecurityConfig(env: Bindings): void;
|
|
|
22
30
|
*/
|
|
23
31
|
declare function bootstrapMiddleware(config?: SonicJSConfig): (c: Context<{
|
|
24
32
|
Bindings: Bindings;
|
|
33
|
+
Variables: {
|
|
34
|
+
hookSystem?: unknown;
|
|
35
|
+
};
|
|
25
36
|
}>, next: Next) => Promise<void>;
|
|
26
37
|
|
|
27
38
|
type JWTPayload = {
|
|
@@ -62,12 +73,31 @@ declare class AuthManager {
|
|
|
62
73
|
/**
|
|
63
74
|
* Verify a token's signature and expiration.
|
|
64
75
|
*
|
|
76
|
+
* IMPORTANT: pass the `JWT_SECRET` binding (e.g. `c.env.JWT_SECRET`) as the
|
|
77
|
+
* `secret` argument. If omitted, this falls back to a development-only
|
|
78
|
+
* placeholder secret — tokens signed with the real `JWT_SECRET` will then
|
|
79
|
+
* silently fail verification. From inside a Hono handler prefer
|
|
80
|
+
* `AuthManager.verifyAuthRequest(c)`, which handles header/cookie extraction
|
|
81
|
+
* and pulls the secret from `c.env` for you.
|
|
82
|
+
*
|
|
65
83
|
* If `graceSeconds` > 0, tokens whose `exp` is within the grace window
|
|
66
84
|
* (i.e. expired by no more than `graceSeconds`) are still returned. This
|
|
67
85
|
* supports a sliding-session refresh endpoint that accepts recently-expired
|
|
68
86
|
* tokens. Signature failures always return null.
|
|
69
87
|
*/
|
|
70
88
|
static verifyToken(token: string, secret?: string, graceSeconds?: number): Promise<JWTPayload | null>;
|
|
89
|
+
/**
|
|
90
|
+
* Verify the JWT on an incoming Hono request using the `JWT_SECRET`
|
|
91
|
+
* binding from `c.env`. Reads the token from the `Authorization: Bearer …`
|
|
92
|
+
* header first, then falls back to the `auth_token` cookie. Returns the
|
|
93
|
+
* decoded payload, or null when the token is missing, malformed, expired,
|
|
94
|
+
* or signed with a different secret.
|
|
95
|
+
*
|
|
96
|
+
* Use this from custom Hono routes mounted alongside SonicJS — it
|
|
97
|
+
* resolves the secret the same way `requireAuth()` does, without forcing
|
|
98
|
+
* the caller to plumb it through manually.
|
|
99
|
+
*/
|
|
100
|
+
static verifyAuthRequest(c: Context): Promise<JWTPayload | null>;
|
|
71
101
|
static hashPassword(password: string): Promise<string>;
|
|
72
102
|
static hashPasswordLegacy(password: string): Promise<string>;
|
|
73
103
|
static verifyPassword(password: string, storedHash: string): Promise<boolean>;
|
|
@@ -93,7 +123,7 @@ declare const requireRole: (requiredRole: string | string[]) => (c: Context, nex
|
|
|
93
123
|
}, 401, "json">) | (Response & hono.TypedResponse<{
|
|
94
124
|
error: string;
|
|
95
125
|
}, 403, "json">)>;
|
|
96
|
-
declare const optionalAuth: () => (
|
|
126
|
+
declare const optionalAuth: () => (_c: Context, next: Next) => Promise<void>;
|
|
97
127
|
|
|
98
128
|
/**
|
|
99
129
|
* Middleware to track all HTTP requests for real-time analytics
|
|
@@ -170,6 +200,42 @@ declare function rateLimit(options: RateLimitOptions): (c: Context, next: Next)
|
|
|
170
200
|
*/
|
|
171
201
|
declare const securityHeadersMiddleware: () => (c: Context, next: Next) => Promise<void>;
|
|
172
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Plugin Middleware
|
|
205
|
+
*
|
|
206
|
+
* Provides middleware functions for checking plugin status and enforcing plugin requirements
|
|
207
|
+
*/
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Check if a plugin is active
|
|
211
|
+
* @param db - The D1 database instance
|
|
212
|
+
* @param pluginId - The plugin ID to check
|
|
213
|
+
* @returns Promise<boolean> - True if the plugin is active, false otherwise
|
|
214
|
+
*/
|
|
215
|
+
declare function isPluginActive(db: D1Database$1, pluginId: string): Promise<boolean>;
|
|
216
|
+
/**
|
|
217
|
+
* Middleware to require a plugin to be active
|
|
218
|
+
* Throws an error if the plugin is not active
|
|
219
|
+
* @param db - The D1 database instance
|
|
220
|
+
* @param pluginId - The plugin ID to check
|
|
221
|
+
* @throws Error if plugin is not active
|
|
222
|
+
*/
|
|
223
|
+
declare function requireActivePlugin(db: D1Database$1, pluginId: string): Promise<void>;
|
|
224
|
+
/**
|
|
225
|
+
* Middleware to require multiple plugins to be active
|
|
226
|
+
* Throws an error if any plugin is not active
|
|
227
|
+
* @param db - The D1 database instance
|
|
228
|
+
* @param pluginIds - Array of plugin IDs to check
|
|
229
|
+
* @throws Error if any plugin is not active
|
|
230
|
+
*/
|
|
231
|
+
declare function requireActivePlugins(db: D1Database$1, pluginIds: string[]): Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* Get all active plugins
|
|
234
|
+
* @param db - The D1 database instance
|
|
235
|
+
* @returns Promise<any[]> - Array of active plugin records
|
|
236
|
+
*/
|
|
237
|
+
declare function getActivePlugins(db: D1Database$1): Promise<any[]>;
|
|
238
|
+
|
|
173
239
|
/**
|
|
174
240
|
* Middleware Module Exports
|
|
175
241
|
*
|
|
@@ -195,9 +261,5 @@ declare const PermissionManager: any;
|
|
|
195
261
|
declare const requirePermission: any;
|
|
196
262
|
declare const requireAnyPermission: any;
|
|
197
263
|
declare const logActivity: any;
|
|
198
|
-
declare const requireActivePlugin: any;
|
|
199
|
-
declare const requireActivePlugins: any;
|
|
200
|
-
declare const getActivePlugins: any;
|
|
201
|
-
declare const isPluginActive: any;
|
|
202
264
|
|
|
203
265
|
export { AuthManager, type Permission, PermissionManager, type UserPermissions, bootstrapMiddleware, cacheHeaders, compressionMiddleware, csrfProtection, detailedLoggingMiddleware, generateCsrfToken, getActivePlugins, getJwtExpirySeconds, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, isPluginActive, logActivity, loggingMiddleware, metricsMiddleware, optionalAuth, performanceLoggingMiddleware, rateLimit, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeadersMiddleware as securityHeaders, securityLoggingMiddleware, validateCsrfToken, verifySecurityConfig };
|
package/dist/middleware.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import * as hono from 'hono';
|
|
2
2
|
import { Context, Next, MiddlewareHandler } from 'hono';
|
|
3
|
-
import { S as SonicJSConfig } from './app-
|
|
4
|
-
import '@cloudflare/workers-types';
|
|
3
|
+
import { S as SonicJSConfig } from './app-Bo0X1OWX.js';
|
|
4
|
+
import { D1Database as D1Database$1 } from '@cloudflare/workers-types';
|
|
5
|
+
import 'better-auth/client';
|
|
6
|
+
import 'better-auth/plugins/email-otp';
|
|
7
|
+
import 'better-auth';
|
|
8
|
+
import 'better-auth/plugins/magic-link';
|
|
9
|
+
import 'better-call';
|
|
10
|
+
import 'zod/v4/core';
|
|
11
|
+
import 'zod';
|
|
12
|
+
import './types-Dea1eNxU.js';
|
|
5
13
|
|
|
6
14
|
type Bindings = {
|
|
7
15
|
DB: D1Database;
|
|
@@ -22,6 +30,9 @@ declare function verifySecurityConfig(env: Bindings): void;
|
|
|
22
30
|
*/
|
|
23
31
|
declare function bootstrapMiddleware(config?: SonicJSConfig): (c: Context<{
|
|
24
32
|
Bindings: Bindings;
|
|
33
|
+
Variables: {
|
|
34
|
+
hookSystem?: unknown;
|
|
35
|
+
};
|
|
25
36
|
}>, next: Next) => Promise<void>;
|
|
26
37
|
|
|
27
38
|
type JWTPayload = {
|
|
@@ -62,12 +73,31 @@ declare class AuthManager {
|
|
|
62
73
|
/**
|
|
63
74
|
* Verify a token's signature and expiration.
|
|
64
75
|
*
|
|
76
|
+
* IMPORTANT: pass the `JWT_SECRET` binding (e.g. `c.env.JWT_SECRET`) as the
|
|
77
|
+
* `secret` argument. If omitted, this falls back to a development-only
|
|
78
|
+
* placeholder secret — tokens signed with the real `JWT_SECRET` will then
|
|
79
|
+
* silently fail verification. From inside a Hono handler prefer
|
|
80
|
+
* `AuthManager.verifyAuthRequest(c)`, which handles header/cookie extraction
|
|
81
|
+
* and pulls the secret from `c.env` for you.
|
|
82
|
+
*
|
|
65
83
|
* If `graceSeconds` > 0, tokens whose `exp` is within the grace window
|
|
66
84
|
* (i.e. expired by no more than `graceSeconds`) are still returned. This
|
|
67
85
|
* supports a sliding-session refresh endpoint that accepts recently-expired
|
|
68
86
|
* tokens. Signature failures always return null.
|
|
69
87
|
*/
|
|
70
88
|
static verifyToken(token: string, secret?: string, graceSeconds?: number): Promise<JWTPayload | null>;
|
|
89
|
+
/**
|
|
90
|
+
* Verify the JWT on an incoming Hono request using the `JWT_SECRET`
|
|
91
|
+
* binding from `c.env`. Reads the token from the `Authorization: Bearer …`
|
|
92
|
+
* header first, then falls back to the `auth_token` cookie. Returns the
|
|
93
|
+
* decoded payload, or null when the token is missing, malformed, expired,
|
|
94
|
+
* or signed with a different secret.
|
|
95
|
+
*
|
|
96
|
+
* Use this from custom Hono routes mounted alongside SonicJS — it
|
|
97
|
+
* resolves the secret the same way `requireAuth()` does, without forcing
|
|
98
|
+
* the caller to plumb it through manually.
|
|
99
|
+
*/
|
|
100
|
+
static verifyAuthRequest(c: Context): Promise<JWTPayload | null>;
|
|
71
101
|
static hashPassword(password: string): Promise<string>;
|
|
72
102
|
static hashPasswordLegacy(password: string): Promise<string>;
|
|
73
103
|
static verifyPassword(password: string, storedHash: string): Promise<boolean>;
|
|
@@ -93,7 +123,7 @@ declare const requireRole: (requiredRole: string | string[]) => (c: Context, nex
|
|
|
93
123
|
}, 401, "json">) | (Response & hono.TypedResponse<{
|
|
94
124
|
error: string;
|
|
95
125
|
}, 403, "json">)>;
|
|
96
|
-
declare const optionalAuth: () => (
|
|
126
|
+
declare const optionalAuth: () => (_c: Context, next: Next) => Promise<void>;
|
|
97
127
|
|
|
98
128
|
/**
|
|
99
129
|
* Middleware to track all HTTP requests for real-time analytics
|
|
@@ -170,6 +200,42 @@ declare function rateLimit(options: RateLimitOptions): (c: Context, next: Next)
|
|
|
170
200
|
*/
|
|
171
201
|
declare const securityHeadersMiddleware: () => (c: Context, next: Next) => Promise<void>;
|
|
172
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Plugin Middleware
|
|
205
|
+
*
|
|
206
|
+
* Provides middleware functions for checking plugin status and enforcing plugin requirements
|
|
207
|
+
*/
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Check if a plugin is active
|
|
211
|
+
* @param db - The D1 database instance
|
|
212
|
+
* @param pluginId - The plugin ID to check
|
|
213
|
+
* @returns Promise<boolean> - True if the plugin is active, false otherwise
|
|
214
|
+
*/
|
|
215
|
+
declare function isPluginActive(db: D1Database$1, pluginId: string): Promise<boolean>;
|
|
216
|
+
/**
|
|
217
|
+
* Middleware to require a plugin to be active
|
|
218
|
+
* Throws an error if the plugin is not active
|
|
219
|
+
* @param db - The D1 database instance
|
|
220
|
+
* @param pluginId - The plugin ID to check
|
|
221
|
+
* @throws Error if plugin is not active
|
|
222
|
+
*/
|
|
223
|
+
declare function requireActivePlugin(db: D1Database$1, pluginId: string): Promise<void>;
|
|
224
|
+
/**
|
|
225
|
+
* Middleware to require multiple plugins to be active
|
|
226
|
+
* Throws an error if any plugin is not active
|
|
227
|
+
* @param db - The D1 database instance
|
|
228
|
+
* @param pluginIds - Array of plugin IDs to check
|
|
229
|
+
* @throws Error if any plugin is not active
|
|
230
|
+
*/
|
|
231
|
+
declare function requireActivePlugins(db: D1Database$1, pluginIds: string[]): Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* Get all active plugins
|
|
234
|
+
* @param db - The D1 database instance
|
|
235
|
+
* @returns Promise<any[]> - Array of active plugin records
|
|
236
|
+
*/
|
|
237
|
+
declare function getActivePlugins(db: D1Database$1): Promise<any[]>;
|
|
238
|
+
|
|
173
239
|
/**
|
|
174
240
|
* Middleware Module Exports
|
|
175
241
|
*
|
|
@@ -195,9 +261,5 @@ declare const PermissionManager: any;
|
|
|
195
261
|
declare const requirePermission: any;
|
|
196
262
|
declare const requireAnyPermission: any;
|
|
197
263
|
declare const logActivity: any;
|
|
198
|
-
declare const requireActivePlugin: any;
|
|
199
|
-
declare const requireActivePlugins: any;
|
|
200
|
-
declare const getActivePlugins: any;
|
|
201
|
-
declare const isPluginActive: any;
|
|
202
264
|
|
|
203
265
|
export { AuthManager, type Permission, PermissionManager, type UserPermissions, bootstrapMiddleware, cacheHeaders, compressionMiddleware, csrfProtection, detailedLoggingMiddleware, generateCsrfToken, getActivePlugins, getJwtExpirySeconds, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, isPluginActive, logActivity, loggingMiddleware, metricsMiddleware, optionalAuth, performanceLoggingMiddleware, rateLimit, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeadersMiddleware as securityHeaders, securityLoggingMiddleware, validateCsrfToken, verifySecurityConfig };
|
package/dist/middleware.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export { AuthManager, PermissionManager, bootstrapMiddleware, cacheHeaders, compressionMiddleware, csrfProtection, detailedLoggingMiddleware, generateCsrfToken, getActivePlugins, getJwtExpirySeconds, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, isPluginActive, logActivity, loggingMiddleware, metricsMiddleware, optionalAuth, performanceLoggingMiddleware, rateLimit, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeadersMiddleware as securityHeaders, securityLoggingMiddleware, validateCsrfToken, verifySecurityConfig } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { AuthManager, PermissionManager, bootstrapMiddleware, cacheHeaders, compressionMiddleware, csrfProtection, detailedLoggingMiddleware, generateCsrfToken, getActivePlugins, getJwtExpirySeconds, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, isPluginActive, logActivity, loggingMiddleware, metricsMiddleware, optionalAuth, performanceLoggingMiddleware, rateLimit, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeadersMiddleware as securityHeaders, securityLoggingMiddleware, validateCsrfToken, verifySecurityConfig } from './chunk-RZ6H7OZK.js';
|
|
2
|
+
import './chunk-BLMTL57B.js';
|
|
3
|
+
import './chunk-GCDZZNIN.js';
|
|
4
|
+
import './chunk-ZGGXCFR6.js';
|
|
5
|
+
import './chunk-NLJVSER2.js';
|
|
6
|
+
import './chunk-RNZFGN4R.js';
|
|
4
7
|
import './chunk-FICTAGD4.js';
|
|
8
|
+
import './chunk-TQABQWOP.js';
|
|
5
9
|
import './chunk-V4OQ3NZ2.js';
|
|
6
10
|
//# sourceMappingURL=middleware.js.map
|
|
7
11
|
//# sourceMappingURL=middleware.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkDSA4UX5B_cjs = require('./chunk-DSA4UX5B.cjs');
|
|
4
|
+
require('./chunk-IGJUBJBW.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "MigrationService", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkDSA4UX5B_cjs.MigrationService; }
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=migrations-NJJWQUKK.cjs.map
|
|
13
|
+
//# sourceMappingURL=migrations-NJJWQUKK.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"migrations-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"migrations-NJJWQUKK.cjs"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"migrations-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"migrations-WCAVBD7C.js"}
|