@carlonicora/nextjs-jsonapi 5.2.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/dist/{BlockNoteEditor-EGY4ZAAM.js → BlockNoteEditor-UJ6363LC.js} +19 -19
  2. package/dist/{BlockNoteEditor-EGY4ZAAM.js.map → BlockNoteEditor-UJ6363LC.js.map} +1 -1
  3. package/dist/{BlockNoteEditor-2QJVK2HH.mjs → BlockNoteEditor-WTSQANKI.mjs} +4 -4
  4. package/dist/{BlockNoteViewer-I2MMFH3S.js → BlockNoteViewer-EL4JFB6P.js} +3 -3
  5. package/dist/{BlockNoteViewer-I2MMFH3S.js.map → BlockNoteViewer-EL4JFB6P.js.map} +1 -1
  6. package/dist/{BlockNoteViewer-6BQXJ4TB.mjs → BlockNoteViewer-JVKWJZ6J.mjs} +2 -2
  7. package/dist/billing/index.js +441 -441
  8. package/dist/billing/index.mjs +3 -3
  9. package/dist/{chunk-3VEQ5JZJ.js → chunk-3BAM23VA.js} +847 -847
  10. package/dist/chunk-3BAM23VA.js.map +1 -0
  11. package/dist/{chunk-JEZQTZQ4.mjs → chunk-6WU74VFU.mjs} +2 -2
  12. package/dist/{chunk-S5MQDWWC.js → chunk-CRI4T47Y.js} +736 -176
  13. package/dist/chunk-CRI4T47Y.js.map +1 -0
  14. package/dist/{chunk-75MLT74B.js → chunk-EO75CV76.js} +8 -8
  15. package/dist/{chunk-75MLT74B.js.map → chunk-EO75CV76.js.map} +1 -1
  16. package/dist/{chunk-NPKFMRH5.mjs → chunk-FNTQQFLH.mjs} +2 -2
  17. package/dist/{chunk-HNOWSFM5.mjs → chunk-JQWI62NV.mjs} +563 -3
  18. package/dist/chunk-JQWI62NV.mjs.map +1 -0
  19. package/dist/{chunk-2Z3ZCYXX.mjs → chunk-MIZTWBPX.mjs} +5 -5
  20. package/dist/chunk-MIZTWBPX.mjs.map +1 -0
  21. package/dist/{chunk-YMUPTXOT.mjs → chunk-QKZUE5OF.mjs} +2 -2
  22. package/dist/{chunk-EXICQC4A.js → chunk-QQQE3N2X.js} +3 -3
  23. package/dist/{chunk-EXICQC4A.js.map → chunk-QQQE3N2X.js.map} +1 -1
  24. package/dist/{chunk-THKYH65N.js → chunk-XGTQWBDJ.js} +4 -4
  25. package/dist/{chunk-THKYH65N.js.map → chunk-XGTQWBDJ.js.map} +1 -1
  26. package/dist/client/index.d.mts +6 -39
  27. package/dist/client/index.d.ts +6 -39
  28. package/dist/client/index.js +4 -4
  29. package/dist/client/index.mjs +3 -3
  30. package/dist/components/index.d.mts +2 -2
  31. package/dist/components/index.d.ts +2 -2
  32. package/dist/components/index.js +4 -4
  33. package/dist/components/index.mjs +3 -3
  34. package/dist/contexts/index.js +4 -4
  35. package/dist/contexts/index.mjs +3 -3
  36. package/dist/core/index.d.mts +187 -1
  37. package/dist/core/index.d.ts +187 -1
  38. package/dist/core/index.js +30 -2
  39. package/dist/core/index.js.map +1 -1
  40. package/dist/core/index.mjs +29 -1
  41. package/dist/email-automation-enrollment.fields-BZvF14qx.d.mts +82 -0
  42. package/dist/email-automation-enrollment.fields-Cp3VMzFq.d.ts +82 -0
  43. package/dist/email-automations/index.css +30 -0
  44. package/dist/email-automations/index.css.map +1 -0
  45. package/dist/email-automations/index.d.mts +303 -0
  46. package/dist/email-automations/index.d.ts +303 -0
  47. package/dist/email-automations/index.js +1705 -0
  48. package/dist/email-automations/index.js.map +1 -0
  49. package/dist/email-automations/index.mjs +1705 -0
  50. package/dist/email-automations/index.mjs.map +1 -0
  51. package/dist/features/analytics/index.js +122 -122
  52. package/dist/features/analytics/index.mjs +4 -4
  53. package/dist/features/analytics/server.js +4 -4
  54. package/dist/features/analytics/server.mjs +2 -2
  55. package/dist/features/help/index.js +37 -37
  56. package/dist/features/help/index.mjs +3 -3
  57. package/dist/features/tokenusage/index.js +125 -125
  58. package/dist/features/tokenusage/index.mjs +4 -4
  59. package/dist/index.d.mts +2 -1
  60. package/dist/index.d.ts +2 -1
  61. package/dist/index.js +31 -3
  62. package/dist/index.js.map +1 -1
  63. package/dist/index.mjs +30 -2
  64. package/dist/server/index.js +3 -3
  65. package/dist/server/index.mjs +2 -2
  66. package/dist/types-70acd-8C.d.mts +39 -0
  67. package/dist/types-l8SFleXi.d.ts +39 -0
  68. package/messages/en.json +117 -0
  69. package/messages/it.json +117 -0
  70. package/package.json +11 -1
  71. package/src/components/forms/FormFieldWrapper.tsx +1 -1
  72. package/src/components/forms/FormTextarea.tsx +2 -1
  73. package/src/core/index.ts +8 -0
  74. package/src/core/registry/ModuleRegistry.ts +5 -0
  75. package/src/email-automations/index.ts +5 -0
  76. package/src/features/email-automation/EmailAutomationEnrollmentModule.ts +11 -0
  77. package/src/features/email-automation/EmailAutomationModule.ts +30 -0
  78. package/src/features/email-automation/EmailAutomationStepModule.ts +11 -0
  79. package/src/features/email-automation/EmailAutomationTriggerModule.ts +11 -0
  80. package/src/features/email-automation/components/__tests__/EmailAutomationEditor.spec.tsx +104 -0
  81. package/src/features/email-automation/components/canvas/EmailAutomationActiveSwitch.tsx +49 -0
  82. package/src/features/email-automation/components/canvas/EmailAutomationCanvas.tsx +474 -0
  83. package/src/features/email-automation/components/canvas/EmailAutomationCanvasInspector.tsx +89 -0
  84. package/src/features/email-automation/components/canvas/EmailAutomationCanvasTab.tsx +32 -0
  85. package/src/features/email-automation/components/canvas/__tests__/buildCanvasGraph.spec.ts +67 -0
  86. package/src/features/email-automation/components/canvas/buildCanvasGraph.ts +141 -0
  87. package/src/features/email-automation/components/canvas/edges/DelayEdge.tsx +68 -0
  88. package/src/features/email-automation/components/canvas/nodes/EmailStepNode.tsx +43 -0
  89. package/src/features/email-automation/components/canvas/nodes/TriggerNode.tsx +23 -0
  90. package/src/features/email-automation/components/canvas/shared/CanvasToolbar.tsx +53 -0
  91. package/src/features/email-automation/components/canvas/shared/EmptyCanvas.tsx +11 -0
  92. package/src/features/email-automation/components/canvas/shared/__tests__/autoLayout.spec.ts +42 -0
  93. package/src/features/email-automation/components/canvas/shared/__tests__/longPress.spec.ts +51 -0
  94. package/src/features/email-automation/components/canvas/shared/autoLayout.ts +55 -0
  95. package/src/features/email-automation/components/canvas/shared/index.ts +4 -0
  96. package/src/features/email-automation/components/canvas/shared/longPress.ts +57 -0
  97. package/src/features/email-automation/components/containers/EmailAutomationContainer.tsx +80 -0
  98. package/src/features/email-automation/components/containers/EmailAutomationsListContainer.tsx +27 -0
  99. package/src/features/email-automation/components/forms/EmailAutomationEditor.tsx +153 -0
  100. package/src/features/email-automation/components/forms/EmailStepEditor.tsx +151 -0
  101. package/src/features/email-automation/components/index.ts +15 -0
  102. package/src/features/email-automation/components/lists/EmailAutomationRecipientsList.tsx +90 -0
  103. package/src/features/email-automation/components/lists/EmailAutomationsList.tsx +76 -0
  104. package/src/features/email-automation/components/unsubscribe/EmailUnsubscribe.tsx +99 -0
  105. package/src/features/email-automation/components/unsubscribe/__tests__/EmailUnsubscribe.spec.tsx +55 -0
  106. package/src/features/email-automation/contexts/EmailAutomationContext.tsx +175 -0
  107. package/src/features/email-automation/data/EmailAutomation.ts +87 -0
  108. package/src/features/email-automation/data/EmailAutomationEnrollment.ts +105 -0
  109. package/src/features/email-automation/data/EmailAutomationEnrollmentInterface.ts +18 -0
  110. package/src/features/email-automation/data/EmailAutomationEnrollmentService.ts +31 -0
  111. package/src/features/email-automation/data/EmailAutomationInterface.ts +22 -0
  112. package/src/features/email-automation/data/EmailAutomationService.ts +106 -0
  113. package/src/features/email-automation/data/EmailAutomationStep.ts +104 -0
  114. package/src/features/email-automation/data/EmailAutomationStepInterface.ts +23 -0
  115. package/src/features/email-automation/data/EmailAutomationStepService.ts +80 -0
  116. package/src/features/email-automation/data/EmailAutomationTrigger.ts +28 -0
  117. package/src/features/email-automation/data/EmailAutomationTriggerInterface.ts +6 -0
  118. package/src/features/email-automation/data/__tests__/email-automation-models.spec.ts +103 -0
  119. package/src/features/email-automation/data/email-automation-enrollment.fields.ts +8 -0
  120. package/src/features/email-automation/data/email-automation.fields.ts +9 -0
  121. package/src/features/email-automation/data/index.ts +13 -0
  122. package/src/features/email-automation/hooks/index.ts +2 -0
  123. package/src/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.tsx +126 -0
  124. package/src/features/email-automation/hooks/useEmailAutomationTableStructure.tsx +119 -0
  125. package/src/features/email-automation/index.ts +5 -0
  126. package/dist/chunk-2Z3ZCYXX.mjs.map +0 -1
  127. package/dist/chunk-3VEQ5JZJ.js.map +0 -1
  128. package/dist/chunk-HNOWSFM5.mjs.map +0 -1
  129. package/dist/chunk-S5MQDWWC.js.map +0 -1
  130. /package/dist/{BlockNoteEditor-2QJVK2HH.mjs.map → BlockNoteEditor-WTSQANKI.mjs.map} +0 -0
  131. /package/dist/{BlockNoteViewer-6BQXJ4TB.mjs.map → BlockNoteViewer-JVKWJZ6J.mjs.map} +0 -0
  132. /package/dist/{chunk-JEZQTZQ4.mjs.map → chunk-6WU74VFU.mjs.map} +0 -0
  133. /package/dist/{chunk-NPKFMRH5.mjs.map → chunk-FNTQQFLH.mjs.map} +0 -0
  134. /package/dist/{chunk-YMUPTXOT.mjs.map → chunk-QKZUE5OF.mjs.map} +0 -0
