@sonicjs-cms/core 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +75 -1
  2. package/dist/app-Db0AfT5F.d.cts +100 -0
  3. package/dist/app-Db0AfT5F.d.ts +100 -0
  4. package/dist/{chunk-KZ5XDGE6.js → chunk-3ZLCMOCM.js} +441 -433
  5. package/dist/chunk-3ZLCMOCM.js.map +1 -0
  6. package/dist/{chunk-K5JZ4JI3.js → chunk-4C433FET.js} +5 -3
  7. package/dist/chunk-4C433FET.js.map +1 -0
  8. package/dist/{chunk-UJ4K4B23.js → chunk-5TRX2JHU.js} +4 -4
  9. package/dist/{chunk-UJ4K4B23.js.map → chunk-5TRX2JHU.js.map} +1 -1
  10. package/dist/{chunk-LWMMMW43.js → chunk-7CXL5K7N.js} +4 -3
  11. package/dist/chunk-7CXL5K7N.js.map +1 -0
  12. package/dist/{chunk-WBX5YMTB.cjs → chunk-7KCDFDRI.cjs} +27 -15
  13. package/dist/chunk-7KCDFDRI.cjs.map +1 -0
  14. package/dist/chunk-CAMM3MJV.js +1550 -0
  15. package/dist/chunk-CAMM3MJV.js.map +1 -0
  16. package/dist/{chunk-HKEK7UNV.js → chunk-CPXAVWCU.js} +3 -3
  17. package/dist/{chunk-HKEK7UNV.js.map → chunk-CPXAVWCU.js.map} +1 -1
  18. package/dist/{chunk-F5ESJXI2.cjs → chunk-DTLB6UIH.cjs} +3 -3
  19. package/dist/{chunk-F5ESJXI2.cjs.map → chunk-DTLB6UIH.cjs.map} +1 -1
  20. package/dist/{chunk-YP52USGX.cjs → chunk-ES3BRZQJ.cjs} +15 -12
  21. package/dist/{chunk-YP52USGX.cjs.map → chunk-ES3BRZQJ.cjs.map} +1 -1
  22. package/dist/chunk-HBJU3I2Y.cjs +1552 -0
  23. package/dist/chunk-HBJU3I2Y.cjs.map +1 -0
  24. package/dist/{chunk-7EGKU7OO.cjs → chunk-KP4DVEX5.cjs} +7 -7
  25. package/dist/{chunk-7EGKU7OO.cjs.map → chunk-KP4DVEX5.cjs.map} +1 -1
  26. package/dist/{chunk-LPM3NPAX.cjs → chunk-MPFSSBIY.cjs} +541 -533
  27. package/dist/chunk-MPFSSBIY.cjs.map +1 -0
  28. package/dist/{chunk-22EFGHAX.cjs → chunk-NAYD76QF.cjs} +4 -3
  29. package/dist/chunk-NAYD76QF.cjs.map +1 -0
  30. package/dist/{chunk-F4K5QAN6.js → chunk-Q52ZQFMB.js} +7 -4
  31. package/dist/{chunk-F4K5QAN6.js.map → chunk-Q52ZQFMB.js.map} +1 -1
  32. package/dist/{chunk-NMVOTNSL.js → chunk-RRKXFGIO.js} +28 -16
  33. package/dist/chunk-RRKXFGIO.js.map +1 -0
  34. package/dist/{chunk-2MBNRFS5.cjs → chunk-TT266RYM.cjs} +5 -3
  35. package/dist/chunk-TT266RYM.cjs.map +1 -0
  36. package/dist/collection-config-FLlGtsh9.d.cts +107 -0
  37. package/dist/collection-config-FLlGtsh9.d.ts +107 -0
  38. package/dist/filter-bar.template-By4jeiw_.d.cts +140 -0
  39. package/dist/filter-bar.template-By4jeiw_.d.ts +140 -0
  40. package/dist/index.cjs +146 -141
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.cts +44 -0
  43. package/dist/index.d.ts +43 -5
  44. package/dist/index.js +19 -14
  45. package/dist/index.js.map +1 -1
  46. package/dist/middleware.cjs +24 -24
  47. package/dist/middleware.d.cts +89 -0
  48. package/dist/middleware.d.ts +89 -2
  49. package/dist/middleware.js +3 -3
  50. package/dist/migrations-B2CDNN76.js +4 -0
  51. package/dist/{migrations-IHERIQVD.js.map → migrations-B2CDNN76.js.map} +1 -1
  52. package/dist/migrations-IBKKBIKR.cjs +13 -0
  53. package/dist/{migrations-POFD5KNG.cjs.map → migrations-IBKKBIKR.cjs.map} +1 -1
  54. package/dist/plugin-bootstrap-C0E3jdz-.d.cts +8339 -0
  55. package/dist/plugin-bootstrap-CDh0JHtW.d.ts +8339 -0
  56. package/dist/plugin-manifest-BCMx9CAq.d.cts +35 -0
  57. package/dist/plugin-manifest-BCMx9CAq.d.ts +35 -0
  58. package/dist/plugin-zvZpaiP5.d.cts +357 -0
  59. package/dist/plugin-zvZpaiP5.d.ts +357 -0
  60. package/dist/plugins.cjs +7 -7
  61. package/dist/plugins.d.cts +330 -0
  62. package/dist/plugins.d.ts +330 -2
  63. package/dist/plugins.js +1 -1
  64. package/dist/routes.cjs +27 -27
  65. package/dist/routes.d.cts +224 -0
  66. package/dist/routes.d.ts +224 -2
  67. package/dist/routes.js +7 -7
  68. package/dist/services.cjs +29 -29
  69. package/dist/services.d.cts +236 -0
  70. package/dist/services.d.ts +236 -2
  71. package/dist/services.js +4 -4
  72. package/dist/telemetry-BFBIjBxK.d.cts +36 -0
  73. package/dist/telemetry-BFBIjBxK.d.ts +36 -0
  74. package/dist/templates.d.cts +133 -0
  75. package/dist/templates.d.ts +133 -2
  76. package/dist/types.d.cts +7 -0
  77. package/dist/types.d.ts +7 -2
  78. package/dist/utils.cjs +23 -23
  79. package/dist/utils.d.cts +53 -0
  80. package/dist/utils.d.ts +53 -2
  81. package/dist/utils.js +2 -2
  82. package/dist/version-vktVAxhe.d.cts +195 -0
  83. package/dist/version-vktVAxhe.d.ts +195 -0
  84. package/migrations/001_initial_schema.sql +1 -1
  85. package/package.json +3 -1
  86. package/dist/chunk-22EFGHAX.cjs.map +0 -1
  87. package/dist/chunk-2MBNRFS5.cjs.map +0 -1
  88. package/dist/chunk-K5JZ4JI3.js.map +0 -1
  89. package/dist/chunk-KZ5XDGE6.js.map +0 -1
  90. package/dist/chunk-LPM3NPAX.cjs.map +0 -1
  91. package/dist/chunk-LWMMMW43.js.map +0 -1
  92. package/dist/chunk-NMVOTNSL.js.map +0 -1
  93. package/dist/chunk-T7IYBGGO.cjs +0 -746
  94. package/dist/chunk-T7IYBGGO.cjs.map +0 -1
  95. package/dist/chunk-WBX5YMTB.cjs.map +0 -1
  96. package/dist/chunk-ZPMFT2JW.js +0 -744
  97. package/dist/chunk-ZPMFT2JW.js.map +0 -1
  98. package/dist/migrations-IHERIQVD.js +0 -4
  99. package/dist/migrations-POFD5KNG.cjs +0 -13
  100. package/migrations/013_code_examples_plugin.sql +0 -177
  101. /package/migrations/{021_add_otp_login.sql → 026_add_otp_login.sql} +0 -0
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Telemetry Types
3
+ *
4
+ * Privacy-first telemetry types for SonicJS
5
+ * No PII (Personally Identifiable Information) is collected
6
+ */
7
+ type TelemetryEvent = 'installation_started' | 'installation_completed' | 'installation_failed' | 'setup_wizard_started' | 'setup_wizard_completed' | 'first_dev_server_start' | 'dev_server_started' | 'dev_server_stopped' | 'admin_login' | 'plugin_activated' | 'plugin_deactivated' | 'collection_created' | 'content_created' | 'page_viewed' | 'feature_used' | 'error_occurred' | 'migration_run' | 'deployment_triggered';
8
+ interface TelemetryProperties {
9
+ os?: 'darwin' | 'linux' | 'win32' | string;
10
+ nodeVersion?: string;
11
+ packageManager?: 'npm' | 'yarn' | 'pnpm' | 'bun';
12
+ installationDuration?: number;
13
+ success?: boolean;
14
+ errorType?: string;
15
+ sessionDuration?: number;
16
+ pluginsCount?: number;
17
+ collectionsCount?: number;
18
+ contentItemsCount?: number;
19
+ route?: string;
20
+ feature?: string;
21
+ migrationType?: 'initial' | 'update' | 'rollback';
22
+ migrationSuccess?: boolean;
23
+ [key: string]: string | number | boolean | undefined;
24
+ }
25
+ interface TelemetryConfig {
26
+ enabled: boolean;
27
+ apiKey?: string;
28
+ host?: string;
29
+ debug?: boolean;
30
+ }
31
+ interface TelemetryIdentity {
32
+ installationId: string;
33
+ projectId?: string;
34
+ }
35
+
36
+ export type { TelemetryEvent as T, TelemetryProperties as a, TelemetryConfig as b, TelemetryIdentity as c };
@@ -0,0 +1,133 @@
1
+ export { A as AlertData, C as ConfirmationDialogOptions, k as Filter, j as FilterBarData, l as FilterOption, h as FormData, F as FormField, P as PaginationData, T as TableColumn, i as TableData, g as getConfirmationDialogScript, d as renderAlert, e as renderConfirmationDialog, f as renderFilterBar, r as renderForm, a as renderFormField, c as renderPagination, b as renderTable } from './filter-bar.template-By4jeiw_.cjs';
2
+ import { HtmlEscapedString } from 'hono/utils/html';
3
+
4
+ interface AdminLayoutData {
5
+ title: string;
6
+ pageTitle?: string;
7
+ currentPath?: string;
8
+ version?: string;
9
+ enableExperimentalFeatures?: boolean;
10
+ user?: {
11
+ name: string;
12
+ email: string;
13
+ role: string;
14
+ };
15
+ scripts?: string[];
16
+ styles?: string[];
17
+ content: string | HtmlEscapedString;
18
+ dynamicMenuItems?: Array<{
19
+ label: string;
20
+ path: string;
21
+ icon: string;
22
+ }>;
23
+ }
24
+ declare function renderAdminLayout(data: AdminLayoutData): string;
25
+
26
+ interface AdminLayoutCatalystData {
27
+ title: string;
28
+ pageTitle?: string;
29
+ currentPath?: string;
30
+ version?: string;
31
+ enableExperimentalFeatures?: boolean;
32
+ user?: {
33
+ name: string;
34
+ email: string;
35
+ role: string;
36
+ };
37
+ scripts?: string[];
38
+ styles?: string[];
39
+ content: string | HtmlEscapedString;
40
+ dynamicMenuItems?: Array<{
41
+ label: string;
42
+ path: string;
43
+ icon: string;
44
+ }>;
45
+ }
46
+ declare function renderAdminLayoutCatalyst(data: AdminLayoutCatalystData): string;
47
+
48
+ interface LogoData {
49
+ size?: 'sm' | 'md' | 'lg' | 'xl';
50
+ variant?: 'default' | 'white' | 'dark';
51
+ showText?: boolean;
52
+ showVersion?: boolean;
53
+ version?: string;
54
+ className?: string;
55
+ href?: string;
56
+ }
57
+ declare function renderLogo(data?: LogoData): string;
58
+
59
+ interface DesignPageData {
60
+ user?: {
61
+ name: string;
62
+ email: string;
63
+ role: string;
64
+ };
65
+ version?: string;
66
+ }
67
+ declare function renderDesignPage(data: DesignPageData): string;
68
+
69
+ interface CheckboxPageData {
70
+ user?: {
71
+ name: string;
72
+ email: string;
73
+ role: string;
74
+ };
75
+ }
76
+ declare function renderCheckboxPage(data: CheckboxPageData): string;
77
+
78
+ interface Testimonial {
79
+ id: number;
80
+ author_name: string;
81
+ author_title?: string;
82
+ author_company?: string;
83
+ testimonial_text: string;
84
+ rating?: number;
85
+ isPublished: boolean;
86
+ sortOrder: number;
87
+ created_at: number;
88
+ updated_at: number;
89
+ }
90
+ interface TestimonialsListData {
91
+ testimonials: Testimonial[];
92
+ totalCount: number;
93
+ currentPage: number;
94
+ totalPages: number;
95
+ user?: {
96
+ name: string;
97
+ email: string;
98
+ role: string;
99
+ };
100
+ message?: string;
101
+ messageType?: 'success' | 'error' | 'warning' | 'info';
102
+ }
103
+ declare function renderTestimonialsList(data: TestimonialsListData): string;
104
+
105
+ interface CodeExample {
106
+ id: number;
107
+ title: string;
108
+ description?: string;
109
+ code: string;
110
+ language: string;
111
+ category?: string;
112
+ tags?: string;
113
+ isPublished: boolean;
114
+ sortOrder: number;
115
+ created_at: number;
116
+ updated_at: number;
117
+ }
118
+ interface CodeExamplesListData {
119
+ codeExamples: CodeExample[];
120
+ totalCount: number;
121
+ currentPage: number;
122
+ totalPages: number;
123
+ user?: {
124
+ name: string;
125
+ email: string;
126
+ role: string;
127
+ };
128
+ message?: string;
129
+ messageType?: 'success' | 'error' | 'warning' | 'info';
130
+ }
131
+ declare function renderCodeExamplesList(data: CodeExamplesListData): string;
132
+
133
+ export { type AdminLayoutCatalystData, type AdminLayoutData, type CheckboxPageData, type DesignPageData, renderAdminLayout, renderAdminLayoutCatalyst, renderCheckboxPage, renderCodeExamplesList, renderDesignPage, renderLogo, renderTestimonialsList };
@@ -1,2 +1,133 @@
1
- // Template exports from core package
2
- export * from '../src/templates/index'
1
+ export { A as AlertData, C as ConfirmationDialogOptions, k as Filter, j as FilterBarData, l as FilterOption, h as FormData, F as FormField, P as PaginationData, T as TableColumn, i as TableData, g as getConfirmationDialogScript, d as renderAlert, e as renderConfirmationDialog, f as renderFilterBar, r as renderForm, a as renderFormField, c as renderPagination, b as renderTable } from './filter-bar.template-By4jeiw_.js';
2
+ import { HtmlEscapedString } from 'hono/utils/html';
3
+
4
+ interface AdminLayoutData {
5
+ title: string;
6
+ pageTitle?: string;
7
+ currentPath?: string;
8
+ version?: string;
9
+ enableExperimentalFeatures?: boolean;
10
+ user?: {
11
+ name: string;
12
+ email: string;
13
+ role: string;
14
+ };
15
+ scripts?: string[];
16
+ styles?: string[];
17
+ content: string | HtmlEscapedString;
18
+ dynamicMenuItems?: Array<{
19
+ label: string;
20
+ path: string;
21
+ icon: string;
22
+ }>;
23
+ }
24
+ declare function renderAdminLayout(data: AdminLayoutData): string;
25
+
26
+ interface AdminLayoutCatalystData {
27
+ title: string;
28
+ pageTitle?: string;
29
+ currentPath?: string;
30
+ version?: string;
31
+ enableExperimentalFeatures?: boolean;
32
+ user?: {
33
+ name: string;
34
+ email: string;
35
+ role: string;
36
+ };
37
+ scripts?: string[];
38
+ styles?: string[];
39
+ content: string | HtmlEscapedString;
40
+ dynamicMenuItems?: Array<{
41
+ label: string;
42
+ path: string;
43
+ icon: string;
44
+ }>;
45
+ }
46
+ declare function renderAdminLayoutCatalyst(data: AdminLayoutCatalystData): string;
47
+
48
+ interface LogoData {
49
+ size?: 'sm' | 'md' | 'lg' | 'xl';
50
+ variant?: 'default' | 'white' | 'dark';
51
+ showText?: boolean;
52
+ showVersion?: boolean;
53
+ version?: string;
54
+ className?: string;
55
+ href?: string;
56
+ }
57
+ declare function renderLogo(data?: LogoData): string;
58
+
59
+ interface DesignPageData {
60
+ user?: {
61
+ name: string;
62
+ email: string;
63
+ role: string;
64
+ };
65
+ version?: string;
66
+ }
67
+ declare function renderDesignPage(data: DesignPageData): string;
68
+
69
+ interface CheckboxPageData {
70
+ user?: {
71
+ name: string;
72
+ email: string;
73
+ role: string;
74
+ };
75
+ }
76
+ declare function renderCheckboxPage(data: CheckboxPageData): string;
77
+
78
+ interface Testimonial {
79
+ id: number;
80
+ author_name: string;
81
+ author_title?: string;
82
+ author_company?: string;
83
+ testimonial_text: string;
84
+ rating?: number;
85
+ isPublished: boolean;
86
+ sortOrder: number;
87
+ created_at: number;
88
+ updated_at: number;
89
+ }
90
+ interface TestimonialsListData {
91
+ testimonials: Testimonial[];
92
+ totalCount: number;
93
+ currentPage: number;
94
+ totalPages: number;
95
+ user?: {
96
+ name: string;
97
+ email: string;
98
+ role: string;
99
+ };
100
+ message?: string;
101
+ messageType?: 'success' | 'error' | 'warning' | 'info';
102
+ }
103
+ declare function renderTestimonialsList(data: TestimonialsListData): string;
104
+
105
+ interface CodeExample {
106
+ id: number;
107
+ title: string;
108
+ description?: string;
109
+ code: string;
110
+ language: string;
111
+ category?: string;
112
+ tags?: string;
113
+ isPublished: boolean;
114
+ sortOrder: number;
115
+ created_at: number;
116
+ updated_at: number;
117
+ }
118
+ interface CodeExamplesListData {
119
+ codeExamples: CodeExample[];
120
+ totalCount: number;
121
+ currentPage: number;
122
+ totalPages: number;
123
+ user?: {
124
+ name: string;
125
+ email: string;
126
+ role: string;
127
+ };
128
+ message?: string;
129
+ messageType?: 'success' | 'error' | 'warning' | 'info';
130
+ }
131
+ declare function renderCodeExamplesList(data: CodeExamplesListData): string;
132
+
133
+ export { type AdminLayoutCatalystData, type AdminLayoutData, type CheckboxPageData, type DesignPageData, renderAdminLayout, renderAdminLayoutCatalyst, renderCheckboxPage, renderCodeExamplesList, renderDesignPage, renderLogo, renderTestimonialsList };
@@ -0,0 +1,7 @@
1
+ export { b as CollectionConfig, c as CollectionConfigModule, C as CollectionSchema, d as CollectionSyncResult, a as FieldConfig, F as FieldType } from './collection-config-FLlGtsh9.cjs';
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
+ export { P as PluginManifest } from './plugin-manifest-BCMx9CAq.cjs';
4
+ export { b as TelemetryConfig, T as TelemetryEvent, c as TelemetryIdentity, a as TelemetryProperties } from './telemetry-BFBIjBxK.cjs';
5
+ import 'hono';
6
+ import 'zod';
7
+ import '@cloudflare/workers-types';
package/dist/types.d.ts CHANGED
@@ -1,2 +1,7 @@
1
- // Type exports from core package
2
- export * from '../src/types/index'
1
+ export { b as CollectionConfig, c as CollectionConfigModule, C as CollectionSchema, d as CollectionSyncResult, a as FieldConfig, F as FieldType } from './collection-config-FLlGtsh9.js';
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
+ export { P as PluginManifest } from './plugin-manifest-BCMx9CAq.js';
4
+ export { b as TelemetryConfig, T as TelemetryEvent, c as TelemetryIdentity, a as TelemetryProperties } from './telemetry-BFBIjBxK.js';
5
+ import 'hono';
6
+ import 'zod';
7
+ import '@cloudflare/workers-types';
package/dist/utils.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunk2MBNRFS5_cjs = require('./chunk-2MBNRFS5.cjs');
4
- var chunkWBX5YMTB_cjs = require('./chunk-WBX5YMTB.cjs');
3
+ var chunkTT266RYM_cjs = require('./chunk-TT266RYM.cjs');
4
+ var chunk7KCDFDRI_cjs = require('./chunk-7KCDFDRI.cjs');
5
5
  var chunkRCQ2HIQD_cjs = require('./chunk-RCQ2HIQD.cjs');
