@carlonicora/nextjs-jsonapi 5.2.0 → 5.4.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 (237) hide show
  1. package/dist/{BlockNoteEditor-EGY4ZAAM.js → BlockNoteEditor-4YCAIEPT.js} +23 -22
  2. package/dist/BlockNoteEditor-4YCAIEPT.js.map +1 -0
  3. package/dist/{BlockNoteEditor-2QJVK2HH.mjs → BlockNoteEditor-YQL2SGFR.mjs} +8 -7
  4. package/dist/BlockNoteEditor-YQL2SGFR.mjs.map +1 -0
  5. package/dist/{BlockNoteViewer-6BQXJ4TB.mjs → BlockNoteViewer-AEJKJ27Q.mjs} +2 -2
  6. package/dist/{BlockNoteViewer-I2MMFH3S.js → BlockNoteViewer-YL3J7J2Y.js} +3 -3
  7. package/dist/{BlockNoteViewer-I2MMFH3S.js.map → BlockNoteViewer-YL3J7J2Y.js.map} +1 -1
  8. package/dist/BlogCategoryFields-DO48vOTE.d.mts +14 -0
  9. package/dist/BlogCategoryFields-DO48vOTE.d.ts +14 -0
  10. package/dist/BlogPostInterface-BB_4wcDR.d.mts +124 -0
  11. package/dist/BlogPostInterface-bWAT1rfR.d.ts +124 -0
  12. package/dist/billing/index.js +441 -441
  13. package/dist/billing/index.mjs +3 -3
  14. package/dist/blog-public.types-BbrzsC1c.d.mts +30 -0
  15. package/dist/blog-public.types-BbrzsC1c.d.ts +30 -0
  16. package/dist/{chunk-3VEQ5JZJ.js → chunk-3NLAXVIN.js} +860 -849
  17. package/dist/{chunk-3VEQ5JZJ.js.map → chunk-3NLAXVIN.js.map} +1 -1
  18. package/dist/{chunk-YMUPTXOT.mjs → chunk-3YW35YHQ.mjs} +1 -101
  19. package/dist/chunk-3YW35YHQ.mjs.map +1 -0
  20. package/dist/{chunk-EXICQC4A.js → chunk-5PPG6PL7.js} +3 -3
  21. package/dist/{chunk-EXICQC4A.js.map → chunk-5PPG6PL7.js.map} +1 -1
  22. package/dist/{chunk-NPKFMRH5.mjs → chunk-6DC2WVVB.mjs} +2 -2
  23. package/dist/{chunk-2Z3ZCYXX.mjs → chunk-EUKTBOI2.mjs} +19 -8
  24. package/dist/chunk-EUKTBOI2.mjs.map +1 -0
  25. package/dist/{chunk-THKYH65N.js → chunk-KSYQEKJX.js} +11 -111
  26. package/dist/chunk-KSYQEKJX.js.map +1 -0
  27. package/dist/{chunk-S5MQDWWC.js → chunk-NFBOSPNJ.js} +1451 -176
  28. package/dist/chunk-NFBOSPNJ.js.map +1 -0
  29. package/dist/{chunk-JEZQTZQ4.mjs → chunk-QMYQRPQC.mjs} +2 -2
  30. package/dist/{chunk-HNOWSFM5.mjs → chunk-WC63PJSC.mjs} +1278 -3
  31. package/dist/chunk-WC63PJSC.mjs.map +1 -0
  32. package/dist/chunk-XCHSX3VC.mjs +107 -0
  33. package/dist/chunk-XCHSX3VC.mjs.map +1 -0
  34. package/dist/{chunk-75MLT74B.js → chunk-YNCQSWQW.js} +8 -8
  35. package/dist/{chunk-75MLT74B.js.map → chunk-YNCQSWQW.js.map} +1 -1
  36. package/dist/chunk-YW4ZCEWB.js +107 -0
  37. package/dist/chunk-YW4ZCEWB.js.map +1 -0
  38. package/dist/client/index.d.mts +6 -39
  39. package/dist/client/index.d.ts +6 -39
  40. package/dist/client/index.js +4 -4
  41. package/dist/client/index.mjs +3 -3
  42. package/dist/components/index.d.mts +15 -4
  43. package/dist/components/index.d.ts +15 -4
  44. package/dist/components/index.js +4 -4
  45. package/dist/components/index.mjs +3 -3
  46. package/dist/contexts/index.js +4 -4
  47. package/dist/contexts/index.mjs +3 -3
  48. package/dist/core/index.d.mts +400 -3
  49. package/dist/core/index.d.ts +400 -3
  50. package/dist/core/index.js +64 -2
  51. package/dist/core/index.js.map +1 -1
  52. package/dist/core/index.mjs +63 -1
  53. package/dist/email-automation-enrollment.fields-BZvF14qx.d.mts +82 -0
  54. package/dist/email-automation-enrollment.fields-Cp3VMzFq.d.ts +82 -0
  55. package/dist/email-automations/index.css +30 -0
  56. package/dist/email-automations/index.css.map +1 -0
  57. package/dist/email-automations/index.d.mts +303 -0
  58. package/dist/email-automations/index.d.ts +303 -0
  59. package/dist/email-automations/index.js +1705 -0
  60. package/dist/email-automations/index.js.map +1 -0
  61. package/dist/email-automations/index.mjs +1705 -0
  62. package/dist/email-automations/index.mjs.map +1 -0
  63. package/dist/features/analytics/index.js +122 -122
  64. package/dist/features/analytics/index.mjs +4 -4
  65. package/dist/features/analytics/server.js +6 -5
  66. package/dist/features/analytics/server.js.map +1 -1
  67. package/dist/features/analytics/server.mjs +4 -3
  68. package/dist/features/analytics/server.mjs.map +1 -1
  69. package/dist/features/blog/index.css +30 -0
  70. package/dist/features/blog/index.css.map +1 -0
  71. package/dist/features/blog/index.d.mts +266 -0
  72. package/dist/features/blog/index.d.ts +266 -0
  73. package/dist/features/blog/index.js +1799 -0
  74. package/dist/features/blog/index.js.map +1 -0
  75. package/dist/features/blog/index.mjs +1799 -0
  76. package/dist/features/blog/index.mjs.map +1 -0
  77. package/dist/features/blog/server.d.mts +33 -0
  78. package/dist/features/blog/server.d.ts +33 -0
  79. package/dist/features/blog/server.js +139 -0
  80. package/dist/features/blog/server.js.map +1 -0
  81. package/dist/features/blog/server.mjs +139 -0
  82. package/dist/features/blog/server.mjs.map +1 -0
  83. package/dist/features/help/index.js +37 -37
  84. package/dist/features/help/index.mjs +3 -3
  85. package/dist/features/tokenusage/index.js +125 -125
  86. package/dist/features/tokenusage/index.mjs +4 -4
  87. package/dist/index.d.mts +5 -2
  88. package/dist/index.d.ts +5 -2
  89. package/dist/index.js +65 -3
  90. package/dist/index.js.map +1 -1
  91. package/dist/index.mjs +64 -2
  92. package/dist/{s3.service-CY-jgOAM.d.ts → s3.service-Bz_K-tjz.d.ts} +11 -0
  93. package/dist/{s3.service-Sri0QP7Z.d.mts → s3.service-D5zNCEW3.d.mts} +11 -0
  94. package/dist/server/index.d.mts +1 -1
  95. package/dist/server/index.d.ts +1 -1
  96. package/dist/server/index.js +8 -6
  97. package/dist/server/index.js.map +1 -1
  98. package/dist/server/index.mjs +12 -10
  99. package/dist/types-70acd-8C.d.mts +39 -0
  100. package/dist/types-l8SFleXi.d.ts +39 -0
  101. package/messages/en.json +210 -0
  102. package/messages/it.json +210 -0
  103. package/package.json +21 -1
  104. package/src/components/editors/BlockNoteEditor.tsx +13 -3
  105. package/src/components/forms/FormBlockNote.tsx +4 -0
  106. package/src/components/forms/FormFieldWrapper.tsx +1 -1
  107. package/src/components/forms/FormTextarea.tsx +2 -1
  108. package/src/components/navigations/ContentTitle.tsx +14 -3
  109. package/src/core/index.ts +12 -0
  110. package/src/core/registry/ModuleRegistry.ts +11 -0
  111. package/src/email-automations/index.ts +5 -0
  112. package/src/features/blog/BlogModules.ts +49 -0
  113. package/src/features/blog/components/admin/BlogAdminContainer.tsx +32 -0
  114. package/src/features/blog/components/admin/BlogCategoriesList.tsx +56 -0
  115. package/src/features/blog/components/admin/BlogCategoryEditor.tsx +230 -0
  116. package/src/features/blog/components/admin/BlogCoverImageField.tsx +123 -0
  117. package/src/features/blog/components/admin/BlogLayoutSetting.tsx +86 -0
  118. package/src/features/blog/components/admin/BlogPostComparison.tsx +54 -0
  119. package/src/features/blog/components/admin/BlogPostContainer.tsx +102 -0
  120. package/src/features/blog/components/admin/BlogPostDeleter.tsx +35 -0
  121. package/src/features/blog/components/admin/BlogPostEditor.tsx +207 -0
  122. package/src/features/blog/components/admin/BlogPostPublishButton.tsx +50 -0
  123. package/src/features/blog/components/admin/BlogPostTranslationEditor.tsx +110 -0
  124. package/src/features/blog/components/admin/BlogPostTranslationPanel.tsx +136 -0
  125. package/src/features/blog/components/admin/BlogPostsList.tsx +58 -0
  126. package/src/features/blog/components/admin/BlogTranslationStatus.tsx +104 -0
  127. package/src/features/blog/components/admin/__tests__/BlogPostTranslationPanel.spec.tsx +100 -0
  128. package/src/features/blog/components/admin/__tests__/BlogPostsList.spec.tsx +30 -0
  129. package/src/features/blog/components/admin/index.ts +14 -0
  130. package/src/features/blog/components/public/BlogCategoryChips.tsx +59 -0
  131. package/src/features/blog/components/public/BlogList.tsx +21 -0
  132. package/src/features/blog/components/public/BlogListColumn.tsx +53 -0
  133. package/src/features/blog/components/public/BlogListFeatured.tsx +57 -0
  134. package/src/features/blog/components/public/BlogListParts.tsx +74 -0
  135. package/src/features/blog/components/public/BlogListRail.tsx +62 -0
  136. package/src/features/blog/components/public/BlogPostCard.tsx +132 -0
  137. package/src/features/blog/components/public/BlogPostMeta.tsx +49 -0
  138. package/src/features/blog/components/public/BlogPostView.tsx +74 -0
  139. package/src/features/blog/components/public/BlogSearchBox.tsx +52 -0
  140. package/src/features/blog/components/public/__tests__/BlogList.spec.tsx +173 -0
  141. package/src/features/blog/components/public/__tests__/BlogPostView.spec.tsx +128 -0
  142. package/src/features/blog/components/public/blogPublicHelpers.ts +30 -0
  143. package/src/features/blog/components/public/index.ts +3 -0
  144. package/src/features/blog/contexts/BlogPostContext.tsx +66 -0
  145. package/src/features/blog/contexts/index.ts +1 -0
  146. package/src/features/blog/data/BlogCategory.ts +93 -0
  147. package/src/features/blog/data/BlogCategoryFields.ts +4 -0
  148. package/src/features/blog/data/BlogCategoryInterface.ts +24 -0
  149. package/src/features/blog/data/BlogCategoryService.ts +54 -0
  150. package/src/features/blog/data/BlogCategoryTranslation.ts +90 -0
  151. package/src/features/blog/data/BlogCategoryTranslationInterface.ts +22 -0
  152. package/src/features/blog/data/BlogCategoryTranslationService.ts +30 -0
  153. package/src/features/blog/data/BlogPost.spec.ts +123 -0
  154. package/src/features/blog/data/BlogPost.ts +159 -0
  155. package/src/features/blog/data/BlogPostFields.ts +7 -0
  156. package/src/features/blog/data/BlogPostInterface.ts +39 -0
  157. package/src/features/blog/data/BlogPostService.ts +82 -0
  158. package/src/features/blog/data/BlogPostTranslation.spec.ts +73 -0
  159. package/src/features/blog/data/BlogPostTranslation.ts +110 -0
  160. package/src/features/blog/data/BlogPostTranslationInterface.ts +27 -0
  161. package/src/features/blog/data/BlogPostTranslationService.ts +30 -0
  162. package/src/features/blog/data/BlogSettings.ts +37 -0
  163. package/src/features/blog/data/BlogSettingsInterface.ts +11 -0
  164. package/src/features/blog/data/BlogSettingsService.ts +24 -0
  165. package/src/features/blog/data/index.ts +17 -0
  166. package/src/features/blog/hooks/index.ts +3 -0
  167. package/src/features/blog/hooks/useBlogCategoryNames.ts +34 -0
  168. package/src/features/blog/hooks/useBlogCategoryTableStructure.tsx +84 -0
  169. package/src/features/blog/hooks/useBlogPostTableStructure.tsx +126 -0
  170. package/src/features/blog/index.ts +15 -0
  171. package/src/features/blog/server/fetchers.ts +120 -0
  172. package/src/features/blog/server/toPublic.spec.ts +91 -0
  173. package/src/features/blog/server/toPublic.ts +36 -0
  174. package/src/features/blog/server-entry.ts +17 -0
  175. package/src/features/blog/types/blog-public.types.ts +34 -0
  176. package/src/features/blog/types/blog.constants.ts +40 -0
  177. package/src/features/email-automation/EmailAutomationEnrollmentModule.ts +11 -0
  178. package/src/features/email-automation/EmailAutomationModule.ts +30 -0
  179. package/src/features/email-automation/EmailAutomationStepModule.ts +11 -0
  180. package/src/features/email-automation/EmailAutomationTriggerModule.ts +11 -0
  181. package/src/features/email-automation/components/__tests__/EmailAutomationEditor.spec.tsx +104 -0
  182. package/src/features/email-automation/components/canvas/EmailAutomationActiveSwitch.tsx +49 -0
  183. package/src/features/email-automation/components/canvas/EmailAutomationCanvas.tsx +474 -0
  184. package/src/features/email-automation/components/canvas/EmailAutomationCanvasInspector.tsx +89 -0
  185. package/src/features/email-automation/components/canvas/EmailAutomationCanvasTab.tsx +32 -0
  186. package/src/features/email-automation/components/canvas/__tests__/buildCanvasGraph.spec.ts +67 -0
  187. package/src/features/email-automation/components/canvas/buildCanvasGraph.ts +141 -0
  188. package/src/features/email-automation/components/canvas/edges/DelayEdge.tsx +68 -0
  189. package/src/features/email-automation/components/canvas/nodes/EmailStepNode.tsx +43 -0
  190. package/src/features/email-automation/components/canvas/nodes/TriggerNode.tsx +23 -0
  191. package/src/features/email-automation/components/canvas/shared/CanvasToolbar.tsx +53 -0
  192. package/src/features/email-automation/components/canvas/shared/EmptyCanvas.tsx +11 -0
  193. package/src/features/email-automation/components/canvas/shared/__tests__/autoLayout.spec.ts +42 -0
  194. package/src/features/email-automation/components/canvas/shared/__tests__/longPress.spec.ts +51 -0
  195. package/src/features/email-automation/components/canvas/shared/autoLayout.ts +55 -0
  196. package/src/features/email-automation/components/canvas/shared/index.ts +4 -0
  197. package/src/features/email-automation/components/canvas/shared/longPress.ts +57 -0
  198. package/src/features/email-automation/components/containers/EmailAutomationContainer.tsx +80 -0
  199. package/src/features/email-automation/components/containers/EmailAutomationsListContainer.tsx +27 -0
  200. package/src/features/email-automation/components/forms/EmailAutomationEditor.tsx +153 -0
  201. package/src/features/email-automation/components/forms/EmailStepEditor.tsx +151 -0
  202. package/src/features/email-automation/components/index.ts +15 -0
  203. package/src/features/email-automation/components/lists/EmailAutomationRecipientsList.tsx +90 -0
  204. package/src/features/email-automation/components/lists/EmailAutomationsList.tsx +76 -0
  205. package/src/features/email-automation/components/unsubscribe/EmailUnsubscribe.tsx +99 -0
  206. package/src/features/email-automation/components/unsubscribe/__tests__/EmailUnsubscribe.spec.tsx +55 -0
  207. package/src/features/email-automation/contexts/EmailAutomationContext.tsx +175 -0
  208. package/src/features/email-automation/data/EmailAutomation.ts +87 -0
  209. package/src/features/email-automation/data/EmailAutomationEnrollment.ts +105 -0
  210. package/src/features/email-automation/data/EmailAutomationEnrollmentInterface.ts +18 -0
  211. package/src/features/email-automation/data/EmailAutomationEnrollmentService.ts +31 -0
  212. package/src/features/email-automation/data/EmailAutomationInterface.ts +22 -0
  213. package/src/features/email-automation/data/EmailAutomationService.ts +106 -0
  214. package/src/features/email-automation/data/EmailAutomationStep.ts +104 -0
  215. package/src/features/email-automation/data/EmailAutomationStepInterface.ts +23 -0
  216. package/src/features/email-automation/data/EmailAutomationStepService.ts +80 -0
  217. package/src/features/email-automation/data/EmailAutomationTrigger.ts +28 -0
  218. package/src/features/email-automation/data/EmailAutomationTriggerInterface.ts +6 -0
  219. package/src/features/email-automation/data/__tests__/email-automation-models.spec.ts +103 -0
  220. package/src/features/email-automation/data/email-automation-enrollment.fields.ts +8 -0
  221. package/src/features/email-automation/data/email-automation.fields.ts +9 -0
  222. package/src/features/email-automation/data/index.ts +13 -0
  223. package/src/features/email-automation/hooks/index.ts +2 -0
  224. package/src/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.tsx +126 -0
  225. package/src/features/email-automation/hooks/useEmailAutomationTableStructure.tsx +119 -0
  226. package/src/features/email-automation/index.ts +5 -0
  227. package/src/features/s3/data/s3.service.ts +17 -0
  228. package/dist/BlockNoteEditor-2QJVK2HH.mjs.map +0 -1
  229. package/dist/BlockNoteEditor-EGY4ZAAM.js.map +0 -1
  230. package/dist/chunk-2Z3ZCYXX.mjs.map +0 -1
  231. package/dist/chunk-HNOWSFM5.mjs.map +0 -1
  232. package/dist/chunk-S5MQDWWC.js.map +0 -1
  233. package/dist/chunk-THKYH65N.js.map +0 -1
  234. package/dist/chunk-YMUPTXOT.mjs.map +0 -1
  235. /package/dist/{BlockNoteViewer-6BQXJ4TB.mjs.map → BlockNoteViewer-AEJKJ27Q.mjs.map} +0 -0
  236. /package/dist/{chunk-NPKFMRH5.mjs.map → chunk-6DC2WVVB.mjs.map} +0 -0
  237. /package/dist/{chunk-JEZQTZQ4.mjs.map → chunk-QMYQRPQC.mjs.map} +0 -0
