@sonicjs-cms/core 2.0.0-beta.3 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/{chunk-4MZPFGLT.cjs → chunk-5FDDDD4J.cjs} +4385 -352
  2. package/dist/chunk-5FDDDD4J.cjs.map +1 -0
  3. package/dist/chunk-5XTB4FE5.js +1030 -0
  4. package/dist/chunk-5XTB4FE5.js.map +1 -0
  5. package/dist/{chunk-ET5I4GBD.cjs → chunk-ALOS2CBJ.cjs} +194 -4
  6. package/dist/chunk-ALOS2CBJ.cjs.map +1 -0
  7. package/dist/{chunk-7N3HK7ZK.js → chunk-CDBVZEWR.js} +7 -904
  8. package/dist/chunk-CDBVZEWR.js.map +1 -0
  9. package/dist/chunk-EGFHFM4N.cjs +76 -0
  10. package/dist/chunk-EGFHFM4N.cjs.map +1 -0
  11. package/dist/chunk-KM4AJFXI.cjs +101 -0
  12. package/dist/chunk-KM4AJFXI.cjs.map +1 -0
  13. package/dist/{chunk-RNR4HA23.cjs → chunk-LEG4KNFP.cjs} +6 -945
  14. package/dist/chunk-LEG4KNFP.cjs.map +1 -0
  15. package/dist/{chunk-P3VS4DV3.js → chunk-O46XKBFM.js} +193 -5
  16. package/dist/chunk-O46XKBFM.js.map +1 -0
  17. package/dist/chunk-P2PTTBO5.js +74 -0
  18. package/dist/chunk-P2PTTBO5.js.map +1 -0
  19. package/dist/{chunk-Q3KCKPHE.js → chunk-QSF34IYQ.js} +4244 -214
  20. package/dist/chunk-QSF34IYQ.js.map +1 -0
  21. package/dist/chunk-SRCY43RN.cjs +1076 -0
  22. package/dist/chunk-SRCY43RN.cjs.map +1 -0
  23. package/dist/chunk-TY3NHEBN.js +80 -0
  24. package/dist/chunk-TY3NHEBN.js.map +1 -0
  25. package/dist/index.cjs +196 -196
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.js +9 -9
  28. package/dist/index.js.map +1 -1
  29. package/dist/middleware.cjs +22 -22
  30. package/dist/middleware.js +2 -2
  31. package/dist/routes.cjs +34 -22
  32. package/dist/routes.js +5 -5
  33. package/dist/services.cjs +28 -28
  34. package/dist/services.js +2 -2
  35. package/dist/templates.cjs +24 -24
  36. package/dist/templates.js +2 -2
  37. package/package.json +2 -16
  38. package/dist/chunk-3MNMOLSA.js +0 -133
  39. package/dist/chunk-3MNMOLSA.js.map +0 -1
  40. package/dist/chunk-4MZPFGLT.cjs.map +0 -1
  41. package/dist/chunk-4XI3YBKU.cjs +0 -266
  42. package/dist/chunk-4XI3YBKU.cjs.map +0 -1
  43. package/dist/chunk-7N3HK7ZK.js.map +0 -1
  44. package/dist/chunk-AGOE25LF.cjs +0 -137
  45. package/dist/chunk-AGOE25LF.cjs.map +0 -1
  46. package/dist/chunk-BUKT6HP5.cjs +0 -776
  47. package/dist/chunk-BUKT6HP5.cjs.map +0 -1
  48. package/dist/chunk-ET5I4GBD.cjs.map +0 -1
  49. package/dist/chunk-LU6J53IX.js +0 -262
  50. package/dist/chunk-LU6J53IX.js.map +0 -1
  51. package/dist/chunk-P3VS4DV3.js.map +0 -1
  52. package/dist/chunk-Q3KCKPHE.js.map +0 -1
  53. package/dist/chunk-RNR4HA23.cjs.map +0 -1
  54. package/dist/chunk-WESS2U3K.js +0 -755
  55. package/dist/chunk-WESS2U3K.js.map +0 -1
package/dist/services.cjs CHANGED
@@ -1,86 +1,86 @@
1
1
  'use strict';
2
2
 