6
6
  require('./chunk-IGJUBJBW.cjs');
7
7
 
@@ -9,75 +9,75 @@ require('./chunk-IGJUBJBW.cjs');
9
9
 
10
10
  Object.defineProperty(exports, "QueryFilterBuilder", {
11
11
  enumerable: true,
12
- get: function () { return chunk2MBNRFS5_cjs.QueryFilterBuilder; }
12
+ get: function () { return chunkTT266RYM_cjs.QueryFilterBuilder; }
13
13
  });
14
14
  Object.defineProperty(exports, "SONICJS_VERSION", {
15
15
  enumerable: true,
16
- get: function () { return chunk2MBNRFS5_cjs.SONICJS_VERSION; }
16
+ get: function () { return chunkTT266RYM_cjs.SONICJS_VERSION; }
17
17
  });
18
18
  Object.defineProperty(exports, "TemplateRenderer", {
19
19
  enumerable: true,
20
- get: function () { return chunk2MBNRFS5_cjs.TemplateRenderer; }
20
+ get: function () { return chunkTT266RYM_cjs.TemplateRenderer; }
21
21
  });
22
22
  Object.defineProperty(exports, "buildQuery", {
23
23
  enumerable: true,
24
- get: function () { return chunk2MBNRFS5_cjs.buildQuery; }
24
+ get: function () { return chunkTT266RYM_cjs.buildQuery; }
25
25
  });