@@ -6165,6 +6165,1225 @@ var HowToService = class extends AbstractService {
6165
6165
  }
6166
6166
  };
6167
6167
 
6168
+ // src/features/email-automation/EmailAutomationModule.ts
6169
+ import { MailIcon } from "lucide-react";
6170
+
6171
+ // src/features/email-automation/data/EmailAutomation.ts
6172
+ var EmailAutomation = class extends AbstractApiData {
6173
+ static {
6174
+ __name(this, "EmailAutomation");
6175
+ }
6176
+ _name;
6177
+ _trigger;
6178
+ _exitTrigger;
6179
+ _replyTo;
6180
+ _isActive = false;
6181
+ _stepCount;
6182
+ _activeCount;
6183
+ _completedCount;
6184
+ _unsubscribedCount;
6185
+ get name() {
6186
+ return this._name ?? "";
6187
+ }
6188
+ get trigger() {
6189
+ return this._trigger;
6190
+ }
6191
+ get exitTrigger() {
6192
+ return this._exitTrigger;
6193
+ }
6194
+ get replyTo() {
6195
+ return this._replyTo;
6196
+ }
6197
+ get isActive() {
6198
+ return this._isActive;
6199
+ }
6200
+ get stepCount() {
6201
+ return this._stepCount ?? 0;
6202
+ }
6203
+ get activeCount() {
6204
+ return this._activeCount ?? 0;
6205
+ }
6206
+ get completedCount() {
6207
+ return this._completedCount ?? 0;
6208
+ }
6209
+ get unsubscribedCount() {
6210
+ return this._unsubscribedCount ?? 0;
6211
+ }
6212
+ rehydrate(data) {
6213
+ super.rehydrate(data);
6214
+ this._name = data.jsonApi.attributes.name;
6215
+ this._trigger = data.jsonApi.attributes.trigger ?? void 0;
6216
+ this._exitTrigger = data.jsonApi.attributes.exitTrigger ?? void 0;
6217
+ this._replyTo = data.jsonApi.attributes.replyTo ?? void 0;
6218
+ this._isActive = data.jsonApi.attributes.isActive === true;
6219
+ this._stepCount = data.jsonApi.attributes.stepCount;
6220
+ this._activeCount = data.jsonApi.attributes.activeCount;
6221
+ this._completedCount = data.jsonApi.attributes.completedCount;
6222
+ this._unsubscribedCount = data.jsonApi.attributes.unsubscribedCount;
6223
+ return this;
6224
+ }
6225
+ createJsonApi(data) {
6226
+ const response = {
6227
+ data: {
6228
+ type: Modules.EmailAutomation.name,
6229
+ id: data.id,
6230
+ attributes: {},
6231
+ meta: {},
6232
+ relationships: {}
6233
+ },
6234
+ included: []
6235
+ };
6236
+ if (data.name !== void 0) response.data.attributes.name = data.name;
6237
+ if (data.trigger !== void 0) response.data.attributes.trigger = data.trigger;
6238
+ if (data.exitTrigger !== void 0) response.data.attributes.exitTrigger = data.exitTrigger;
6239
+ if (data.replyTo !== void 0) response.data.attributes.replyTo = data.replyTo;
6240
+ if (data.isActive !== void 0) response.data.attributes.isActive = data.isActive;
6241
+ return response;
6242
+ }
6243
+ };
6244
+
6245
+ // src/features/email-automation/EmailAutomationModule.ts
6246
+ var EmailAutomationModule = /* @__PURE__ */ __name((factory) => factory({
6247
+ moduleId: "3f6c1a2e-7b94-4d1e-8c55-9a0b2e4f6d71",
6248
+ pageUrl: "/administration/email-automations",
6249
+ name: "email-automations",
6250
+ model: EmailAutomation,
6251
+ icon: MailIcon,
6252
+ inclusions: {
6253
+ lists: {
6254
+ fields: [
6255
+ createJsonApiInclusion("email-automations", [
6256
+ "name",
6257
+ "trigger",
6258
+ "exitTrigger",
6259
+ "replyTo",
6260
+ "isActive",
6261
+ "stepCount",
6262
+ "activeCount",
6263
+ "completedCount",
6264
+ "unsubscribedCount"
6265
+ ])
6266
+ ]
6267
+ }
6268
+ }
6269
+ }), "EmailAutomationModule");
6270
+
6271
+ // src/features/email-automation/EmailAutomationStepModule.ts
6272
+ import { MailIcon as MailIcon2 } from "lucide-react";
6273
+
6274
+ // src/features/email-automation/data/EmailAutomationStep.ts
6275
+ var EmailAutomationStep = class extends AbstractApiData {
6276
+ static {
6277
+ __name(this, "EmailAutomationStep");
6278
+ }
6279
+ _subject;
6280
+ _body;
6281
+ _delayHours;
6282
+ _positionX;
6283
+ _positionY;
6284
+ _sentCount;
6285
+ _automation;
6286
+ _next;
6287
+ get subject() {
6288
+ return this._subject ?? "";
6289
+ }
6290
+ get body() {
6291
+ return this._body ?? "";
6292
+ }
6293
+ get delayHours() {
6294
+ return this._delayHours ?? 0;
6295
+ }
6296
+ get positionX() {
6297
+ return this._positionX;
6298
+ }
6299
+ get positionY() {
6300
+ return this._positionY;
6301
+ }
6302
+ get sentCount() {
6303
+ return this._sentCount ?? 0;
6304
+ }
6305
+ get automation() {
6306
+ return this._automation;
6307
+ }
6308
+ get next() {
6309
+ return this._next;
6310
+ }
6311
+ rehydrate(data) {
6312
+ super.rehydrate(data);
6313
+ this._subject = data.jsonApi.attributes.subject;
6314
+ this._body = data.jsonApi.attributes.body;
6315
+ this._delayHours = data.jsonApi.attributes.delayHours;
6316
+ this._positionX = data.jsonApi.attributes.positionX ?? void 0;
6317
+ this._positionY = data.jsonApi.attributes.positionY ?? void 0;
6318
+ this._sentCount = data.jsonApi.attributes.sentCount;
6319
+ this._automation = this._readIncluded(data, "automation", Modules.EmailAutomation);
6320
+ this._next = this._readIncluded(data, "next", Modules.EmailAutomationStep);
6321
+ return this;
6322
+ }
6323
+ createJsonApi(data) {
6324
+ const response = {
6325
+ data: {
6326
+ type: Modules.EmailAutomationStep.name,
6327
+ id: data.id,
6328
+ attributes: {},
6329
+ meta: {},
6330
+ relationships: {}
6331
+ },
6332
+ included: []
6333
+ };
6334
+ if (data.subject !== void 0) response.data.attributes.subject = data.subject;
6335
+ if (data.body !== void 0) response.data.attributes.body = data.body;
6336
+ if (data.delayHours !== void 0) response.data.attributes.delayHours = data.delayHours;
6337
+ if (data.positionX !== void 0) response.data.attributes.positionX = data.positionX;
6338
+ if (data.positionY !== void 0) response.data.attributes.positionY = data.positionY;
6339
+ if (data.automationId) {
6340
+ response.data.relationships.automation = {
6341
+ data: {
6342
+ type: Modules.EmailAutomation.name,
6343
+ id: data.automationId
6344
+ }
6345
+ };
6346
+ }
6347
+ return response;
6348
+ }
6349
+ /**
6350
+ * Body of POST email-automation-steps/:stepId/next: the step the chain continues to.
6351
+ */
6352
+ createNextJsonApi(params) {
6353
+ return {
6354
+ data: {
6355
+ type: Modules.EmailAutomationStep.name,
6356
+ id: params.nextStepId
6357
+ }
6358
+ };
6359
+ }
6360
+ };
6361
+
6362
+ // src/features/email-automation/EmailAutomationStepModule.ts
6363
+ var EmailAutomationStepModule = /* @__PURE__ */ __name((factory) => factory({
6364
+ pageUrl: void 0,
6365
+ name: "email-automation-steps",
6366
+ model: EmailAutomationStep,
6367
+ icon: MailIcon2
6368
+ }), "EmailAutomationStepModule");
6369
+
6370
+ // src/features/email-automation/EmailAutomationEnrollmentModule.ts
6371
+ import { UsersIcon } from "lucide-react";
6372
+
6373
+ // src/features/email-automation/data/EmailAutomationEnrollment.ts
6374
+ var EMAIL_AUTOMATION_UNSUBSCRIBE_TYPE = "email-automation-unsubscribes";
6375
+ var EmailAutomationEnrollment = class extends AbstractApiData {
6376
+ static {
6377
+ __name(this, "EmailAutomationEnrollment");
6378
+ }
6379
+ _email;
6380
+ _name;
6381
+ _status = "active";
6382
+ _enrolledAt;
6383
+ _nextSendAt;
6384
+ _finishedAt;
6385
+ _attempts;
6386
+ _lastError;
6387
+ _currentStepSubject;
6388
+ _sentCount;
6389
+ _automation;
6390
+ get email() {
6391
+ return this._email ?? "";
6392
+ }
6393
+ get name() {
6394
+ return this._name;
6395
+ }
6396
+ get status() {
6397
+ return this._status;
6398
+ }
6399
+ get enrolledAt() {
6400
+ return this._enrolledAt ?? /* @__PURE__ */ new Date(0);
6401
+ }
6402
+ get nextSendAt() {
6403
+ return this._nextSendAt;
6404
+ }
6405
+ get finishedAt() {
6406
+ return this._finishedAt;
6407
+ }
6408
+ get attempts() {
6409
+ return this._attempts ?? 0;
6410
+ }
6411
+ get lastError() {
6412
+ return this._lastError;
6413
+ }
6414
+ get currentStepSubject() {
6415
+ return this._currentStepSubject;
6416
+ }
6417
+ get sentCount() {
6418
+ return this._sentCount ?? 0;
6419
+ }
6420
+ get automation() {
6421
+ return this._automation;
6422
+ }
6423
+ rehydrate(data) {
6424
+ super.rehydrate(data);
6425
+ const attributes = data.jsonApi.attributes;
6426
+ this._email = attributes.email;
6427
+ this._name = attributes.name ?? void 0;
6428
+ this._status = attributes.status ?? "active";
6429
+ this._enrolledAt = attributes.enrolledAt ? new Date(attributes.enrolledAt) : void 0;
6430
+ this._nextSendAt = attributes.nextSendAt ? new Date(attributes.nextSendAt) : void 0;
6431
+ this._finishedAt = attributes.finishedAt ? new Date(attributes.finishedAt) : void 0;
6432
+ this._attempts = attributes.attempts;
6433
+ this._lastError = attributes.lastError ?? void 0;
6434
+ this._currentStepSubject = attributes.currentStepSubject ?? void 0;
6435
+ this._sentCount = attributes.sentCount;
6436
+ this._automation = this._readIncluded(data, "automation", Modules.EmailAutomation);
6437
+ return this;
6438
+ }
6439
+ createJsonApi(_data) {
6440
+ throw new Error("EmailAutomationEnrollment is created by the API and cannot be created from the client");
6441
+ }
6442
+ /**
6443
+ * Body of POST email-automations/unsubscribe/:token.
6444
+ */
6445
+ createUnsubscribeJsonApi(params) {
6446
+ return {
6447
+ data: {
6448
+ type: EMAIL_AUTOMATION_UNSUBSCRIBE_TYPE,
6449
+ attributes: {
6450
+ scope: params.scope
6451
+ }
6452
+ }
6453
+ };
6454
+ }
6455
+ };
6456
+
6457
+ // src/features/email-automation/EmailAutomationEnrollmentModule.ts
6458
+ var EmailAutomationEnrollmentModule = /* @__PURE__ */ __name((factory) => factory({
6459
+ pageUrl: void 0,
6460
+ name: "email-automation-enrollments",
6461
+ model: EmailAutomationEnrollment,
6462
+ icon: UsersIcon
6463
+ }), "EmailAutomationEnrollmentModule");
6464
+
6465
+ // src/features/email-automation/EmailAutomationTriggerModule.ts
6466
+ import { ZapIcon } from "lucide-react";
6467
+
6468
+ // src/features/email-automation/data/EmailAutomationTrigger.ts
6469
+ var EmailAutomationTrigger = class extends AbstractApiData {
6470
+ static {
6471
+ __name(this, "EmailAutomationTrigger");
6472
+ }
6473
+ _key;
6474
+ _label;
6475
+ get key() {
6476
+ return this._key ?? "";
6477
+ }
6478
+ get label() {
6479
+ return this._label ?? "";
6480
+ }
6481
+ rehydrate(data) {
6482
+ super.rehydrate(data);
6483
+ this._key = data.jsonApi.attributes.key;
6484
+ this._label = data.jsonApi.attributes.label;
6485
+ return this;
6486
+ }
6487
+ createJsonApi(_data) {
6488
+ throw new Error("EmailAutomationTrigger is declared by the API and is read-only");
6489
+ }
6490
+ };
6491
+
6492
+ // src/features/email-automation/EmailAutomationTriggerModule.ts
6493
+ var EmailAutomationTriggerModule = /* @__PURE__ */ __name((factory) => factory({
6494
+ pageUrl: void 0,
6495
+ name: "email-automation-triggers",
6496
+ model: EmailAutomationTrigger,
6497
+ icon: ZapIcon
6498
+ }), "EmailAutomationTriggerModule");
6499
+
6500
+ // src/features/email-automation/data/EmailAutomationService.ts
6501
+ var EmailAutomationService = class extends AbstractService {
6502
+ static {
6503
+ __name(this, "EmailAutomationService");
6504
+ }
6505
+ static async findMany(params = {}) {
6506
+ const endpoint = new EndpointCreator({ endpoint: Modules.EmailAutomation });
6507
+ if (Modules.EmailAutomation.inclusions?.lists?.fields)
6508
+ endpoint.limitToFields(Modules.EmailAutomation.inclusions.lists.fields);
6509
+ if (Modules.EmailAutomation.inclusions?.lists?.types)
6510
+ endpoint.limitToType(Modules.EmailAutomation.inclusions.lists.types);
6511
+ return this.callApi({
6512
+ type: Modules.EmailAutomation,
6513
+ method: "GET" /* GET */,
6514
+ endpoint: endpoint.generate(),
6515
+ next: params.next,
6516
+ previous: params.previous
6517
+ });
6518
+ }
6519
+ static async findOne(params) {
6520
+ return this.callApi({
6521
+ type: Modules.EmailAutomation,
6522
+ method: "GET" /* GET */,
6523
+ endpoint: new EndpointCreator({ endpoint: Modules.EmailAutomation, id: params.id }).generate()
6524
+ });
6525
+ }
6526
+ static async create(params) {
6527
+ return this.callApi({
6528
+ type: Modules.EmailAutomation,
6529
+ method: "POST" /* POST */,
6530
+ endpoint: new EndpointCreator({ endpoint: Modules.EmailAutomation }).generate(),
6531
+ input: params
6532
+ });
6533
+ }
6534
+ static async update(params) {
6535
+ return this.callApi({
6536
+ type: Modules.EmailAutomation,
6537
+ method: "PATCH" /* PATCH */,
6538
+ endpoint: new EndpointCreator({ endpoint: Modules.EmailAutomation, id: params.id }).generate(),
6539
+ input: params
6540
+ });
6541
+ }
6542
+ static async delete(params) {
6543
+ await this.callApi({
6544
+ type: Modules.EmailAutomation,
6545
+ method: "DELETE" /* DELETE */,
6546
+ endpoint: new EndpointCreator({ endpoint: Modules.EmailAutomation, id: params.id }).generate()
6547
+ });
6548
+ }
6549
+ /**
6550
+ * GET email-automations/triggers: the triggers the app declared to the API.
6551
+ */
6552
+ static async findTriggers() {
6553
+ return this.callApi({
6554
+ type: Modules.EmailAutomationTrigger,
6555
+ method: "GET" /* GET */,
6556
+ endpoint: new EndpointCreator({ endpoint: Modules.EmailAutomation, id: "triggers" }).generate()
6557
+ });
6558
+ }
6559
+ /**
6560
+ * POST email-automations/:id/tidy: clears every manual step position. Replies 204.
6561
+ */
6562
+ static async tidy(params) {
6563
+ await this.callApi({
6564
+ type: Modules.EmailAutomation,
6565
+ method: "POST" /* POST */,
6566
+ endpoint: new EndpointCreator({
6567
+ endpoint: Modules.EmailAutomation,
6568
+ id: params.id,
6569
+ childEndpoint: "tidy"
6570
+ }).generate()
6571
+ });
6572
+ }
6573
+ static async findEnrollments(params) {
6574
+ const endpoint = new EndpointCreator({
6575
+ endpoint: Modules.EmailAutomation,
6576
+ id: params.automationId,
6577
+ childEndpoint: Modules.EmailAutomationEnrollment
6578
+ });
6579
+ if (params.status) endpoint.addAdditionalParam("status", params.status);
6580
+ return this.callApi({
6581
+ type: Modules.EmailAutomationEnrollment,
6582
+ method: "GET" /* GET */,
6583
+ endpoint: endpoint.generate(),
6584
+ next: params.next,
6585
+ previous: params.previous
6586
+ });
6587
+ }
6588
+ };
6589
+
6590
+ // src/features/email-automation/data/EmailAutomationStepService.ts
6591
+ var EmailAutomationStepService = class extends AbstractService {
6592
+ static {
6593
+ __name(this, "EmailAutomationStepService");
6594
+ }
6595
+ static async findByAutomation(params) {
6596
+ const endpoint = new EndpointCreator({
6597
+ endpoint: Modules.EmailAutomation,
6598
+ id: params.automationId,
6599
+ childEndpoint: Modules.EmailAutomationStep
6600
+ });
6601
+ endpoint.addAdditionalParam("fetchAll", "true");
6602
+ return this.callApi({
6603
+ type: Modules.EmailAutomationStep,
6604
+ method: "GET" /* GET */,
6605
+ endpoint: endpoint.generate()
6606
+ });
6607
+ }
6608
+ static async create(params) {
6609
+ return this.callApi({
6610
+ type: Modules.EmailAutomationStep,
6611
+ method: "POST" /* POST */,
6612
+ endpoint: new EndpointCreator({ endpoint: Modules.EmailAutomationStep }).generate(),
6613
+ input: params
6614
+ });
6615
+ }
6616
+ static async update(params) {
6617
+ return this.callApi({
6618
+ type: Modules.EmailAutomationStep,
6619
+ method: "PATCH" /* PATCH */,
6620
+ endpoint: new EndpointCreator({ endpoint: Modules.EmailAutomationStep, id: params.id }).generate(),
6621
+ input: params
6622
+ });
6623
+ }
6624
+ static async delete(params) {
6625
+ await this.callApi({
6626
+ type: Modules.EmailAutomationStep,
6627
+ method: "DELETE" /* DELETE */,
6628
+ endpoint: new EndpointCreator({ endpoint: Modules.EmailAutomationStep, id: params.id }).generate()
6629
+ });
6630
+ }
6631
+ /**
6632
+ * POST email-automation-steps/:stepId/next: continues the chain from stepId to nextStepId.
6633
+ */
6634
+ static async setNext(params) {
6635
+ const step = new EmailAutomationStep();
6636
+ return this.callApi({
6637
+ type: Modules.EmailAutomationStep,
6638
+ method: "POST" /* POST */,
6639
+ endpoint: new EndpointCreator({
6640
+ endpoint: Modules.EmailAutomationStep,
6641
+ id: params.stepId,
6642
+ childEndpoint: "next"
6643
+ }).generate(),
6644
+ input: step.createNextJsonApi({ nextStepId: params.nextStepId }),
6645
+ overridesJsonApiCreation: true
6646
+ });
6647
+ }
6648
+ /**
6649
+ * DELETE email-automation-steps/:stepId/next: the step becomes the end of the chain.
6650
+ */
6651
+ static async clearNext(params) {
6652
+ await this.callApi({
6653
+ type: Modules.EmailAutomationStep,
6654
+ method: "DELETE" /* DELETE */,
6655
+ endpoint: new EndpointCreator({
6656
+ endpoint: Modules.EmailAutomationStep,
6657
+ id: params.stepId,
6658
+ childEndpoint: "next"
6659
+ }).generate()
6660
+ });
6661
+ }
6662
+ };
6663
+
6664
+ // src/features/email-automation/data/EmailAutomationEnrollmentService.ts
6665
+ var EmailAutomationEnrollmentService = class extends AbstractService {
6666
+ static {
6667
+ __name(this, "EmailAutomationEnrollmentService");
6668
+ }
6669
+ /**
6670
+ * POST email-automations/unsubscribe/:token (public). The scope travels both as
6671
+ * a query parameter and in the body, as the API reads either.
6672
+ */
6673
+ static async unsubscribe(params) {
6674
+ const enrollment = new EmailAutomationEnrollment();
6675
+ const endpoint = new EndpointCreator({
6676
+ endpoint: Modules.EmailAutomation,
6677
+ childEndpoint: "unsubscribe",
6678
+ childId: params.token
6679
+ });
6680
+ endpoint.addAdditionalParam("scope", params.scope);
6681
+ return this.callApi({
6682
+ type: Modules.EmailAutomationEnrollment,
6683
+ method: "POST" /* POST */,
6684
+ endpoint: endpoint.generate(),
6685
+ input: enrollment.createUnsubscribeJsonApi({ scope: params.scope }),
6686
+ overridesJsonApiCreation: true
6687
+ });
6688
+ }
6689
+ };
6690
+
6691
+ // src/features/email-automation/data/email-automation.fields.ts
6692
+ var EmailAutomationFields = /* @__PURE__ */ ((EmailAutomationFields2) => {
6693
+ EmailAutomationFields2["name"] = "name";
6694
+ EmailAutomationFields2["trigger"] = "trigger";
6695
+ EmailAutomationFields2["status"] = "status";
6696
+ EmailAutomationFields2["steps"] = "steps";
6697
+ EmailAutomationFields2["active"] = "active";
6698
+ EmailAutomationFields2["completed"] = "completed";
6699
+ EmailAutomationFields2["unsubscribed"] = "unsubscribed";
6700
+ return EmailAutomationFields2;
6701
+ })(EmailAutomationFields || {});
6702
+
6703
+ // src/features/email-automation/data/email-automation-enrollment.fields.ts
6704
+ var EmailAutomationEnrollmentFields = /* @__PURE__ */ ((EmailAutomationEnrollmentFields2) => {
6705
+ EmailAutomationEnrollmentFields2["email"] = "email";
6706
+ EmailAutomationEnrollmentFields2["name"] = "name";
6707
+ EmailAutomationEnrollmentFields2["status"] = "status";
6708
+ EmailAutomationEnrollmentFields2["currentStep"] = "currentStep";
6709
+ EmailAutomationEnrollmentFields2["nextSendAt"] = "nextSendAt";
6710
+ EmailAutomationEnrollmentFields2["sentCount"] = "sentCount";
6711
+ return EmailAutomationEnrollmentFields2;
6712
+ })(EmailAutomationEnrollmentFields || {});
6713
+
6714
+ // src/features/blog/BlogModules.ts
6715
+ import { NewspaperIcon } from "lucide-react";
6716
+
6717
+ // src/features/blog/data/BlogCategory.ts
6718
+ var BlogCategory = class extends AbstractApiData {
6719
+ static {
6720
+ __name(this, "BlogCategory");
6721
+ }
6722
+ _originalLanguage;
6723
+ _image;
6724
+ _translations;
6725
+ _language;
6726
+ _name;
6727
+ _slug;
6728
+ _description;
6729
+ get originalLanguage() {
6730
+ return this._originalLanguage ?? "";
6731
+ }
6732
+ get image() {
6733
+ return this._image;
6734
+ }
6735
+ get translations() {
6736
+ return this._translations ?? [];
6737
+ }
6738
+ get original() {
6739
+ return this.translations.find((translation) => translation.isOriginal);
6740
+ }
6741
+ get language() {
6742
+ return this._language;
6743
+ }
6744
+ get name() {
6745
+ return this._name;
6746
+ }
6747
+ get slug() {
6748
+ return this._slug;
6749
+ }
6750
+ get description() {
6751
+ return this._description;
6752
+ }
6753
+ rehydrate(data) {
6754
+ super.rehydrate(data);
6755
+ const attributes = data.jsonApi.attributes ?? {};
6756
+ const meta = data.jsonApi.meta ?? {};
6757
+ const resolved = /* @__PURE__ */ __name((key) => attributes[key] ?? meta[key] ?? void 0, "resolved");
6758
+ this._originalLanguage = attributes.originalLanguage;
6759
+ this._image = attributes.image ?? void 0;
6760
+ this._language = resolved("language");
6761
+ this._name = resolved("name");
6762
+ this._slug = resolved("slug");
6763
+ this._description = resolved("description");
6764
+ this._translations = this._readIncluded(
6765
+ data,
6766
+ "translations",
6767
+ Modules.BlogCategoryTranslation
6768
+ );
6769
+ return this;
6770
+ }
6771
+ createJsonApi(data) {
6772
+ const response = {
6773
+ data: {
6774
+ type: Modules.BlogCategory.name,
6775
+ id: data.id,
6776
+ attributes: {},
6777
+ meta: {},
6778
+ relationships: {}
6779
+ },
6780
+ included: []
6781
+ };
6782
+ if (data.originalLanguage !== void 0) response.data.attributes.originalLanguage = data.originalLanguage;
6783
+ if (data.name !== void 0) response.data.attributes.name = data.name;
6784
+ if (data.slug !== void 0) response.data.attributes.slug = data.slug;
6785
+ if (data.description !== void 0) response.data.attributes.description = data.description;
6786
+ if (data.image !== void 0) response.data.attributes.image = data.image;
6787
+ return response;
6788
+ }
6789
+ };
6790
+
6791
+ // src/features/blog/data/BlogCategoryTranslation.ts
6792
+ var BlogCategoryTranslation = class extends AbstractApiData {
6793
+ static {
6794
+ __name(this, "BlogCategoryTranslation");
6795
+ }
6796
+ _language;
6797
+ _isOriginal;
6798
+ _source;
6799
+ _aiStatus;
6800
+ _name;
6801
+ _slug;
6802
+ _description;
6803
+ _translatedAt;
6804
+ _category;
6805
+ get language() {
6806
+ return this._language ?? "";
6807
+ }
6808
+ get isOriginal() {
6809
+ return this._isOriginal ?? false;
6810
+ }
6811
+ get source() {
6812
+ return this._source ?? "ai";
6813
+ }
6814
+ get aiStatus() {
6815
+ return this._aiStatus ?? "pending";
6816
+ }
6817
+ get name() {
6818
+ return this._name ?? "";
6819
+ }
6820
+ get slug() {
6821
+ return this._slug ?? "";
6822
+ }
6823
+ get description() {
6824
+ return this._description;
6825
+ }
6826
+ get translatedAt() {
6827
+ return this._translatedAt;
6828
+ }
6829
+ get category() {
6830
+ return this._category;
6831
+ }
6832
+ rehydrate(data) {
6833
+ super.rehydrate(data);
6834
+ const attributes = data.jsonApi.attributes ?? {};
6835
+ this._language = attributes.language;
6836
+ this._isOriginal = attributes.isOriginal === true;
6837
+ this._source = attributes.source;
6838
+ this._aiStatus = attributes.aiStatus;
6839
+ this._name = attributes.name ?? void 0;
6840
+ this._slug = attributes.slug ?? void 0;
6841
+ this._description = attributes.description ?? void 0;
6842
+ this._translatedAt = attributes.translatedAt ? new Date(attributes.translatedAt) : void 0;
6843
+ this._category = this._readIncluded(data, "category", Modules.BlogCategory);
6844
+ return this;
6845
+ }
6846
+ createJsonApi(data) {
6847
+ const response = {
6848
+ data: {
6849
+ type: Modules.BlogCategoryTranslation.name,
6850
+ id: data.id,
6851
+ attributes: {},
6852
+ meta: {},
6853
+ relationships: {}
6854
+ },
6855
+ included: []
6856
+ };
6857
+ if (data.name !== void 0) response.data.attributes.name = data.name;
6858
+ if (data.slug !== void 0) response.data.attributes.slug = data.slug;
6859
+ if (data.description !== void 0) response.data.attributes.description = data.description;
6860
+ return response;
6861
+ }
6862
+ };
6863
+
6864
+ // src/features/blog/data/BlogPost.ts
6865
+ var BlogPost = class extends AbstractApiData {
6866
+ static {
6867
+ __name(this, "BlogPost");
6868
+ }
6869
+ _status;
6870
+ _originalLanguage;
6871
+ _coverImage;
6872
+ _publishedAt;
6873
+ _author;
6874
+ _categories;
6875
+ _translations;
6876
+ _language;
6877
+ _title;
6878
+ _slug;
6879
+ _summary;
6880
+ _body;
6881
+ _coverImageAlt;
6882
+ _readingMinutes;
6883
+ _authorName;
6884
+ _categoryIds;
6885
+ get status() {
6886
+ return this._status ?? "draft";
6887
+ }
6888
+ get originalLanguage() {
6889
+ return this._originalLanguage ?? "";
6890
+ }
6891
+ get coverImage() {
6892
+ return this._coverImage;
6893
+ }
6894
+ get publishedAt() {
6895
+ return this._publishedAt;
6896
+ }
6897
+ get author() {
6898
+ return this._author;
6899
+ }
6900
+ get categories() {
6901
+ return this._categories ?? [];
6902
+ }
6903
+ get translations() {
6904
+ return this._translations ?? [];
6905
+ }
6906
+ get original() {
6907
+ return this.translations.find((translation) => translation.isOriginal);
6908
+ }
6909
+ get language() {
6910
+ return this._language;
6911
+ }
6912
+ get title() {
6913
+ return this._title;
6914
+ }
6915
+ get slug() {
6916
+ return this._slug;
6917
+ }
6918
+ get summary() {
6919
+ return this._summary;
6920
+ }
6921
+ get body() {
6922
+ return this._body ?? [];
6923
+ }
6924
+ get coverImageAlt() {
6925
+ return this._coverImageAlt;
6926
+ }
6927
+ get readingMinutes() {
6928
+ return this._readingMinutes;
6929
+ }
6930
+ get authorName() {
6931
+ return this._authorName;
6932
+ }
6933
+ get categoryIds() {
6934
+ return this._categoryIds ?? [];
6935
+ }
6936
+ rehydrate(data) {
6937
+ super.rehydrate(data);
6938
+ const attributes = data.jsonApi.attributes ?? {};
6939
+ const meta = data.jsonApi.meta ?? {};
6940
+ const resolved = /* @__PURE__ */ __name((key) => attributes[key] ?? meta[key] ?? void 0, "resolved");
6941
+ this._status = attributes.status;
6942
+ this._originalLanguage = attributes.originalLanguage;
6943
+ this._coverImage = attributes.coverImage ?? void 0;
6944
+ this._publishedAt = attributes.publishedAt ? new Date(attributes.publishedAt) : void 0;
6945
+ this._language = resolved("language");
6946
+ this._title = resolved("title");
6947
+ this._slug = resolved("slug");
6948
+ this._summary = resolved("summary");
6949
+ const body = resolved("body");
6950
+ this._body = body ? JSON.parse(body) : void 0;
6951
+ this._coverImageAlt = resolved("coverImageAlt");
6952
+ this._readingMinutes = resolved("readingMinutes");
6953
+ this._authorName = resolved("authorName");
6954
+ this._categoryIds = resolved("categoryIds") ?? [];
6955
+ this._author = this._readIncluded(data, "author", Modules.User);
6956
+ this._categories = this._readIncluded(data, "categories", Modules.BlogCategory);
6957
+ this._translations = this._readIncluded(
6958
+ data,
6959
+ "translations",
6960
+ Modules.BlogPostTranslation
6961
+ );
6962
+ return this;
6963
+ }
6964
+ createJsonApi(data) {
6965
+ const response = {
6966
+ data: {
6967
+ type: Modules.BlogPost.name,
6968
+ id: data.id,
6969
+ attributes: {},
6970
+ meta: {},
6971
+ relationships: {}
6972
+ },
6973
+ included: []
6974
+ };
6975
+ if (data.originalLanguage !== void 0) response.data.attributes.originalLanguage = data.originalLanguage;
6976
+ if (data.title !== void 0) response.data.attributes.title = data.title;
6977
+ if (data.slug !== void 0) response.data.attributes.slug = data.slug;
6978
+ if (data.summary !== void 0) response.data.attributes.summary = data.summary;
6979
+ if (data.body !== void 0) response.data.attributes.body = JSON.stringify(data.body);
6980
+ if (data.coverImage !== void 0) response.data.attributes.coverImage = data.coverImage;
6981
+ if (data.coverImageAlt !== void 0) response.data.attributes.coverImageAlt = data.coverImageAlt;
6982
+ if (data.categoryIds !== void 0) {
6983
+ response.data.relationships.categories = {
6984
+ data: data.categoryIds.map((id) => ({ type: Modules.BlogCategory.name, id }))
6985
+ };
6986
+ }
6987
+ return response;
6988
+ }
6989
+ };
6990
+
6991
+ // src/features/blog/data/BlogPostTranslation.ts
6992
+ var BlogPostTranslation = class extends AbstractApiData {
6993
+ static {
6994
+ __name(this, "BlogPostTranslation");
6995
+ }
6996
+ _language;
6997
+ _isOriginal;
6998
+ _source;
6999
+ _aiStatus;
7000
+ _title;
7001
+ _slug;
7002
+ _summary;
7003
+ _body;
7004
+ _coverImageAlt;
7005
+ _readingMinutes;
7006
+ _translatedAt;
7007
+ _post;
7008
+ get language() {
7009
+ return this._language ?? "";
7010
+ }
7011
+ get isOriginal() {
7012
+ return this._isOriginal ?? false;
7013
+ }
7014
+ get source() {
7015
+ return this._source ?? "ai";
7016
+ }
7017
+ get aiStatus() {
7018
+ return this._aiStatus ?? "pending";
7019
+ }
7020
+ get title() {
7021
+ return this._title ?? "";
7022
+ }
7023
+ get slug() {
7024
+ return this._slug ?? "";
7025
+ }
7026
+ get summary() {
7027
+ return this._summary;
7028
+ }
7029
+ get body() {
7030
+ return this._body ?? [];
7031
+ }
7032
+ get coverImageAlt() {
7033
+ return this._coverImageAlt;
7034
+ }
7035
+ get readingMinutes() {
7036
+ return this._readingMinutes ?? 1;
7037
+ }
7038
+ get translatedAt() {
7039
+ return this._translatedAt;
7040
+ }
7041
+ get post() {
7042
+ return this._post;
7043
+ }
7044
+ rehydrate(data) {
7045
+ super.rehydrate(data);
7046
+ const attributes = data.jsonApi.attributes ?? {};
7047
+ this._language = attributes.language;
7048
+ this._isOriginal = attributes.isOriginal === true;
7049
+ this._source = attributes.source;
7050
+ this._aiStatus = attributes.aiStatus;
7051
+ this._title = attributes.title ?? void 0;
7052
+ this._slug = attributes.slug ?? void 0;
7053
+ this._summary = attributes.summary ?? void 0;
7054
+ this._body = attributes.body ? JSON.parse(attributes.body) : void 0;
7055
+ this._coverImageAlt = attributes.coverImageAlt ?? void 0;
7056
+ this._readingMinutes = attributes.readingMinutes ?? void 0;
7057
+ this._translatedAt = attributes.translatedAt ? new Date(attributes.translatedAt) : void 0;
7058
+ this._post = this._readIncluded(data, "post", Modules.BlogPost);
7059
+ return this;
7060
+ }
7061
+ createJsonApi(data) {
7062
+ const response = {
7063
+ data: {
7064
+ type: Modules.BlogPostTranslation.name,
7065
+ id: data.id,
7066
+ attributes: {},
7067
+ meta: {},
7068
+ relationships: {}
7069
+ },
7070
+ included: []
7071
+ };
7072
+ if (data.title !== void 0) response.data.attributes.title = data.title;
7073
+ if (data.slug !== void 0) response.data.attributes.slug = data.slug;
7074
+ if (data.summary !== void 0) response.data.attributes.summary = data.summary;
7075
+ if (data.body !== void 0) response.data.attributes.body = JSON.stringify(data.body);
7076
+ if (data.coverImageAlt !== void 0) response.data.attributes.coverImageAlt = data.coverImageAlt;
7077
+ return response;
7078
+ }
7079
+ };
7080
+
7081
+ // src/features/blog/types/blog.constants.ts
7082
+ var BLOG_LIST_LAYOUTS = ["featured", "column", "rail"];
7083
+ var BLOG_POST_STATUSES = ["draft", "published", "unpublished"];
7084
+ var BLOG_TRANSLATION_SOURCES = ["original", "ai", "manual"];
7085
+ var BLOG_SETTINGS_ID = "5f3c2a9e-8d41-4b7a-9c2e-1a6b0d4e7f13";
7086
+ var BLOG_MODULE_ID = "c1d0e6a2-4b8f-4f3e-9a7d-2e5b8c6f1a90";
7087
+ var BLOG_UPLOAD_ROOT = "blog";
7088
+ var BLOG_POST_UPLOAD_PREFIX = `${BLOG_UPLOAD_ROOT}/blog-posts`;
7089
+ var BLOG_CATEGORY_UPLOAD_PREFIX = `${BLOG_UPLOAD_ROOT}/blog-categories`;
7090
+ var BLOG_PUBLIC_PREFIX = "public";
7091
+ var BLOG_ACTION = {
7092
+ publish: "publish",
7093
+ unpublish: "unpublish",
7094
+ retranslate: "retranslate",
7095
+ related: "related"
7096
+ };
7097
+
7098
+ // src/features/blog/data/BlogSettings.ts
7099
+ var BlogSettings = class extends AbstractApiData {
7100
+ static {
7101
+ __name(this, "BlogSettings");
7102
+ }
7103
+ _listLayout;
7104
+ get listLayout() {
7105
+ return this._listLayout ?? "featured";
7106
+ }
7107
+ rehydrate(data) {
7108
+ super.rehydrate(data);
7109
+ const listLayout = data.jsonApi.attributes?.listLayout;
7110
+ this._listLayout = BLOG_LIST_LAYOUTS.includes(listLayout) ? listLayout : void 0;
7111
+ return this;
7112
+ }
7113
+ createJsonApi(data) {
7114
+ const response = {
7115
+ data: {
7116
+ type: Modules.BlogSettings.name,
7117
+ id: data.id,
7118
+ attributes: {},
7119
+ meta: {},
7120
+ relationships: {}
7121
+ },
7122
+ included: []
7123
+ };
7124
+ response.data.attributes.listLayout = data.listLayout;
7125
+ return response;
7126
+ }
7127
+ };
7128
+
7129
+ // src/features/blog/BlogModules.ts
7130
+ var BlogPostModule = /* @__PURE__ */ __name((factory) => factory({
7131
+ moduleId: BLOG_MODULE_ID,
7132
+ pageUrl: "/administration/blog",
7133
+ name: "blog-posts",
7134
+ model: BlogPost,
7135
+ icon: NewspaperIcon
7136
+ }), "BlogPostModule");
7137
+ var BlogPostTranslationModule = /* @__PURE__ */ __name((factory) => factory({
7138
+ moduleId: BLOG_MODULE_ID,
7139
+ name: "blog-post-translations",
7140
+ model: BlogPostTranslation,
7141
+ icon: NewspaperIcon
7142
+ }), "BlogPostTranslationModule");
7143
+ var BlogCategoryModule = /* @__PURE__ */ __name((factory) => factory({
7144
+ moduleId: BLOG_MODULE_ID,
7145
+ name: "blog-categories",
7146
+ model: BlogCategory,
7147
+ icon: NewspaperIcon
7148
+ }), "BlogCategoryModule");
7149
+ var BlogCategoryTranslationModule = /* @__PURE__ */ __name((factory) => factory({
7150
+ moduleId: BLOG_MODULE_ID,
7151
+ name: "blog-category-translations",
7152
+ model: BlogCategoryTranslation,
7153
+ icon: NewspaperIcon
7154
+ }), "BlogCategoryTranslationModule");
7155
+ var BlogSettingsModule = /* @__PURE__ */ __name((factory) => factory({
7156
+ moduleId: BLOG_MODULE_ID,
7157
+ name: "blog-settings",
7158
+ model: BlogSettings,
7159
+ icon: NewspaperIcon
7160
+ }), "BlogSettingsModule");
7161
+
7162
+ // src/features/blog/data/BlogPostService.ts
7163
+ var BlogPostService = class extends AbstractService {
7164
+ static {
7165
+ __name(this, "BlogPostService");
7166
+ }
7167
+ static async findMany(params = {}) {
7168
+ const endpoint = new EndpointCreator({ endpoint: Modules.BlogPost });
7169
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
7170
+ return this.callApi({
7171
+ type: Modules.BlogPost,
7172
+ method: "GET" /* GET */,
7173
+ endpoint: endpoint.generate(),
7174
+ next: params.next
7175
+ });
7176
+ }
7177
+ static async findOne(params) {
7178
+ return this.callApi({
7179
+ type: Modules.BlogPost,
7180
+ method: "GET" /* GET */,
7181
+ endpoint: new EndpointCreator({ endpoint: Modules.BlogPost, id: params.id }).generate()
7182
+ });
7183
+ }
7184
+ static async create(params) {
7185
+ return this.callApi({
7186
+ type: Modules.BlogPost,
7187
+ method: "POST" /* POST */,
7188
+ endpoint: new EndpointCreator({ endpoint: Modules.BlogPost }).generate(),
7189
+ input: params
7190
+ });
7191
+ }
7192
+ static async update(params) {
7193
+ return this.callApi({
7194
+ type: Modules.BlogPost,
7195
+ method: "PUT" /* PUT */,
7196
+ endpoint: new EndpointCreator({ endpoint: Modules.BlogPost, id: params.id }).generate(),
7197
+ input: params
7198
+ });
7199
+ }
7200
+ static async delete(params) {
7201
+ await this.callApi({
7202
+ type: Modules.BlogPost,
7203
+ method: "DELETE" /* DELETE */,
7204
+ endpoint: new EndpointCreator({ endpoint: Modules.BlogPost, id: params.id }).generate()
7205
+ });
7206
+ }
7207
+ /**
7208
+ * POST blog-posts/:id/publish. Sends no body; replies with the post.
7209
+ */
7210
+ static async publish(params) {
7211
+ return this.callApi({
7212
+ type: Modules.BlogPost,
7213
+ method: "POST" /* POST */,
7214
+ endpoint: new EndpointCreator({
7215
+ endpoint: Modules.BlogPost,
7216
+ id: params.id,
7217
+ childEndpoint: BLOG_ACTION.publish
7218
+ }).generate()
7219
+ });
7220
+ }
7221
+ /**
7222
+ * POST blog-posts/:id/unpublish. Sends no body; replies with the post.
7223
+ */
7224
+ static async unpublish(params) {
7225
+ return this.callApi({
7226
+ type: Modules.BlogPost,
7227
+ method: "POST" /* POST */,
7228
+ endpoint: new EndpointCreator({
7229
+ endpoint: Modules.BlogPost,
7230
+ id: params.id,
7231
+ childEndpoint: BLOG_ACTION.unpublish
7232
+ }).generate()
7233
+ });
7234
+ }
7235
+ };
7236
+
7237
+ // src/features/blog/data/BlogPostTranslationService.ts
7238
+ var BlogPostTranslationService = class extends AbstractService {
7239
+ static {
7240
+ __name(this, "BlogPostTranslationService");
7241
+ }
7242
+ static async update(params) {
7243
+ return this.callApi({
7244
+ type: Modules.BlogPostTranslation,
7245
+ method: "PUT" /* PUT */,
7246
+ endpoint: new EndpointCreator({ endpoint: Modules.BlogPostTranslation, id: params.id }).generate(),
7247
+ input: params
7248
+ });
7249
+ }
7250
+ /**
7251
+ * POST blog-post-translations/:id/retranslate. Re-queues this one language
7252
+ * from the current original. Replies 204.
7253
+ */
7254
+ static async retranslate(params) {
7255
+ await this.callApi({
7256
+ type: Modules.BlogPostTranslation,
7257
+ method: "POST" /* POST */,
7258
+ endpoint: new EndpointCreator({
7259
+ endpoint: Modules.BlogPostTranslation,
7260
+ id: params.id,
7261
+ childEndpoint: BLOG_ACTION.retranslate
7262
+ }).generate()
7263
+ });
7264
+ }
7265
+ };
7266
+
7267
+ // src/features/blog/data/BlogCategoryService.ts
7268
+ var BlogCategoryService = class extends AbstractService {
7269
+ static {
7270
+ __name(this, "BlogCategoryService");
7271
+ }
7272
+ static async findMany(params = {}) {
7273
+ const endpoint = new EndpointCreator({ endpoint: Modules.BlogCategory });
7274
+ if (params.fetchAll) endpoint.addAdditionalParam("fetchAll", "true");
7275
+ if (params.search) endpoint.addAdditionalParam("search", params.search);
7276
+ return this.callApi({
7277
+ type: Modules.BlogCategory,
7278
+ method: "GET" /* GET */,
7279
+ endpoint: endpoint.generate(),
7280
+ next: params.next
7281
+ });
7282
+ }
7283
+ static async findOne(params) {
7284
+ return this.callApi({
7285
+ type: Modules.BlogCategory,
7286
+ method: "GET" /* GET */,
7287
+ endpoint: new EndpointCreator({ endpoint: Modules.BlogCategory, id: params.id }).generate()
7288
+ });
7289
+ }
7290
+ static async create(params) {
7291
+ return this.callApi({
7292
+ type: Modules.BlogCategory,
7293
+ method: "POST" /* POST */,
7294
+ endpoint: new EndpointCreator({ endpoint: Modules.BlogCategory }).generate(),
7295
+ input: params
7296
+ });
7297
+ }
7298
+ static async update(params) {
7299
+ return this.callApi({
7300
+ type: Modules.BlogCategory,
7301
+ method: "PUT" /* PUT */,
7302
+ endpoint: new EndpointCreator({ endpoint: Modules.BlogCategory, id: params.id }).generate(),
7303
+ input: params
7304
+ });
7305
+ }
7306
+ static async delete(params) {
7307
+ await this.callApi({
7308
+ type: Modules.BlogCategory,
7309
+ method: "DELETE" /* DELETE */,
7310
+ endpoint: new EndpointCreator({ endpoint: Modules.BlogCategory, id: params.id }).generate()
7311
+ });
7312
+ }
7313
+ };
7314
+
7315
+ // src/features/blog/data/BlogCategoryTranslationService.ts
7316
+ var BlogCategoryTranslationService = class extends AbstractService {
7317
+ static {
7318
+ __name(this, "BlogCategoryTranslationService");
7319
+ }
7320
+ static async update(params) {
7321
+ return this.callApi({
7322
+ type: Modules.BlogCategoryTranslation,
7323
+ method: "PUT" /* PUT */,
7324
+ endpoint: new EndpointCreator({ endpoint: Modules.BlogCategoryTranslation, id: params.id }).generate(),
7325
+ input: params
7326
+ });
7327
+ }
7328
+ /**
7329
+ * POST blog-category-translations/:id/retranslate. Re-queues this one
7330
+ * language from the current original. Replies 204.
7331
+ */
7332
+ static async retranslate(params) {
7333
+ await this.callApi({
7334
+ type: Modules.BlogCategoryTranslation,
7335
+ method: "POST" /* POST */,
7336
+ endpoint: new EndpointCreator({
7337
+ endpoint: Modules.BlogCategoryTranslation,
7338
+ id: params.id,
7339
+ childEndpoint: BLOG_ACTION.retranslate
7340
+ }).generate()
7341
+ });
7342
+ }
7343
+ };
7344
+
7345
+ // src/features/blog/data/BlogSettingsService.ts
7346
+ var BlogSettingsService = class extends AbstractService {
7347
+ static {
7348
+ __name(this, "BlogSettingsService");
7349
+ }
7350
+ /**
7351
+ * GET blog-settings: the stored singleton, or the API's default.
7352
+ */
7353
+ static async get() {
7354
+ return this.callApi({
7355
+ type: Modules.BlogSettings,
7356
+ method: "GET" /* GET */,
7357
+ endpoint: new EndpointCreator({ endpoint: Modules.BlogSettings }).generate()
7358
+ });
7359
+ }
7360
+ static async save(params) {
7361
+ return this.callApi({
7362
+ type: Modules.BlogSettings,
7363
+ method: "PUT" /* PUT */,
7364
+ endpoint: new EndpointCreator({ endpoint: Modules.BlogSettings, id: params.id }).generate(),
7365
+ input: params
7366
+ });
7367
+ }
7368
+ };
7369
+
7370
+ // src/features/blog/data/BlogPostFields.ts
7371
+ var BlogPostFields = /* @__PURE__ */ ((BlogPostFields2) => {
7372
+ BlogPostFields2["title"] = "title";
7373
+ BlogPostFields2["status"] = "status";
7374
+ BlogPostFields2["categories"] = "categories";
7375
+ BlogPostFields2["publishedAt"] = "publishedAt";
7376
+ BlogPostFields2["languages"] = "languages";
7377
+ return BlogPostFields2;
7378
+ })(BlogPostFields || {});
7379
+
7380
+ // src/features/blog/data/BlogCategoryFields.ts
7381
+ var BlogCategoryFields = /* @__PURE__ */ ((BlogCategoryFields2) => {
7382
+ BlogCategoryFields2["name"] = "name";
7383
+ BlogCategoryFields2["languages"] = "languages";
7384
+ return BlogCategoryFields2;
7385
+ })(BlogCategoryFields || {});
7386
+
6168
7387
  // src/features/handbook/HandbookPageModule.ts
