@antelopejs/dms-mailing 0.8.0 → 0.9.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 (179) hide show
  1. package/README.md +41 -43
  2. package/dist/automation/email-event-trigger.d.ts +2 -2
  3. package/dist/automation/send-template-action.d.ts +11 -3
  4. package/dist/automation/send-template-action.js +1 -1
  5. package/dist/automation/send-template-action.js.map +1 -1
  6. package/dist/data/body.d.ts +2 -1
  7. package/dist/data/body.js +2 -1
  8. package/dist/data/body.js.map +1 -1
  9. package/dist/data/read-only-routes.d.ts +4 -4
  10. package/dist/data/sends-table.d.ts +4 -4
  11. package/dist/data/suppressions-table.d.ts +4 -4
  12. package/dist/data/templates-table.d.ts +35 -12
  13. package/dist/data/templates-table.js +29 -24
  14. package/dist/data/templates-table.js.map +1 -1
  15. package/dist/data-types/categories-type.d.ts +1 -2
  16. package/dist/data-types/categories-type.js +3 -5
  17. package/dist/data-types/categories-type.js.map +1 -1
  18. package/dist/data-types/category-type.d.ts +1 -2
  19. package/dist/data-types/category-type.js +3 -5
  20. package/dist/data-types/category-type.js.map +1 -1
  21. package/dist/db/models/send-events.model.d.ts +7 -5
  22. package/dist/db/models/sends.model.d.ts +7 -5
  23. package/dist/db/models/sends.model.js.map +1 -1
  24. package/dist/db/models/settings.model.d.ts +7 -5
  25. package/dist/db/models/suppressions.model.d.ts +7 -5
  26. package/dist/db/models/template-versions.model.d.ts +7 -5
  27. package/dist/db/models/template-versions.model.js +4 -3
  28. package/dist/db/models/template-versions.model.js.map +1 -1
  29. package/dist/db/models/templates.model.d.ts +7 -5
  30. package/dist/db/models/webhook-status.model.d.ts +7 -5
  31. package/dist/db/tables/templates.table.js.map +1 -1
  32. package/dist/engine/changes.js +8 -19
  33. package/dist/engine/changes.js.map +1 -1
  34. package/dist/engine/conditions.d.ts +2 -1
  35. package/dist/engine/conditions.js +3 -2
  36. package/dist/engine/conditions.js.map +1 -1
  37. package/dist/engine/coverage.d.ts +2 -1
  38. package/dist/engine/coverage.js.map +1 -1
  39. package/dist/engine/formats.d.ts +4 -6
  40. package/dist/engine/formats.js +17 -3
  41. package/dist/engine/formats.js.map +1 -1
  42. package/dist/engine/paths.d.ts +4 -2
  43. package/dist/engine/paths.js +15 -3
  44. package/dist/engine/paths.js.map +1 -1
  45. package/dist/engine/plain-text.js +2 -4
  46. package/dist/engine/plain-text.js.map +1 -1
  47. package/dist/engine/resolve.d.ts +2 -1
  48. package/dist/engine/resolve.js +1 -1
  49. package/dist/engine/resolve.js.map +1 -1
  50. package/dist/engine/system-variables.d.ts +2 -1
  51. package/dist/engine/system-variables.js.map +1 -1
  52. package/dist/engine/tokens.d.ts +2 -1
  53. package/dist/engine/tokens.js.map +1 -1
  54. package/dist/hooks/tenant-export.js +10 -9
  55. package/dist/hooks/tenant-export.js.map +1 -1
  56. package/dist/pages/templates.js +3 -1
  57. package/dist/pages/templates.js.map +1 -1
  58. package/dist/routes/events.js +4 -2
  59. package/dist/routes/events.js.map +1 -1
  60. package/dist/routes/index.d.ts +1 -0
  61. package/dist/routes/index.js +1 -0
  62. package/dist/routes/index.js.map +1 -1
  63. package/dist/routes/metrics.js +27 -28
  64. package/dist/routes/metrics.js.map +1 -1
  65. package/dist/routes/period.js +5 -5
  66. package/dist/routes/period.js.map +1 -1
  67. package/dist/routes/sends.js +3 -4
  68. package/dist/routes/sends.js.map +1 -1
  69. package/dist/routes/settings.d.ts +1 -1
  70. package/dist/routes/settings.js +12 -10
  71. package/dist/routes/settings.js.map +1 -1
  72. package/dist/routes/suppressions.js +9 -6
  73. package/dist/routes/suppressions.js.map +1 -1
  74. package/dist/routes/template-content.d.ts +27 -0
  75. package/dist/routes/template-content.js +3 -0
  76. package/dist/routes/template-content.js.map +1 -0
  77. package/dist/routes/templates.d.ts +7 -30
  78. package/dist/routes/templates.js +3 -2
  79. package/dist/routes/templates.js.map +1 -1
  80. package/dist/routes/zod-json.d.ts +3 -0
  81. package/dist/routes/zod-json.js +21 -0
  82. package/dist/routes/zod-json.js.map +1 -0
  83. package/dist/services/attention.js +14 -7
  84. package/dist/services/attention.js.map +1 -1
  85. package/dist/services/catalog.js +4 -2
  86. package/dist/services/catalog.js.map +1 -1
  87. package/dist/services/declaration-error.d.ts +1 -1
  88. package/dist/services/declaration-error.js.map +1 -1
  89. package/dist/services/declarations.js +4 -1
  90. package/dist/services/declarations.js.map +1 -1
  91. package/dist/services/events.js +3 -1
  92. package/dist/services/events.js.map +1 -1
  93. package/dist/services/metrics.js +2 -5
  94. package/dist/services/metrics.js.map +1 -1
  95. package/dist/services/send.js +3 -4
  96. package/dist/services/send.js.map +1 -1
  97. package/dist/services/settings.d.ts +4 -2
  98. package/dist/services/settings.js +5 -4
  99. package/dist/services/settings.js.map +1 -1
  100. package/dist/services/starters.d.ts +3 -2
  101. package/dist/services/starters.js +1 -1
  102. package/dist/services/starters.js.map +1 -1
  103. package/dist/services/templates.d.ts +2 -1
  104. package/dist/services/templates.js +5 -5
  105. package/dist/services/templates.js.map +1 -1
  106. package/dist/services/webhook-status.d.ts +2 -2
  107. package/dist/services/webhook-status.js +6 -4
  108. package/dist/services/webhook-status.js.map +1 -1
  109. package/dist/types/json.d.ts +1 -0
  110. package/dist/types/json.js +3 -0
  111. package/dist/types/json.js.map +1 -0
  112. package/dist/types/settings.d.ts +2 -2
  113. package/dist/validation/declarations.schema.d.ts +28 -28
  114. package/dist/validation/declarations.schema.js +4 -3
  115. package/dist/validation/declarations.schema.js.map +1 -1
  116. package/dist/validation/guards.d.ts +0 -1
  117. package/dist/validation/guards.js +0 -4
  118. package/dist/validation/guards.js.map +1 -1
  119. package/dist/validation/json.d.ts +5 -0
  120. package/dist/validation/json.js +54 -0
  121. package/dist/validation/json.js.map +1 -0
  122. package/dist/validation/json.schema.d.ts +2 -0
  123. package/dist/validation/json.schema.js +9 -0
  124. package/dist/validation/json.schema.js.map +1 -0
  125. package/dist/validation/templates.schema.d.ts +25 -24
  126. package/dist/validation/templates.schema.js +4 -3
  127. package/dist/validation/templates.schema.js.map +1 -1
  128. package/frontend-vue/package.json +1 -1
  129. package/frontend-vue/pnpm-lock.yaml +44 -4
  130. package/package.json +16 -15
  131. package/skills/dms-mailing/SKILL.md +3 -3
  132. package/src/automation/email-event-trigger.ts +2 -2
  133. package/src/automation/send-template-action.ts +33 -14
  134. package/src/data/body.ts +5 -2
  135. package/src/data/templates-table.ts +46 -52
  136. package/src/data-types/categories-type.ts +2 -2
  137. package/src/data-types/category-type.ts +2 -2
  138. package/src/db/models/sends.model.ts +2 -2
  139. package/src/db/models/template-versions.model.ts +5 -3
  140. package/src/db/tables/templates.table.ts +1 -1
  141. package/src/engine/changes.ts +11 -29
  142. package/src/engine/conditions.ts +12 -4
  143. package/src/engine/coverage.ts +2 -1
  144. package/src/engine/formats.ts +31 -17
  145. package/src/engine/paths.ts +39 -6
  146. package/src/engine/plain-text.ts +2 -4
  147. package/src/engine/resolve.ts +12 -4
  148. package/src/engine/system-variables.ts +2 -1
  149. package/src/engine/tokens.ts +2 -1
  150. package/src/hooks/tenant-export.ts +11 -13
  151. package/src/pages/templates.ts +3 -1
  152. package/src/routes/events.ts +7 -4
  153. package/src/routes/index.ts +1 -0
  154. package/src/routes/metrics.ts +30 -30
  155. package/src/routes/period.ts +5 -5
  156. package/src/routes/sends.ts +13 -8
  157. package/src/routes/settings.ts +15 -10
  158. package/src/routes/suppressions.ts +12 -8
  159. package/src/routes/template-content.ts +45 -0
  160. package/src/routes/templates.ts +11 -44
  161. package/src/routes/zod-json.ts +28 -0
  162. package/src/services/attention.ts +16 -15
  163. package/src/services/catalog.ts +4 -8
  164. package/src/services/declaration-error.ts +1 -1
  165. package/src/services/declarations.ts +4 -1
  166. package/src/services/events.ts +4 -2
  167. package/src/services/metrics.ts +3 -5
  168. package/src/services/send.ts +3 -6
  169. package/src/services/settings.ts +17 -16
  170. package/src/services/starters.ts +8 -4
  171. package/src/services/templates.ts +16 -9
  172. package/src/services/webhook-status.ts +13 -8
  173. package/src/types/json.ts +1 -0
  174. package/src/types/settings.ts +2 -2
  175. package/src/validation/declarations.schema.ts +4 -3
  176. package/src/validation/guards.ts +0 -8
  177. package/src/validation/json.schema.ts +7 -0
  178. package/src/validation/json.ts +66 -0
  179. package/src/validation/templates.schema.ts +7 -3