26
26
  Object.defineProperty(exports, "escapeHtml", {
27
27
  enumerable: true,
28
- get: function () { return chunk2MBNRFS5_cjs.escapeHtml; }
28
+ get: function () { return chunkTT266RYM_cjs.escapeHtml; }
29
29
  });
30
30
  Object.defineProperty(exports, "getCoreVersion", {
31
31
  enumerable: true,
32
- get: function () { return chunk2MBNRFS5_cjs.getCoreVersion; }
32
+ get: function () { return chunkTT266RYM_cjs.getCoreVersion; }
33
33
  });
34
34
  Object.defineProperty(exports, "renderTemplate", {
35
35
  enumerable: true,
36
- get: function () { return chunk2MBNRFS5_cjs.renderTemplate; }
36
+ get: function () { return chunkTT266RYM_cjs.renderTemplate; }
37
37
  });
38
38
  Object.defineProperty(exports, "sanitizeInput", {
39
39
  enumerable: true,
40
- get: function () { return chunk2MBNRFS5_cjs.sanitizeInput; }
40
+ get: function () { return chunkTT266RYM_cjs.sanitizeInput; }
41
41
  });
42
42
  Object.defineProperty(exports, "sanitizeObject", {
43
43
  enumerable: true,
44
- get: function () { return chunk2MBNRFS5_cjs.sanitizeObject; }
44
+ get: function () { return chunkTT266RYM_cjs.sanitizeObject; }
45
45
  });