3
- var chunkAGOE25LF_cjs = require('./chunk-AGOE25LF.cjs');
4
- var chunkRNR4HA23_cjs = require('./chunk-RNR4HA23.cjs');
3
+ var chunkSRCY43RN_cjs = require('./chunk-SRCY43RN.cjs');
4
+ var chunkLEG4KNFP_cjs = require('./chunk-LEG4KNFP.cjs');
5
5
  require('./chunk-IGJUBJBW.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "CACHE_CONFIGS", {
10
10
  enumerable: true,
11
- get: function () { return chunkAGOE25LF_cjs.CACHE_CONFIGS; }
11
+ get: function () { return chunkSRCY43RN_cjs.CACHE_CONFIGS; }
12
12
  });
13
13
  Object.defineProperty(exports, "CacheService", {
14
14
  enumerable: true,
15
- get: function () { return chunkAGOE25LF_cjs.CacheService; }
15
+ get: function () { return chunkSRCY43RN_cjs.CacheService; }
16
+ });
17
+ Object.defineProperty(exports, "Logger", {
18
+ enumerable: true,
19
+ get: function () { return chunkSRCY43RN_cjs.Logger; }
16
20
  });
17
21
  Object.defineProperty(exports, "getCacheService", {
18
22
  enumerable: true,
19
- get: function () { return chunkAGOE25LF_cjs.getCacheService; }
23
+ get: function () { return chunkSRCY43RN_cjs.getCacheService; }
20
24
  });