@@ -23,7 +23,7 @@ importers:
23
23
  devDependencies:
24
24
  '@antelopejs/tooling-configs':
25
25
  specifier: ^0.2.12
26
- version: 0.2.12
26
+ version: 0.2.17
27
27
  '@nuxt/ui':
28
28
  specifier: 4.10.0
29
29
  version: 4.10.0(9bdbb06d8a0b4accef61070adc217622)
@@ -67,8 +67,8 @@ packages:
67
67
  resolution: {integrity: sha512-U4+70Pc5ZS9osnCBCE5Jha/ciHM+Yp+CNMNC/7HvYbNRk1Ldd+f7qO65W5qfhu/TCv+/ozljlXXe9Nj8419DMA==}
68
68
  engines: {node: '>=10'}
69
69
 
70
- '@antelopejs/tooling-configs@0.2.12':
71
- resolution: {integrity: sha512-giwZ5U5kSd1EsmYio8+X36TcFZ2QhVWGjGddrF+A2zNqsWP9w15vVBaHOkUqkR8oH3An2wm/5hYLLGrLhGB/FQ==}
70
+ '@antelopejs/tooling-configs@0.2.17':
71
+ resolution: {integrity: sha512-8fwh7xQPzazP/l/ivEwRKpfN8qShV9+PRizpI9cBewe2TwoRPu4n95w6sYSlygiRmm0HxLJYZFhmSPRgtiNo1Q==}
72
72
  engines: {node: '>=22.18.0'}