46
46
  Object.defineProperty(exports, "templateRenderer", {
47
47
  enumerable: true,
48
- get: function () { return chunk2MBNRFS5_cjs.templateRenderer; }
49
- });
50
- Object.defineProperty(exports, "DEFAULT_TELEMETRY_CONFIG", {
51
- enumerable: true,
52
- get: function () { return chunkWBX5YMTB_cjs.DEFAULT_TELEMETRY_CONFIG; }
48
+ get: function () { return chunkTT266RYM_cjs.templateRenderer; }
53
49
  });
54
50
  Object.defineProperty(exports, "generateInstallationId", {
55
51
  enumerable: true,
56
- get: function () { return chunkWBX5YMTB_cjs.generateInstallationId; }
52
+ get: function () { return chunk7KCDFDRI_cjs.generateInstallationId; }
57
53
  });
58
54
  Object.defineProperty(exports, "generateProjectId", {
59
55
  enumerable: true,
60
- get: function () { return chunkWBX5YMTB_cjs.generateProjectId; }
56
+ get: function () { return chunk7KCDFDRI_cjs.generateProjectId; }
57
+ });
58
+ Object.defineProperty(exports, "getDefaultTelemetryConfig", {
59
+ enumerable: true,
60
+ get: function () { return chunk7KCDFDRI_cjs.getDefaultTelemetryConfig; }
61
61
  });