21
- Object.defineProperty(exports, "Logger", {
25
+ Object.defineProperty(exports, "getLogger", {
26
+ enumerable: true,
27
+ get: function () { return chunkSRCY43RN_cjs.getLogger; }
28
+ });
29
+ Object.defineProperty(exports, "initLogger", {
22
30
  enumerable: true,
23
- get: function () { return chunkRNR4HA23_cjs.Logger; }
31
+ get: function () { return chunkSRCY43RN_cjs.initLogger; }
24
32
  });
25
33
  Object.defineProperty(exports, "MigrationService", {
26
34
  enumerable: true,
27
- get: function () { return chunkRNR4HA23_cjs.MigrationService; }
35
+ get: function () { return chunkLEG4KNFP_cjs.MigrationService; }
28
36
  });
29
37
  Object.defineProperty(exports, "PluginBootstrapService", {
30
38
  enumerable: true,
31
- get: function () { return chunkRNR4HA23_cjs.PluginBootstrapService; }
39
+ get: function () { return chunkLEG4KNFP_cjs.PluginBootstrapService; }
32
40
  });
33
41
  Object.defineProperty(exports, "PluginService", {
34
42
  enumerable: true,
35
- get: function () { return chunkRNR4HA23_cjs.PluginService; }
43
+ get: function () { return chunkLEG4KNFP_cjs.PluginService; }
36
44
  });
37
45
  Object.defineProperty(exports, "cleanupRemovedCollections", {
38
46
  enumerable: true,
39
- get: function () { return chunkRNR4HA23_cjs.cleanupRemovedCollections; }
47
+ get: function () { return chunkLEG4KNFP_cjs.cleanupRemovedCollections; }
40
48
  });
41
49
  Object.defineProperty(exports, "fullCollectionSync", {
42
50
  enumerable: true,
43
- get: function () { return chunkRNR4HA23_cjs.fullCollectionSync; }
51
+ get: function () { return chunkLEG4KNFP_cjs.fullCollectionSync; }
44
52
  });
45
53
  Object.defineProperty(exports, "getAvailableCollectionNames", {
46
54
  enumerable: true,
47
- get: function () { return chunkRNR4HA23_cjs.getAvailableCollectionNames; }
48
- });
49
- Object.defineProperty(exports, "getLogger", {
50
- enumerable: true,
51
- get: function () { return chunkRNR4HA23_cjs.getLogger; }
55
+ get: function () { return chunkLEG4KNFP_cjs.getAvailableCollectionNames; }
52
56
  });
53
57
  Object.defineProperty(exports, "getManagedCollections", {
54
58
  enumerable: true,
55
- get: function () { return chunkRNR4HA23_cjs.getManagedCollections; }
56
- });
57
- Object.defineProperty(exports, "initLogger", {
58
- enumerable: true,
59
- get: function () { return chunkRNR4HA23_cjs.initLogger; }
59
+ get: function () { return chunkLEG4KNFP_cjs.getManagedCollections; }
60
60
  });
61
61
  Object.defineProperty(exports, "isCollectionManaged", {
62
62
  enumerable: true,
63
- get: function () { return chunkRNR4HA23_cjs.isCollectionManaged; }
63
+ get: function () { return chunkLEG4KNFP_cjs.isCollectionManaged; }
64
64
  });
65
65
  Object.defineProperty(exports, "loadCollectionConfig", {
66
66
  enumerable: true,
67
- get: function () { return chunkRNR4HA23_cjs.loadCollectionConfig; }
67
+ get: function () { return chunkLEG4KNFP_cjs.loadCollectionConfig; }
68
68
  });
69
69
  Object.defineProperty(exports, "loadCollectionConfigs", {
70
70
  enumerable: true,
71
- get: function () { return chunkRNR4HA23_cjs.loadCollectionConfigs; }
71
+ get: function () { return chunkLEG4KNFP_cjs.loadCollectionConfigs; }
72
72
  });
73
73
  Object.defineProperty(exports, "syncCollection", {
74
74
  enumerable: true,
75
- get: function () { return chunkRNR4HA23_cjs.syncCollection; }
75
+ get: function () { return chunkLEG4KNFP_cjs.syncCollection; }
76
76
  });
77
77
  Object.defineProperty(exports, "syncCollections", {
78
78
  enumerable: true,
79
- get: function () { return chunkRNR4HA23_cjs.syncCollections; }
79
+ get: function () { return chunkLEG4KNFP_cjs.syncCollections; }
80
80
  });
81
81
  Object.defineProperty(exports, "validateCollectionConfig", {
82
82
  enumerable: true,
83
- get: function () { return chunkRNR4HA23_cjs.validateCollectionConfig; }
83
+ get: function () { return chunkLEG4KNFP_cjs.validateCollectionConfig; }
84
84
  });
85
85
  //# sourceMappingURL=services.cjs.map
86
86
  //# sourceMappingURL=services.cjs.map
package/dist/services.js CHANGED
@@ -1,5 +1,5 @@
1
- export { CACHE_CONFIGS, CacheService, getCacheService } from './chunk-3MNMOLSA.js';
2
- export { Logger, MigrationService, PluginBootstrapService, PluginService, cleanupRemovedCollections, fullCollectionSync, getAvailableCollectionNames, getLogger, getManagedCollections, initLogger, isCollectionManaged, loadCollectionConfig, loadCollectionConfigs, syncCollection, syncCollections, validateCollectionConfig } from './chunk-7N3HK7ZK.js';
1
+ export { CACHE_CONFIGS, CacheService, Logger, getCacheService, getLogger, initLogger } from './chunk-5XTB4FE5.js';
2
+ export { MigrationService, PluginBootstrapService, PluginService, cleanupRemovedCollections, fullCollectionSync, getAvailableCollectionNames, getManagedCollections, isCollectionManaged, loadCollectionConfig, loadCollectionConfigs, syncCollection, syncCollections, validateCollectionConfig } from './chunk-CDBVZEWR.js';
3
3
  import './chunk-V4OQ3NZ2.js';
4
4
  //# sourceMappingURL=services.js.map
5
5
  //# sourceMappingURL=services.js.map
@@ -1,74 +1,74 @@
1
1
  'use strict';
2
2
 
3
- var chunk4XI3YBKU_cjs = require('./chunk-4XI3YBKU.cjs');
4
- var chunkET5I4GBD_cjs = require('./chunk-ET5I4GBD.cjs');
3
+ var chunkEGFHFM4N_cjs = require('./chunk-EGFHFM4N.cjs');
4
+ var chunkALOS2CBJ_cjs = require('./chunk-ALOS2CBJ.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 chunk4XI3YBKU_cjs.renderFilterBar; }
12
- });
13
- Object.defineProperty(exports, "renderForm", {
14
- enumerable: true,
15
- get: function () { return chunk4XI3YBKU_cjs.renderForm; }
16
- });
17
- Object.defineProperty(exports, "renderFormField", {
18
- enumerable: true,
19
- get: function () { return chunk4XI3YBKU_cjs.renderFormField; }
11
+ get: function () { return chunkEGFHFM4N_cjs.renderFilterBar; }
20
12
  });
21
13
  Object.defineProperty(exports, "getConfirmationDialogScript", {
22
14
  enumerable: true,
23
- get: function () { return chunkET5I4GBD_cjs.getConfirmationDialogScript; }
15
+ get: function () { return chunkALOS2CBJ_cjs.getConfirmationDialogScript; }
24
16
  });
25
17
  Object.defineProperty(exports, "renderAdminLayout", {
26
18
  enumerable: true,
27
- get: function () { return chunkET5I4GBD_cjs.renderAdminLayout; }
19
+ get: function () { return chunkALOS2CBJ_cjs.renderAdminLayout; }
28
20
  });
29
21
  Object.defineProperty(exports, "renderAdminLayoutCatalyst", {
30
22
  enumerable: true,
31
- get: function () { return chunkET5I4GBD_cjs.renderAdminLayoutCatalyst; }
23
+ get: function () { return chunkALOS2CBJ_cjs.renderAdminLayoutCatalyst; }
32
24
  });
33
25
  Object.defineProperty(exports, "renderAlert", {
34
26
  enumerable: true,
35
- get: function () { return chunkET5I4GBD_cjs.renderAlert; }
27
+ get: function () { return chunkALOS2CBJ_cjs.renderAlert; }
36
28
  });
37
29
  Object.defineProperty(exports, "renderCheckboxPage", {
38
30
  enumerable: true,
39
- get: function () { return chunkET5I4GBD_cjs.renderCheckboxPage; }
31
+ get: function () { return chunkALOS2CBJ_cjs.renderCheckboxPage; }
40
32
  });
41
33
  Object.defineProperty(exports, "renderCodeExamplesList", {
42
34
  enumerable: true,
43
- get: function () { return chunkET5I4GBD_cjs.renderCodeExamplesList; }
35
+ get: function () { return chunkALOS2CBJ_cjs.renderCodeExamplesList; }
44
36
  });
45
37
  Object.defineProperty(exports, "renderConfirmationDialog", {
46
38
  enumerable: true,
47
- get: function () { return chunkET5I4GBD_cjs.renderConfirmationDialog; }
39
+ get: function () { return chunkALOS2CBJ_cjs.renderConfirmationDialog; }
48
40
  });
49
41
  Object.defineProperty(exports, "renderDesignPage", {
50
42
  enumerable: true,
51
- get: function () { return chunkET5I4GBD_cjs.renderDesignPage; }
43
+ get: function () { return chunkALOS2CBJ_cjs.renderDesignPage; }
52
44
  });
53
45
  Object.defineProperty(exports, "renderFAQList", {
54
46
  enumerable: true,
55
- get: function () { return chunkET5I4GBD_cjs.renderFAQList; }
47
+ get: function () { return chunkALOS2CBJ_cjs.renderFAQList; }
48
+ });
49
+ Object.defineProperty(exports, "renderForm", {
50
+ enumerable: true,
51
+ get: function () { return chunkALOS2CBJ_cjs.renderForm; }
52
+ });
53
+ Object.defineProperty(exports, "renderFormField", {
54
+ enumerable: true,
55
+ get: function () { return chunkALOS2CBJ_cjs.renderFormField; }
56
56
  });
57
57
  Object.defineProperty(exports, "renderLogo", {
58
58
  enumerable: true,
59
- get: function () { return chunkET5I4GBD_cjs.renderLogo; }
59
+ get: function () { return chunkALOS2CBJ_cjs.renderLogo; }
60
60
  });
61
61
  Object.defineProperty(exports, "renderPagination", {
62
62
  enumerable: true,
63
- get: function () { return chunkET5I4GBD_cjs.renderPagination; }
63
+ get: function () { return chunkALOS2CBJ_cjs.renderPagination; }
64
64
  });
65
65
  Object.defineProperty(exports, "renderTable", {
66
66
  enumerable: true,
67
- get: function () { return chunkET5I4GBD_cjs.renderTable; }
67
+ get: function () { return chunkALOS2CBJ_cjs.renderTable; }
68
68
  });
69
69
  Object.defineProperty(exports, "renderTestimonialsList", {
70
70
  enumerable: true,
71
- get: function () { return chunkET5I4GBD_cjs.renderTestimonialsList; }
71
+ get: function () { return chunkALOS2CBJ_cjs.renderTestimonialsList; }
72
72
  });
73
73
  //# sourceMappingURL=templates.cjs.map
74
74
  //# sourceMappingURL=templates.cjs.map
package/dist/templates.js CHANGED
@@ -1,5 +1,5 @@
1
- export { renderFilterBar, renderForm, renderFormField } from './chunk-LU6J53IX.js';
2
- export { getConfirmationDialogScript, renderAdminLayout, renderAdminLayoutCatalyst, renderAlert, renderCheckboxPage, renderCodeExamplesList, renderConfirmationDialog, renderDesignPage, renderFAQList, renderLogo, renderPagination, renderTable, renderTestimonialsList } from './chunk-P3VS4DV3.js';
1
+ export { renderFilterBar } from './chunk-P2PTTBO5.js';
2
+ export { getConfirmationDialogScript, renderAdminLayout, renderAdminLayoutCatalyst, renderAlert, renderCheckboxPage, renderCodeExamplesList, renderConfirmationDialog, renderDesignPage, renderFAQList, renderForm, renderFormField, renderLogo, renderPagination, renderTable, renderTestimonialsList } from './chunk-O46XKBFM.js';
3
3
  import './chunk-V4OQ3NZ2.js';
4
4
  //# sourceMappingURL=templates.js.map
5
5
  //# sourceMappingURL=templates.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonicjs-cms/core",
3
- "version": "2.0.0-beta.3",
3
+ "version": "2.0.1",
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",
@@ -78,7 +78,7 @@
78
78
  "license": "MIT",
79
79
  "repository": {
80
80
  "type": "git",
81
- "url": "https://github.com/sonicjs/sonicjs.git",
81
+ "url": "git+https://github.com/sonicjs/sonicjs.git",
82
82
  "directory": "packages/core"
83
83
  },
84
84
  "bugs": {
@@ -91,20 +91,6 @@
91
91
  "drizzle-orm": "^0.44.0",
92
92
  "zod": "^3.0.0"
93
93
  },
94
- "peerDependenciesMeta": {
95
- "@cloudflare/workers-types": {
96
- "optional": false
97
- },
98
- "hono": {
99
- "optional": false
100
- },
101
- "drizzle-orm": {
102
- "optional": false
103
- },
104
- "zod": {
105
- "optional": false
106
- }
107
- },
108
94
  "dependencies": {
109
95
  "drizzle-zod": "^0.8.2",
110
96
  "marked": "^15.0.12",
@@ -1,133 +0,0 @@
1
- // src/services/cache.ts
2
- var CacheService = class {
3
- config;
4
- memoryCache = /* @__PURE__ */ new Map();
5
- constructor(config) {
6
- this.config = config;
7
- }
8
- /**
9
- * Generate cache key with prefix
10
- */
11
- generateKey(type, identifier) {
12
- const parts = [this.config.keyPrefix, type];
13
- if (identifier) {
14
- parts.push(identifier);
15
- }
16
- return parts.join(":");
17
- }
18
- /**
19
- * Get value from cache
20
- */
21
- async get(key) {
22
- const cached = this.memoryCache.get(key);
23
- if (!cached) {
24
- return null;
25
- }
26
- if (Date.now() > cached.expires) {
27
- this.memoryCache.delete(key);
28
- return null;
29
- }
30
- return cached.value;
31
- }
32
- /**
33
- * Get value from cache with source information
34
- */
35
- async getWithSource(key) {
36
- const cached = this.memoryCache.get(key);
37
- if (!cached) {
38
- return {
39
- hit: false,
40
- data: null,
41
- source: "none"
42
- };
43
- }
44
- if (Date.now() > cached.expires) {
45
- this.memoryCache.delete(key);
46
- return {
47
- hit: false,
48
- data: null,
49
- source: "expired"
50
- };
51
- }
52
- return {
53
- hit: true,
54
- data: cached.value,
55
- source: "memory",
56
- ttl: (cached.expires - Date.now()) / 1e3
57
- // TTL in seconds
58
- };
59
- }
60
- /**
61
- * Set value in cache
62
- */
63
- async set(key, value, ttl) {
64
- const expires = Date.now() + (ttl || this.config.ttl) * 1e3;
65
- this.memoryCache.set(key, { value, expires });
66
- }
67
- /**
68
- * Delete specific key from cache
69
- */
70
- async delete(key) {
71
- this.memoryCache.delete(key);
72
- }
73
- /**
74
- * Invalidate cache keys matching a pattern
75
- * For memory cache, we do simple string matching
76
- */
77
- async invalidate(pattern) {
78
- const regexPattern = pattern.replace(/\*/g, ".*").replace(/\?/g, ".");
79
- const regex = new RegExp(`^${regexPattern}$`);
80
- for (const key of this.memoryCache.keys()) {
81
- if (regex.test(key)) {
82
- this.memoryCache.delete(key);
83
- }
84
- }
85
- }
86
- /**
87
- * Clear all cache
88
- */
89
- async clear() {
90
- this.memoryCache.clear();
91
- }
92
- /**
93
- * Get value from cache or set it using a callback
94
- */
95
- async getOrSet(key, callback, ttl) {
96
- const cached = await this.get(key);
97
- if (cached !== null) {
98
- return cached;
99
- }
100
- const value = await callback();
101
- await this.set(key, value, ttl);
102
- return value;
103
- }
104
- };
105
- var CACHE_CONFIGS = {
106
- api: {
107
- ttl: 300,
108
- // 5 minutes
109
- keyPrefix: "api"
110
- },
111
- user: {
112
- ttl: 600,
113
- // 10 minutes
114
- keyPrefix: "user"
115
- },
116
- content: {
117
- ttl: 300,
118
- // 5 minutes
119
- keyPrefix: "content"
120
- },
121
- collection: {
122
- ttl: 600,
123
- // 10 minutes
124
- keyPrefix: "collection"
125
- }
126
- };
127
- function getCacheService(config) {
128
- return new CacheService(config);
129
- }
130
-
131
- export { CACHE_CONFIGS, CacheService, getCacheService };
132
- //# sourceMappingURL=chunk-3MNMOLSA.js.map
133
- //# sourceMappingURL=chunk-3MNMOLSA.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/services/cache.ts"],"names":[],"mappings":";AAYO,IAAM,eAAN,MAAmB;AAAA,EAChB,MAAA;AAAA,EACA,WAAA,uBAAgE,GAAA,EAAI;AAAA,EAE5E,YAAY,MAAA,EAAqB;AAC/B,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAKA,WAAA,CAAY,MAAc,UAAA,EAA6B;AACrD,IAAA,MAAM,KAAA,GAAQ,CAAC,IAAA,CAAK,MAAA,CAAO,WAAW,IAAI,CAAA;AAC1C,IAAA,IAAI,UAAA,EAAY;AACd,MAAA,KAAA,CAAM,KAAK,UAAU,CAAA;AAAA,IACvB;AACA,IAAA,OAAO,KAAA,CAAM,KAAK,GAAG,CAAA;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,IAAO,GAAA,EAAgC;AAC3C,IAAA,MAAM,MAAA,GAAS,IAAA,CAAK,WAAA,CAAY,GAAA,CAAI,GAAG,CAAA;AAEvC,IAAA,IAAI,CAAC,MAAA,EAAQ;AAC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AA,IACH,GAAA,EAAK,GAAA;AAAA;AAAA,IACL,SAAA,EAAW;AAAA,GACb;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,GAAA,EAAK,GAAA;AAAA;AAAA,IACL,SAAA,EAAW;AAAA,GACb;AAAA,EACA,OAAA,EAAS;AAAA,IACP,GAAA,EAAK,GAAA;AAAA;AAAA,IACL,SAAA,EAAW;AAAA,GACb;AAAA,EACA,UAAA,EAAY;AAAA,IACV,GAAA,EAAK,GAAA;AAAA;AAAA,IACL,SAAA,EAAW;AAAA;AAEf;AAKO,SAAS,gBAAgB,MAAA,EAAmC;AACjE,EAAA,OAAO,IAAI,aAAa,MAAM,CAAA;AAChC","file":"chunk-3MNMOLSA.js","sourcesContent":["/**\n * Simple Cache Service\n *\n * Provides basic caching functionality for the core package\n * Can be extended with KV or other storage backends\n */\n\nexport interface CacheConfig {\n ttl: number // Time to live in seconds\n keyPrefix: string\n}\n\nexport class CacheService {\n private config: CacheConfig\n private memoryCache: Map<string, { value: any; expires: number }> = new Map()\n\n constructor(config: CacheConfig) {\n this.config = config\n }\n\n /**\n * Generate cache key with prefix\n */\n generateKey(type: string, identifier?: string): string {\n const parts = [this.config.keyPrefix, type]\n if (identifier) {\n parts.push(identifier)\n }\n return parts.join(':')\n }\n\n /**\n * Get value from cache\n */\n async get<T>(key: string): Promise<T | null> {\n const cached = this.memoryCache.get(key)\n\n if (!cached) {\n return null\n }\n\n // Check if expired\n if (Date.now() > cached.expires) {\n this.memoryCache.delete(key)\n return null\n }\n\n return cached.value as T\n }\n\n /**\n * Get value from cache with source information\n */\n async getWithSource<T>(key: string): Promise<{\n hit: boolean\n data: T | null\n source: string\n ttl?: number\n }> {\n const cached = this.memoryCache.get(key)\n\n if (!cached) {\n return {\n hit: false,\n data: null,\n source: 'none'\n }\n }\n\n // Check if expired\n if (Date.now() > cached.expires) {\n this.memoryCache.delete(key)\n return {\n hit: false,\n data: null,\n source: 'expired'\n }\n }\n\n return {\n hit: true,\n data: cached.value as T,\n source: 'memory',\n ttl: (cached.expires - Date.now()) / 1000 // TTL in seconds\n }\n }\n\n /**\n * Set value in cache\n */\n async set(key: string, value: any, ttl?: number): Promise<void> {\n const expires = Date.now() + ((ttl || this.config.ttl) * 1000)\n this.memoryCache.set(key, { value, expires })\n }\n\n /**\n * Delete specific key from cache\n */\n async delete(key: string): Promise<void> {\n this.memoryCache.delete(key)\n }\n\n /**\n * Invalidate cache keys matching a pattern\n * For memory cache, we do simple string matching\n */\n async invalidate(pattern: string): Promise<void> {\n // Convert glob pattern to regex\n const regexPattern = pattern\n .replace(/\\*/g, '.*')\n .replace(/\\?/g, '.')\n const regex = new RegExp(`^${regexPattern}$`)\n\n // Find and delete matching keys\n for (const key of this.memoryCache.keys()) {\n if (regex.test(key)) {\n this.memoryCache.delete(key)\n }\n }\n }\n\n /**\n * Clear all cache\n */\n async clear(): Promise<void> {\n this.memoryCache.clear()\n }\n\n /**\n * Get value from cache or set it using a callback\n */\n async getOrSet<T>(key: string, callback: () => Promise<T>, ttl?: number): Promise<T> {\n const cached = await this.get<T>(key)\n\n if (cached !== null) {\n return cached\n }\n\n const value = await callback()\n await this.set(key, value, ttl)\n return value\n }\n}\n\n/**\n * Cache configurations for different data types\n */\nexport const CACHE_CONFIGS = {\n api: {\n ttl: 300, // 5 minutes\n keyPrefix: 'api'\n },\n user: {\n ttl: 600, // 10 minutes\n keyPrefix: 'user'\n },\n content: {\n ttl: 300, // 5 minutes\n keyPrefix: 'content'\n },\n collection: {\n ttl: 600, // 10 minutes\n keyPrefix: 'collection'\n }\n}\n\n/**\n * Get cache service instance for a config\n */\nexport function getCacheService(config: CacheConfig): CacheService {\n return new CacheService(config)\n}\n"]}