73
73
  hasBin: true
74
74
  peerDependencies:
@@ -582,6 +582,7 @@ packages:
582
582
  engines: {node: ^22.20 || ^24.12 || >=25}
583
583
  cpu: [x64]
584
584
  os: [linux]
585
+ libc: [glibc]
585
586
 
586
587
  '@napi-rs/wasm-runtime@1.2.3':
587
588
  resolution: {integrity: sha512-UMduMbqO5s5zF2NkNacMT/yK5Y5QiKvWr2+50bzIIxFDwVJ2h49b+oyjaCGPhJxd2/gC2x39EHv/gHVuu36x2Q==}
@@ -718,48 +719,56 @@ packages:
718
719
  engines: {node: ^20.19.0 || >=22.12.0}
719
720
  cpu: [arm64]
720
721
  os: [linux]
722
+ libc: [glibc]
721
723
 
722
724
  '@oxc-parser/binding-linux-arm64-musl@0.141.0':
723
725
  resolution: {integrity: sha512-jMkS/EztNW34HKsXIaT/SoHcmtocq/vWhwFOVduF9kduuuRIVwfwQ6uxzIO+qPKSXdd2TXt54of0BJ2zFMXnmw==}
724
726
  engines: {node: ^20.19.0 || >=22.12.0}
725
727
  cpu: [arm64]
726
728
  os: [linux]
729
+ libc: [musl]
727
730
 
728
731
  '@oxc-parser/binding-linux-ppc64-gnu@0.141.0':
729
732
  resolution: {integrity: sha512-vo+MR+n3zQJ6Mq92hiP084NZcgDv5iJlVR02gMf28neMvVT1tKVm7VeiW/DxhdqOi3QLeaXIk9cUcLL1qrkngw==}
730
733
  engines: {node: ^20.19.0 || >=22.12.0}
731
734
  cpu: [ppc64]
732
735
  os: [linux]
736
+ libc: [glibc]
733
737
 
734
738
  '@oxc-parser/binding-linux-riscv64-gnu@0.141.0':
735
739
  resolution: {integrity: sha512-oh80w+7RuiO5gBp9Jnoa/H8Qlt3JsHL2MkW+0dwEdlDMdslVZX/YsekSK6EeyEenY66/mhCfypsNATQ7Ph3qlQ==}
736
740
  engines: {node: ^20.19.0 || >=22.12.0}
737
741
  cpu: [riscv64]
738
742
  os: [linux]
743
+ libc: [glibc]
739
744
 
740
745
  '@oxc-parser/binding-linux-riscv64-musl@0.141.0':
741
746
  resolution: {integrity: sha512-LOyEmFA8sCnYbEXP1+iQvCC/P1YXHMA/t6x1Ksp0Y9VwhLFsiBJFzV1zIxrOIE2LKaGGhDjQ29xq9cbq6omDXA==}
742
747
  engines: {node: ^20.19.0 || >=22.12.0}
743
748
  cpu: [riscv64]
744
749
  os: [linux]
750
+ libc: [musl]
745
751
 
746
752
  '@oxc-parser/binding-linux-s390x-gnu@0.141.0':
747
753
  resolution: {integrity: sha512-3wnwk/l1CvszVE5TJR1wSl/zSEfydRqrNhn6s7Vr9IzSJpUQIroqVsIoPARHRFA+FQwkxAFDAHDAasa7v8OobQ==}
748
754
  engines: {node: ^20.19.0 || >=22.12.0}
749
755
  cpu: [s390x]
750
756
  os: [linux]
757
+ libc: [glibc]
751
758
 
752
759
  '@oxc-parser/binding-linux-x64-gnu@0.141.0':
753
760
  resolution: {integrity: sha512-qtyQVAAebFq57B2tifTlel3TgGqUtsYNI/e+p6aya9rN9lOZVTDvr215fGYSA9XWooxzMxDiVxkBLk2jQHbsOQ==}
754
761
  engines: {node: ^20.19.0 || >=22.12.0}
755
762
  cpu: [x64]
756
763
  os: [linux]
764
+ libc: [glibc]
757
765
 
758
766
  '@oxc-parser/binding-linux-x64-musl@0.141.0':