6169
7388
  import { BookOpenIcon } from "lucide-react";
6170
7389
 
@@ -7946,6 +9165,20 @@ var S3Service = class extends AbstractService {
7946
9165
  if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
7947
9166
  return this.callApi({ type: Modules.S3, method: "GET" /* GET */, endpoint: endpoint.generate() });
7948
9167
  }
9168
+ /**
9169
+ * Presigns `key` and PUTs `file` to the presigned S3 URL. The PUT goes straight
9170
+ * to object storage (not the JSON:API backend), so it cannot use callApi.
9171
+ * Throws when the upload is rejected.
9172
+ */
9173
+ static async upload(params) {
9174
+ const s3 = await this.getPreSignedUrl({
9175
+ key: params.key,
9176
+ contentType: params.contentType,
9177
+ isPublic: params.isPublic
9178
+ });
9179
+ const response = await fetch(s3.url, { method: "PUT", headers: s3.headers, body: params.file });
9180
+ if (!response.ok) throw new Error(`S3 upload failed: ${response.status}`);
9181
+ }
7949
9182
  static async getSignedUrl(params) {
7950
9183
  const endpoint = new EndpointCreator({ endpoint: Modules.S3, id: "sign" }).addAdditionalParam("key", params.key);
7951
9184
  if (params.isPublic) endpoint.addAdditionalParam("isPublic", "true");
@@ -8326,13 +9559,13 @@ var AuthorModule = /* @__PURE__ */ __name((factory) => factory({
8326
9559
  }), "AuthorModule");
8327
9560
 
8328
9561
  // src/features/user/user.module.ts
8329
- import { UsersIcon } from "lucide-react";
9562
+ import { UsersIcon as UsersIcon2 } from "lucide-react";
8330
9563
  var UserModule = /* @__PURE__ */ __name((factory) => factory({
8331
9564
  pageUrl: "/users",
8332
9565
  name: "users",
8333
9566
  model: User,
8334
9567
  moduleId: "04cfc677-0fd2-4f5e-adf4-2483a00c0277",
8335
- icon: UsersIcon,
9568
+ icon: UsersIcon2,
8336
9569
  inclusions: {
8337
9570
  lists: {
8338
9571
  fields: [
@@ -10103,6 +11336,7 @@ export {
10103
11336
  getI18nLink,
10104
11337
  useI18nLocale,
10105
11338
  useI18nDateFnsLocale,
11339
+ getI18nSupportedLocales,
10106
11340
  HttpMethod,
10107
11341
  setGlobalErrorHandler,
10108
11342
  getGlobalErrorHandler,
@@ -10253,6 +11487,47 @@ export {
10253
11487
  HowToModule,
10254
11488
  HowToFields,
10255
11489
  HowToService,
11490
+ EmailAutomation,
11491
+ EmailAutomationModule,
11492
+ EmailAutomationStep,
11493
+ EmailAutomationStepModule,
11494
+ EMAIL_AUTOMATION_UNSUBSCRIBE_TYPE,
11495
+ EmailAutomationEnrollment,
11496
+ EmailAutomationEnrollmentModule,
11497
+ EmailAutomationTrigger,
11498
+ EmailAutomationTriggerModule,
11499
+ EmailAutomationService,
11500
+ EmailAutomationStepService,
11501
+ EmailAutomationEnrollmentService,
11502
+ EmailAutomationFields,
11503
+ EmailAutomationEnrollmentFields,
11504
+ BlogCategory,
11505
+ BlogCategoryTranslation,
11506
+ BlogPost,
11507
+ BlogPostTranslation,
11508
+ BLOG_LIST_LAYOUTS,
11509
+ BLOG_POST_STATUSES,
11510
+ BLOG_TRANSLATION_SOURCES,
11511
+ BLOG_SETTINGS_ID,
11512
+ BLOG_MODULE_ID,
11513
+ BLOG_UPLOAD_ROOT,
11514
+ BLOG_POST_UPLOAD_PREFIX,
11515
+ BLOG_CATEGORY_UPLOAD_PREFIX,
11516
+ BLOG_PUBLIC_PREFIX,
11517
+ BLOG_ACTION,
11518
+ BlogSettings,
11519
+ BlogPostModule,
11520
+ BlogPostTranslationModule,
11521
+ BlogCategoryModule,
11522
+ BlogCategoryTranslationModule,
11523
+ BlogSettingsModule,
11524
+ BlogPostService,
11525
+ BlogPostTranslationService,
11526
+ BlogCategoryService,
11527
+ BlogCategoryTranslationService,
11528
+ BlogSettingsService,
11529
+ BlogPostFields,
11530
+ BlogCategoryFields,
10256
11531
  HandbookPage,
10257
11532
  HandbookPageModule,
10258
11533
  HandbookSection,
@@ -10352,4 +11627,4 @@ export {
10352
11627
  AuditLogService,
10353
11628
  AuditLogModule
10354
11629
  };
10355
- //# sourceMappingURL=chunk-HNOWSFM5.mjs.map
11630
+ //# sourceMappingURL=chunk-WC63PJSC.mjs.map