@beechcms/core 0.8.0 → 0.8.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 (290) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/antivirus/noop-antivirus.provider.d.ts.map +1 -1
  3. package/dist/antivirus/virustotal-antivirus.provider.d.ts.map +1 -1
  4. package/dist/automations-grammar-words.d.ts +2 -0
  5. package/dist/automations-grammar-words.d.ts.map +1 -0
  6. package/dist/automations-grammar-words.js +8 -0
  7. package/dist/automations.repository.interface.d.ts +19 -0
  8. package/dist/automations.repository.interface.d.ts.map +1 -0
  9. package/dist/automations.repository.interface.js +3 -0
  10. package/dist/automations.runner.interface.d.ts +10 -0
  11. package/dist/automations.runner.interface.d.ts.map +1 -0
  12. package/dist/automations.runner.interface.js +3 -0
  13. package/dist/automations.runner.stub.d.ts +5 -0
  14. package/dist/automations.runner.stub.d.ts.map +1 -0
  15. package/dist/automations.runner.stub.js +7 -0
  16. package/dist/automations.types.d.ts +75 -0
  17. package/dist/automations.types.d.ts.map +1 -0
  18. package/dist/automations.types.js +3 -0
  19. package/dist/clock.d.ts +25 -0
  20. package/dist/clock.d.ts.map +1 -0
  21. package/dist/clock.js +11 -0
  22. package/dist/common/canonical-json.d.ts +30 -0
  23. package/dist/common/canonical-json.d.ts.map +1 -0
  24. package/dist/common/canonical-json.js +89 -0
  25. package/dist/content/content.repository.d.ts +2 -2
  26. package/dist/content/content.repository.d.ts.map +1 -1
  27. package/dist/content/deletion-ledger.d.ts +39 -0
  28. package/dist/content/deletion-ledger.d.ts.map +1 -0
  29. package/dist/content/deletion-ledger.js +3 -0
  30. package/dist/content-scan.repository.d.ts +9 -0
  31. package/dist/content-scan.repository.d.ts.map +1 -0
  32. package/dist/content-scan.repository.js +3 -0
  33. package/dist/content.repository.d.ts +247 -0
  34. package/dist/content.repository.d.ts.map +1 -0
  35. package/dist/content.repository.js +59 -0
  36. package/dist/dashboard-layout.d.ts +154 -0
  37. package/dist/dashboard-layout.d.ts.map +1 -0
  38. package/dist/dashboard-layout.js +186 -0
  39. package/dist/dashboard-layout.repository.d.ts +18 -0
  40. package/dist/dashboard-layout.repository.d.ts.map +1 -0
  41. package/dist/dashboard-layout.repository.js +3 -0
  42. package/dist/dashboard-permissions.d.ts +3 -0
  43. package/dist/dashboard-permissions.d.ts.map +1 -0
  44. package/dist/dashboard-permissions.js +11 -0
  45. package/dist/dashboard-scopes.d.ts +12 -0
  46. package/dist/dashboard-scopes.d.ts.map +1 -0
  47. package/dist/dashboard-scopes.js +30 -0
  48. package/dist/define-seed.d.ts +3 -0
  49. package/dist/define-seed.d.ts.map +1 -0
  50. package/dist/define-seed.js +5 -0
  51. package/dist/demo-data.repository.d.ts +5 -0
  52. package/dist/demo-data.repository.d.ts.map +1 -0
  53. package/dist/demo-data.repository.js +3 -0
  54. package/dist/email.provider.d.ts +32 -0
  55. package/dist/email.provider.d.ts.map +1 -0
  56. package/dist/email.provider.js +4 -0
  57. package/dist/engine/ddl/ddl.d.ts +216 -0
  58. package/dist/engine/ddl/ddl.d.ts.map +1 -0
  59. package/dist/engine/ddl/ddl.js +574 -0
  60. package/dist/engine/ddl/schema-mutator.d.ts +26 -0
  61. package/dist/engine/ddl/schema-mutator.d.ts.map +1 -0
  62. package/dist/engine/ddl/schema-mutator.js +3 -0
  63. package/dist/engine/ddl/seed-ddl-destructive.d.ts +40 -0
  64. package/dist/engine/ddl/seed-ddl-destructive.d.ts.map +1 -0
  65. package/dist/engine/ddl/seed-ddl-destructive.js +149 -0
  66. package/dist/engine/ddl/seed-ddl.d.ts +43 -0
  67. package/dist/engine/ddl/seed-ddl.d.ts.map +1 -0
  68. package/dist/engine/ddl/seed-ddl.js +115 -0
  69. package/dist/engine/introspection/introspection.d.ts +101 -0
  70. package/dist/engine/introspection/introspection.d.ts.map +1 -0
  71. package/dist/engine/introspection/introspection.js +127 -0
  72. package/dist/engine/introspection/schema-fingerprint.d.ts +73 -0
  73. package/dist/engine/introspection/schema-fingerprint.d.ts.map +1 -0
  74. package/dist/engine/introspection/schema-fingerprint.js +97 -0
  75. package/dist/engine/introspection.d.ts +101 -0
  76. package/dist/engine/introspection.d.ts.map +1 -0
  77. package/dist/engine/introspection.js +127 -0
  78. package/dist/engine/localization/localization.d.ts +127 -0
  79. package/dist/engine/localization/localization.d.ts.map +1 -0
  80. package/dist/engine/localization/localization.js +212 -0
  81. package/dist/engine/localization.d.ts +127 -0
  82. package/dist/engine/localization.d.ts.map +1 -0
  83. package/dist/engine/localization.js +212 -0
  84. package/dist/engine/privacy/policies.d.ts +58 -0
  85. package/dist/engine/privacy/policies.d.ts.map +1 -0
  86. package/dist/engine/privacy/policies.js +185 -0
  87. package/dist/engine/privacy/privacy.service.d.ts +65 -0
  88. package/dist/engine/privacy/privacy.service.d.ts.map +1 -0
  89. package/dist/engine/privacy/privacy.service.js +114 -0
  90. package/dist/engine/privacy.service.d.ts.map +1 -1
  91. package/dist/engine/query/query.d.ts +23 -0
  92. package/dist/engine/query/query.d.ts.map +1 -0
  93. package/dist/engine/query/query.js +301 -0
  94. package/dist/engine/query/relations.d.ts +28 -0
  95. package/dist/engine/query/relations.d.ts.map +1 -0
  96. package/dist/engine/query/relations.js +25 -0
  97. package/dist/engine/query/serialize.d.ts +22 -0
  98. package/dist/engine/query/serialize.d.ts.map +1 -0
  99. package/dist/engine/query/serialize.js +175 -0
  100. package/dist/engine/schema-fingerprint.d.ts +73 -0
  101. package/dist/engine/schema-fingerprint.d.ts.map +1 -0
  102. package/dist/engine/schema-fingerprint.js +97 -0
  103. package/dist/engine/seed-registry.d.ts.map +1 -1
  104. package/dist/engine/seeds/define-seed.d.ts +3 -0
  105. package/dist/engine/seeds/define-seed.d.ts.map +1 -0
  106. package/dist/engine/seeds/define-seed.js +5 -0
  107. package/dist/engine/seeds/seed-registry.d.ts +71 -0
  108. package/dist/engine/seeds/seed-registry.d.ts.map +1 -0
  109. package/dist/engine/seeds/seed-registry.js +167 -0
  110. package/dist/engine/seeds/seed-types-generator.d.ts +25 -0
  111. package/dist/engine/seeds/seed-types-generator.d.ts.map +1 -0
  112. package/dist/engine/seeds/seed-types-generator.js +117 -0
  113. package/dist/engine/seeds/seed-validation.d.ts +30 -0
  114. package/dist/engine/seeds/seed-validation.d.ts.map +1 -0
  115. package/dist/engine/seeds/seed-validation.js +364 -0
  116. package/dist/engine/seeds/seeds.d.ts +20 -0
  117. package/dist/engine/seeds/seeds.d.ts.map +1 -0
  118. package/dist/engine/seeds/seeds.js +21 -0
  119. package/dist/engine/validation/emptiness.d.ts +12 -0
  120. package/dist/engine/validation/emptiness.d.ts.map +1 -0
  121. package/dist/engine/validation/emptiness.js +33 -0
  122. package/dist/engine/validation/index.d.ts +1 -1
  123. package/dist/engine/validation/index.d.ts.map +1 -1
  124. package/dist/engine.d.ts +144 -0
  125. package/dist/engine.d.ts.map +1 -0
  126. package/dist/engine.js +741 -0
  127. package/dist/file-types.d.ts +13 -0
  128. package/dist/file-types.d.ts.map +1 -0
  129. package/dist/file-types.js +85 -0
  130. package/dist/hooks.d.ts +29 -0
  131. package/dist/hooks.d.ts.map +1 -0
  132. package/dist/hooks.js +3 -0
  133. package/dist/id-generator.d.ts +26 -0
  134. package/dist/id-generator.d.ts.map +1 -0
  135. package/dist/id-generator.js +12 -0
  136. package/dist/idempotency.repository.d.ts +13 -0
  137. package/dist/idempotency.repository.d.ts.map +1 -0
  138. package/dist/idempotency.repository.js +3 -0
  139. package/dist/kanban-position.repository.d.ts +19 -0
  140. package/dist/kanban-position.repository.d.ts.map +1 -0
  141. package/dist/kanban-position.repository.js +3 -0
  142. package/dist/kanban.d.ts +75 -0
  143. package/dist/kanban.d.ts.map +1 -0
  144. package/dist/kanban.js +82 -0
  145. package/dist/layout-permissions.d.ts +3 -0
  146. package/dist/layout-permissions.d.ts.map +1 -0
  147. package/dist/layout-permissions.js +11 -0
  148. package/dist/media/image-transformer.d.ts +34 -0
  149. package/dist/media/image-transformer.d.ts.map +1 -0
  150. package/dist/media/image-transformer.js +3 -0
  151. package/dist/media/media-transform.d.ts +88 -0
  152. package/dist/media/media-transform.d.ts.map +1 -0
  153. package/dist/media/media-transform.js +193 -0
  154. package/dist/media.repository.d.ts +61 -0
  155. package/dist/media.repository.d.ts.map +1 -0
  156. package/dist/media.repository.js +3 -0
  157. package/dist/notifications/notification-service.d.ts +1 -1
  158. package/dist/oauth/pkce.d.ts +1 -1
  159. package/dist/oauth/role-guard.d.ts.map +1 -1
  160. package/dist/oauth/scopes.d.ts +1 -1
  161. package/dist/oauth/scopes.d.ts.map +1 -1
  162. package/dist/policies.d.ts +10 -0
  163. package/dist/policies.d.ts.map +1 -0
  164. package/dist/policies.js +33 -0
  165. package/dist/queue/queue.stub.d.ts.map +1 -1
  166. package/dist/queue/scheduler.stub.d.ts.map +1 -1
  167. package/dist/queue.interface.d.ts +39 -0
  168. package/dist/queue.interface.d.ts.map +1 -0
  169. package/dist/queue.interface.js +3 -0
  170. package/dist/queue.stub.d.ts +6 -0
  171. package/dist/queue.stub.d.ts.map +1 -0
  172. package/dist/queue.stub.js +8 -0
  173. package/dist/rate-limit/token-bucket-rate-limiter.d.ts.map +1 -1
  174. package/dist/rbac/evaluate.d.ts +57 -0
  175. package/dist/rbac/evaluate.d.ts.map +1 -0
  176. package/dist/rbac/evaluate.js +113 -0
  177. package/dist/rbac/invitation.repository.d.ts +66 -0
  178. package/dist/rbac/invitation.repository.d.ts.map +1 -0
  179. package/dist/rbac/invitation.repository.js +3 -0
  180. package/dist/rbac/permissions.d.ts +39 -0
  181. package/dist/rbac/permissions.d.ts.map +1 -0
  182. package/dist/rbac/permissions.js +43 -0
  183. package/dist/rbac/types.d.ts +118 -0
  184. package/dist/rbac/types.d.ts.map +1 -0
  185. package/dist/rbac/types.js +3 -0
  186. package/dist/relations.d.ts +28 -0
  187. package/dist/relations.d.ts.map +1 -0
  188. package/dist/relations.js +25 -0
  189. package/dist/richtext-render.d.ts +11 -0
  190. package/dist/richtext-render.d.ts.map +1 -0
  191. package/dist/richtext-render.js +87 -0
  192. package/dist/richtext.d.ts +11 -0
  193. package/dist/richtext.d.ts.map +1 -0
  194. package/dist/richtext.js +13 -0
  195. package/dist/scheduler.interface.d.ts +4 -0
  196. package/dist/scheduler.interface.d.ts.map +1 -0
  197. package/dist/scheduler.interface.js +3 -0
  198. package/dist/scheduler.stub.d.ts +5 -0
  199. package/dist/scheduler.stub.d.ts.map +1 -0
  200. package/dist/scheduler.stub.js +7 -0
  201. package/dist/schema/canonical.d.ts +15 -0
  202. package/dist/schema/canonical.d.ts.map +1 -0
  203. package/dist/schema/canonical.js +37 -0
  204. package/dist/schema/define.d.ts +42 -0
  205. package/dist/schema/define.d.ts.map +1 -0
  206. package/dist/schema/define.js +56 -0
  207. package/dist/schema/emit.d.ts +14 -0
  208. package/dist/schema/emit.d.ts.map +1 -0
  209. package/dist/schema/emit.js +43 -0
  210. package/dist/schema/index.d.ts +12 -0
  211. package/dist/schema/index.d.ts.map +1 -0
  212. package/dist/schema/index.js +13 -0
  213. package/dist/schema/manifest-seeds.d.ts +12 -0
  214. package/dist/schema/manifest-seeds.d.ts.map +1 -0
  215. package/dist/schema/manifest-seeds.js +48 -0
  216. package/dist/schema/manifest-validation.d.ts +13 -0
  217. package/dist/schema/manifest-validation.d.ts.map +1 -0
  218. package/dist/schema/manifest-validation.js +41 -0
  219. package/dist/schema/manifest.types.d.ts +54 -0
  220. package/dist/schema/manifest.types.d.ts.map +1 -0
  221. package/dist/schema/manifest.types.js +7 -0
  222. package/dist/schema-mutator.d.ts +26 -0
  223. package/dist/schema-mutator.d.ts.map +1 -0
  224. package/dist/schema-mutator.js +3 -0
  225. package/dist/seed-ddl-destructive.d.ts +40 -0
  226. package/dist/seed-ddl-destructive.d.ts.map +1 -0
  227. package/dist/seed-ddl-destructive.js +149 -0
  228. package/dist/seed-ddl.d.ts +40 -0
  229. package/dist/seed-ddl.d.ts.map +1 -0
  230. package/dist/seed-ddl.js +100 -0
  231. package/dist/seed-layout.d.ts +145 -0
  232. package/dist/seed-layout.d.ts.map +1 -0
  233. package/dist/seed-layout.js +192 -0
  234. package/dist/seed-layout.repository.d.ts +22 -0
  235. package/dist/seed-layout.repository.d.ts.map +1 -0
  236. package/dist/seed-layout.repository.js +3 -0
  237. package/dist/seed-registry.d.ts +71 -0
  238. package/dist/seed-registry.d.ts.map +1 -0
  239. package/dist/seed-registry.js +143 -0
  240. package/dist/seed-types-generator.d.ts +1 -1
  241. package/dist/seed-types-generator.d.ts.map +1 -1
  242. package/dist/seed-validation.d.ts +23 -0
  243. package/dist/seed-validation.d.ts.map +1 -0
  244. package/dist/seed-validation.js +224 -0
  245. package/dist/seed.repository.d.ts +37 -0
  246. package/dist/seed.repository.d.ts.map +1 -0
  247. package/dist/seed.repository.js +3 -0
  248. package/dist/seeds.d.ts +20 -0
  249. package/dist/seeds.d.ts.map +1 -0
  250. package/dist/seeds.js +21 -0
  251. package/dist/site-settings.repository.d.ts +16 -0
  252. package/dist/site-settings.repository.d.ts.map +1 -0
  253. package/dist/site-settings.repository.js +3 -0
  254. package/dist/slug-utils.d.ts +18 -0
  255. package/dist/slug-utils.d.ts.map +1 -0
  256. package/dist/slug-utils.js +32 -0
  257. package/dist/storage.d.ts +46 -0
  258. package/dist/storage.d.ts.map +1 -0
  259. package/dist/storage.js +3 -0
  260. package/dist/transfer/csv.d.ts +34 -0
  261. package/dist/transfer/csv.d.ts.map +1 -0
  262. package/dist/transfer/csv.js +135 -0
  263. package/dist/transfer/flat-seed.d.ts +13 -0
  264. package/dist/transfer/flat-seed.d.ts.map +1 -0
  265. package/dist/transfer/flat-seed.js +45 -0
  266. package/dist/transfer/index.d.ts +7 -0
  267. package/dist/transfer/index.d.ts.map +1 -0
  268. package/dist/transfer/index.js +8 -0
  269. package/dist/transfer/ndjson.d.ts +25 -0
  270. package/dist/transfer/ndjson.d.ts.map +1 -0
  271. package/dist/transfer/ndjson.js +62 -0
  272. package/dist/transfer/row-mapping.d.ts +36 -0
  273. package/dist/transfer/row-mapping.d.ts.map +1 -0
  274. package/dist/transfer/row-mapping.js +90 -0
  275. package/dist/transfer/transfer.constants.d.ts +20 -0
  276. package/dist/transfer/transfer.constants.d.ts.map +1 -0
  277. package/dist/transfer/transfer.constants.js +21 -0
  278. package/dist/transfer/transfer.types.d.ts +46 -0
  279. package/dist/transfer/transfer.types.d.ts.map +1 -0
  280. package/dist/transfer/transfer.types.js +6 -0
  281. package/dist/types.d.ts +243 -0
  282. package/dist/types.d.ts.map +1 -0
  283. package/dist/types.js +3 -0
  284. package/dist/validation.d.ts +50 -0
  285. package/dist/validation.d.ts.map +1 -0
  286. package/dist/validation.js +660 -0
  287. package/dist/webhook-validation.d.ts +3 -0
  288. package/dist/webhook-validation.d.ts.map +1 -0
  289. package/dist/webhook-validation.js +6 -0
  290. package/package.json +4 -4