759
767
  resolution: {integrity: sha512-SkGV1nKw40roEc94pv5EaaeH2ay14G6+roe8Q0wIUC1LcEKxzKW921h7+ZuZX0D3q2Mb/7aSFmxEVqnko3lPRw==}
760
768
  engines: {node: ^20.19.0 || >=22.12.0}
761
769
  cpu: [x64]
762
770
  os: [linux]
771
+ libc: [musl]
763
772
 
764
773
  '@oxc-parser/binding-openharmony-arm64@0.141.0':
765
774
  resolution: {integrity: sha512-cVgDM7n8QziQqOaP5hNgUYfMG7S/ZeuPxFWXnnHRv7rh025COk0rfQ6eEdKG3j/GaUuyvNZN4ifF1J8KmuXLLA==}
@@ -844,36 +853,42 @@ packages:
844
853
  engines: {node: ^20.19.0 || >=22.12.0}
845
854
  cpu: [arm64]
846
855
  os: [linux]
856
+ libc: [glibc]
847
857
 
848
858
  '@rolldown/binding-linux-arm64-musl@1.2.7':
849
859
  resolution: {integrity: sha512-lAIXTH/aiLRLxsTgQvfhjo4K1ydWIp00+V0voOr9beb/9ZmkUFrSIb03dXNFRgMNvkE6oGsF10ioQ6UsI+vS5Q==}
850
860
  engines: {node: ^20.19.0 || >=22.12.0}
851
861
  cpu: [arm64]
852
862
  os: [linux]
863
+ libc: [musl]
853
864
 
854
865
  '@rolldown/binding-linux-ppc64-gnu@1.2.7':
855
866
  resolution: {integrity: sha512-kdnwS28Pkenp/mZMRwjXXXwxQ7pIsm+bF919LUK93BOyhcLsrVKdP2p9fxpiPNPAbNuch8ypQt0pm2P2LYCAGg==}
856
867
  engines: {node: ^20.19.0 || >=22.12.0}
857
868
  cpu: [ppc64]
858
869
  os: [linux]
870
+ libc: [glibc]
859
871
 
860
872
  '@rolldown/binding-linux-s390x-gnu@1.2.7':
861
873
  resolution: {integrity: sha512-516OdsyLdr5E65paF3yBF55t8mfm9+gmtCsK3xI7XKXIT7EfRlHhxL8K/NR6Hu8BWSgF5+1w74lTL0+nxcc8Qw==}
862
874
  engines: {node: ^20.19.0 || >=22.12.0}
863
875
  cpu: [s390x]
864
876
  os: [linux]
877
+ libc: [glibc]
865
878
 
866
879
  '@rolldown/binding-linux-x64-gnu@1.2.7':
867
880
  resolution: {integrity: sha512-r8/z8n7GFaYRln3xmP1Cxy0HH/HLM0uBUPkEuSVEfKGDA89M0FsZRZJRSwe/tJjRx+fpH/gjorfhB8tmEbSFLA==}
868
881
  engines: {node: ^20.19.0 || >=22.12.0}
869
882
  cpu: [x64]
870
883
  os: [linux]
884
+ libc: [glibc]
871
885
 
872
886
  '@rolldown/binding-linux-x64-musl@1.2.7':
873
887
  resolution: {integrity: sha512-pAsE8iiDxUg1xBqdhrTfg45AVDVpirjz00sblEYClGNNcMnDb+e8beQgqIAw6LvauX/APvgxUnwrgun/YYGBhw==}
874
888
  engines: {node: ^20.19.0 || >=22.12.0}
875
889
  cpu: [x64]
876
890
  os: [linux]
891
+ libc: [musl]
877
892
 
878
893
  '@rolldown/binding-openharmony-arm64@1.2.7':
879
894
  resolution: {integrity: sha512-lTcIYmmnQQA8Or/2DatS6oSqcdLHvendjS+zLu+FwgToynWMRSmQdpM65fTANJgIS4mjbMOo5KT2lnT9SAb96w==}
@@ -930,66 +945,79 @@ packages:
930
945
  resolution: {integrity: sha512-YDUNvVM85TI3g/1OpnqKP1h4NeW/j64DfWMf+G3M809xNk1bJSnpFp4sh83NpmVE5DXnkh8ULor4LTVZKoYLHw==}
931
946
  cpu: [arm]
932
947
  os: [linux]
948
+ libc: [glibc]
933
949
 
934
950
  '@rollup/rollup-linux-arm-musleabihf@4.63.1':
935
951
  resolution: {integrity: sha512-7Mcn71p9ZuQFAj+h+dhQXy/yeLePRS2yKRnmW1DijA9thKO5qap0GNOIQK4yQ6iP3SU0Mrb/yWo8h8vgRba8lw==}
936
952
  cpu: [arm]
937
953
  os: [linux]
954
+ libc: [musl]
938
955
 
939
956
  '@rollup/rollup-linux-arm64-gnu@4.63.1':
940
957
  resolution: {integrity: sha512-4YiLQTX6U4CSl0L9cluep9A9W6UmTfqBDc2/CH6wlu54pl4E7Jn3cOD8oxzvBDEGk/JMKgJ47C8g+radF7mwvg==}
941
958
  cpu: [arm64]
942
959
  os: [linux]
960
+ libc: [glibc]
943
961
 
944
962
  '@rollup/rollup-linux-arm64-musl@4.63.1':
945
963
  resolution: {integrity: sha512-2ra8F7w8OquwZN9z2/fKFnli69wa8PLwaVzRMIPGb13ByMJwC28Fbp8YcVGoUhlYMTt7j5j9bNgpysrN2UM+vw==}