62
62
  Object.defineProperty(exports, "getTelemetryConfig", {
63
63
  enumerable: true,
64
- get: function () { return chunkWBX5YMTB_cjs.getTelemetryConfig; }
64
+ get: function () { return chunk7KCDFDRI_cjs.getTelemetryConfig; }
65
65
  });
66
66
  Object.defineProperty(exports, "isTelemetryEnabled", {
67
67
  enumerable: true,
68
- get: function () { return chunkWBX5YMTB_cjs.isTelemetryEnabled; }
68
+ get: function () { return chunk7KCDFDRI_cjs.isTelemetryEnabled; }
69
69
  });
70
70
  Object.defineProperty(exports, "sanitizeErrorMessage", {
71
71
  enumerable: true,
72
- get: function () { return chunkWBX5YMTB_cjs.sanitizeErrorMessage; }
72
+ get: function () { return chunk7KCDFDRI_cjs.sanitizeErrorMessage; }
73
73
  });
74
74
  Object.defineProperty(exports, "sanitizeRoute", {
75
75
  enumerable: true,
76
- get: function () { return chunkWBX5YMTB_cjs.sanitizeRoute; }
76
+ get: function () { return chunk7KCDFDRI_cjs.sanitizeRoute; }
77
77
  });
78
78
  Object.defineProperty(exports, "shouldSkipEvent", {
79
79
  enumerable: true,
80
- get: function () { return chunkWBX5YMTB_cjs.shouldSkipEvent; }
80
+ get: function () { return chunk7KCDFDRI_cjs.shouldSkipEvent; }
81
81
  });