@@ -0,0 +1,3 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // Copyright (c) 2024–2026 Flavio De Musso
3
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare const ROLES_ALLOWED_TO_EDIT_DASHBOARD: ReadonlyArray<string>;
2
+ export declare function canEditDashboard(role: string | undefined | null): boolean;
3
+ //# sourceMappingURL=dashboard-permissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-permissions.d.ts","sourceRoot":"","sources":["../src/dashboard-permissions.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,+BAA+B,EAAE,aAAa,CAAC,MAAM,CAAa,CAAA;AAE/E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAGzE"}
@@ -0,0 +1,11 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // Copyright (c) 2024–2026 Flavio De Musso
3
+ // NOTE: change this list to extend write-access to other roles
4
+ // (e.g. add 'editor', or introduce a fine-grained 'dashboard:edit' permission).
5
+ // Single source of truth — used by both API guards and dashboard buttons.
6
+ export const ROLES_ALLOWED_TO_EDIT_DASHBOARD = ['admin'];
7
+ export function canEditDashboard(role) {
8
+ if (!role)
9
+ return false;
10
+ return ROLES_ALLOWED_TO_EDIT_DASHBOARD.includes(role);
11
+ }
@@ -0,0 +1,12 @@
1
+ /** Roles that may have their own dashboard layout. Single source of truth —
2
+ * extend this list if a new role is introduced. */
3
+ export declare const KNOWN_DASHBOARD_ROLES: ReadonlyArray<string>;
4
+ export declare const DEFAULT_DASHBOARD_SCOPE = "default";
5
+ /** Builds the per-role scope string, e.g. `roleScope('editor') === 'role:editor'`. */
6
+ export declare function roleScope(role: string): string;
7
+ /** Whether `scope` is one of the closed set: `'default' | 'role:<known role>'`. */
8
+ export declare function isValidDashboardScope(scope: string): boolean;
9
+ /** Read-resolution order for a caller's role: `['role:<role>', 'default']`,
10
+ * or just `['default']` for unknown/missing roles. */
11
+ export declare function resolveDashboardScopeChain(role: string | undefined | null): string[];
12
+ //# sourceMappingURL=dashboard-scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-scopes.d.ts","sourceRoot":"","sources":["../src/dashboard-scopes.ts"],"names":[],"mappings":"AAOA;oDACoD;AACpD,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAAuB,CAAA;AAE/E,eAAO,MAAM,uBAAuB,YAAY,CAAA;AAEhD,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAK5D;AAED;uDACuD;AACvD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,EAAE,CAKpF"}
@@ -0,0 +1,30 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // Copyright (c) 2024–2026 Flavio De Musso
3
+ // ---------------------------------------------------------------------------
4
+ // Dashboard layout scopes (Sprint 06: role-based dashboards)
5
+ // ---------------------------------------------------------------------------
6
+ /** Roles that may have their own dashboard layout. Single source of truth —
7
+ * extend this list if a new role is introduced. */
8
+ export const KNOWN_DASHBOARD_ROLES = ['admin', 'editor'];
9
+ export const DEFAULT_DASHBOARD_SCOPE = 'default';
10
+ /** Builds the per-role scope string, e.g. `roleScope('editor') === 'role:editor'`. */
11
+ export function roleScope(role) {
12
+ return `role:${role}`;
13
+ }
14
+ /** Whether `scope` is one of the closed set: `'default' | 'role:<known role>'`. */
15
+ export function isValidDashboardScope(scope) {
16
+ if (scope === DEFAULT_DASHBOARD_SCOPE)
17
+ return true;
18
+ const match = /^role:(.+)$/.exec(scope);
19
+ if (!match)
20
+ return false;
21
+ return KNOWN_DASHBOARD_ROLES.includes(match[1]);
22
+ }
23
+ /** Read-resolution order for a caller's role: `['role:<role>', 'default']`,
24
+ * or just `['default']` for unknown/missing roles. */
25
+ export function resolveDashboardScopeChain(role) {
26
+ if (role && KNOWN_DASHBOARD_ROLES.includes(role)) {
27
+ return [roleScope(role), DEFAULT_DASHBOARD_SCOPE];
28
+ }
29
+ return [DEFAULT_DASHBOARD_SCOPE];
30
+ }
@@ -0,0 +1,3 @@
1
+ import type { Seed } from './types.js';
2
+ export declare function defineSeed(seed: Seed): Seed;
3
+ //# sourceMappingURL=define-seed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-seed.d.ts","sourceRoot":"","sources":["../src/define-seed.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAE3C"}
@@ -0,0 +1,5 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // Copyright (c) 2024–2026 Flavio De Musso
3
+ export function defineSeed(seed) {
4
+ return seed;
5
+ }
@@ -0,0 +1,5 @@
1
+ export interface IDemoDataRepository {
2
+ /** Executes the compiled demo dataset SQL against the database. */
3
+ loadDemoData(): Promise<void>;
4
+ }
5
+ //# sourceMappingURL=demo-data.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demo-data.repository.d.ts","sourceRoot":"","sources":["../src/demo-data.repository.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,mBAAmB;IAClC,mEAAmE;IACnE,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9B"}
@@ -0,0 +1,3 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // Copyright (c) 2024–2026 Flavio De Musso
3
+ export {};
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The resolved email message that the provider receives and sends.
3
+ * Constructed by the service by combining call parameters with template builder output.
4
+ */
5
+ export interface OutboundEmail {
6
+ /** Sender address in RFC 5321 format (e.g., "Beech CMS <noreply@beechcms.dev>"). */
7
+ from: string;
8
+ /** List of recipient addresses. Must contain at least one element. */
9
+ to: string[];
10
+ subject: string;
11
+ /** Complete HTML body. Must be a valid HTML document (see templates/shell.ts). */
12
+ html: string;
13
+ }
14
+ /**
15
+ * Formal contract for email sending providers.
16
+ *
17
+ * Every implementation (Resend, SMTP, …) must comply with this interface.
18
+ * It is the only point of coupling between the email module and any external service.
19
+ *
20
+ * To add a new provider: create a class in apps/api/src/shared/email/providers/
21
+ * that implements this interface, then wire it in email.service.ts.
22
+ */
23
+ export interface EmailProvider {
24
+ /**
25
+ * Sends a single transactional email.
26
+ *
27
+ * @throws {Error} If the provider rejects the request. The caller is responsible
28
+ * for catching and handling this error appropriately.
29
+ */
30
+ send(email: OutboundEmail): Promise<void>;
31
+ }
32
+ //# sourceMappingURL=email.provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.provider.d.ts","sourceRoot":"","sources":["../src/email.provider.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAA;IACZ,sEAAsE;IACtE,EAAE,EAAE,MAAM,EAAE,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1C"}
@@ -0,0 +1,4 @@
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ // Copyright (c) 2024–2026 Flavio De Musso. All rights reserved.
3
+ // See LICENSE in the repository root for license terms.
4
+ export {};
@@ -0,0 +1,216 @@
1
+ import type { Seed, Branch } from '../types.js';
2
+ /**
3
+ * Helper function to determine if a branch requires a blind index column.
4
+ * Returns true if storage classification is 'encrypt' and filtering is not explicitly disabled.
5
+ */
6
+ export declare function hasBlindIndex(branch: Branch): boolean;
7
+ /**
8
+ * System-defined columns that exist on all content tables.
9
+ */
10
+ export declare const SYSTEM_COLUMNS: Set<string>;
11
+ /**
12
+ * Returns the SQL table name for a given Seed.
13
+ *
14
+ * @param seed The seed definition.
15
+ * @returns The table name.
16
+ */
17
+ export declare function tableName(seed: Seed): string;
18
+ /**
19
+ * Returns the FTS (Full-Text Search) virtual table name for a given Seed.
20
+ *
21
+ * @param seed The seed definition.
22
+ * @returns The FTS table name.
23
+ */
24
+ export declare function ftsTableName(seed: Seed): string;
25
+ /**
26
+ * Returns the vector table name for a given Seed.
27
+ *
28
+ * @param seed The seed definition.
29
+ * @returns The vector table name.
30
+ */
31
+ export declare function vectorTableName(seed: Seed): string;
32
+ /**
33
+ * Determines whether a column is valid for a given Seed (either system column or branch alias).
34
+ *
35
+ * @param seed The seed definition.
36
+ * @param col The column name to check.
37
+ * @returns True if the column is valid, false otherwise.
38
+ */
39
+ export declare function isValidColumn(seed: Seed, col: string): boolean;
40
+ /**
41
+ * Filters the branches of a Seed to return only the ones that are indexable for full-text search.
42
+ *
43
+ * @param seed The seed definition.
44
+ * @returns An array of indexable branches.
45
+ */
46
+ export declare function indexableSearchBranches(seed: Seed): Branch[];
47
+ /**
48
+ * Generates the SQL `CREATE TABLE IF NOT EXISTS content_{slug}` statement
49
+ * with system columns and one column per branch.
50
+ *
51
+ * @param seed The seed definition.
52
+ * @returns The CREATE TABLE SQL statement.
53
+ */
54
+ export declare function generateCreateTable(seed: Seed): string;
55
+ /**
56
+ * Generates the SQL `CREATE TABLE IF NOT EXISTS content_{slug}_drafts` statement
57
+ * for seeds that allow drafts.
58
+ *
59
+ * @param seed The seed definition.
60
+ * @returns The draft table CREATE TABLE SQL statement, or null if drafts are disabled.
61
+ */
62
+ export declare function generateDraftTable(seed: Seed): string | null;
63
+ /**
64
+ * Generates the SQL `ALTER TABLE content_{slug} ADD COLUMN {alias} {type}` statement.
65
+ *
66
+ * @param seed The seed definition.
67
+ * @param branch The branch definition for the new column.
68
+ * @returns The ALTER TABLE SQL statement.
69
+ */
70
+ export declare function generateAddColumn(seed: Seed, branch: Branch): string;
71
+ /**
72
+ * Generates the `ALTER TABLE content_{slug}_drafts ADD COLUMN live_snapshot_at INTEGER` statement
73
+ * for a draft table provisioned before the column existed.
74
+ *
75
+ * System column, not a branch — `generateAddColumn` iterates `seed.branches` and can never emit it.
76
+ * NOT idempotent: `ADD COLUMN` fails when the column is already present and `ISchemaMutator.execDdl`
77
+ * aborts the whole batch on the first failing statement, so the caller MUST check the physical
78
+ * columns first (see `planExtendSeed`).
79
+ *
80
+ * @param seed The seed definition. Caller must have verified `seed.allowDrafts`.
81
+ * @returns The ALTER TABLE statement.
82
+ */
83
+ export declare function generateAddDraftSnapshotColumn(seed: Seed): string;
84
+ /**
85
+ * Generates SQL index statements for system fields (status, created_at)
86
+ * and indexable branch columns.
87
+ *
88
+ * @param seed The seed definition.
89
+ * @returns An array of CREATE INDEX SQL statements.
90
+ */
91
+ export declare function generateIndexes(seed: Seed): string[];
92
+ /**
93
+ * Generates the FTS5 virtual table definition for indexable text/richtext branches.
94
+ *
95
+ * @param seed The seed definition.
96
+ * @returns The CREATE VIRTUAL TABLE SQL statement, or null if no branches are indexable.
97
+ */
98
+ export declare function generateFtsTable(seed: Seed): string | null;
99
+ /**
100
+ * Generates FTS5 triggers (insert, update, delete) to keep the FTS virtual table synchronized.
101
+ *
102
+ * @param seed The seed definition.
103
+ * @returns An array of CREATE TRIGGER SQL statements.
104
+ */
105
+ export declare function generateFtsTriggers(seed: Seed): string[];
106
+ /**
107
+ * Generates the SQL `CREATE TABLE IF NOT EXISTS vector_{slug}` statement
108
+ * for indexable text/richtext branches.
109
+ *
110
+ * @param seed The seed definition.
111
+ * @returns The CREATE TABLE SQL statement, or null if no branches are indexable.
112
+ */
113
+ export declare function generateVectorTable(seed: Seed): string | null;
114
+ /**
115
+ * Expected database schema column interface.
116
+ */
117
+ export interface SchemaColumn {
118
+ /** Column name. */
119
+ name: string;
120
+ /** SQLite storage type. */
121
+ sqlType: 'TEXT' | 'REAL' | 'INTEGER';
122
+ /** Whether the column is NOT NULL. */
123
+ notNull: boolean;
124
+ /** Whether the column is the PRIMARY KEY. */
125
+ isPk: boolean;
126
+ }
127
+ /**
128
+ * Returns the list of expected columns for a Seed's table.
129
+ * Used to compare current vs expected schema (diffing).
130
+ *
131
+ * @param seed The seed definition.
132
+ * @returns The array of expected schema columns.
133
+ */
134
+ export declare function getExpectedColumns(seed: Seed): SchemaColumn[];
135
+ /**
136
+ * Returns the junction table name for a many-to-many relation branch.
137
+ * Format: `rel_<seedSlug>_<branchAlias>`.
138
+ *
139
+ * @param seedSlug The slug of the parent Seed.
140
+ * @param branchAlias The alias of the relation branch.
141
+ * @returns The junction table name.
142
+ */
143
+ export declare function junctionTableName(seedSlug: string, branchAlias: string): string;
144
+ /**
145
+ * Generates `CREATE TABLE IF NOT EXISTS rel_<seed>_<alias>` statement for a multi-relation branch.
146
+ *
147
+ * @param seed The parent seed definition.
148
+ * @param branch The multi-relation branch definition.
149
+ * @throws {Error} If called on a non-multi-relation branch or if `targetSeed` is missing.
150
+ * @returns The CREATE TABLE SQL statement.
151
+ */
152
+ export declare function generateJunctionTable(seed: Seed, branch: Branch): string;
153
+ /**
154
+ * Generates the two B-tree indexes for a junction table:
155
+ * one on `parent_id` (listing entries by parent) and one on `target_id` (handling cascade checks from target side).
156
+ *
157
+ * @param seed The parent seed definition.
158
+ * @param branch The multi-relation branch definition.
159
+ * @returns An array of CREATE INDEX SQL statements.
160
+ */
161
+ export declare function generateJunctionIndexes(seed: Seed, branch: Branch): string[];
162
+ /**
163
+ * Generates the drafts junction table `rel_<seed>_<alias>_drafts` for a many-to-many relation branch.
164
+ *
165
+ * @param seed The parent seed definition.
166
+ * @param branch The multi-relation branch definition.
167
+ * @returns The CREATE TABLE SQL statement, or null if drafts are disabled.
168
+ */
169
+ export declare function generateJunctionDraftTable(seed: Seed, branch: Branch): string | null;
170
+ /**
171
+ * Returns every `DROP TABLE IF EXISTS` needed to fully remove a content type:
172
+ * the main table, the drafts table (if drafts enabled), full-text search table/triggers, and junction tables.
173
+ *
174
+ * @param seed The seed definition.
175
+ * @returns An array of DROP TABLE / DROP TRIGGER SQL statements.
176
+ */
177
+ export declare function generateDropTable(seed: Seed): string[];
178
+ /**
179
+ * Returns the `DROP COLUMN` SQL statements for removing a single field.
180
+ * Drops the junction table for multi-relations, or alters the tables to drop the column.
181
+ *
182
+ * @param seed The seed definition.
183
+ * @param alias The alias of the branch to drop.
184
+ * @returns An array of SQL statements.
185
+ */
186
+ export declare function generateDropColumn(seed: Seed, alias: string): string[];
187
+ /**
188
+ * Returns the `RENAME COLUMN` SQL statements for renaming a field's alias.
189
+ * For a multi-relation branch, renames the junction table (+ drafts junction table) instead.
190
+ *
191
+ * @param seed The seed definition.
192
+ * @param from The old alias.
193
+ * @param to The new alias.
194
+ * @returns An array of SQL statements.
195
+ */
196
+ export declare function generateRenameColumn(seed: Seed, from: string, to: string): string[];
197
+ /**
198
+ * Returns the statements that change a column's SQL type in place using CAST, bypassing SQLite rebuild limitations.
199
+ *
200
+ * @param seed The seed definition.
201
+ * @param branch The target branch definition (carrying the new type).
202
+ * @throws {Error} If called on a multi-relation branch.
203
+ * @returns An array of SQL statements.
204
+ */
205
+ export declare function generateRetypeColumn(seed: Seed, branch: Branch): string[];
206
+ /**
207
+ * Additive statements that turn soft delete on for a table that already exists.
208
+ *
209
+ * The partial unique index is emitted for correctness on tables that were CREATED with
210
+ * `softDelete: true`. On a pre-existing table the inline `slug … UNIQUE` survives as a
211
+ * sqlite_autoindex that SQLite cannot drop via ALTER; there the partial index is redundant
212
+ * and a trashed slug stays reserved until the table is rebuilt (see ROADMAP deferral).
213
+ * Returns [] when the seed does not opt in.
214
+ */
215
+ export declare function generateEnableSoftDelete(seed: Seed): string[];
216
+ //# sourceMappingURL=ddl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ddl.d.ts","sourceRoot":"","sources":["../../../src/engine/ddl/ddl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EACJ,MAAM,EAOP,MAAM,aAAa,CAAC;AAIrB;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAGrD;AA6BD;;GAEG;AACH,eAAO,MAAM,cAAc,aAA8E,CAAA;AAGzG;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE5C;AAcD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE/C;AAGD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAElD;AAGD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAI9D;AAGD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,CAM5D;AAgCD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAiCtD;AAGD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CA+B5D;AAGD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAEjE;AAGD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,CAiCpD;AAGD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAc1D;AAGD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,CAgCxD;AAGD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAU7D;AAGD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,2BAA2B;IAC3B,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACpC,sCAAsC;IACtC,OAAO,EAAE,OAAO,CAAA;IAChB,6CAA6C;IAC7C,IAAI,EAAE,OAAO,CAAA;CACd;AAGD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,EAAE,CA+B7D;AAGD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAE/E;AAGD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAkBxE;AAGD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAM5E;AAGD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAapF;AAGD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,CAyBtD;AAGD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAgBtE;AAGD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBnF;AAGD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBzE;AAGD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,CAS7D"}