946
964
  cpu: [arm64]
947
965
  os: [linux]
966
+ libc: [musl]
948
967
 
949
968
  '@rollup/rollup-linux-loong64-gnu@4.63.1':
950
969
  resolution: {integrity: sha512-Sy20ncyhjmBP0Ml+UvQbimjlk6VFgjW5uNP+qqwHB00mTE8Bl2C1TuHTlRwK2YoXeZbee5lP2XevBWVkAQAtSQ==}
951
970
  cpu: [loong64]
952
971
  os: [linux]
972
+ libc: [glibc]
953
973
 
954
974
  '@rollup/rollup-linux-loong64-musl@4.63.1':
955
975
  resolution: {integrity: sha512-noITLp8oNjYliPnGWmLyelIHwULGqbHloQHGw1rtxbWhTuWooRpnZarZQJ1y9EUC4szuCusCc+HEpUtxpIwYvA==}
956
976
  cpu: [loong64]
957
977
  os: [linux]
978
+ libc: [musl]
958
979
 
959
980
  '@rollup/rollup-linux-ppc64-gnu@4.63.1':
960
981
  resolution: {integrity: sha512-hlxxXd+F1mWiAcaFR7Sv9ZQT6m6UfI8+Vy/kFJzztq2pDMU/0wZ9sish0iszNZvsQDo8Gc0i5yuFEOz5dDf6fA==}
961
982
  cpu: [ppc64]
962
983
  os: [linux]
984
+ libc: [glibc]
963
985
 
964
986
  '@rollup/rollup-linux-ppc64-musl@4.63.1':
965
987
  resolution: {integrity: sha512-EF7OpqQTQ/BvGqLzUi4rEHuagCV9MugAUXSHemwPW5vxZ75RR+jxO/2j95Ph2dalMpFHSVECjRoioHZgA9zOYA==}
966
988
  cpu: [ppc64]
967
989
  os: [linux]
990
+ libc: [musl]
968
991
 
969
992
  '@rollup/rollup-linux-riscv64-gnu@4.63.1':
970
993
  resolution: {integrity: sha512-wQO3JesW9PRkwlabQ27y7sPfVOOTLRG73I4F2UYHG5PXun3J9U3y+b7ezVKSYbsvSKGQ1k1cq8Qlun4C9kLt3w==}
971
994
  cpu: [riscv64]
972
995
  os: [linux]
996
+ libc: [glibc]
973
997
 
974
998
  '@rollup/rollup-linux-riscv64-musl@4.63.1':
975
999
  resolution: {integrity: sha512-ouAGwhO6wHRXdnOVCOsB0tRFkA7nhNB2Nwax6oECXN0YiN8EYUTBAOudADOB1PI+yDL61TeNx/u7MVCzksNbkQ==}
976
1000
  cpu: [riscv64]
977
1001
  os: [linux]
1002
+ libc: [musl]
978
1003
 
979
1004
  '@rollup/rollup-linux-s390x-gnu@4.63.1':
980
1005
  resolution: {integrity: sha512-q2R38Sn+1J8RxhfJ+T54wSWmyKXWec+9jgDfqO2AtArEqHO5R2aeayp5H5OYLr5UYDVGsVaZPEFUooMhYCdz5A==}
981
1006
  cpu: [s390x]
982
1007
  os: [linux]
1008
+ libc: [glibc]
983
1009
 
984
1010
  '@rollup/rollup-linux-x64-gnu@4.63.1':
985
1011
  resolution: {integrity: sha512-gfI5T24WLLuFfSKw7Go/zDXjAAV0fny0swTaDv+WjK7vqcw4cRhFfdsyKL1n+ukI+ooBxn3bVQnyrn06WpI50w==}
986
1012
  cpu: [x64]
987
1013
  os: [linux]
1014
+ libc: [glibc]
988
1015
 
989
1016
  '@rollup/rollup-linux-x64-musl@4.63.1':
990
1017
  resolution: {integrity: sha512-4h6XqthmB4Hspji84wvgk+ElodTsGj+dbZqHJHHtKxj4mYq0ANSEEPX9ys3moJueqsRjwpaJYH7874Itwnj2ow==}
991
1018
  cpu: [x64]
992
1019
  os: [linux]
1020
+ libc: [musl]
993
1021
 
994
1022
  '@rollup/rollup-openbsd-x64@4.63.1':
995
1023
  resolution: {integrity: sha512-dlfCOa87o1VAYegLQ9EKilx2JCeRofiyPGhTCmqnuXZ6bMPiycO1rq1+sKoulAp7pGLIsTIw+1x5R+zgh5LhhA==}
@@ -1071,24 +1099,28 @@ packages:
1071
1099
  engines: {node: '>= 20'}
1072
1100
  cpu: [arm64]
1073
1101
  os: [linux]
1102
+ libc: [glibc]
1074
1103
 
1075
1104
  '@tailwindcss/oxide-linux-arm64-musl@4.3.3':
1076
1105
  resolution: {integrity: sha512-Md44bD6veX/PC5iyF8cDVnw4HBIANZepRZZ7a8DQOvkfo5WUBwcp6iAuCUz23u+4SUkhJlD3eL7hNdW8ezd/kA==}
1077
1106
  engines: {node: '>= 20'}
1078
1107
  cpu: [arm64]