82
82
  Object.defineProperty(exports, "metricsTracker", {
83
83
  enumerable: true,
@@ -0,0 +1,53 @@
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
+ import { b as TelemetryConfig } from './telemetry-BFBIjBxK.cjs';
3
+
4
+ /**
5
+ * Telemetry ID Utilities
6
+ *
7
+ * Generates and manages anonymous installation IDs
8
+ */
9
+ /**
10
+ * Generate a new anonymous installation ID
11
+ * Uses globalThis.crypto for Cloudflare Workers compatibility
12
+ */
13
+ declare function generateInstallationId(): string;
14
+ /**
15
+ * Generate a project-specific ID from project name
16
+ * Uses a simple hash to anonymize while maintaining consistency
17
+ */
18
+ declare function generateProjectId(projectName: string): string;
19
+ /**
20
+ * Sanitize error messages to remove any potential PII
21
+ */
22
+ declare function sanitizeErrorMessage(error: Error | string): string;
23
+ /**
24
+ * Sanitize route to remove any user-specific data
25
+ */
26
+ declare function sanitizeRoute(route: string): string;
27
+
28
+ /**
29
+ * Telemetry Configuration Utilities
30
+ *
31
+ * Manages telemetry settings and opt-out mechanisms
32
+ */
33
+
34
+ /**
35
+ * Get default telemetry configuration
36
+ * Uses lazy evaluation to avoid accessing process.env at module load time
37
+ */
38
+ declare function getDefaultTelemetryConfig(): TelemetryConfig;
39
+ /**
40
+ * Check if telemetry is enabled via environment variables
41
+ */
42
+ declare function isTelemetryEnabled(): boolean;
43
+ /**
44
+ * Get telemetry configuration from environment
45
+ */
46
+ declare function getTelemetryConfig(): TelemetryConfig;
47
+ /**
48
+ * Check if telemetry should be skipped for this event
49
+ * Used to implement sampling or rate limiting if needed
50
+ */
51
+ declare function shouldSkipEvent(eventName: string, sampleRate?: number): boolean;
52
+
53
+ export { generateInstallationId, generateProjectId, getDefaultTelemetryConfig, getTelemetryConfig, isTelemetryEnabled, sanitizeErrorMessage, sanitizeRoute, shouldSkipEvent };
package/dist/utils.d.ts CHANGED
@@ -1,2 +1,53 @@
1
- // Utility exports from core package
2
- export * from '../src/utils/index'
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
+ import { b as TelemetryConfig } from './telemetry-BFBIjBxK.js';
3
+
4
+ /**
5
+ * Telemetry ID Utilities
6
+ *
7
+ * Generates and manages anonymous installation IDs
8
+ */
9
+ /**
10
+ * Generate a new anonymous installation ID
11
+ * Uses globalThis.crypto for Cloudflare Workers compatibility
12
+ */
13
+ declare function generateInstallationId(): string;
14
+ /**
15
+ * Generate a project-specific ID from project name
16
+ * Uses a simple hash to anonymize while maintaining consistency
17
+ */
18
+ declare function generateProjectId(projectName: string): string;
19
+ /**
20
+ * Sanitize error messages to remove any potential PII
21
+ */
22
+ declare function sanitizeErrorMessage(error: Error | string): string;
23
+ /**
24
+ * Sanitize route to remove any user-specific data
25
+ */
26
+ declare function sanitizeRoute(route: string): string;
27
+
28
+ /**
29
+ * Telemetry Configuration Utilities
30
+ *
31
+ * Manages telemetry settings and opt-out mechanisms
32
+ */
33
+
34
+ /**
35
+ * Get default telemetry configuration
36
+ * Uses lazy evaluation to avoid accessing process.env at module load time
37
+ */
38
+ declare function getDefaultTelemetryConfig(): TelemetryConfig;
39
+ /**
40
+ * Check if telemetry is enabled via environment variables
41
+ */
42
+ declare function isTelemetryEnabled(): boolean;
43
+ /**
44
+ * Get telemetry configuration from environment
45
+ */
46
+ declare function getTelemetryConfig(): TelemetryConfig;
47
+ /**
48
+ * Check if telemetry should be skipped for this event
49
+ * Used to implement sampling or rate limiting if needed
50
+ */
51
+ declare function shouldSkipEvent(eventName: string, sampleRate?: number): boolean;
52
+
53
+ export { generateInstallationId, generateProjectId, getDefaultTelemetryConfig, getTelemetryConfig, isTelemetryEnabled, sanitizeErrorMessage, sanitizeRoute, shouldSkipEvent };
package/dist/utils.js CHANGED
@@ -1,5 +1,5 @@
1
- export { QueryFilterBuilder, SONICJS_VERSION, TemplateRenderer, buildQuery, escapeHtml, getCoreVersion, renderTemplate, sanitizeInput, sanitizeObject, templateRenderer } from './chunk-K5JZ4JI3.js';
2
- export { DEFAULT_TELEMETRY_CONFIG, generateInstallationId, generateProjectId, getTelemetryConfig, isTelemetryEnabled, sanitizeErrorMessage, sanitizeRoute, shouldSkipEvent } from './chunk-NMVOTNSL.js';
1
+ export { QueryFilterBuilder, SONICJS_VERSION, TemplateRenderer, buildQuery, escapeHtml, getCoreVersion, renderTemplate, sanitizeInput, sanitizeObject, templateRenderer } from './chunk-4C433FET.js';
2
+ export { generateInstallationId, generateProjectId, getDefaultTelemetryConfig, getTelemetryConfig, isTelemetryEnabled, sanitizeErrorMessage, sanitizeRoute, shouldSkipEvent } from './chunk-RRKXFGIO.js';
3
3
  export { metricsTracker } from './chunk-FICTAGD4.js';
4
4
  import './chunk-V4OQ3NZ2.js';
5
5
  //# sourceMappingURL=utils.js.map