@carlonicora/nestjs-neo4jsonapi 6.3.0 → 6.5.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 (195) hide show
  1. package/dist/agents/graph/services/graph.search.service.d.ts +6 -0
  2. package/dist/agents/graph/services/graph.search.service.d.ts.map +1 -1
  3. package/dist/agents/graph/services/graph.search.service.js +51 -10
  4. package/dist/agents/graph/services/graph.search.service.js.map +1 -1
  5. package/dist/bootstrap/app.module.factory.d.ts.map +1 -1
  6. package/dist/bootstrap/app.module.factory.js +1 -0
  7. package/dist/bootstrap/app.module.factory.js.map +1 -1
  8. package/dist/bootstrap/bootstrap.options.d.ts +20 -0
  9. package/dist/bootstrap/bootstrap.options.d.ts.map +1 -1
  10. package/dist/core/email/services/email.service.d.ts +2 -0
  11. package/dist/core/email/services/email.service.d.ts.map +1 -1
  12. package/dist/core/email/services/email.service.js +18 -8
  13. package/dist/core/email/services/email.service.js.map +1 -1
  14. package/dist/core/email/templates/en/emailAutomation.hbs +24 -0
  15. package/dist/foundations/auth/controllers/auth.controller.d.ts +2 -2
  16. package/dist/foundations/auth/controllers/auth.controller.d.ts.map +1 -1
  17. package/dist/foundations/auth/controllers/auth.controller.js +8 -6
  18. package/dist/foundations/auth/controllers/auth.controller.js.map +1 -1
  19. package/dist/foundations/auth/events/auth.events.d.ts +12 -0
  20. package/dist/foundations/auth/events/auth.events.d.ts.map +1 -0
  21. package/dist/foundations/auth/events/auth.events.js +6 -0
  22. package/dist/foundations/auth/events/auth.events.js.map +1 -0
  23. package/dist/foundations/auth/index.d.ts +2 -0
  24. package/dist/foundations/auth/index.d.ts.map +1 -1
  25. package/dist/foundations/auth/index.js +3 -1
  26. package/dist/foundations/auth/index.js.map +1 -1
  27. package/dist/foundations/auth/services/auth.service.d.ts +5 -3
  28. package/dist/foundations/auth/services/auth.service.d.ts.map +1 -1
  29. package/dist/foundations/auth/services/auth.service.js +13 -4
  30. package/dist/foundations/auth/services/auth.service.js.map +1 -1
  31. package/dist/foundations/community/repositories/community.repository.d.ts +6 -0
  32. package/dist/foundations/community/repositories/community.repository.d.ts.map +1 -1
  33. package/dist/foundations/community/repositories/community.repository.js +42 -9
  34. package/dist/foundations/community/repositories/community.repository.js.map +1 -1
  35. package/dist/foundations/email-automation/controllers/email-automation-step.controller.d.ts +22 -0
  36. package/dist/foundations/email-automation/controllers/email-automation-step.controller.d.ts.map +1 -0
  37. package/dist/foundations/email-automation/controllers/email-automation-step.controller.js +152 -0
  38. package/dist/foundations/email-automation/controllers/email-automation-step.controller.js.map +1 -0
  39. package/dist/foundations/email-automation/controllers/email-automation.controller.d.ts +29 -0
  40. package/dist/foundations/email-automation/controllers/email-automation.controller.d.ts.map +1 -0
  41. package/dist/foundations/email-automation/controllers/email-automation.controller.js +183 -0
  42. package/dist/foundations/email-automation/controllers/email-automation.controller.js.map +1 -0
  43. package/dist/foundations/email-automation/controllers/email-automation.public.controller.d.ts +20 -0
  44. package/dist/foundations/email-automation/controllers/email-automation.public.controller.d.ts.map +1 -0
  45. package/dist/foundations/email-automation/controllers/email-automation.public.controller.js +63 -0
  46. package/dist/foundations/email-automation/controllers/email-automation.public.controller.js.map +1 -0
  47. package/dist/foundations/email-automation/cron/email-automation-sender.cron.d.ts +9 -0
  48. package/dist/foundations/email-automation/cron/email-automation-sender.cron.d.ts.map +1 -0
  49. package/dist/foundations/email-automation/cron/email-automation-sender.cron.js +44 -0
  50. package/dist/foundations/email-automation/cron/email-automation-sender.cron.js.map +1 -0
  51. package/dist/foundations/email-automation/dtos/email-automation-step.dto.d.ts +8 -0
  52. package/dist/foundations/email-automation/dtos/email-automation-step.dto.d.ts.map +1 -0
  53. package/dist/foundations/email-automation/dtos/email-automation-step.dto.js +36 -0
  54. package/dist/foundations/email-automation/dtos/email-automation-step.dto.js.map +1 -0
  55. package/dist/foundations/email-automation/dtos/email-automation-step.patch.dto.d.ts +16 -0
  56. package/dist/foundations/email-automation/dtos/email-automation-step.patch.dto.d.ts.map +1 -0
  57. package/dist/foundations/email-automation/dtos/email-automation-step.patch.dto.js +72 -0
  58. package/dist/foundations/email-automation/dtos/email-automation-step.patch.dto.js.map +1 -0
  59. package/dist/foundations/email-automation/dtos/email-automation-step.post.dto.d.ts +21 -0
  60. package/dist/foundations/email-automation/dtos/email-automation-step.post.dto.d.ts.map +1 -0
  61. package/dist/foundations/email-automation/dtos/email-automation-step.post.dto.js +88 -0
  62. package/dist/foundations/email-automation/dtos/email-automation-step.post.dto.js.map +1 -0
  63. package/dist/foundations/email-automation/dtos/email-automation-unsubscribe.dto.d.ts +11 -0
  64. package/dist/foundations/email-automation/dtos/email-automation-unsubscribe.dto.d.ts.map +1 -0
  65. package/dist/foundations/email-automation/dtos/email-automation-unsubscribe.dto.js +47 -0
  66. package/dist/foundations/email-automation/dtos/email-automation-unsubscribe.dto.js.map +1 -0
  67. package/dist/foundations/email-automation/dtos/email-automation.dto.d.ts +8 -0
  68. package/dist/foundations/email-automation/dtos/email-automation.dto.d.ts.map +1 -0
  69. package/dist/foundations/email-automation/dtos/email-automation.dto.js +36 -0
  70. package/dist/foundations/email-automation/dtos/email-automation.dto.js.map +1 -0
  71. package/dist/foundations/email-automation/dtos/email-automation.patch.dto.d.ts +16 -0
  72. package/dist/foundations/email-automation/dtos/email-automation.patch.dto.d.ts.map +1 -0
  73. package/dist/foundations/email-automation/dtos/email-automation.patch.dto.js +72 -0
  74. package/dist/foundations/email-automation/dtos/email-automation.patch.dto.js.map +1 -0
  75. package/dist/foundations/email-automation/dtos/email-automation.post.dto.d.ts +16 -0
  76. package/dist/foundations/email-automation/dtos/email-automation.post.dto.d.ts.map +1 -0
  77. package/dist/foundations/email-automation/dtos/email-automation.post.dto.js +72 -0
  78. package/dist/foundations/email-automation/dtos/email-automation.post.dto.js.map +1 -0
  79. package/dist/foundations/email-automation/email-automation.module.d.ts +35 -0
  80. package/dist/foundations/email-automation/email-automation.module.d.ts.map +1 -0
  81. package/dist/foundations/email-automation/email-automation.module.js +122 -0
  82. package/dist/foundations/email-automation/email-automation.module.js.map +1 -0
  83. package/dist/foundations/email-automation/entities/email-automation-enrollment.d.ts +55 -0
  84. package/dist/foundations/email-automation/entities/email-automation-enrollment.d.ts.map +1 -0
  85. package/dist/foundations/email-automation/entities/email-automation-enrollment.js +74 -0
  86. package/dist/foundations/email-automation/entities/email-automation-enrollment.js.map +1 -0
  87. package/dist/foundations/email-automation/entities/email-automation-enrollment.meta.d.ts +3 -0
  88. package/dist/foundations/email-automation/entities/email-automation-enrollment.meta.d.ts.map +1 -0
  89. package/dist/foundations/email-automation/entities/email-automation-enrollment.meta.js +10 -0
  90. package/dist/foundations/email-automation/entities/email-automation-enrollment.meta.js.map +1 -0
  91. package/dist/foundations/email-automation/entities/email-automation-step.d.ts +32 -0
  92. package/dist/foundations/email-automation/entities/email-automation-step.d.ts.map +1 -0
  93. package/dist/foundations/email-automation/entities/email-automation-step.js +55 -0
  94. package/dist/foundations/email-automation/entities/email-automation-step.js.map +1 -0
  95. package/dist/foundations/email-automation/entities/email-automation-step.meta.d.ts +3 -0
  96. package/dist/foundations/email-automation/entities/email-automation-step.meta.d.ts.map +1 -0
  97. package/dist/foundations/email-automation/entities/email-automation-step.meta.js +10 -0
  98. package/dist/foundations/email-automation/entities/email-automation-step.meta.js.map +1 -0
  99. package/dist/foundations/email-automation/entities/email-automation-trigger.d.ts +11 -0
  100. package/dist/foundations/email-automation/entities/email-automation-trigger.d.ts.map +1 -0
  101. package/dist/foundations/email-automation/entities/email-automation-trigger.js +15 -0
  102. package/dist/foundations/email-automation/entities/email-automation-trigger.js.map +1 -0
  103. package/dist/foundations/email-automation/entities/email-automation-trigger.meta.d.ts +6 -0
  104. package/dist/foundations/email-automation/entities/email-automation-trigger.meta.d.ts.map +1 -0
  105. package/dist/foundations/email-automation/entities/email-automation-trigger.meta.js +13 -0
  106. package/dist/foundations/email-automation/entities/email-automation-trigger.meta.js.map +1 -0
  107. package/dist/foundations/email-automation/entities/email-automation.d.ts +26 -0
  108. package/dist/foundations/email-automation/entities/email-automation.d.ts.map +1 -0
  109. package/dist/foundations/email-automation/entities/email-automation.js +54 -0
  110. package/dist/foundations/email-automation/entities/email-automation.js.map +1 -0
  111. package/dist/foundations/email-automation/entities/email-automation.meta.d.ts +7 -0
  112. package/dist/foundations/email-automation/entities/email-automation.meta.d.ts.map +1 -0
  113. package/dist/foundations/email-automation/entities/email-automation.meta.js +14 -0
  114. package/dist/foundations/email-automation/entities/email-automation.meta.js.map +1 -0
  115. package/dist/foundations/email-automation/entities/email-opt-out.d.ts +9 -0
  116. package/dist/foundations/email-automation/entities/email-opt-out.d.ts.map +1 -0
  117. package/dist/foundations/email-automation/entities/email-opt-out.js +17 -0
  118. package/dist/foundations/email-automation/entities/email-opt-out.js.map +1 -0
  119. package/dist/foundations/email-automation/entities/email-opt-out.meta.d.ts +3 -0
  120. package/dist/foundations/email-automation/entities/email-opt-out.meta.d.ts.map +1 -0
  121. package/dist/foundations/email-automation/entities/email-opt-out.meta.js +10 -0
  122. package/dist/foundations/email-automation/entities/email-opt-out.meta.js.map +1 -0
  123. package/dist/foundations/email-automation/index.d.ts +32 -0
  124. package/dist/foundations/email-automation/index.d.ts.map +1 -0
  125. package/dist/foundations/email-automation/index.js +56 -0
  126. package/dist/foundations/email-automation/index.js.map +1 -0
  127. package/dist/foundations/email-automation/interfaces/email-automation.config.interface.d.ts +49 -0
  128. package/dist/foundations/email-automation/interfaces/email-automation.config.interface.d.ts.map +1 -0
  129. package/dist/foundations/email-automation/interfaces/email-automation.config.interface.js +14 -0
  130. package/dist/foundations/email-automation/interfaces/email-automation.config.interface.js.map +1 -0
  131. package/dist/foundations/email-automation/repositories/email-automation-enrollment.repository.d.ts +150 -0
  132. package/dist/foundations/email-automation/repositories/email-automation-enrollment.repository.d.ts.map +1 -0
  133. package/dist/foundations/email-automation/repositories/email-automation-enrollment.repository.js +379 -0
  134. package/dist/foundations/email-automation/repositories/email-automation-enrollment.repository.js.map +1 -0
  135. package/dist/foundations/email-automation/repositories/email-automation-step.repository.d.ts +64 -0
  136. package/dist/foundations/email-automation/repositories/email-automation-step.repository.d.ts.map +1 -0
  137. package/dist/foundations/email-automation/repositories/email-automation-step.repository.js +156 -0
  138. package/dist/foundations/email-automation/repositories/email-automation-step.repository.js.map +1 -0
  139. package/dist/foundations/email-automation/repositories/email-automation.repository.d.ts +36 -0
  140. package/dist/foundations/email-automation/repositories/email-automation.repository.d.ts.map +1 -0
  141. package/dist/foundations/email-automation/repositories/email-automation.repository.js +93 -0
  142. package/dist/foundations/email-automation/repositories/email-automation.repository.js.map +1 -0
  143. package/dist/foundations/email-automation/repositories/email-opt-out.repository.d.ts +25 -0
  144. package/dist/foundations/email-automation/repositories/email-opt-out.repository.d.ts.map +1 -0
  145. package/dist/foundations/email-automation/repositories/email-opt-out.repository.js +69 -0
  146. package/dist/foundations/email-automation/repositories/email-opt-out.repository.js.map +1 -0
  147. package/dist/foundations/email-automation/services/email-automation-renderer.service.d.ts +35 -0
  148. package/dist/foundations/email-automation/services/email-automation-renderer.service.d.ts.map +1 -0
  149. package/dist/foundations/email-automation/services/email-automation-renderer.service.js +109 -0
  150. package/dist/foundations/email-automation/services/email-automation-renderer.service.js.map +1 -0
  151. package/dist/foundations/email-automation/services/email-automation-sender.service.d.ts +31 -0
  152. package/dist/foundations/email-automation/services/email-automation-sender.service.d.ts.map +1 -0
  153. package/dist/foundations/email-automation/services/email-automation-sender.service.js +129 -0
  154. package/dist/foundations/email-automation/services/email-automation-sender.service.js.map +1 -0
  155. package/dist/foundations/email-automation/services/email-automation-step.service.d.ts +60 -0
  156. package/dist/foundations/email-automation/services/email-automation-step.service.d.ts.map +1 -0
  157. package/dist/foundations/email-automation/services/email-automation-step.service.js +101 -0
  158. package/dist/foundations/email-automation/services/email-automation-step.service.js.map +1 -0
  159. package/dist/foundations/email-automation/services/email-automation-trigger.service.d.ts +28 -0
  160. package/dist/foundations/email-automation/services/email-automation-trigger.service.d.ts.map +1 -0
  161. package/dist/foundations/email-automation/services/email-automation-trigger.service.js +125 -0
  162. package/dist/foundations/email-automation/services/email-automation-trigger.service.js.map +1 -0
  163. package/dist/foundations/email-automation/services/email-automation-unsubscribe.service.d.ts +53 -0
  164. package/dist/foundations/email-automation/services/email-automation-unsubscribe.service.d.ts.map +1 -0
  165. package/dist/foundations/email-automation/services/email-automation-unsubscribe.service.js +67 -0
  166. package/dist/foundations/email-automation/services/email-automation-unsubscribe.service.js.map +1 -0
  167. package/dist/foundations/email-automation/services/email-automation.service.d.ts +53 -0
  168. package/dist/foundations/email-automation/services/email-automation.service.d.ts.map +1 -0
  169. package/dist/foundations/email-automation/services/email-automation.service.js +90 -0
  170. package/dist/foundations/email-automation/services/email-automation.service.js.map +1 -0
  171. package/dist/foundations/email-automation/triggers/built-in.triggers.d.ts +10 -0
  172. package/dist/foundations/email-automation/triggers/built-in.triggers.d.ts.map +1 -0
  173. package/dist/foundations/email-automation/triggers/built-in.triggers.js +50 -0
  174. package/dist/foundations/email-automation/triggers/built-in.triggers.js.map +1 -0
  175. package/dist/foundations/foundations.modules.d.ts +3 -0
  176. package/dist/foundations/foundations.modules.d.ts.map +1 -1
  177. package/dist/foundations/foundations.modules.js +7 -1
  178. package/dist/foundations/foundations.modules.js.map +1 -1
  179. package/dist/foundations/index.d.ts +1 -0
  180. package/dist/foundations/index.d.ts.map +1 -1
  181. package/dist/foundations/index.js +1 -0
  182. package/dist/foundations/index.js.map +1 -1
  183. package/dist/foundations/waitlist/events/waitlist.events.d.ts +7 -0
  184. package/dist/foundations/waitlist/events/waitlist.events.d.ts.map +1 -0
  185. package/dist/foundations/waitlist/events/waitlist.events.js +6 -0
  186. package/dist/foundations/waitlist/events/waitlist.events.js.map +1 -0
  187. package/dist/foundations/waitlist/index.d.ts +2 -0
  188. package/dist/foundations/waitlist/index.d.ts.map +1 -1
  189. package/dist/foundations/waitlist/index.js +4 -1
  190. package/dist/foundations/waitlist/index.js.map +1 -1
  191. package/dist/foundations/waitlist/services/waitlist.service.d.ts +3 -1
  192. package/dist/foundations/waitlist/services/waitlist.service.d.ts.map +1 -1
  193. package/dist/foundations/waitlist/services/waitlist.service.js +27 -14
  194. package/dist/foundations/waitlist/services/waitlist.service.js.map +1 -1
  195. package/package.json +1 -1
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmailOptOutDescriptor = void 0;
4
+ const common_1 = require("../../../common");
5
+ const email_opt_out_meta_1 = require("./email-opt-out.meta");
6
+ exports.EmailOptOutDescriptor = (0, common_1.defineEntity)()({
7
+ ...email_opt_out_meta_1.emailOptOutMeta,
8
+ // Opt-outs are per email address, across the whole app
9
+ isCompanyScoped: false,
10
+ fields: {
11
+ email: { type: "string", required: true },
12
+ optedOutAt: { type: "datetime", required: true },
13
+ source: { type: "string", required: true },
14
+ },
15
+ relationships: {},
16
+ });
17
+ //# sourceMappingURL=email-opt-out.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-opt-out.js","sourceRoot":"","sources":["../../../../src/foundations/email-automation/entities/email-opt-out.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AACvD,6DAAuD;AAQ1C,QAAA,qBAAqB,GAAG,IAAA,qBAAY,GAAe,CAAC;IAC/D,GAAG,oCAAe;IAElB,uDAAuD;IACvD,eAAe,EAAE,KAAK;IAEtB,MAAM,EAAE;QACN,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzC,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;QAChD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC3C;IAED,aAAa,EAAE,EAAE;CAClB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { DataMeta } from "../../../common/interfaces/datamodel.interface";
2
+ export declare const emailOptOutMeta: DataMeta;
3
+ //# sourceMappingURL=email-opt-out.meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-opt-out.meta.d.ts","sourceRoot":"","sources":["../../../../src/foundations/email-automation/entities/email-opt-out.meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAE1E,eAAO,MAAM,eAAe,EAAE,QAK7B,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.emailOptOutMeta = void 0;
4
+ exports.emailOptOutMeta = {
5
+ type: "email-opt-outs",
6
+ endpoint: "email-opt-outs",
7
+ nodeName: "emailOptOut",
8
+ labelName: "EmailOptOut",
9
+ };
10
+ //# sourceMappingURL=email-opt-out.meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-opt-out.meta.js","sourceRoot":"","sources":["../../../../src/foundations/email-automation/entities/email-opt-out.meta.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAa;IACvC,IAAI,EAAE,gBAAgB;IACtB,QAAQ,EAAE,gBAAgB;IAC1B,QAAQ,EAAE,aAAa;IACvB,SAAS,EAAE,aAAa;CACzB,CAAC"}
@@ -0,0 +1,32 @@
1
+ export * from "./email-automation.module";
2
+ export * from "./interfaces/email-automation.config.interface";
3
+ export * from "./triggers/built-in.triggers";
4
+ export * from "./entities/email-automation";
5
+ export * from "./entities/email-automation.meta";
6
+ export * from "./entities/email-automation-step";
7
+ export * from "./entities/email-automation-step.meta";
8
+ export * from "./entities/email-automation-enrollment";
9
+ export * from "./entities/email-automation-enrollment.meta";
10
+ export * from "./entities/email-opt-out";
11
+ export * from "./entities/email-opt-out.meta";
12
+ export * from "./entities/email-automation-trigger";
13
+ export * from "./entities/email-automation-trigger.meta";
14
+ export * from "./dtos/email-automation.dto";
15
+ export * from "./dtos/email-automation.post.dto";
16
+ export * from "./dtos/email-automation.patch.dto";
17
+ export * from "./dtos/email-automation-step.dto";
18
+ export * from "./dtos/email-automation-step.post.dto";
19
+ export * from "./dtos/email-automation-step.patch.dto";
20
+ export * from "./dtos/email-automation-unsubscribe.dto";
21
+ export * from "./repositories/email-automation.repository";
22
+ export * from "./repositories/email-automation-step.repository";
23
+ export * from "./repositories/email-automation-enrollment.repository";
24
+ export * from "./repositories/email-opt-out.repository";
25
+ export * from "./services/email-automation.service";
26
+ export * from "./services/email-automation-step.service";
27
+ export * from "./services/email-automation-trigger.service";
28
+ export * from "./services/email-automation-renderer.service";
29
+ export * from "./services/email-automation-sender.service";
30
+ export * from "./services/email-automation-unsubscribe.service";
31
+ export * from "./cron/email-automation-sender.cron";
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/foundations/email-automation/index.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC;AAG1C,cAAc,gDAAgD,CAAC;AAG/D,cAAc,8BAA8B,CAAC;AAG7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,0CAA0C,CAAC;AAGzD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AAGxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,iDAAiD,CAAC;AAChE,cAAc,uDAAuD,CAAC;AACtE,cAAc,yCAAyC,CAAC;AAGxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0CAA0C,CAAC;AACzD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,iDAAiD,CAAC;AAGhE,cAAc,qCAAqC,CAAC"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Module
18
+ __exportStar(require("./email-automation.module"), exports);
19
+ // Config
20
+ __exportStar(require("./interfaces/email-automation.config.interface"), exports);
21
+ // Built-in triggers
22
+ __exportStar(require("./triggers/built-in.triggers"), exports);
23
+ // Entities + metas
24
+ __exportStar(require("./entities/email-automation"), exports);
25
+ __exportStar(require("./entities/email-automation.meta"), exports);
26
+ __exportStar(require("./entities/email-automation-step"), exports);
27
+ __exportStar(require("./entities/email-automation-step.meta"), exports);
28
+ __exportStar(require("./entities/email-automation-enrollment"), exports);
29
+ __exportStar(require("./entities/email-automation-enrollment.meta"), exports);
30
+ __exportStar(require("./entities/email-opt-out"), exports);
31
+ __exportStar(require("./entities/email-opt-out.meta"), exports);
32
+ __exportStar(require("./entities/email-automation-trigger"), exports);
33
+ __exportStar(require("./entities/email-automation-trigger.meta"), exports);
34
+ // DTOs
35
+ __exportStar(require("./dtos/email-automation.dto"), exports);
36
+ __exportStar(require("./dtos/email-automation.post.dto"), exports);
37
+ __exportStar(require("./dtos/email-automation.patch.dto"), exports);
38
+ __exportStar(require("./dtos/email-automation-step.dto"), exports);
39
+ __exportStar(require("./dtos/email-automation-step.post.dto"), exports);
40
+ __exportStar(require("./dtos/email-automation-step.patch.dto"), exports);
41
+ __exportStar(require("./dtos/email-automation-unsubscribe.dto"), exports);
42
+ // Repositories
43
+ __exportStar(require("./repositories/email-automation.repository"), exports);
44
+ __exportStar(require("./repositories/email-automation-step.repository"), exports);
45
+ __exportStar(require("./repositories/email-automation-enrollment.repository"), exports);
46
+ __exportStar(require("./repositories/email-opt-out.repository"), exports);
47
+ // Services
48
+ __exportStar(require("./services/email-automation.service"), exports);
49
+ __exportStar(require("./services/email-automation-step.service"), exports);
50
+ __exportStar(require("./services/email-automation-trigger.service"), exports);
51
+ __exportStar(require("./services/email-automation-renderer.service"), exports);
52
+ __exportStar(require("./services/email-automation-sender.service"), exports);
53
+ __exportStar(require("./services/email-automation-unsubscribe.service"), exports);
54
+ // Cron
55
+ __exportStar(require("./cron/email-automation-sender.cron"), exports);
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/foundations/email-automation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS;AACT,4DAA0C;AAE1C,SAAS;AACT,iFAA+D;AAE/D,oBAAoB;AACpB,+DAA6C;AAE7C,mBAAmB;AACnB,8DAA4C;AAC5C,mEAAiD;AACjD,mEAAiD;AACjD,wEAAsD;AACtD,yEAAuD;AACvD,8EAA4D;AAC5D,2DAAyC;AACzC,gEAA8C;AAC9C,sEAAoD;AACpD,2EAAyD;AAEzD,OAAO;AACP,8DAA4C;AAC5C,mEAAiD;AACjD,oEAAkD;AAClD,mEAAiD;AACjD,wEAAsD;AACtD,yEAAuD;AACvD,0EAAwD;AAExD,eAAe;AACf,6EAA2D;AAC3D,kFAAgE;AAChE,wFAAsE;AACtE,0EAAwD;AAExD,WAAW;AACX,sEAAoD;AACpD,2EAAyD;AACzD,8EAA4D;AAC5D,+EAA6D;AAC7D,6EAA2D;AAC3D,kFAAgE;AAEhE,OAAO;AACP,sEAAoD"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * The person a trigger enrols: built by `EmailAutomationTriggerDefinition.toRecipient`
3
+ * from the event payload.
4
+ */
5
+ export type EmailAutomationRecipient = {
6
+ email: string;
7
+ name?: string;
8
+ recipientType: "user" | "waitlist";
9
+ recipientId: string;
10
+ marketingConsent: boolean;
11
+ };
12
+ /**
13
+ * One trigger an app declares. The library holds no app trigger key: every key and
14
+ * label comes from the consuming app (see `waitlistConfirmedTrigger` /
15
+ * `userActivatedTrigger` for the built-in events).
16
+ */
17
+ export interface EmailAutomationTriggerDefinition {
18
+ /** Stable key stored on `EmailAutomation.trigger` / `exitTrigger` */
19
+ key: string;
20
+ /** Plain-text label shown to administrators */
21
+ label: string;
22
+ /** `EventEmitter2` event name the trigger listens to */
23
+ event: string;
24
+ /** Maps the event payload to a recipient; null skips the event */
25
+ toRecipient: (payload: unknown) => EmailAutomationRecipient | null;
26
+ }
27
+ /**
28
+ * Configuration interface for the EmailAutomationModule.
29
+ *
30
+ * Every option is optional and defaults to the inert value: with no triggers the
31
+ * module mounts its admin and unsubscribe routes, but nobody is ever enrolled.
32
+ */
33
+ export interface EmailAutomationModuleConfig {
34
+ /**
35
+ * The triggers administrators can pick as an automation's entry or exit.
36
+ *
37
+ * @default []
38
+ */
39
+ triggers?: EmailAutomationTriggerDefinition[];
40
+ }
41
+ /**
42
+ * Default configuration values.
43
+ */
44
+ export declare const DEFAULT_EMAIL_AUTOMATION_CONFIG: Required<EmailAutomationModuleConfig>;
45
+ /**
46
+ * Injection token for the merged EmailAutomationModule configuration.
47
+ */
48
+ export declare const EMAIL_AUTOMATION_CONFIG: unique symbol;
49
+ //# sourceMappingURL=email-automation.config.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-automation.config.interface.d.ts","sourceRoot":"","sources":["../../../../src/foundations/email-automation/interfaces/email-automation.config.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,GAAG,UAAU,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,gCAAgC;IAC/C,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,wBAAwB,GAAG,IAAI,CAAC;CACpE;AAED;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,gCAAgC,EAAE,CAAC;CAC/C;AAED;;GAEG;AACH,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,2BAA2B,CAEjF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,eAAoC,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EMAIL_AUTOMATION_CONFIG = exports.DEFAULT_EMAIL_AUTOMATION_CONFIG = void 0;
4
+ /**
5
+ * Default configuration values.
6
+ */
7
+ exports.DEFAULT_EMAIL_AUTOMATION_CONFIG = {
8
+ triggers: [],
9
+ };
10
+ /**
11
+ * Injection token for the merged EmailAutomationModule configuration.
12
+ */
13
+ exports.EMAIL_AUTOMATION_CONFIG = Symbol("EMAIL_AUTOMATION_CONFIG");
14
+ //# sourceMappingURL=email-automation.config.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-automation.config.interface.js","sourceRoot":"","sources":["../../../../src/foundations/email-automation/interfaces/email-automation.config.interface.ts"],"names":[],"mappings":";;;AA2CA;;GAEG;AACU,QAAA,+BAA+B,GAA0C;IACpF,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF;;GAEG;AACU,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,150 @@
1
+ import { ClsService } from "nestjs-cls";
2
+ import { JsonApiCursorInterface } from "../../../core/jsonapi/interfaces/jsonapi.cursor.interface";
3
+ import { AbstractRepository } from "../../../core/neo4j/abstracts/abstract.repository";
4
+ import { Neo4jService } from "../../../core/neo4j/services/neo4j.service";
5
+ import { SecurityService } from "../../../core/security/services/security.service";
6
+ import { EmailAutomationEnrollment, EmailAutomationEnrollmentDescriptor } from "../entities/email-automation-enrollment";
7
+ import { EmailAutomationRecipient } from "../interfaces/email-automation.config.interface";
8
+ export declare class EmailAutomationEnrollmentRepository extends AbstractRepository<EmailAutomationEnrollment, typeof EmailAutomationEnrollmentDescriptor.relationships> {
9
+ protected readonly descriptor: import("../../..").EntityDescriptor<EmailAutomationEnrollment, {
10
+ automation: {
11
+ model: import("../../..").DataMeta;
12
+ direction: "in";
13
+ relationship: string;
14
+ cardinality: "one";
15
+ required: true;
16
+ dtoKey: string;
17
+ };
18
+ currentStep: {
19
+ model: import("../../..").DataMeta;
20
+ direction: "out";
21
+ relationship: string;
22
+ cardinality: "one";
23
+ required: false;
24
+ dtoKey: string;
25
+ };
26
+ sentSteps: {
27
+ model: import("../../..").DataMeta;
28
+ direction: "out";
29
+ relationship: string;
30
+ cardinality: "many";
31
+ required: false;
32
+ dtoKey: string;
33
+ fields: {
34
+ name: string;
35
+ type: "datetime";
36
+ required: true;
37
+ }[];
38
+ };
39
+ }>;
40
+ constructor(neo4j: Neo4jService, securityService: SecurityService, clsService: ClsService);
41
+ /**
42
+ * Enrolment + automation + current step, with the current step's subject
43
+ * (`currentStepSubject`) and the number of steps sent (`sentCount`). The SENT
44
+ * steps themselves are not returned: the count is what every reader needs.
45
+ */
46
+ protected buildReturnStatement(): string;
47
+ /**
48
+ * Creates an active enrolment of `recipient` in an automation, waiting on `stepId`.
49
+ */
50
+ createEnrollment(params: {
51
+ id: string;
52
+ automationId: string;
53
+ stepId: string;
54
+ recipient: EmailAutomationRecipient;
55
+ enrolledAt: Date;
56
+ nextSendAt: Date;
57
+ unsubscribeToken: string;
58
+ }): Promise<void>;
59
+ /**
60
+ * The enrolment of an email in an automation, whatever its status (latest first).
61
+ */
62
+ findByAutomationAndEmail(params: {
63
+ automationId: string;
64
+ email: string;
65
+ }): Promise<EmailAutomationEnrollment | null>;
66
+ /**
67
+ * Every active enrolment of an email, in any automation.
68
+ */
69
+ findActiveByEmail(params: {
70
+ email: string;
71
+ }): Promise<EmailAutomationEnrollment[]>;
72
+ /**
73
+ * The active enrolments of an email in one automation.
74
+ */
75
+ findActiveByEmailAndAutomation(params: {
76
+ email: string;
77
+ automationId: string;
78
+ }): Promise<EmailAutomationEnrollment[]>;
79
+ /**
80
+ * The enrolment an unsubscribe link belongs to.
81
+ */
82
+ findByUnsubscribeToken(params: {
83
+ token: string;
84
+ }): Promise<EmailAutomationEnrollment | null>;
85
+ /**
86
+ * Bounded worker query: active enrolments whose next send is due, in active
87
+ * automations, oldest due first. Automation and current step are included.
88
+ */
89
+ findDue(params: {
90
+ now: Date;
91
+ limit: number;
92
+ }): Promise<EmailAutomationEnrollment[]>;
93
+ /**
94
+ * Whether the enrolment already received the step (a SENT edge exists).
95
+ */
96
+ hasSent(params: {
97
+ enrollmentId: string;
98
+ stepId: string;
99
+ }): Promise<boolean>;
100
+ /**
101
+ * Records that the step was sent and resets the failure counters.
102
+ */
103
+ markSent(params: {
104
+ enrollmentId: string;
105
+ stepId: string;
106
+ sentAt: Date;
107
+ }): Promise<void>;
108
+ /**
109
+ * Moves the enrolment to the next step and schedules it.
110
+ */
111
+ advance(params: {
112
+ enrollmentId: string;
113
+ nextStepId: string;
114
+ nextSendAt: Date;
115
+ }): Promise<void>;
116
+ /**
117
+ * Ends the enrolment: no current step, no next send.
118
+ */
119
+ finish(params: {
120
+ enrollmentId: string;
121
+ status: "completed" | "unsubscribed" | "exited" | "failed";
122
+ finishedAt: Date;
123
+ }): Promise<void>;
124
+ /**
125
+ * Counts a failed send and schedules the retry.
126
+ */
127
+ recordFailure(params: {
128
+ enrollmentId: string;
129
+ error: string;
130
+ nextSendAt: Date;
131
+ }): Promise<void>;
132
+ /**
133
+ * Moves every active enrolment waiting on `fromStepId` to `toStepId`; with no
134
+ * successor (`toStepId` null) those enrolments are completed instead.
135
+ */
136
+ repointStep(params: {
137
+ fromStepId: string;
138
+ toStepId: string | null;
139
+ finishedAt: Date;
140
+ }): Promise<void>;
141
+ /**
142
+ * The enrolments of an automation, newest first, optionally filtered by status.
143
+ */
144
+ findByAutomation(params: {
145
+ automationId: string;
146
+ status?: string;
147
+ cursor: JsonApiCursorInterface;
148
+ }): Promise<EmailAutomationEnrollment[]>;
149
+ }
150
+ //# sourceMappingURL=email-automation-enrollment.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-automation-enrollment.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/email-automation/repositories/email-automation-enrollment.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2DAA2D,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EACL,yBAAyB,EACzB,mCAAmC,EAEpC,MAAM,yCAAyC,CAAC;AAIjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAE3F,qBACa,mCAAoC,SAAQ,kBAAkB,CACzE,yBAAyB,EACzB,OAAO,mCAAmC,CAAC,aAAa,CAC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