1079
1108
  os: [linux]
1109
+ libc: [musl]
1080
1110
 
1081
1111
  '@tailwindcss/oxide-linux-x64-gnu@4.3.3':
1082
1112
  resolution: {integrity: sha512-tx7us1muwOKAKWao2v/GaafFeQboE6aj88vC6ziN2NCGcRm8gWUhwjzg+YdVB1e4boAtdtma4L43onunI6NS4w==}
1083
1113
  engines: {node: '>= 20'}
1084
1114
  cpu: [x64]
1085
1115
  os: [linux]
1116
+ libc: [glibc]
1086
1117
 
1087
1118
  '@tailwindcss/oxide-linux-x64-musl@4.3.3':
1088
1119
  resolution: {integrity: sha512-SJxX60smvHgasZoBy11dX6YRjXJFovwWBoedhbQPOBzgFWBHGB+TVPWB9BxzR7TTxU8FQZAI2AyiNCMzFm8Img==}
1089
1120
  engines: {node: '>= 20'}
1090
1121
  cpu: [x64]
1091
1122
  os: [linux]
1123
+ libc: [musl]
1092
1124
 
1093
1125
  '@tailwindcss/oxide-wasm32-wasi@4.3.3':
1094
1126
  resolution: {integrity: sha512-jx1+rPhY/5Ympkktd656HBWEBLxP7dH06losBLjjf5vgCODXvi9KhtftWcMIwTFIDqBr7cRnQkdLnAG+IOlGvQ==}
@@ -2291,48 +2323,56 @@ packages:
2291
2323
  engines: {node: '>= 12.0.0'}
2292
2324
  cpu: [arm64]
2293
2325
  os: [linux]
2326
+ libc: [glibc]
2294
2327
 
2295
2328
  lightningcss-linux-arm64-gnu@1.33.0:
2296
2329
  resolution: {integrity: sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==}
2297
2330
  engines: {node: '>= 12.0.0'}
2298
2331
  cpu: [arm64]
2299
2332
  os: [linux]
2333
+ libc: [glibc]
2300
2334
 
2301
2335
  lightningcss-linux-arm64-musl@1.32.0:
2302
2336
  resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==}
2303
2337
  engines: {node: '>= 12.0.0'}
2304
2338
  cpu: [arm64]
2305
2339
  os: [linux]
2340
+ libc: [musl]
2306
2341
 
2307
2342
  lightningcss-linux-arm64-musl@1.33.0:
2308
2343
  resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==}
2309
2344
  engines: {node: '>= 12.0.0'}
2310
2345
  cpu: [arm64]
2311
2346
  os: [linux]
2347
+ libc: [musl]
2312
2348
 
2313
2349
  lightningcss-linux-x64-gnu@1.32.0:
2314
2350
  resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==}
2315
2351
  engines: {node: '>= 12.0.0'}
2316
2352
  cpu: [x64]
2317
2353
  os: [linux]
2354
+ libc: [glibc]
2318
2355
 
2319
2356
  lightningcss-linux-x64-gnu@1.33.0:
2320
2357
  resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==}
2321
2358
  engines: {node: '>= 12.0.0'}
2322
2359
  cpu: [x64]
2323
2360
  os: [linux]
2361
+ libc: [glibc]
2324
2362
 
2325
2363
  lightningcss-linux-x64-musl@1.32.0:
2326
2364
  resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==}
2327
2365
  engines: {node: '>= 12.0.0'}
2328
2366
  cpu: [x64]
2329
2367
  os: [linux]
2368
+ libc: [musl]
2330
2369
 
2331
2370
  lightningcss-linux-x64-musl@1.33.0:
2332
2371
  resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==}
2333
2372
  engines: {node: '>= 12.0.0'}
2334
2373
  cpu: [x64]
2335
2374
  os: [linux]
2375
+ libc: [musl]
2336
2376
 
2337
2377
  lightningcss-win32-arm64-msvc@1.32.0:
2338
2378
  resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==}
@@ -3332,7 +3372,7 @@ snapshots:
3332
3372
 
3333
3373
  '@alloc/quick-lru@5.3.0': {}
3334
3374
 
3335
- '@antelopejs/tooling-configs@0.2.12':
3375
+ '@antelopejs/tooling-configs@0.2.17':
3336
3376
  dependencies:
3337
3377
  '@oxlint/plugins': 1.81.0
3338
3378
  dts-bundle-generator: 9.5.1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/dms-mailing",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "E-mail templates for the AntelopeJS DMS: a block editor with drafts and versions, a send log, delivery metrics and a suppression list.",
5
5
  "keywords": [
6
6
  "antelopejs",
@@ -46,22 +46,23 @@
46
46
  "registry": "https://registry.npmjs.org/"
47
47
  },
