@sonicjs-cms/core 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{app-Db0AfT5F.d.cts → app-DV27cjPy.d.cts} +1 -1
- package/dist/{app-Db0AfT5F.d.ts → app-DV27cjPy.d.ts} +1 -1
- package/dist/{chunk-YIXSSJWD.cjs → chunk-63K7XXRX.cjs} +5 -5
- package/dist/{chunk-YIXSSJWD.cjs.map → chunk-63K7XXRX.cjs.map} +1 -1
- package/dist/{chunk-VNCYCH3H.js → chunk-7DL5SPPX.js} +59 -5
- package/dist/chunk-7DL5SPPX.js.map +1 -0
- package/dist/{chunk-AZLU3ROK.cjs → chunk-BZC4FYW7.cjs} +4 -4
- package/dist/chunk-BZC4FYW7.cjs.map +1 -0
- package/dist/chunk-CLIH2T74.js +403 -0
- package/dist/chunk-CLIH2T74.js.map +1 -0
- package/dist/{chunk-D2NLCPO2.js → chunk-EVZOVYLO.js} +53 -2
- package/dist/chunk-EVZOVYLO.js.map +1 -0
- package/dist/{chunk-DXM575E2.js → chunk-EYWR6UA2.js} +6 -6
- package/dist/chunk-EYWR6UA2.js.map +1 -0
- package/dist/{chunk-CPXAVWCU.js → chunk-F332TENF.js} +278 -3
- package/dist/chunk-F332TENF.js.map +1 -0
- package/dist/{chunk-FT6NBHNX.js → chunk-F6GZURXJ.js} +2536 -600
- package/dist/chunk-F6GZURXJ.js.map +1 -0
- package/dist/{chunk-2MI3LZFH.cjs → chunk-IIRVZSP2.cjs} +53 -2
- package/dist/chunk-IIRVZSP2.cjs.map +1 -0
- package/dist/{chunk-V5LBQN3I.js → chunk-KA2PDJNB.js} +4 -4
- package/dist/chunk-KA2PDJNB.js.map +1 -0
- package/dist/{chunk-AVPUX57O.js → chunk-KAOWRIFD.js} +3 -3
- package/dist/{chunk-AVPUX57O.js.map → chunk-KAOWRIFD.js.map} +1 -1
- package/dist/{chunk-ILZ3DP4I.cjs → chunk-MPT5PA6U.cjs} +24 -2
- package/dist/chunk-MPT5PA6U.cjs.map +1 -0
- package/dist/{chunk-A4SVOGG6.cjs → chunk-N7TDLOUE.cjs} +2696 -762
- package/dist/chunk-N7TDLOUE.cjs.map +1 -0
- package/dist/{chunk-7I5INVNR.cjs → chunk-T3YIKW2A.cjs} +9 -9
- package/dist/chunk-T3YIKW2A.cjs.map +1 -0
- package/dist/{chunk-DTLB6UIH.cjs → chunk-Y72M3MVX.cjs} +280 -2
- package/dist/chunk-Y72M3MVX.cjs.map +1 -0
- package/dist/{chunk-SGAG6FD3.js → chunk-YFJJU26H.js} +24 -2
- package/dist/chunk-YFJJU26H.js.map +1 -0
- package/dist/chunk-YHW27CBV.cjs +406 -0
- package/dist/chunk-YHW27CBV.cjs.map +1 -0
- package/dist/{chunk-FYEDK7K7.cjs → chunk-YMTTGHEK.cjs} +61 -4
- package/dist/chunk-YMTTGHEK.cjs.map +1 -0
- package/dist/{collection-config-FLlGtsh9.d.cts → collection-config-BF95LgQb.d.cts} +10 -2
- package/dist/{collection-config-FLlGtsh9.d.ts → collection-config-BF95LgQb.d.ts} +10 -2
- package/dist/index.cjs +2001 -142
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +504 -9
- package/dist/index.d.ts +504 -9
- package/dist/index.js +1893 -41
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +24 -24
- package/dist/middleware.d.cts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.js +3 -3
- package/dist/migrations-QNYAWQLB.cjs +13 -0
- package/dist/{migrations-32QAYLWJ.cjs.map → migrations-QNYAWQLB.cjs.map} +1 -1
- package/dist/migrations-R6NQBKQV.js +4 -0
- package/dist/{migrations-57ZHBQ4X.js.map → migrations-R6NQBKQV.js.map} +1 -1
- package/dist/{plugin-bootstrap-CDh0JHtW.d.ts → plugin-bootstrap-CB-xaBfK.d.ts} +2 -2
- package/dist/{plugin-bootstrap-C0E3jdz-.d.cts → plugin-bootstrap-U-cw9jn3.d.cts} +2 -2
- package/dist/plugin-manager-Baa6xXqB.d.ts +328 -0
- package/dist/plugin-manager-vBal9Zip.d.cts +328 -0
- package/dist/plugins.cjs +20 -7
- package/dist/plugins.d.cts +53 -310
- package/dist/plugins.d.ts +53 -310
- package/dist/plugins.js +2 -1
- package/dist/routes.cjs +27 -26
- package/dist/routes.d.cts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +7 -6
- package/dist/services.cjs +16 -16
- package/dist/services.d.cts +2 -2
- package/dist/services.d.ts +2 -2
- package/dist/services.js +2 -2
- package/dist/templates.cjs +17 -17
- package/dist/templates.js +2 -2
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils.cjs +23 -11
- package/dist/utils.d.cts +38 -1
- package/dist/utils.d.ts +38 -1
- package/dist/utils.js +1 -1
- package/migrations/027_fix_slug_field_type.sql +18 -0
- package/migrations/028_fix_slug_field_type_in_schemas.sql +30 -0
- package/migrations/029_ai_search_plugin.sql +45 -0
- package/package.json +5 -2
- package/dist/chunk-2MI3LZFH.cjs.map +0 -1
- package/dist/chunk-7I5INVNR.cjs.map +0 -1
- package/dist/chunk-A4SVOGG6.cjs.map +0 -1
- package/dist/chunk-AZLU3ROK.cjs.map +0 -1
- package/dist/chunk-CPXAVWCU.js.map +0 -1
- package/dist/chunk-D2NLCPO2.js.map +0 -1
- package/dist/chunk-DTLB6UIH.cjs.map +0 -1
- package/dist/chunk-DXM575E2.js.map +0 -1
- package/dist/chunk-FT6NBHNX.js.map +0 -1
- package/dist/chunk-FYEDK7K7.cjs.map +0 -1
- package/dist/chunk-ILZ3DP4I.cjs.map +0 -1
- package/dist/chunk-SGAG6FD3.js.map +0 -1
- package/dist/chunk-V5LBQN3I.js.map +0 -1
- package/dist/chunk-VNCYCH3H.js.map +0 -1
- package/dist/migrations-32QAYLWJ.cjs +0 -13
- package/dist/migrations-57ZHBQ4X.js +0 -4
package/dist/services.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { CACHE_CONFIGS, CacheService, Logger, SettingsService, TelemetryService, createInstallationIdentity, getCacheService, getLogger, getTelemetryService, initLogger, initTelemetry } from './chunk-3YNNVSMC.js';
|
|
2
|
-
export { PluginBootstrapService, PluginService, cleanupRemovedCollections, fullCollectionSync, getAvailableCollectionNames, getManagedCollections, isCollectionManaged, loadCollectionConfig, loadCollectionConfigs, registerCollections, syncCollection, syncCollections, validateCollectionConfig } from './chunk-
|
|
3
|
-
export { MigrationService } from './chunk-
|
|
2
|
+
export { PluginBootstrapService, PluginService, cleanupRemovedCollections, fullCollectionSync, getAvailableCollectionNames, getManagedCollections, isCollectionManaged, loadCollectionConfig, loadCollectionConfigs, registerCollections, syncCollection, syncCollections, validateCollectionConfig } from './chunk-YFJJU26H.js';
|
|
3
|
+
export { MigrationService } from './chunk-EVZOVYLO.js';
|
|
4
4
|
import './chunk-X7ZAEI5S.js';
|
|
5
5
|
import './chunk-V4OQ3NZ2.js';
|
|
6
6
|
//# sourceMappingURL=services.js.map
|
package/dist/templates.cjs
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk63K7XXRX_cjs = require('./chunk-63K7XXRX.cjs');
|
|
4
|
+
var chunkBZC4FYW7_cjs = require('./chunk-BZC4FYW7.cjs');
|
|
5
5
|
require('./chunk-IGJUBJBW.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "renderFilterBar", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunk63K7XXRX_cjs.renderFilterBar; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "getConfirmationDialogScript", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkBZC4FYW7_cjs.getConfirmationDialogScript; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "renderAdminLayout", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkBZC4FYW7_cjs.renderAdminLayout; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "renderAdminLayoutCatalyst", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkBZC4FYW7_cjs.renderAdminLayoutCatalyst; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "renderAlert", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkBZC4FYW7_cjs.renderAlert; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "renderCheckboxPage", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkBZC4FYW7_cjs.renderCheckboxPage; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "renderCodeExamplesList", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkBZC4FYW7_cjs.renderCodeExamplesList; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "renderConfirmationDialog", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkBZC4FYW7_cjs.renderConfirmationDialog; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "renderDesignPage", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkBZC4FYW7_cjs.renderDesignPage; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "renderForm", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkBZC4FYW7_cjs.renderForm; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "renderFormField", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkBZC4FYW7_cjs.renderFormField; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "renderLogo", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkBZC4FYW7_cjs.renderLogo; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "renderPagination", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkBZC4FYW7_cjs.renderPagination; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "renderTable", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkBZC4FYW7_cjs.renderTable; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "renderTestimonialsList", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunkBZC4FYW7_cjs.renderTestimonialsList; }
|
|
68
68
|
});
|
|
69
69
|
//# sourceMappingURL=templates.cjs.map
|
|
70
70
|
//# sourceMappingURL=templates.cjs.map
|
package/dist/templates.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { renderFilterBar } from './chunk-
|
|
2
|
-
export { getConfirmationDialogScript, renderAdminLayout, renderAdminLayoutCatalyst, renderAlert, renderCheckboxPage, renderCodeExamplesList, renderConfirmationDialog, renderDesignPage, renderForm, renderFormField, renderLogo, renderPagination, renderTable, renderTestimonialsList } from './chunk-
|
|
1
|
+
export { renderFilterBar } from './chunk-KAOWRIFD.js';
|
|
2
|
+
export { getConfirmationDialogScript, renderAdminLayout, renderAdminLayoutCatalyst, renderAlert, renderCheckboxPage, renderCodeExamplesList, renderConfirmationDialog, renderDesignPage, renderForm, renderFormField, renderLogo, renderPagination, renderTable, renderTestimonialsList } from './chunk-KA2PDJNB.js';
|
|
3
3
|
import './chunk-V4OQ3NZ2.js';
|
|
4
4
|
//# sourceMappingURL=templates.js.map
|
|
5
5
|
//# sourceMappingURL=templates.js.map
|
package/dist/types.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as
|
|
1
|
+
export { B as BlockDefinition, b as BlockDefinitions, c as CollectionConfig, d as CollectionConfigModule, C as CollectionSchema, e as CollectionSyncResult, a as FieldConfig, F as FieldType } from './collection-config-BF95LgQb.cjs';
|
|
2
2
|
export { A as AuthService, C as ContentService, v as HOOKS, k as HookContext, H as HookHandler, u as HookName, l as HookSystem, p as MediaService, M as ModelRelationship, P as Plugin, g as PluginAdminPage, r as PluginBuilderOptions, h as PluginComponent, b as PluginConfig, a as PluginContext, j as PluginHook, q as PluginLogger, n as PluginManager, i as PluginMenuItem, d as PluginMiddleware, e as PluginModel, m as PluginRegistry, c as PluginRoutes, f as PluginService, o as PluginStatus, t as PluginValidationResult, s as PluginValidator, S as ScopedHookSystem } from './plugin-zvZpaiP5.cjs';
|
|
3
3
|
export { P as PluginManifest } from './plugin-manifest-Dpy8wxIB.cjs';
|
|
4
4
|
export { b as TelemetryConfig, T as TelemetryEvent, c as TelemetryIdentity, a as TelemetryProperties } from './telemetry-UiD1i9GS.cjs';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as
|
|
1
|
+
export { B as BlockDefinition, b as BlockDefinitions, c as CollectionConfig, d as CollectionConfigModule, C as CollectionSchema, e as CollectionSyncResult, a as FieldConfig, F as FieldType } from './collection-config-BF95LgQb.js';
|
|
2
2
|
export { A as AuthService, C as ContentService, v as HOOKS, k as HookContext, H as HookHandler, u as HookName, l as HookSystem, p as MediaService, M as ModelRelationship, P as Plugin, g as PluginAdminPage, r as PluginBuilderOptions, h as PluginComponent, b as PluginConfig, a as PluginContext, j as PluginHook, q as PluginLogger, n as PluginManager, i as PluginMenuItem, d as PluginMiddleware, e as PluginModel, m as PluginRegistry, c as PluginRoutes, f as PluginService, o as PluginStatus, t as PluginValidationResult, s as PluginValidator, S as ScopedHookSystem } from './plugin-zvZpaiP5.js';
|
|
3
3
|
export { P as PluginManifest } from './plugin-manifest-Dpy8wxIB.js';
|
|
4
4
|
export { b as TelemetryConfig, T as TelemetryEvent, c as TelemetryIdentity, a as TelemetryProperties } from './telemetry-UiD1i9GS.js';
|
package/dist/utils.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYMTTGHEK_cjs = require('./chunk-YMTTGHEK.cjs');
|
|
4
4
|
var chunkP3XDZL6Q_cjs = require('./chunk-P3XDZL6Q.cjs');
|
|
5
5
|
var chunkRCQ2HIQD_cjs = require('./chunk-RCQ2HIQD.cjs');
|
|
6
6
|
require('./chunk-IGJUBJBW.cjs');
|
|
@@ -9,43 +9,55 @@ require('./chunk-IGJUBJBW.cjs');
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "QueryFilterBuilder", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkYMTTGHEK_cjs.QueryFilterBuilder; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "SONICJS_VERSION", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkYMTTGHEK_cjs.SONICJS_VERSION; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "TemplateRenderer", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkYMTTGHEK_cjs.TemplateRenderer; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "buildQuery", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkYMTTGHEK_cjs.buildQuery; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "escapeHtml", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkYMTTGHEK_cjs.escapeHtml; }
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "generateSlug", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return chunkYMTTGHEK_cjs.generateSlug; }
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "getBlocksFieldConfig", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () { return chunkYMTTGHEK_cjs.getBlocksFieldConfig; }
|
|
29
37
|
});
|
|
30
38
|
Object.defineProperty(exports, "getCoreVersion", {
|
|
31
39
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkYMTTGHEK_cjs.getCoreVersion; }
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "parseBlocksValue", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () { return chunkYMTTGHEK_cjs.parseBlocksValue; }
|
|
33
45
|
});
|
|
34
46
|
Object.defineProperty(exports, "renderTemplate", {
|
|
35
47
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunkYMTTGHEK_cjs.renderTemplate; }
|
|
37
49
|
});
|
|
38
50
|
Object.defineProperty(exports, "sanitizeInput", {
|
|
39
51
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunkYMTTGHEK_cjs.sanitizeInput; }
|
|
41
53
|
});
|
|
42
54
|
Object.defineProperty(exports, "sanitizeObject", {
|
|
43
55
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkYMTTGHEK_cjs.sanitizeObject; }
|
|
45
57
|
});
|
|
46
58
|
Object.defineProperty(exports, "templateRenderer", {
|
|
47
59
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkYMTTGHEK_cjs.templateRenderer; }
|
|
49
61
|
});
|
|
50
62
|
Object.defineProperty(exports, "generateInstallationId", {
|
|
51
63
|
enumerable: true,
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
export { c as FilterCondition, d as FilterGroup, F as FilterOperator, f as QueryFilter, Q as QueryFilterBuilder, h as QueryResult, S as SONICJS_VERSION, T as TemplateRenderer, b as buildQuery, e as escapeHtml, g as getCoreVersion, m as metricsTracker, r as renderTemplate, s as sanitizeInput, a as sanitizeObject, t as templateRenderer } from './version-vktVAxhe.cjs';
|
|
2
2
|
import { b as TelemetryConfig } from './telemetry-UiD1i9GS.cjs';
|
|
3
|
+
import { b as BlockDefinitions } from './collection-config-BF95LgQb.cjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Slug generation utilities for creating URL-friendly slugs
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Generate URL-friendly slug from text
|
|
10
|
+
*
|
|
11
|
+
* Features:
|
|
12
|
+
* - Converts to lowercase
|
|
13
|
+
* - Handles accented characters (NFD normalization)
|
|
14
|
+
* - Removes diacritics
|
|
15
|
+
* - Keeps only alphanumeric, spaces, underscores, and hyphens
|
|
16
|
+
* - Replaces spaces with hyphens
|
|
17
|
+
* - Collapses multiple hyphens/underscores
|
|
18
|
+
* - Trims leading/trailing hyphens/underscores
|
|
19
|
+
* - Limits length to 100 characters
|
|
20
|
+
*
|
|
21
|
+
* @param text - Text to slugify
|
|
22
|
+
* @returns URL-safe slug
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* generateSlug('Hello World!') // 'hello-world'
|
|
26
|
+
* generateSlug('Café París 2024') // 'cafe-paris-2024'
|
|
27
|
+
* generateSlug('Multiple Spaces') // 'multiple-spaces'
|
|
28
|
+
*/
|
|
29
|
+
declare function generateSlug(text: string): string;
|
|
3
30
|
|
|
4
31
|
/**
|
|
5
32
|
* Telemetry ID Utilities
|
|
@@ -50,4 +77,14 @@ declare function getTelemetryConfig(): TelemetryConfig;
|
|
|
50
77
|
*/
|
|
51
78
|
declare function shouldSkipEvent(eventName: string, sampleRate?: number): boolean;
|
|
52
79
|
|
|
53
|
-
|
|
80
|
+
type BlocksFieldConfig = {
|
|
81
|
+
blocks: BlockDefinitions;
|
|
82
|
+
discriminator: string;
|
|
83
|
+
};
|
|
84
|
+
declare function getBlocksFieldConfig(fieldOptions: any): BlocksFieldConfig | null;
|
|
85
|
+
declare function parseBlocksValue(value: unknown, config: BlocksFieldConfig): {
|
|
86
|
+
value: any[];
|
|
87
|
+
errors: string[];
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export { generateInstallationId, generateProjectId, generateSlug, getBlocksFieldConfig, getDefaultTelemetryConfig, getTelemetryConfig, isTelemetryEnabled, parseBlocksValue, sanitizeErrorMessage, sanitizeRoute, shouldSkipEvent };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
export { c as FilterCondition, d as FilterGroup, F as FilterOperator, f as QueryFilter, Q as QueryFilterBuilder, h as QueryResult, S as SONICJS_VERSION, T as TemplateRenderer, b as buildQuery, e as escapeHtml, g as getCoreVersion, m as metricsTracker, r as renderTemplate, s as sanitizeInput, a as sanitizeObject, t as templateRenderer } from './version-vktVAxhe.js';
|
|
2
2
|
import { b as TelemetryConfig } from './telemetry-UiD1i9GS.js';
|
|
3
|
+
import { b as BlockDefinitions } from './collection-config-BF95LgQb.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Slug generation utilities for creating URL-friendly slugs
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Generate URL-friendly slug from text
|
|
10
|
+
*
|
|
11
|
+
* Features:
|
|
12
|
+
* - Converts to lowercase
|
|
13
|
+
* - Handles accented characters (NFD normalization)
|
|
14
|
+
* - Removes diacritics
|
|
15
|
+
* - Keeps only alphanumeric, spaces, underscores, and hyphens
|
|
16
|
+
* - Replaces spaces with hyphens
|
|
17
|
+
* - Collapses multiple hyphens/underscores
|
|
18
|
+
* - Trims leading/trailing hyphens/underscores
|
|
19
|
+
* - Limits length to 100 characters
|
|
20
|
+
*
|
|
21
|
+
* @param text - Text to slugify
|
|
22
|
+
* @returns URL-safe slug
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* generateSlug('Hello World!') // 'hello-world'
|
|
26
|
+
* generateSlug('Café París 2024') // 'cafe-paris-2024'
|
|
27
|
+
* generateSlug('Multiple Spaces') // 'multiple-spaces'
|
|
28
|
+
*/
|
|
29
|
+
declare function generateSlug(text: string): string;
|
|
3
30
|
|
|
4
31
|
/**
|
|
5
32
|
* Telemetry ID Utilities
|
|
@@ -50,4 +77,14 @@ declare function getTelemetryConfig(): TelemetryConfig;
|
|
|
50
77
|
*/
|
|
51
78
|
declare function shouldSkipEvent(eventName: string, sampleRate?: number): boolean;
|
|
52
79
|
|
|
53
|
-
|
|
80
|
+
type BlocksFieldConfig = {
|
|
81
|
+
blocks: BlockDefinitions;
|
|
82
|
+
discriminator: string;
|
|
83
|
+
};
|
|
84
|
+
declare function getBlocksFieldConfig(fieldOptions: any): BlocksFieldConfig | null;
|
|
85
|
+
declare function parseBlocksValue(value: unknown, config: BlocksFieldConfig): {
|
|
86
|
+
value: any[];
|
|
87
|
+
errors: string[];
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export { generateInstallationId, generateProjectId, generateSlug, getBlocksFieldConfig, getDefaultTelemetryConfig, getTelemetryConfig, isTelemetryEnabled, parseBlocksValue, sanitizeErrorMessage, sanitizeRoute, shouldSkipEvent };
|
package/dist/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { QueryFilterBuilder, SONICJS_VERSION, TemplateRenderer, buildQuery, escapeHtml, getCoreVersion, renderTemplate, sanitizeInput, sanitizeObject, templateRenderer } from './chunk-
|
|
1
|
+
export { QueryFilterBuilder, SONICJS_VERSION, TemplateRenderer, buildQuery, escapeHtml, generateSlug, getBlocksFieldConfig, getCoreVersion, parseBlocksValue, renderTemplate, sanitizeInput, sanitizeObject, templateRenderer } from './chunk-7DL5SPPX.js';
|
|
2
2
|
export { generateInstallationId, generateProjectId, getDefaultTelemetryConfig, getTelemetryConfig, isTelemetryEnabled, sanitizeErrorMessage, sanitizeRoute, shouldSkipEvent } from './chunk-X7ZAEI5S.js';
|
|
3
3
|
export { metricsTracker } from './chunk-FICTAGD4.js';
|
|
4
4
|
import './chunk-V4OQ3NZ2.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
-- Migration: Fix slug field type
|
|
2
|
+
-- Description: Update slug fields to use 'slug' field type instead of 'text' for proper auto-generation
|
|
3
|
+
-- Created: 2026-01-10
|
|
4
|
+
|
|
5
|
+
-- Update pages collection slug field to use 'slug' field type
|
|
6
|
+
UPDATE content_fields
|
|
7
|
+
SET field_type = 'slug'
|
|
8
|
+
WHERE field_name = 'slug' AND collection_id = 'pages-collection';
|
|
9
|
+
|
|
10
|
+
-- Update blog posts slug field if it exists
|
|
11
|
+
UPDATE content_fields
|
|
12
|
+
SET field_type = 'slug'
|
|
13
|
+
WHERE field_name = 'slug' AND collection_id = 'blog-posts-collection';
|
|
14
|
+
|
|
15
|
+
-- Update news slug field if it exists
|
|
16
|
+
UPDATE content_fields
|
|
17
|
+
SET field_type = 'slug'
|
|
18
|
+
WHERE field_name = 'slug' AND collection_id = 'news-collection';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
-- Migration: Fix slug field type in collection schemas
|
|
2
|
+
-- Description: Update slug fields in collection schemas to use 'slug' type instead of 'string'
|
|
3
|
+
-- Created: 2026-01-10
|
|
4
|
+
|
|
5
|
+
-- Update pages-collection schema
|
|
6
|
+
UPDATE collections
|
|
7
|
+
SET schema = REPLACE(
|
|
8
|
+
schema,
|
|
9
|
+
'"slug":{"type":"string"',
|
|
10
|
+
'"slug":{"type":"slug"'
|
|
11
|
+
)
|
|
12
|
+
WHERE id = 'pages-collection' AND schema LIKE '%"slug":{"type":"string"%';
|
|
13
|
+
|
|
14
|
+
-- Update blog-posts-collection schema if it exists
|
|
15
|
+
UPDATE collections
|
|
16
|
+
SET schema = REPLACE(
|
|
17
|
+
schema,
|
|
18
|
+
'"slug":{"type":"string"',
|
|
19
|
+
'"slug":{"type":"slug"'
|
|
20
|
+
)
|
|
21
|
+
WHERE id = 'blog-posts-collection' AND schema LIKE '%"slug":{"type":"string"%';
|
|
22
|
+
|
|
23
|
+
-- Update news-collection schema if it exists
|
|
24
|
+
UPDATE collections
|
|
25
|
+
SET schema = REPLACE(
|
|
26
|
+
schema,
|
|
27
|
+
'"slug":{"type":"string"',
|
|
28
|
+
'"slug":{"type":"slug"'
|
|
29
|
+
)
|
|
30
|
+
WHERE id = 'news-collection' AND schema LIKE '%"slug":{"type":"string"%';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
-- AI Search plugin settings
|
|
2
|
+
CREATE TABLE IF NOT EXISTS ai_search_settings (
|
|
3
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
4
|
+
enabled BOOLEAN DEFAULT 0,
|
|
5
|
+
ai_mode_enabled BOOLEAN DEFAULT 1,
|
|
6
|
+
selected_collections TEXT, -- JSON array of collection IDs to index
|
|
7
|
+
dismissed_collections TEXT, -- JSON array of collection IDs user chose not to index
|
|
8
|
+
autocomplete_enabled BOOLEAN DEFAULT 1,
|
|
9
|
+
cache_duration INTEGER DEFAULT 1, -- hours
|
|
10
|
+
results_limit INTEGER DEFAULT 20,
|
|
11
|
+
index_media BOOLEAN DEFAULT 0,
|
|
12
|
+
index_status TEXT, -- JSON object with status per collection
|
|
13
|
+
last_indexed_at INTEGER,
|
|
14
|
+
created_at INTEGER DEFAULT (strftime('%s', 'now') * 1000),
|
|
15
|
+
updated_at INTEGER DEFAULT (strftime('%s', 'now') * 1000)
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
-- Search history/analytics
|
|
19
|
+
CREATE TABLE IF NOT EXISTS ai_search_history (
|
|
20
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
21
|
+
query TEXT NOT NULL,
|
|
22
|
+
mode TEXT, -- 'ai' or 'keyword'
|
|
23
|
+
results_count INTEGER,
|
|
24
|
+
user_id INTEGER,
|
|
25
|
+
created_at INTEGER DEFAULT (strftime('%s', 'now') * 1000)
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
-- Index metadata tracking (per collection)
|
|
29
|
+
CREATE TABLE IF NOT EXISTS ai_search_index_meta (
|
|
30
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
31
|
+
collection_id INTEGER NOT NULL,
|
|
32
|
+
collection_name TEXT NOT NULL, -- Cache collection name for display
|
|
33
|
+
total_items INTEGER DEFAULT 0,
|
|
34
|
+
indexed_items INTEGER DEFAULT 0,
|
|
35
|
+
last_sync_at INTEGER,
|
|
36
|
+
status TEXT DEFAULT 'pending', -- 'pending', 'indexing', 'completed', 'error'
|
|
37
|
+
error_message TEXT,
|
|
38
|
+
UNIQUE(collection_id)
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
-- Indexes for performance
|
|
42
|
+
CREATE INDEX IF NOT EXISTS idx_ai_search_history_created_at ON ai_search_history(created_at);
|
|
43
|
+
CREATE INDEX IF NOT EXISTS idx_ai_search_history_mode ON ai_search_history(mode);
|
|
44
|
+
CREATE INDEX IF NOT EXISTS idx_ai_search_index_meta_collection_id ON ai_search_index_meta(collection_id);
|
|
45
|
+
CREATE INDEX IF NOT EXISTS idx_ai_search_index_meta_status ON ai_search_index_meta(status);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonicjs-cms/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Core framework for SonicJS headless CMS - Edge-first, TypeScript-native CMS built for Cloudflare Workers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"lint": "eslint src/",
|
|
69
69
|
"lint:fix": "eslint src/ --fix",
|
|
70
70
|
"test": "vitest --run",
|
|
71
|
+
"test:cov": "vitest --run --coverage",
|
|
71
72
|
"test:watch": "vitest",
|
|
72
73
|
"prepublishOnly": "npm run build"
|
|
73
74
|
},
|
|
@@ -107,13 +108,15 @@
|
|
|
107
108
|
"semver": "^7.7.3"
|
|
108
109
|
},
|
|
109
110
|
"devDependencies": {
|
|
111
|
+
"@vitest/coverage-v8": "^4.0.5",
|
|
110
112
|
"@cloudflare/workers-types": "^4.20251014.0",
|
|
111
113
|
"@types/node": "^24.9.2",
|
|
112
114
|
"@typescript-eslint/eslint-plugin": "^8.50.0",
|
|
113
115
|
"@typescript-eslint/parser": "^8.50.0",
|
|
114
116
|
"drizzle-orm": "^0.44.7",
|
|
115
117
|
"eslint": "^9.39.2",
|
|
116
|
-
"
|
|
118
|
+
"glob": "^10.5.0",
|
|
119
|
+
"hono": "^4.11.4",
|
|
117
120
|
"tsup": "^8.5.0",
|
|
118
121
|
"typescript": "^5.9.3",
|
|
119
122
|
"vitest": "^4.0.5",
|