@@ -6165,6 +6165,552 @@ 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
+
6168
6714
  // src/features/handbook/HandbookPageModule.ts
6169
6715
  import { BookOpenIcon } from "lucide-react";
6170
6716
 
@@ -8326,13 +8872,13 @@ var AuthorModule = /* @__PURE__ */ __name((factory) => factory({
8326
8872
  }), "AuthorModule");
8327
8873
 
8328
8874
  // src/features/user/user.module.ts
8329
- import { UsersIcon } from "lucide-react";
8875
+ import { UsersIcon as UsersIcon2 } from "lucide-react";
8330
8876
  var UserModule = /* @__PURE__ */ __name((factory) => factory({
8331
8877
  pageUrl: "/users",
8332
8878
  name: "users",
8333
8879
  model: User,
8334
8880
  moduleId: "04cfc677-0fd2-4f5e-adf4-2483a00c0277",
8335
- icon: UsersIcon,
8881
+ icon: UsersIcon2,
8336
8882
  inclusions: {
8337
8883
  lists: {
8338
8884
  fields: [
@@ -10253,6 +10799,20 @@ export {
10253
10799
  HowToModule,
10254
10800
  HowToFields,
10255
10801
  HowToService,
10802
+ EmailAutomation,
10803
+ EmailAutomationModule,
10804
+ EmailAutomationStep,
10805
+ EmailAutomationStepModule,
10806
+ EMAIL_AUTOMATION_UNSUBSCRIBE_TYPE,
10807
+ EmailAutomationEnrollment,
10808
+ EmailAutomationEnrollmentModule,
10809
+ EmailAutomationTrigger,
10810
+ EmailAutomationTriggerModule,
10811
+ EmailAutomationService,
10812
+ EmailAutomationStepService,
10813
+ EmailAutomationEnrollmentService,
10814
+ EmailAutomationFields,
10815
+ EmailAutomationEnrollmentFields,
10256
10816
  HandbookPage,
10257
10817
  HandbookPageModule,
10258
10818
  HandbookSection,
@@ -10352,4 +10912,4 @@ export {
10352
10912
  AuditLogService,
10353
10913
  AuditLogModule
10354
10914
  };
10355
- //# sourceMappingURL=chunk-HNOWSFM5.mjs.map
10915
+ //# sourceMappingURL=chunk-JQWI62NV.mjs.map