48
48
  "dependencies": {
49
- "@antelopejs/interface-api": ">=0.0.15 <1.0.0",
50
- "@antelopejs/interface-api-util": ">=0.1.3 <1.0.0",
51
- "@antelopejs/interface-core": ">=0.2.4 <1.0.0",
52
- "@antelopejs/interface-data-api": ">=0.4.0 <1.0.0",
53
- "@antelopejs/interface-database": ">=0.1.11 <1.0.0",
54
- "@antelopejs/interface-database-decorators": ">=0.1.10 <1.0.0",
55
- "@antelopejs/interface-dms": ">=0.9.0 <1.0.0",
56
- "@antelopejs/interface-dms-mailing": ">=0.9.0 <0.10.0",
49
+ "@antelopejs/interface-api": ">=0.3.0 <1.0.0",
50
+ "@antelopejs/interface-api-util": ">=0.3.0 <1.0.0",
51
+ "@antelopejs/interface-core": ">=0.4.0 <1.0.0",
52
+ "@antelopejs/interface-data-api": ">=0.6.1 <1.0.0",
53
+ "@antelopejs/interface-database": ">=0.3.0 <1.0.0",
54
+ "@antelopejs/interface-database-decorators": ">=0.2.0 <1.0.0",
55
+ "@antelopejs/interface-dms": ">=0.12.0 <1.0.0",
56
+ "@antelopejs/interface-dms-mailing": ">=0.10.0 <0.11.0",
57
57
  "@antelopejs/interface-email": ">=0.0.6 <1.0.0",
58
58
  "node-cron": "^4.2.1",
59
59
  "zod": "~3.24.2"
60
60
  },
61
61
  "devDependencies": {
62
- "@antelopejs/core": ">=1.17.1 <2",
63
- "@antelopejs/dms": ">=0.13.1 <1.0.0",
64
- "@antelopejs/tooling-configs": "^0.2.12",
62
+ "@antelopejs/core": "^1.20.0",
63
+ "@antelopejs/dms": ">=0.16.1 <1.0.0",
64
+ "@antelopejs/mongodb": "^1.6.2",
65
+ "@antelopejs/tooling-configs": "^0.2.18",
65
66
  "@types/chai": "^4.3.20",
66
67
  "@types/mocha": "^10",
67
68
  "@types/node": "^24.0.0",
@@ -76,7 +77,7 @@
76
77
  "typescript": "^6.0.3"
77
78
  },
78
79
  "optionalDependencies": {
79
- "@antelopejs/interface-dms-automation": ">=0.2.1 <1.0.0"
80
+ "@antelopejs/interface-dms-automation": ">=0.6.0 <1.0.0"
80
81
  },
81
82
  "antelopeJs": {
82
83
  "baseUrl": "dist",
@@ -90,14 +91,14 @@
90
91
  },
91
92
  "dmsFrontend": "dist/frontend-module.js",
92
93
  "scripts": {
93
- "build": "rimraf dist && tsc",
94
+ "build": "pnpm --filter @antelopejs/interface-dms-mailing build && rimraf dist && tsc",
94
95
  "dev": "ajs project dev -w -p playground",
95
96
  "dev:frontend": "cd playground && pnpm frontend:dev",
96
97
  "frontend:dev": "cd playground && pnpm frontend:dev",
97
98
  "typecheck": "tsc --noEmit",
98
99
  "knip": "knip --dependencies",
99
100
  "knip:all": "knip",
100
- "release": "pnpm --filter @antelopejs/interface-dms-mailing build && pnpm --dir frontend-vue install --frozen-lockfile && release-it",
101
+ "release": "pnpm --filter @antelopejs/interface-dms-mailing build && pnpm --dir ../.. install --frozen-lockfile && release-it",
101
102
  "test": "pnpm run test:backend && pnpm run test:layer",
102
103
  "test:backend": "([ -n \"$DMS_PREBUILT\" ] || pnpm run build) && ajs module test .",
103
104
  "test:layer": "cd frontend-vue && pnpm test",
@@ -23,9 +23,9 @@ https://dms.antelopejs.com/docs/modules/mailing (sending from code and the webho
23
23
 
24
24
  - `ajs project modules add @antelopejs/dms-mailing`, plus a module implementing `@antelopejs/interface-email`
25
25
  (`@antelopejs/nodemailer`, `config: { ethereal: true }` in dev).
26
- - Mailing 0.7.1 requires `@antelopejs/dms` `>=0.11.0 <1.0.0`, so DMS 0.11 or later (interface-dms 0.9, renderer `@antelopejs/dms-frontend` `>=0.9.1 <0.10.0`);
27
- 0.7.0 is the DMS 0.10 line. It implements `@antelopejs/interface-dms-mailing` `>=0.9.0 <0.10.0`: declaration and import calls,
28
- and `DeclareSender` since interface 0.9; `SendTemplate` / `RecordEmailEvent` callers do not change.
26
+ - The DMS backend and renderer releases the module runs on are in the README compatibility block and in `engines["@antelopejs/dms-frontend"]` of `frontend-vue/package.json`;
27
+ 0.4 is the DMS 0.8 line. Mailing 0.6 implements `@antelopejs/interface-dms-mailing` `>=0.8.0 <0.9.0`, adding declaration and import calls;
28
+ interface 0.9 adds `DeclareSender`; `SendTemplate` / `RecordEmailEvent` callers do not change.
29
29
  - Module option: `useHtmlRender` (default `true`, DMS html-render chain; `false` = built-in standalone HTML).
30
30
  - Set the DMS `clientBaseUrl`: the webhook URL and the e-mail logo are built on it.
31
31
  - Per-workspace settings (sender, missing-variable guard, fallback locale, webhook secret, retention,
@@ -5,13 +5,13 @@ import type {
5
5
  } from "@antelopejs/interface-dms-automation";
6
6
  import { SEND_EVENT_TYPES, type SendEventType } from "../types";
7
7
 
8
- export interface EmailEventPayload {
8
+ export type EmailEventPayload = {
9
9
  tenantId: string;
10
10
  sendId: string;
11
11
  templateSlug: string;
12
12
  type: SendEventType;
13
13
  recipientEmail: string;
14
- }
14
+ };
15
15
 
16
16
  export interface EmailEventTriggerConfig {
17
17
  types?: SendEventType[];
@@ -3,7 +3,10 @@ import type {
3
3
  JsonSchema,
4
4
  } from "@antelopejs/interface-dms-automation";
5
5
  import type { EmailAddress } from "@antelopejs/interface-email";
6
- import type { SendTemplateResult } from "@antelopejs/interface-dms-mailing";
6
+ import type {
7
+ SendTemplateResult,
8
+ TemplateVariables,
9
+ } from "@antelopejs/interface-dms-mailing";
7
10
  import { sendUnlessSuppressed } from "../services/checked-send";
8
11
  import { SEND_STATUSES } from "../types";
9
12
 
@@ -12,7 +15,7 @@ export interface SendTemplateActionInput {
12
15
  slug: string;
13
16
  to: EmailAddress | EmailAddress[];
14
17
  locale?: string;
15
- variables?: Record<string, unknown>;
18
+ variables?: TemplateVariables;
16
19
  source?: string;
17
20
  }
18
21
 
@@ -42,12 +45,12 @@ const INPUT_SCHEMA: JsonSchema = {
42
45
  required: ["tenantId", "slug", "to"],
43
46
  };
44
47
 
45
- const RESULT_PROPERTIES: JsonSchema = {
48
+ const RESULT_PROPERTIES = {
46
49
  sendId: { type: "string" },
47
50
  status: { type: "string", enum: SEND_STATUSES },
48
51
  messageId: { type: "string" },
49
52
  error: { type: "string" },
50
- };
53
+ } satisfies { [name: string]: JsonSchema };
51
54
 
52
55
  const OUTPUT_SCHEMA: JsonSchema = {
53
56
  type: "object",
@@ -61,12 +64,21 @@ const OUTPUT_SCHEMA: JsonSchema = {
61
64
  },
62
65
  };
63
66
 
64
- const failedRecipients = (result: SendTemplateResult): SendTemplateResult[] =>
67
+ /** What the action hands the graph: the send's result, as JSON. */
68
+ type SendTemplateOutput = {
69
+ sendId: string;
70
+ status: SendTemplateResult["status"];
71
+ messageId?: string;
72
+ error?: string;
73
+ results?: SendTemplateOutput[];
74
+ };
75
+
76
+ const failedRecipients = (result: SendTemplateOutput): SendTemplateOutput[] =>
65
77
  (result.results ?? [result]).filter((entry) => entry.status === "failed");
66
78
 
67
79
  export const sendTemplateAction: ActionType<
68
80
  SendTemplateActionInput,
69
- SendTemplateResult
81
+ SendTemplateOutput
70
82
  > = {
71
83
  id: SEND_TEMPLATE_ACTION_ID,
72
84
  name: "Send e-mail template",
@@ -78,13 +90,16 @@ export const sendTemplateAction: ActionType<
78
90
  const source =
79
91
  input.source ?? `${AUTOMATION_SOURCE_PREFIX}${ctx.procedureId}`;
80
92
  try {
81
- const result = await sendUnlessSuppressed(input.slug, {
82
- tenantId: input.tenantId,
83
- to: input.to,
84
- locale: input.locale,
85
- variables: input.variables,
86
- source,
87
- });
93
+ const result: SendTemplateOutput = await sendUnlessSuppressed(
94
+ input.slug,
95
+ {
96
+ tenantId: input.tenantId,
97
+ to: input.to,
98
+ locale: input.locale,
99
+ variables: input.variables,
100
+ source,
101
+ },
102
+ );
88
103
  const failures = failedRecipients(result);
89
104
  if (failures.length > 0) {
90
105
  ctx.log(
@@ -95,7 +110,11 @@ export const sendTemplateAction: ActionType<
95
110
  }
96
111
  return result;
97
112
  } catch (error) {
98
- ctx.log("error", `Template "${input.slug}" could not be sent`, error);
113
+ ctx.log(
114
+ "error",
115
+ `Template "${input.slug}" could not be sent`,
116
+ error instanceof Error ? error.message : String(error),
117
+ );
99
118
  throw error;
100
119
  }
101
120
  },
package/src/data/body.ts CHANGED
@@ -1,14 +1,17 @@
1
1
  import { HTTPResult } from "@antelopejs/interface-api";
2
2
  import { HTTP_BAD_REQUEST } from "../constants";
3
+ import type { JsonValue } from "../types/json";
3
4
  import { isText } from "../validation/guards";
5
+ import { parseJson } from "../validation/json";
4
6
 
5
7
  const INVALID_BODY = "$dms_mailing.errors.invalid_body";
6
8
 
7
- export function parseBody(body: Buffer | string): Record<string, unknown> {
9
+ /** The JSON a request body carries, `{}` for an empty one; 400 when it is not JSON. */
10
+ export function parseBody(body: Buffer | string): JsonValue {
8
11
  const raw = isText(body) ? body : body.toString("utf8");
9
12
  if (!raw) return {};
10
13
  try {
11
- return JSON.parse(raw) as Record<string, unknown>;
14
+ return parseJson(raw);
12
15
  } catch {
13
16
  throw new HTTPResult(HTTP_BAD_REQUEST, INVALID_BODY);
14
17
  }