@awell-health/awell-extensions 1.1.63 → 1.2.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (434) hide show
  1. package/dist/extensions/avaAi/common/sdk/openAiSdk.d.ts +2 -0
  2. package/dist/extensions/avaAi/common/sdk/openAiSdk.js +5 -0
  3. package/dist/extensions/avaAi/common/sdk/openAiSdk.js.map +1 -0
  4. package/dist/extensions/avaAi/index.d.ts +2 -0
  5. package/dist/extensions/avaAi/index.js +21 -0
  6. package/dist/extensions/avaAi/index.js.map +1 -0
  7. package/dist/extensions/avaAi/settings.d.ts +18 -0
  8. package/dist/extensions/avaAi/settings.js +22 -0
  9. package/dist/extensions/avaAi/settings.js.map +1 -0
  10. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/dataPoints.d.ts +10 -0
  11. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/dataPoints.js +15 -0
  12. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/dataPoints.js.map +1 -0
  13. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/fields.d.ts +29 -0
  14. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/fields.js +46 -0
  15. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/fields.js.map +1 -0
  16. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/index.d.ts +2 -0
  17. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/index.js +9 -0
  18. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/config/index.js.map +1 -0
  19. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.d.ts +4 -0
  20. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.js +83 -0
  21. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.js.map +1 -0
  22. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.test.d.ts +1 -0
  23. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.test.js +27 -0
  24. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/generatePatientSummary.test.js.map +1 -0
  25. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/index.d.ts +1 -0
  26. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/index.js +6 -0
  27. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/index.js.map +1 -0
  28. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.d.ts +3 -0
  29. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.js +43 -0
  30. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.js.map +1 -0
  31. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.test.d.ts +1 -0
  32. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.test.js +133 -0
  33. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/generatePrompt.test.js.map +1 -0
  34. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/index.d.ts +1 -0
  35. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/index.js +6 -0
  36. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/generatePromp/index.js.map +1 -0
  37. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/index.d.ts +1 -0
  38. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/index.js +6 -0
  39. package/dist/extensions/avaAi/v1/actions/generatePatientSummary/utils/index.js.map +1 -0
  40. package/dist/extensions/avaAi/v1/actions/index.d.ts +1 -0
  41. package/dist/extensions/avaAi/v1/actions/index.js +6 -0
  42. package/dist/extensions/avaAi/v1/actions/index.js.map +1 -0
  43. package/dist/extensions/awell/v1/gql/fragment-masking.d.ts +13 -0
  44. package/dist/extensions/awell/v1/gql/fragment-masking.js +12 -0
  45. package/dist/extensions/awell/v1/gql/fragment-masking.js.map +1 -0
  46. package/dist/extensions/awell/v1/gql/gql.d.ts +36 -0
  47. package/dist/extensions/awell/v1/gql/gql.js +47 -0
  48. package/dist/extensions/awell/v1/gql/gql.js.map +1 -0
  49. package/dist/extensions/awell/v1/gql/index.d.ts +2 -0
  50. package/dist/extensions/awell/v1/gql/index.js +19 -0
  51. package/dist/extensions/awell/v1/gql/index.js.map +1 -0
  52. package/dist/extensions/calDotCom/actions/bookAppointment/bookAppointment.js +2 -0
  53. package/dist/extensions/calDotCom/actions/bookAppointment/bookAppointment.js.map +1 -1
  54. package/dist/extensions/calDotCom/actions/bookAppointment/component/BookAppointmentAction.d.ts +9 -0
  55. package/dist/extensions/calDotCom/actions/bookAppointment/component/BookAppointmentAction.js +55 -0
  56. package/dist/extensions/calDotCom/actions/bookAppointment/component/BookAppointmentAction.js.map +1 -0
  57. package/dist/extensions/calDotCom/actions/bookAppointment/component/types.d.ts +10 -0
  58. package/dist/extensions/calDotCom/actions/bookAppointment/component/types.js +8 -0
  59. package/dist/extensions/calDotCom/actions/bookAppointment/component/types.js.map +1 -0
  60. package/dist/extensions/calendly/webhooks/eventRescheduled.d.ts +71 -0
  61. package/dist/extensions/calendly/webhooks/eventRescheduled.js +113 -0
  62. package/dist/extensions/calendly/webhooks/eventRescheduled.js.map +1 -0
  63. package/dist/extensions/canvasMedical/v1/validation/address.zod.d.ts +2 -2
  64. package/dist/extensions/canvasMedical/v1/validation/appointment.zod.d.ts +8 -8
  65. package/dist/extensions/canvasMedical/v1/validation/claim.d.ts +2 -2
  66. package/dist/extensions/canvasMedical/v1/validation/identifier.zod.d.ts +2 -2
  67. package/dist/extensions/canvasMedical/v1/validation/patient.zod.d.ts +32 -32
  68. package/dist/extensions/canvasMedical/v1/validation/questionnaireResponses.zod.d.ts +16 -16
  69. package/dist/extensions/canvasMedical/v1/validation/task.zod.d.ts +8 -8
  70. package/dist/extensions/dockHealth/api/schema/task.schema.d.ts +2 -2
  71. package/dist/extensions/experimental/v1/actions/enterMedication/config/datapoints.d.ts +6 -0
  72. package/dist/extensions/experimental/v1/actions/enterMedication/config/datapoints.js +10 -0
  73. package/dist/extensions/experimental/v1/actions/enterMedication/config/datapoints.js.map +1 -0
  74. package/dist/extensions/experimental/v1/actions/enterMedication/config/fields.d.ts +3 -0
  75. package/dist/extensions/experimental/v1/actions/enterMedication/config/fields.js +7 -0
  76. package/dist/extensions/experimental/v1/actions/enterMedication/config/fields.js.map +1 -0
  77. package/dist/extensions/experimental/v1/actions/enterMedication/config/index.d.ts +2 -0
  78. package/dist/extensions/experimental/v1/actions/enterMedication/config/index.js +9 -0
  79. package/dist/extensions/experimental/v1/actions/enterMedication/config/index.js.map +1 -0
  80. package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.d.ts +4 -0
  81. package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.js +24 -0
  82. package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.js.map +1 -0
  83. package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.test.d.ts +1 -0
  84. package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.test.js +21 -0
  85. package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.test.js.map +1 -0
  86. package/dist/extensions/experimental/v1/actions/enterMedication/index.d.ts +1 -0
  87. package/dist/extensions/experimental/v1/actions/enterMedication/index.js +6 -0
  88. package/dist/extensions/experimental/v1/actions/enterMedication/index.js.map +1 -0
  89. package/dist/extensions/healthie/codegen.d.ts +3 -0
  90. package/dist/extensions/healthie/codegen.js +20 -0
  91. package/dist/extensions/healthie/codegen.js.map +1 -0
  92. package/dist/extensions/healthie/errors.d.ts +9 -0
  93. package/dist/extensions/healthie/errors.js +42 -0
  94. package/dist/extensions/healthie/errors.js.map +1 -0
  95. package/dist/extensions/healthie/gql/sdk.d.ts +24576 -0
  96. package/dist/extensions/healthie/gql/sdk.js +1002 -0
  97. package/dist/extensions/healthie/gql/sdk.js.map +1 -0
  98. package/dist/extensions/healthie/graphqlClient.d.ts +5 -0
  99. package/dist/extensions/healthie/graphqlClient.js +31 -0
  100. package/dist/extensions/healthie/graphqlClient.js.map +1 -0
  101. package/dist/extensions/healthie/graphqlClient.test.d.ts +1 -0
  102. package/dist/extensions/healthie/graphqlClient.test.js +63 -0
  103. package/dist/extensions/healthie/graphqlClient.test.js.map +1 -0
  104. package/dist/extensions/healthie/helpers.d.ts +1 -0
  105. package/dist/extensions/healthie/helpers.js +18 -0
  106. package/dist/extensions/healthie/helpers.js.map +1 -0
  107. package/dist/extensions/healthie/types.d.ts +11 -0
  108. package/dist/extensions/healthie/types.js +3 -0
  109. package/dist/extensions/healthie/types.js.map +1 -0
  110. package/dist/extensions/healthie/validation/createTask.zod.d.ts +168 -0
  111. package/dist/extensions/healthie/validation/createTask.zod.js +113 -0
  112. package/dist/extensions/healthie/validation/createTask.zod.js.map +1 -0
  113. package/dist/extensions/healthie/validation/dateValidation.d.ts +11 -0
  114. package/dist/extensions/healthie/validation/dateValidation.js +27 -0
  115. package/dist/extensions/healthie/validation/dateValidation.js.map +1 -0
  116. package/dist/extensions/healthie/validation/getPatient.zod.d.ts +12 -0
  117. package/dist/extensions/healthie/validation/getPatient.zod.js +50 -0
  118. package/dist/extensions/healthie/validation/getPatient.zod.js.map +1 -0
  119. package/dist/extensions/healthie/validation/sendFormCompletionRequest.zod.d.ts +57 -0
  120. package/dist/extensions/healthie/validation/sendFormCompletionRequest.zod.js +106 -0
  121. package/dist/extensions/healthie/validation/sendFormCompletionRequest.zod.js.map +1 -0
  122. package/dist/extensions/healthie/webhooks/appointmentCreated.test.d.ts +1 -0
  123. package/dist/extensions/healthie/webhooks/appointmentCreated.test.js +61 -0
  124. package/dist/extensions/healthie/webhooks/appointmentCreated.test.js.map +1 -0
  125. package/dist/extensions/healthie/webhooks/goalCreated.test.d.ts +1 -0
  126. package/dist/extensions/healthie/webhooks/goalCreated.test.js +35 -0
  127. package/dist/extensions/healthie/webhooks/goalCreated.test.js.map +1 -0
  128. package/dist/extensions/healthie/webhooks/goalDeleted.d.ts +11 -0
  129. package/dist/extensions/healthie/webhooks/goalDeleted.js +30 -0
  130. package/dist/extensions/healthie/webhooks/goalDeleted.js.map +1 -0
  131. package/dist/extensions/healthie/webhooks/metricEntryDeleted.d.ts +11 -0
  132. package/dist/extensions/healthie/webhooks/metricEntryDeleted.js +30 -0
  133. package/dist/extensions/healthie/webhooks/metricEntryDeleted.js.map +1 -0
  134. package/dist/extensions/healthie/webhooks/requestedFormCompletionDeleted.d.ts +11 -0
  135. package/dist/extensions/healthie/webhooks/requestedFormCompletionDeleted.js +30 -0
  136. package/dist/extensions/healthie/webhooks/requestedFormCompletionDeleted.js.map +1 -0
  137. package/dist/extensions/healthie/webhooks/taskDeleted.d.ts +11 -0
  138. package/dist/extensions/healthie/webhooks/taskDeleted.js +30 -0
  139. package/dist/extensions/healthie/webhooks/taskDeleted.js.map +1 -0
  140. package/dist/extensions/mailgun/v1/actions/sendEmailWithTemplate/config/fields.d.ts +2 -2
  141. package/dist/extensions/medplum/actions/createServiceRequest/config/fields.d.ts +2 -2
  142. package/dist/extensions/medplum/actions/createTask/config/fields.d.ts +2 -2
  143. package/dist/extensions/medplum/fhir/schemas/resources/serviceRequest.schema.d.ts +2 -2
  144. package/dist/extensions/medplum/fhir/schemas/resources/task.schema.d.ts +2 -2
  145. package/dist/extensions/rest/actions/post/post.js +28 -72
  146. package/dist/extensions/rest/actions/post/post.js.map +1 -1
  147. package/dist/extensions/rest/actions/post/post.test.js +0 -49
  148. package/dist/extensions/rest/actions/post/post.test.js.map +1 -1
  149. package/dist/extensions/wellinks/actions/checkFlourishCustomer/checkFlourishCustomer.d.ts +11 -0
  150. package/dist/extensions/wellinks/actions/checkFlourishCustomer/checkFlourishCustomer.js +39 -0
  151. package/dist/extensions/wellinks/actions/checkFlourishCustomer/checkFlourishCustomer.js.map +1 -0
  152. package/dist/extensions/wellinks/actions/checkFlourishCustomer/checkFlourishCustomer.test.d.ts +1 -0
  153. package/dist/extensions/wellinks/actions/checkFlourishCustomer/checkFlourishCustomer.test.js +85 -0
  154. package/dist/extensions/wellinks/actions/checkFlourishCustomer/checkFlourishCustomer.test.js.map +1 -0
  155. package/dist/extensions/wellinks/actions/checkFlourishCustomer/config/fields.d.ts +18 -0
  156. package/dist/extensions/wellinks/actions/checkFlourishCustomer/config/fields.js +18 -0
  157. package/dist/extensions/wellinks/actions/checkFlourishCustomer/config/fields.js.map +1 -0
  158. package/dist/extensions/wellinks/actions/checkFlourishCustomer/config/index.d.ts +2 -0
  159. package/dist/extensions/wellinks/actions/checkFlourishCustomer/config/index.js +9 -0
  160. package/dist/extensions/wellinks/actions/checkFlourishCustomer/config/index.js.map +1 -0
  161. package/dist/extensions/wellinks/actions/checkFlourishCustomer/config/settings.d.ts +35 -0
  162. package/dist/extensions/wellinks/actions/checkFlourishCustomer/config/settings.js +17 -0
  163. package/dist/extensions/wellinks/actions/checkFlourishCustomer/config/settings.js.map +1 -0
  164. package/dist/extensions/wellinks/actions/checkForChat/checkForChat.d.ts +33 -0
  165. package/dist/extensions/wellinks/actions/checkForChat/checkForChat.js +129 -0
  166. package/dist/extensions/wellinks/actions/checkForChat/checkForChat.js.map +1 -0
  167. package/dist/extensions/wellinks/actions/checkForChat/checkForChat.test.d.ts +1 -0
  168. package/dist/extensions/wellinks/actions/checkForChat/checkForChat.test.js +154 -0
  169. package/dist/extensions/wellinks/actions/checkForChat/checkForChat.test.js.map +1 -0
  170. package/dist/extensions/wellinks/actions/checkForCheckInOverride/checkForCheckInOverride.d.ts +26 -0
  171. package/dist/extensions/wellinks/actions/checkForCheckInOverride/checkForCheckInOverride.js +139 -0
  172. package/dist/extensions/wellinks/actions/checkForCheckInOverride/checkForCheckInOverride.js.map +1 -0
  173. package/dist/extensions/wellinks/actions/checkForCheckInOverride/checkForCheckInOverride.test.d.ts +1 -0
  174. package/dist/extensions/wellinks/actions/checkForCheckInOverride/checkForCheckInOverride.test.js +185 -0
  175. package/dist/extensions/wellinks/actions/checkForCheckInOverride/checkForCheckInOverride.test.js.map +1 -0
  176. package/dist/extensions/wellinks/actions/checkForOverride/checkForOverride.d.ts +23 -0
  177. package/dist/extensions/wellinks/actions/checkForOverride/checkForOverride.js +153 -0
  178. package/dist/extensions/wellinks/actions/checkForOverride/checkForOverride.js.map +1 -0
  179. package/dist/extensions/wellinks/actions/checkForOverride/checkForOverride.test.d.ts +1 -0
  180. package/dist/extensions/wellinks/actions/checkForOverride/checkForOverride.test.js +184 -0
  181. package/dist/extensions/wellinks/actions/checkForOverride/checkForOverride.test.js.map +1 -0
  182. package/dist/extensions/wellinks/actions/checkForScheduledAppointment/checkForScheduledAppointment.d.ts +26 -0
  183. package/dist/extensions/wellinks/actions/checkForScheduledAppointment/checkForScheduledAppointment.js +118 -0
  184. package/dist/extensions/wellinks/actions/checkForScheduledAppointment/checkForScheduledAppointment.js.map +1 -0
  185. package/dist/extensions/wellinks/actions/checkForScheduledAppointment/checkForScheduledAppointment.test.d.ts +1 -0
  186. package/dist/extensions/wellinks/actions/checkForScheduledAppointment/checkForScheduledAppointment.test.js +119 -0
  187. package/dist/extensions/wellinks/actions/checkForScheduledAppointment/checkForScheduledAppointment.test.js.map +1 -0
  188. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/config/fields.d.ts +66 -0
  189. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/config/fields.js +59 -0
  190. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/config/fields.js.map +1 -0
  191. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/config/index.d.ts +1 -0
  192. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/config/index.js +6 -0
  193. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/config/index.js.map +1 -0
  194. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.d.ts +4 -0
  195. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.js +80 -0
  196. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.js.map +1 -0
  197. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.test.d.ts +1 -0
  198. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.test.js +47 -0
  199. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.test.js.map +1 -0
  200. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/index.d.ts +1 -0
  201. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/index.js +6 -0
  202. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/index.js.map +1 -0
  203. package/dist/extensions/wellinks/actions/createFlourishCustomer/config/fields.d.ts +58 -0
  204. package/dist/extensions/wellinks/actions/createFlourishCustomer/config/fields.js +56 -0
  205. package/dist/extensions/wellinks/actions/createFlourishCustomer/config/fields.js.map +1 -0
  206. package/dist/extensions/wellinks/actions/createFlourishCustomer/config/index.d.ts +2 -0
  207. package/dist/extensions/wellinks/actions/createFlourishCustomer/config/index.js +9 -0
  208. package/dist/extensions/wellinks/actions/createFlourishCustomer/config/index.js.map +1 -0
  209. package/dist/extensions/wellinks/actions/createFlourishCustomer/config/settings.d.ts +35 -0
  210. package/dist/extensions/wellinks/actions/createFlourishCustomer/config/settings.js +17 -0
  211. package/dist/extensions/wellinks/actions/createFlourishCustomer/config/settings.js.map +1 -0
  212. package/dist/extensions/wellinks/actions/createFlourishCustomer/createFlourishCustomer.d.ts +11 -0
  213. package/dist/extensions/wellinks/actions/createFlourishCustomer/createFlourishCustomer.js +56 -0
  214. package/dist/extensions/wellinks/actions/createFlourishCustomer/createFlourishCustomer.js.map +1 -0
  215. package/dist/extensions/wellinks/actions/createFlourishCustomer/createFlourishCustomer.test.d.ts +1 -0
  216. package/dist/extensions/wellinks/actions/createFlourishCustomer/createFlourishCustomer.test.js +53 -0
  217. package/dist/extensions/wellinks/actions/createFlourishCustomer/createFlourishCustomer.test.js.map +1 -0
  218. package/dist/extensions/wellinks/actions/index.d.ts +967 -0
  219. package/dist/extensions/wellinks/actions/index.js +24 -0
  220. package/dist/extensions/wellinks/actions/index.js.map +1 -0
  221. package/dist/extensions/wellinks/actions/insertMemberListEvent/config/fields.d.ts +78 -0
  222. package/dist/extensions/wellinks/actions/insertMemberListEvent/config/fields.js +66 -0
  223. package/dist/extensions/wellinks/actions/insertMemberListEvent/config/fields.js.map +1 -0
  224. package/dist/extensions/wellinks/actions/insertMemberListEvent/config/index.d.ts +2 -0
  225. package/dist/extensions/wellinks/actions/insertMemberListEvent/config/index.js +9 -0
  226. package/dist/extensions/wellinks/actions/insertMemberListEvent/config/index.js.map +1 -0
  227. package/dist/extensions/wellinks/actions/insertMemberListEvent/config/settings.d.ts +35 -0
  228. package/dist/extensions/wellinks/actions/insertMemberListEvent/config/settings.js +11 -0
  229. package/dist/extensions/wellinks/actions/insertMemberListEvent/config/settings.js.map +1 -0
  230. package/dist/extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.d.ts +11 -0
  231. package/dist/extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.js +75 -0
  232. package/dist/extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.js.map +1 -0
  233. package/dist/extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.test.d.ts +1 -0
  234. package/dist/extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.test.js +133 -0
  235. package/dist/extensions/wellinks/actions/insertMemberListEvent/insertMemberListEvent.test.js.map +1 -0
  236. package/dist/extensions/wellinks/actions/submitPamSurvey/config/fields.d.ts +188 -0
  237. package/dist/extensions/wellinks/actions/submitPamSurvey/config/fields.js +160 -0
  238. package/dist/extensions/wellinks/actions/submitPamSurvey/config/fields.js.map +1 -0
  239. package/dist/extensions/wellinks/actions/submitPamSurvey/config/index.d.ts +2 -0
  240. package/dist/extensions/wellinks/actions/submitPamSurvey/config/index.js +9 -0
  241. package/dist/extensions/wellinks/actions/submitPamSurvey/config/index.js.map +1 -0
  242. package/dist/extensions/wellinks/actions/submitPamSurvey/config/settings.d.ts +35 -0
  243. package/dist/extensions/wellinks/actions/submitPamSurvey/config/settings.js +17 -0
  244. package/dist/extensions/wellinks/actions/submitPamSurvey/config/settings.js.map +1 -0
  245. package/dist/extensions/wellinks/actions/submitPamSurvey/submitPamSurvey.d.ts +19 -0
  246. package/dist/extensions/wellinks/actions/submitPamSurvey/submitPamSurvey.js +66 -0
  247. package/dist/extensions/wellinks/actions/submitPamSurvey/submitPamSurvey.js.map +1 -0
  248. package/dist/extensions/wellinks/actions/submitPamSurvey/submitPamSurvey.test.d.ts +1 -0
  249. package/dist/extensions/wellinks/actions/submitPamSurvey/submitPamSurvey.test.js +125 -0
  250. package/dist/extensions/wellinks/actions/submitPamSurvey/submitPamSurvey.test.js.map +1 -0
  251. package/dist/extensions/wellinks/api/clients/wellinksClient.d.ts +16 -0
  252. package/dist/extensions/wellinks/api/clients/wellinksClient.js +40 -0
  253. package/dist/extensions/wellinks/api/clients/wellinksClient.js.map +1 -0
  254. package/dist/extensions/wellinks/api/clients/wellinksFlourishClient.d.ts +14 -0
  255. package/dist/extensions/wellinks/api/clients/wellinksFlourishClient.js +195 -0
  256. package/dist/extensions/wellinks/api/clients/wellinksFlourishClient.js.map +1 -0
  257. package/dist/extensions/wellinks/api/clients/wellinksGraphqlClient.d.ts +3 -0
  258. package/dist/extensions/wellinks/api/clients/wellinksGraphqlClient.js +23 -0
  259. package/dist/extensions/wellinks/api/clients/wellinksGraphqlClient.js.map +1 -0
  260. package/dist/extensions/wellinks/api/test/wellinksFlourishClient.test.d.ts +1 -0
  261. package/dist/extensions/wellinks/api/test/wellinksFlourishClient.test.js +192 -0
  262. package/dist/extensions/wellinks/api/test/wellinksFlourishClient.test.js.map +1 -0
  263. package/dist/extensions/wellinks/codegen.d.ts +3 -0
  264. package/dist/extensions/wellinks/codegen.js +21 -0
  265. package/dist/extensions/wellinks/codegen.js.map +1 -0
  266. package/dist/extensions/wellinks/config/settings.d.ts +107 -0
  267. package/dist/extensions/wellinks/config/settings.js +89 -0
  268. package/dist/extensions/wellinks/config/settings.js.map +1 -0
  269. package/dist/extensions/wellinks/config/types.d.ts +5 -0
  270. package/dist/extensions/wellinks/config/types.js +3 -0
  271. package/dist/extensions/wellinks/config/types.js.map +1 -0
  272. package/dist/extensions/wellinks/gql/wellinksSdk.d.ts +24053 -0
  273. package/dist/extensions/wellinks/gql/wellinksSdk.js +619 -0
  274. package/dist/extensions/wellinks/gql/wellinksSdk.js.map +1 -0
  275. package/dist/extensions/wellinks/graphql/mutations.d.ts +1 -0
  276. package/dist/extensions/wellinks/graphql/mutations.js +17 -0
  277. package/dist/extensions/wellinks/graphql/mutations.js.map +1 -0
  278. package/dist/extensions/wellinks/graphql/queries.d.ts +4 -0
  279. package/dist/extensions/wellinks/graphql/queries.js +58 -0
  280. package/dist/extensions/wellinks/graphql/queries.js.map +1 -0
  281. package/dist/extensions/wellinks/index.d.ts +2 -0
  282. package/dist/extensions/wellinks/index.js +20 -0
  283. package/dist/extensions/wellinks/index.js.map +1 -0
  284. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/checkFlourishCustomer.d.ts +11 -0
  285. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/checkFlourishCustomer.js +39 -0
  286. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/checkFlourishCustomer.js.map +1 -0
  287. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/checkFlourishCustomer.test.d.ts +1 -0
  288. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/checkFlourishCustomer.test.js +85 -0
  289. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/checkFlourishCustomer.test.js.map +1 -0
  290. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/config/fields.d.ts +18 -0
  291. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/config/fields.js +18 -0
  292. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/config/fields.js.map +1 -0
  293. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/config/index.d.ts +2 -0
  294. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/config/index.js +9 -0
  295. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/config/index.js.map +1 -0
  296. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/config/settings.d.ts +35 -0
  297. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/config/settings.js +17 -0
  298. package/dist/extensions/wellinks-public/actions/checkFlourishCustomer/config/settings.js.map +1 -0
  299. package/dist/extensions/wellinks-public/actions/checkForChat/checkForChat.d.ts +33 -0
  300. package/dist/extensions/wellinks-public/actions/checkForChat/checkForChat.js +129 -0
  301. package/dist/extensions/wellinks-public/actions/checkForChat/checkForChat.js.map +1 -0
  302. package/dist/extensions/wellinks-public/actions/checkForChat/checkForChat.test.d.ts +1 -0
  303. package/dist/extensions/wellinks-public/actions/checkForChat/checkForChat.test.js +154 -0
  304. package/dist/extensions/wellinks-public/actions/checkForChat/checkForChat.test.js.map +1 -0
  305. package/dist/extensions/wellinks-public/actions/checkForCheckInOverride/checkForCheckInOverride.d.ts +26 -0
  306. package/dist/extensions/wellinks-public/actions/checkForCheckInOverride/checkForCheckInOverride.js +139 -0
  307. package/dist/extensions/wellinks-public/actions/checkForCheckInOverride/checkForCheckInOverride.js.map +1 -0
  308. package/dist/extensions/wellinks-public/actions/checkForCheckInOverride/checkForCheckInOverride.test.d.ts +1 -0
  309. package/dist/extensions/wellinks-public/actions/checkForCheckInOverride/checkForCheckInOverride.test.js +185 -0
  310. package/dist/extensions/wellinks-public/actions/checkForCheckInOverride/checkForCheckInOverride.test.js.map +1 -0
  311. package/dist/extensions/wellinks-public/actions/checkForOverride/checkForOverride.d.ts +23 -0
  312. package/dist/extensions/wellinks-public/actions/checkForOverride/checkForOverride.js +153 -0
  313. package/dist/extensions/wellinks-public/actions/checkForOverride/checkForOverride.js.map +1 -0
  314. package/dist/extensions/wellinks-public/actions/checkForOverride/checkForOverride.test.d.ts +1 -0
  315. package/dist/extensions/wellinks-public/actions/checkForOverride/checkForOverride.test.js +184 -0
  316. package/dist/extensions/wellinks-public/actions/checkForOverride/checkForOverride.test.js.map +1 -0
  317. package/dist/extensions/wellinks-public/actions/checkForScheduledAppointment/checkForScheduledAppointment.d.ts +26 -0
  318. package/dist/extensions/wellinks-public/actions/checkForScheduledAppointment/checkForScheduledAppointment.js +118 -0
  319. package/dist/extensions/wellinks-public/actions/checkForScheduledAppointment/checkForScheduledAppointment.js.map +1 -0
  320. package/dist/extensions/wellinks-public/actions/checkForScheduledAppointment/checkForScheduledAppointment.test.d.ts +1 -0
  321. package/dist/extensions/wellinks-public/actions/checkForScheduledAppointment/checkForScheduledAppointment.test.js +119 -0
  322. package/dist/extensions/wellinks-public/actions/checkForScheduledAppointment/checkForScheduledAppointment.test.js.map +1 -0
  323. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/config/fields.d.ts +82 -0
  324. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/config/fields.js +78 -0
  325. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/config/fields.js.map +1 -0
  326. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/config/index.d.ts +1 -0
  327. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/config/index.js +6 -0
  328. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/config/index.js.map +1 -0
  329. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/createChartingNoteAdvanced-fail.test.d.ts +1 -0
  330. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/createChartingNoteAdvanced-fail.test.js +152 -0
  331. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/createChartingNoteAdvanced-fail.test.js.map +1 -0
  332. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.d.ts +4 -0
  333. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.js +86 -0
  334. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.js.map +1 -0
  335. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.test.d.ts +1 -0
  336. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.test.js +42 -0
  337. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.test.js.map +1 -0
  338. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/index.d.ts +1 -0
  339. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/index.js +6 -0
  340. package/dist/extensions/wellinks-public/actions/createChartingNoteAdvanced/index.js.map +1 -0
  341. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/config/fields.d.ts +58 -0
  342. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/config/fields.js +56 -0
  343. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/config/fields.js.map +1 -0
  344. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/config/index.d.ts +2 -0
  345. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/config/index.js +9 -0
  346. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/config/index.js.map +1 -0
  347. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/config/settings.d.ts +35 -0
  348. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/config/settings.js +17 -0
  349. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/config/settings.js.map +1 -0
  350. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/createFlourishCustomer.d.ts +11 -0
  351. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/createFlourishCustomer.js +56 -0
  352. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/createFlourishCustomer.js.map +1 -0
  353. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/createFlourishCustomer.test.d.ts +1 -0
  354. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/createFlourishCustomer.test.js +53 -0
  355. package/dist/extensions/wellinks-public/actions/createFlourishCustomer/createFlourishCustomer.test.js.map +1 -0
  356. package/dist/extensions/wellinks-public/actions/index.d.ts +967 -0
  357. package/dist/extensions/wellinks-public/actions/index.js +24 -0
  358. package/dist/extensions/wellinks-public/actions/index.js.map +1 -0
  359. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/config/fields.d.ts +78 -0
  360. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/config/fields.js +66 -0
  361. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/config/fields.js.map +1 -0
  362. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/config/index.d.ts +2 -0
  363. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/config/index.js +9 -0
  364. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/config/index.js.map +1 -0
  365. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/config/settings.d.ts +38 -0
  366. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/config/settings.js +11 -0
  367. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/config/settings.js.map +1 -0
  368. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/insertMemberListEvent.d.ts +11 -0
  369. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/insertMemberListEvent.js +75 -0
  370. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/insertMemberListEvent.js.map +1 -0
  371. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/insertMemberListEvent.test.d.ts +1 -0
  372. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/insertMemberListEvent.test.js +133 -0
  373. package/dist/extensions/wellinks-public/actions/insertMemberListEvent/insertMemberListEvent.test.js.map +1 -0
  374. package/dist/extensions/wellinks-public/actions/submitPamSurvey/config/fields.d.ts +188 -0
  375. package/dist/extensions/wellinks-public/actions/submitPamSurvey/config/fields.js +160 -0
  376. package/dist/extensions/wellinks-public/actions/submitPamSurvey/config/fields.js.map +1 -0
  377. package/dist/extensions/wellinks-public/actions/submitPamSurvey/config/index.d.ts +2 -0
  378. package/dist/extensions/wellinks-public/actions/submitPamSurvey/config/index.js +9 -0
  379. package/dist/extensions/wellinks-public/actions/submitPamSurvey/config/index.js.map +1 -0
  380. package/dist/extensions/wellinks-public/actions/submitPamSurvey/config/settings.d.ts +35 -0
  381. package/dist/extensions/wellinks-public/actions/submitPamSurvey/config/settings.js +17 -0
  382. package/dist/extensions/wellinks-public/actions/submitPamSurvey/config/settings.js.map +1 -0
  383. package/dist/extensions/wellinks-public/actions/submitPamSurvey/submitPamSurvey.d.ts +19 -0
  384. package/dist/extensions/wellinks-public/actions/submitPamSurvey/submitPamSurvey.js +66 -0
  385. package/dist/extensions/wellinks-public/actions/submitPamSurvey/submitPamSurvey.js.map +1 -0
  386. package/dist/extensions/wellinks-public/actions/submitPamSurvey/submitPamSurvey.test.d.ts +1 -0
  387. package/dist/extensions/wellinks-public/actions/submitPamSurvey/submitPamSurvey.test.js +125 -0
  388. package/dist/extensions/wellinks-public/actions/submitPamSurvey/submitPamSurvey.test.js.map +1 -0
  389. package/dist/extensions/wellinks-public/api/clients/wellinksClient.d.ts +16 -0
  390. package/dist/extensions/wellinks-public/api/clients/wellinksClient.js +40 -0
  391. package/dist/extensions/wellinks-public/api/clients/wellinksClient.js.map +1 -0
  392. package/dist/extensions/wellinks-public/api/clients/wellinksFlourishClient.d.ts +14 -0
  393. package/dist/extensions/wellinks-public/api/clients/wellinksFlourishClient.js +201 -0
  394. package/dist/extensions/wellinks-public/api/clients/wellinksFlourishClient.js.map +1 -0
  395. package/dist/extensions/wellinks-public/api/clients/wellinksGraphqlClient.d.ts +3 -0
  396. package/dist/extensions/wellinks-public/api/clients/wellinksGraphqlClient.js +23 -0
  397. package/dist/extensions/wellinks-public/api/clients/wellinksGraphqlClient.js.map +1 -0
  398. package/dist/extensions/wellinks-public/api/test/wellinksFlourishClient.test.d.ts +1 -0
  399. package/dist/extensions/wellinks-public/api/test/wellinksFlourishClient.test.js +192 -0
  400. package/dist/extensions/wellinks-public/api/test/wellinksFlourishClient.test.js.map +1 -0
  401. package/dist/extensions/wellinks-public/codegen.d.ts +3 -0
  402. package/dist/extensions/wellinks-public/codegen.js +21 -0
  403. package/dist/extensions/wellinks-public/codegen.js.map +1 -0
  404. package/dist/extensions/wellinks-public/config/settings.d.ts +107 -0
  405. package/dist/extensions/wellinks-public/config/settings.js +89 -0
  406. package/dist/extensions/wellinks-public/config/settings.js.map +1 -0
  407. package/dist/extensions/wellinks-public/config/types.d.ts +5 -0
  408. package/dist/extensions/wellinks-public/config/types.js +3 -0
  409. package/dist/extensions/wellinks-public/config/types.js.map +1 -0
  410. package/dist/extensions/wellinks-public/gql/wellinksSdk.d.ts +24110 -0
  411. package/dist/extensions/wellinks-public/gql/wellinksSdk.js +635 -0
  412. package/dist/extensions/wellinks-public/gql/wellinksSdk.js.map +1 -0
  413. package/dist/extensions/wellinks-public/graphql/mutations.d.ts +1 -0
  414. package/dist/extensions/wellinks-public/graphql/mutations.js +17 -0
  415. package/dist/extensions/wellinks-public/graphql/mutations.js.map +1 -0
  416. package/dist/extensions/wellinks-public/graphql/queries.d.ts +5 -0
  417. package/dist/extensions/wellinks-public/graphql/queries.js +66 -0
  418. package/dist/extensions/wellinks-public/graphql/queries.js.map +1 -0
  419. package/dist/extensions/wellinks-public/index.d.ts +2 -0
  420. package/dist/extensions/wellinks-public/index.js +20 -0
  421. package/dist/extensions/wellinks-public/index.js.map +1 -0
  422. package/dist/src/types/OrchestrationTypes.d.ts +2065 -0
  423. package/dist/src/types/OrchestrationTypes.js +266 -0
  424. package/dist/src/types/OrchestrationTypes.js.map +1 -0
  425. package/dist/src/types/index.d.ts +1 -0
  426. package/dist/src/types/index.js +18 -0
  427. package/dist/src/types/index.js.map +1 -0
  428. package/dist/src/utils/mapToObject.d.ts +4 -0
  429. package/dist/src/utils/mapToObject.js +18 -0
  430. package/dist/src/utils/mapToObject.js.map +1 -0
  431. package/package.json +13 -3
  432. package/dist/extensions/rest/lib/errors.d.ts +0 -6
  433. package/dist/extensions/rest/lib/errors.js +0 -16
  434. package/dist/extensions/rest/lib/errors.js.map +0 -1
@@ -4,7 +4,6 @@ exports.post = void 0;
4
4
  const extensions_core_1 = require("@awell-health/extensions-core");
5
5
  const config_1 = require("./config");
6
6
  const zod_1 = require("zod");
7
- const errors_1 = require("../../lib/errors");
8
7
  exports.post = {
9
8
  key: 'post',
10
9
  title: 'POST request',
@@ -14,84 +13,41 @@ exports.post = {
14
13
  dataPoints: config_1.dataPoints,
15
14
  previewable: true,
16
15
  onActivityCreated: async (payload, onComplete, onError) => {
17
- var _a, _b;
18
16
  const { fields: { endpoint, headers, jsonPayload, additionalPayload }, } = (0, extensions_core_1.validate)({
19
17
  schema: zod_1.z.object({
20
18
  fields: config_1.FieldsValidationSchema,
21
19
  }),
22
20
  payload,
23
21
  });
24
- try {
25
- const response = await fetch(endpoint, {
26
- method: 'POST',
27
- headers: {
28
- ...headers,
29
- 'Content-Type': 'application/json',
30
- },
31
- body: JSON.stringify({
32
- ...jsonPayload,
33
- ...additionalPayload,
34
- }),
35
- });
36
- if (response.ok) {
37
- const getResponseBody = async (response) => {
38
- var _a, _b;
39
- const contentType = (_b = (_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a.get('content-type')) !== null && _b !== void 0 ? _b : '';
40
- if (contentType === null || contentType === void 0 ? void 0 : contentType.toLowerCase().includes('application/json')) {
41
- return await response.json();
42
- }
43
- return await response.text();
44
- };
45
- const responseBody = await getResponseBody(response);
46
- const statusCode = response.status;
47
- await onComplete({
48
- data_points: {
49
- response: typeof responseBody === 'string'
50
- ? responseBody
51
- : JSON.stringify(responseBody),
52
- statusCode: String(statusCode),
53
- },
54
- });
55
- }
56
- else {
57
- throw new errors_1.FetchError(response.status, response.statusText, response.body);
58
- }
59
- }
60
- catch (error) {
61
- if (error instanceof errors_1.FetchError) {
62
- await onError({
63
- events: [
64
- {
65
- date: new Date().toISOString(),
66
- text: {
67
- en: `${error.message} ${error.responseBody}`,
68
- },
69
- error: {
70
- category: 'SERVER_ERROR',
71
- message: `${error.message} ${error.responseBody}`,
72
- },
73
- },
74
- ],
75
- });
76
- }
77
- else {
78
- const parsedError = error;
79
- await onError({
80
- events: [
81
- {
82
- date: new Date().toISOString(),
83
- text: {
84
- en: (_a = parsedError.message) !== null && _a !== void 0 ? _a : 'Unexpected error',
85
- },
86
- error: {
87
- category: 'SERVER_ERROR',
88
- message: (_b = parsedError.message) !== null && _b !== void 0 ? _b : 'Unexpected error',
89
- },
90
- },
91
- ],
92
- });
22
+ const response = await fetch(endpoint, {
23
+ method: 'POST',
24
+ headers: {
25
+ ...headers,
26
+ 'Content-Type': 'application/json',
27
+ },
28
+ body: JSON.stringify({
29
+ ...jsonPayload,
30
+ ...additionalPayload,
31
+ }),
32
+ });
33
+ const getResponseBody = async (response) => {
34
+ var _a;
35
+ const contentType = (_a = response.headers.get('content-type')) !== null && _a !== void 0 ? _a : '';
36
+ if (contentType === null || contentType === void 0 ? void 0 : contentType.toLowerCase().includes('application/json')) {
37
+ return await response.json();
93
38
  }
94
- }
39
+ return await response.text();
40
+ };
41
+ const responseBody = await getResponseBody(response);
42
+ const statusCode = response.status;
43
+ await onComplete({
44
+ data_points: {
45
+ response: typeof responseBody === 'string'
46
+ ? responseBody
47
+ : JSON.stringify(responseBody),
48
+ statusCode: String(statusCode),
49
+ },
50
+ });
95
51
  },
96
52
  };
97
53
  //# sourceMappingURL=post.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"post.js","sourceRoot":"","sources":["../../../../../extensions/rest/actions/post/post.ts"],"names":[],"mappings":";;;AACA,mEAAkE;AAElE,qCAAqE;AACrE,6BAAuB;AACvB,6CAA6C;AAEhC,QAAA,IAAI,GAIb;IACF,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,qBAAqB;IAClC,QAAQ,EAAE,0BAAQ,CAAC,IAAI;IACvB,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,WAAW,E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,KAAK,QAAQ;4BAC9B,CAAC,CAAC,YAAY;4BACd,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;wBAClC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;qBAC/B;iBACF,CAAC,CAAA;aACH;iBAAM;gBACL,MAAM,IAAI,mBAAU,CAClB,QAAQ,CAAC,MAAM,EACf,QAAQ,CAAC,UAAU,EACnB,QAAQ,CAAC,IAAI,CACd,CAAA;aACF;SACF;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,KAAK,YAAY,mBAAU,EAAE;gBAC/B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE;gCACJ,EAAE,EAAE,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,YAAY,EAAE;6BAC7C;4BACD,KAAK,EAAE;gCACL,QAAQ,EAAE,cAAc;gCACxB,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,YAAY,EAAE;6BAClD;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;iBAAM;gBACL,MAAM,WAAW,GAAG,KAAc,CAAA;gBAClC,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE;gCACJ,EAAE,EAAE,MAAA,WAAW,CAAC,OAAO,mCAAI,kBAAkB;6BAC9C;4BACD,KAAK,EAAE;gCACL,QAAQ,EAAE,cAAc;gCACxB,OAAO,EAAE,MAAA,WAAW,CAAC,OAAO,mCAAI,kBAAkB;6BACnD;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SACF;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"post.js","sourceRoot":"","sources":["../../../../../extensions/rest/actions/post/post.ts"],"names":[],"mappings":";;;AACA,mEAAkE;AAElE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;QACpD,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAA;QAElC,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,QAAQ,EACN,OAAO,YAAY,KAAK,QAAQ;oBAC9B,CAAC,CAAC,YAAY;oBACd,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;gBAClC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;aAC/B;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -16,11 +16,6 @@ describe('REST - POST', () => {
16
16
  ;
17
17
  global.fetch.mockResolvedValue({
18
18
  status: 200,
19
- statusText: 'Ok',
20
- ok: true,
21
- headers: new Headers({
22
- 'Content-Type': 'application/json',
23
- }),
24
19
  json: jest.fn().mockResolvedValue({
25
20
  success: true,
26
21
  message: 'Data received successfully',
@@ -62,49 +57,5 @@ describe('REST - POST', () => {
62
57
  },
63
58
  });
64
59
  });
65
- test('Should catch errors', async () => {
66
- ;
67
- global.fetch.mockResolvedValue({
68
- status: 404,
69
- ok: false,
70
- statusText: 'Not found',
71
- headers: new Headers({
72
- 'Content-Type': 'application/json',
73
- }),
74
- json: jest.fn().mockResolvedValue({
75
- message: 'Not found',
76
- }),
77
- });
78
- const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
79
- fields: {
80
- endpoint: 'https://webhook.site/bb853fec-9260-44e5-a944-17894d678a7f',
81
- headers: '{}',
82
- jsonPayload: `{}`,
83
- additionalPayload: `{}`,
84
- },
85
- settings: {},
86
- });
87
- await _1.post.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
88
- expect(global.fetch).toHaveBeenCalledWith('https://webhook.site/bb853fec-9260-44e5-a944-17894d678a7f', expect.objectContaining({
89
- method: 'POST',
90
- headers: {
91
- 'Content-Type': 'application/json',
92
- },
93
- body: JSON.stringify({}),
94
- }));
95
- expect(onError).toHaveBeenCalledWith({
96
- events: [
97
- expect.objectContaining({
98
- error: {
99
- category: 'SERVER_ERROR',
100
- message: '404 Not found ',
101
- },
102
- text: {
103
- en: '404 Not found ',
104
- },
105
- }),
106
- ],
107
- });
108
- });
109
60
  });
110
61
  //# sourceMappingURL=post.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"post.test.js","sourceRoot":"","sources":["../../../../../extensions/rest/actions/post/post.test.ts"],"names":[],"mappings":";;AAAA,wBAAwB;AACxB,iDAA2D;AAE3D,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;QACpB,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,eAAe,EAAE,CAAA;IACxB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;QAC7B,CAAC;QAAC,MAAM,CAAC,KAAmB,CAAC,iBAAiB,CAAC;YAC7C,MAAM,EAAE,GAAG;YACX,UAAU,EAAE,IAAI;YAChB,EAAE,EAAE,IAAI;YACR,OAAO,EAAE,IAAI,OAAO,CAAC;gBACnB,cAAc,EAAE,kBAAkB;aACnC,CAAC;YACF,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC;gBAChC,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,4BAA4B;aACtC,CAAC;SACyB,CAAC,CAAA;QAE9B,MAAM,WAAW,GAAG;YAClB,OAAO,EAAE,OAAO;SACjB,CAAA;QACD,MAAM,iBAAiB,GAAG;YACxB,OAAO,EAAE,OAAO;SACjB,CAAA;QAED,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,QA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AAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,QAAQ,EAAE,2DAA2D;gBACrE,OAAO,EAAE,IAAI;gBACb,WAAW,EAAE,IAAI;gBACjB,iBAAiB,EAAE,IAAI;aACxB;YACD,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;QAEF,MAAM,OAAI,CAAC,iBAAiB,CAC1B,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,oBAAoB,CACvC,2DAA2D,EAC3D,MAAM,CAAC,gBAAgB,CAAC;YACtB,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;SACzB,CAAC,CACH,CAAA;QAED,MAAM,CAAC,OAAO,CAAC,CAAC,oBAAoB,CAAC;YACnC,MAAM,EAAE;gBACN,MAAM,CAAC,gBAAgB,CAAC;oBACtB,KAAK,EAAE;wBACL,QAAQ,EAAE,cAAc;wBACxB,OAAO,EAAE,gBAAgB;qBAC1B;oBACD,IAAI,EAAE;wBACJ,EAAE,EAAE,gBAAgB;qBACrB;iBACF,CAAC;aACH;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"post.test.js","sourceRoot":"","sources":["../../../../../extensions/rest/actions/post/post.test.ts"],"names":[],"mappings":";;AAAA,wBAAwB;AACxB,iDAA2D;AAE3D,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;QACpB,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,C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H,CAAC,CACH,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,WAAW,EAAE;gBACX,QAAQ,EAAE,yDAAyD;gBACnE,UAAU,EAAE,KAAK;aAClB;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../config/settings';
3
+ import { fields } from './config';
4
+ declare const dataPoints: {
5
+ userExists: {
6
+ key: string;
7
+ valueType: "boolean";
8
+ };
9
+ };
10
+ export declare const checkFlourishCustomer: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
11
+ export {};
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkFlourishCustomer = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const wellinksFlourishClient_1 = require("../../api/clients/wellinksFlourishClient");
6
+ const config_1 = require("./config");
7
+ const zod_1 = require("zod");
8
+ const dataPoints = {
9
+ userExists: {
10
+ key: 'userExists',
11
+ valueType: 'boolean',
12
+ },
13
+ };
14
+ exports.checkFlourishCustomer = {
15
+ key: 'checkFlourishCustomer',
16
+ category: extensions_core_1.Category.WORKFLOW,
17
+ title: 'Check for Flourish Customer',
18
+ description: 'Checks Flourish for a customer with the given identifier.',
19
+ fields: config_1.fields,
20
+ dataPoints,
21
+ previewable: true,
22
+ onActivityCreated: async (payload, onComplete, onError) => {
23
+ const { fields: { identifier }, settings: { flourishApiKey, flourishApiUrl, flourishClientExtId }, } = (0, extensions_core_1.validate)({
24
+ schema: zod_1.z.object({
25
+ fields: config_1.FieldsValidationSchema,
26
+ settings: config_1.SettingsValidationSchema,
27
+ }),
28
+ payload,
29
+ });
30
+ const client = new wellinksFlourishClient_1.WellinksFlourishClient(flourishApiUrl, flourishApiKey, flourishClientExtId);
31
+ const result = await client.user.exists(identifier);
32
+ await onComplete({
33
+ data_points: {
34
+ userExists: result.toString(),
35
+ },
36
+ });
37
+ },
38
+ };
39
+ //# sourceMappingURL=checkFlourishCustomer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkFlourishCustomer.js","sourceRoot":"","sources":["../../../../../extensions/wellinks/actions/checkFlourishCustomer/checkFlourishCustomer.ts"],"names":[],"mappings":";;;AAAA,mEAKsC;AAEtC,qFAAiF;AACjF,qCAIiB;AACjB,6BAAuB;AAEvB,MAAM,UAAU,GAAG;IACjB,UAAU,EAAE;QACV,GAAG,EAAE,YAAY;QACjB,SAAS,EAAE,SAAS;KACrB;CAC4C,CAAA;AAElC,QAAA,qBAAqB,GAI9B;IACF,GAAG,EAAE,uBAAuB;IAC5B,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,6BAA6B;IACpC,WAAW,EAAE,2DAA2D;IACxE,MAAM,EAAN,eAAM;IACN,UAAU;IACV,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;QACvE,MAAM,EACJ,MAAM,EAAE,EAAE,UAAU,EAAE,EACtB,QAAQ,EAAE,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,GAClE,GAAG,IAAA,0BAAQ,EAAC;YACX,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,MAAM,EAAE,+BAAsB;gBAC9B,QAAQ,EAAE,iCAAwB;aACnC,CAAC;YACF,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,IAAI,+CAAsB,CACvC,cAAc,EACd,cAAc,EACd,mBAAmB,CACpB,CAAA;QAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;QACnD,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE;aAC9B;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tests_1 = require("../../../../src/tests");
4
+ const wellinksFlourishClient_1 = require("../../api/clients/__mocks__/wellinksFlourishClient");
5
+ const settings_1 = require("../../__mocks__/config/settings");
6
+ const checkFlourishCustomer_1 = require("./checkFlourishCustomer");
7
+ const zod_1 = require("zod");
8
+ jest.mock('../../api/clients/wellinksFlourishClient', () => ({
9
+ WellinksFlourishClient: wellinksFlourishClient_1.WellinksFlourishClient,
10
+ }));
11
+ describe('Check Flourish Customer', () => {
12
+ const onComplete = jest.fn();
13
+ const onError = jest.fn();
14
+ beforeEach(() => {
15
+ jest.clearAllMocks();
16
+ });
17
+ test('should call onComplete with a true DataPoint when there is a customer with the given identifier', async () => {
18
+ const validPayload = (0, tests_1.generateTestPayload)({
19
+ fields: {
20
+ identifier: 'identifier',
21
+ },
22
+ settings: settings_1.mockSettings,
23
+ });
24
+ wellinksFlourishClient_1.WellinksFlourishClientMockImplementation.user.exists.mockImplementationOnce(() => {
25
+ return true;
26
+ });
27
+ await checkFlourishCustomer_1.checkFlourishCustomer.onActivityCreated(validPayload, onComplete, onError);
28
+ expect(onError).not.toBeCalled();
29
+ expect(onComplete).toHaveBeenNthCalledWith(1, {
30
+ data_points: {
31
+ userExists: 'true',
32
+ },
33
+ });
34
+ });
35
+ test('should call onComplete with a false DataPoint when there is a customer with the given identifier', async () => {
36
+ const validPayload = (0, tests_1.generateTestPayload)({
37
+ fields: {
38
+ identifier: 'identifier',
39
+ },
40
+ settings: settings_1.mockSettings,
41
+ });
42
+ wellinksFlourishClient_1.WellinksFlourishClientMockImplementation.user.exists.mockImplementationOnce(() => {
43
+ return false;
44
+ });
45
+ await checkFlourishCustomer_1.checkFlourishCustomer.onActivityCreated(validPayload, onComplete, onError);
46
+ expect(onError).not.toBeCalled();
47
+ expect(onComplete).toHaveBeenNthCalledWith(1, {
48
+ data_points: {
49
+ userExists: 'false',
50
+ },
51
+ });
52
+ });
53
+ test('should call onError when the action is not given an identifier', async () => {
54
+ const validPayload = (0, tests_1.generateTestPayload)({
55
+ fields: {
56
+ identifier: undefined,
57
+ },
58
+ settings: settings_1.mockSettings,
59
+ });
60
+ wellinksFlourishClient_1.WellinksFlourishClientMockImplementation.user.exists.mockImplementationOnce(() => {
61
+ return true;
62
+ });
63
+ await expect(checkFlourishCustomer_1.checkFlourishCustomer.onActivityCreated(validPayload, onComplete, onError)).rejects.toThrow(zod_1.ZodError);
64
+ expect(onComplete).not.toBeCalled();
65
+ });
66
+ test('should call onError when the Flourish Settings are not set', async () => {
67
+ const validPayload = (0, tests_1.generateTestPayload)({
68
+ fields: {
69
+ identifier: 'identifier',
70
+ },
71
+ settings: {
72
+ ...settings_1.mockSettings,
73
+ flourishApiKey: undefined,
74
+ flourishApiUrl: undefined,
75
+ flourishClientExtId: undefined,
76
+ },
77
+ });
78
+ wellinksFlourishClient_1.WellinksFlourishClientMockImplementation.user.exists.mockImplementationOnce(() => {
79
+ return true;
80
+ });
81
+ await expect(checkFlourishCustomer_1.checkFlourishCustomer.onActivityCreated(validPayload, onComplete, onError)).rejects.toThrow(zod_1.ZodError);
82
+ expect(onComplete).not.toBeCalled();
83
+ });
84
+ });
85
+ //# sourceMappingURL=checkFlourishCustomer.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkFlourishCustomer.test.js","sourceRoot":"","sources":["../../../../../extensions/wellinks/actions/checkFlourishCustomer/checkFlourishCustomer.test.ts"],"names":[],"mappings":";;AAAA,iDAA2D;AAC3D,+FAG2D;AAC3D,8DAA8D;AAC9D,mEAA+D;AAC/D,6BAA8B;AAE9B,IAAI,CAAC,IAAI,CAAC,0CAA0C,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3D,sBAAsB,EAAtB,+CAAsB;CACvB,CAAC,CAAC,CAAA;AAEH,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,MA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QAE3B,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { FieldType } from '@awell-health/extensions-core';
3
+ export declare const fields: {
4
+ identifier: {
5
+ id: string;
6
+ label: string;
7
+ description: string;
8
+ type: FieldType.STRING;
9
+ required: true;
10
+ };
11
+ };
12
+ export declare const FieldsValidationSchema: z.ZodObject<{
13
+ identifier: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ identifier: string;
16
+ }, {
17
+ identifier: string;
18
+ }>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldsValidationSchema = exports.fields = void 0;
4
+ const zod_1 = require("zod");
5
+ const extensions_core_1 = require("@awell-health/extensions-core");
6
+ exports.fields = {
7
+ identifier: {
8
+ id: 'identifier',
9
+ label: 'Identifier',
10
+ description: 'The identifier of the user to check Flourish for.',
11
+ type: extensions_core_1.FieldType.STRING,
12
+ required: true,
13
+ },
14
+ };
15
+ exports.FieldsValidationSchema = zod_1.z.object({
16
+ identifier: zod_1.z.string(),
17
+ });
18
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/wellinks/actions/checkFlourishCustomer/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AACxC,mEAAqE;AAExD,QAAA,MAAM,GAAG;IACpB,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,mDAAmD;QAChE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;CAC2B,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { fields, FieldsValidationSchema } from './fields';
2
+ export { SettingsValidationSchema } from './settings';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SettingsValidationSchema = exports.FieldsValidationSchema = exports.fields = void 0;
4
+ var fields_1 = require("./fields");
5
+ Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
6
+ Object.defineProperty(exports, "FieldsValidationSchema", { enumerable: true, get: function () { return fields_1.FieldsValidationSchema; } });
7
+ var settings_1 = require("./settings");
8
+ Object.defineProperty(exports, "SettingsValidationSchema", { enumerable: true, get: function () { return settings_1.SettingsValidationSchema; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/wellinks/actions/checkFlourishCustomer/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,uCAAqD;AAA5C,oHAAA,wBAAwB,OAAA"}
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ export declare const SettingsValidationSchema: z.ZodObject<{
3
+ platformApiKey: z.ZodOptional<z.ZodString>;
4
+ platformApiUrl: z.ZodOptional<z.ZodString>;
5
+ apiUrl: z.ZodOptional<z.ZodString>;
6
+ apiKey: z.ZodOptional<z.ZodString>;
7
+ selectEventTypeQuestion: z.ZodOptional<z.ZodString>;
8
+ startSendingRemindersQuestions: z.ZodOptional<z.ZodString>;
9
+ memberEventFormId: z.ZodOptional<z.ZodString>;
10
+ flourishApiKey: z.ZodString;
11
+ flourishApiUrl: z.ZodString;
12
+ flourishClientExtId: z.ZodString;
13
+ }, "strip", z.ZodTypeAny, {
14
+ flourishApiUrl: string;
15
+ flourishApiKey: string;
16
+ flourishClientExtId: string;
17
+ platformApiKey?: string | undefined;
18
+ platformApiUrl?: string | undefined;
19
+ apiUrl?: string | undefined;
20
+ apiKey?: string | undefined;
21
+ selectEventTypeQuestion?: string | undefined;
22
+ startSendingRemindersQuestions?: string | undefined;
23
+ memberEventFormId?: string | undefined;
24
+ }, {
25
+ flourishApiUrl: string;
26
+ flourishApiKey: string;
27
+ flourishClientExtId: string;
28
+ platformApiKey?: string | undefined;
29
+ platformApiUrl?: string | undefined;
30
+ apiUrl?: string | undefined;
31
+ apiKey?: string | undefined;
32
+ selectEventTypeQuestion?: string | undefined;
33
+ startSendingRemindersQuestions?: string | undefined;
34
+ memberEventFormId?: string | undefined;
35
+ }>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SettingsValidationSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.SettingsValidationSchema = zod_1.z.object({
6
+ platformApiKey: zod_1.z.string().optional(),
7
+ platformApiUrl: zod_1.z.string().optional(),
8
+ apiUrl: zod_1.z.string().optional(),
9
+ apiKey: zod_1.z.string().optional(),
10
+ selectEventTypeQuestion: zod_1.z.string().optional(),
11
+ startSendingRemindersQuestions: zod_1.z.string().optional(),
12
+ memberEventFormId: zod_1.z.string().optional(),
13
+ flourishApiKey: zod_1.z.string(),
14
+ flourishApiUrl: zod_1.z.string(),
15
+ flourishClientExtId: zod_1.z.string(),
16
+ });
17
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../../../extensions/wellinks/actions/checkFlourishCustomer/config/settings.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AAE3B,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,uBAAuB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9C,8BAA8B,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrD,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE;IAC1B,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE;IAC1B,mBAAmB,EAAE,OAAC,CAAC,MAAM,EAAE;CACoB,CAAC,CAAA"}
@@ -0,0 +1,33 @@
1
+ import { FieldType, type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../config/settings';
3
+ declare const fields: {
4
+ patientId: {
5
+ id: string;
6
+ label: string;
7
+ description: string;
8
+ type: FieldType.STRING;
9
+ required: true;
10
+ };
11
+ coachId: {
12
+ id: string;
13
+ label: string;
14
+ description: string;
15
+ type: FieldType.STRING;
16
+ required: true;
17
+ };
18
+ appointmentTime: {
19
+ id: string;
20
+ label: string;
21
+ description: string;
22
+ type: FieldType.DATE;
23
+ required: true;
24
+ };
25
+ };
26
+ declare const dataPoints: {
27
+ messageSent: {
28
+ key: string;
29
+ valueType: "boolean";
30
+ };
31
+ };
32
+ export declare const checkForChat: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
33
+ export {};
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkForChat = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const extensions_core_2 = require("@awell-health/extensions-core");
6
+ const wellinksSdk_1 = require("../../gql/wellinksSdk");
7
+ const wellinksGraphqlClient_1 = require("../../api/clients/wellinksGraphqlClient");
8
+ const lodash_1 = require("lodash");
9
+ const fields = {
10
+ patientId: {
11
+ id: 'patientId',
12
+ label: 'Patient ID',
13
+ description: 'The ID of the patient to check chats for.',
14
+ type: extensions_core_1.FieldType.STRING,
15
+ required: true,
16
+ },
17
+ coachId: {
18
+ id: 'coachId',
19
+ label: 'Coach ID',
20
+ description: 'The ID of the coach to check chats for.',
21
+ type: extensions_core_1.FieldType.STRING,
22
+ required: true,
23
+ },
24
+ appointmentTime: {
25
+ id: 'appointmentTime',
26
+ label: 'Appointment Time',
27
+ description: 'The appointment time to check against',
28
+ type: extensions_core_1.FieldType.DATE,
29
+ required: true,
30
+ },
31
+ };
32
+ const dataPoints = {
33
+ messageSent: {
34
+ key: 'messageSent',
35
+ valueType: 'boolean',
36
+ },
37
+ };
38
+ exports.checkForChat = {
39
+ key: 'checkForChat',
40
+ category: extensions_core_2.Category.SCHEDULING,
41
+ title: 'Check for Messages after Appointment',
42
+ description: 'Checks that a message has been sent 24 hours after the given Appointment',
43
+ fields,
44
+ dataPoints,
45
+ previewable: true,
46
+ onActivityCreated: async (payload, onComplete, onError) => {
47
+ var _a, _b;
48
+ const { fields, settings } = payload;
49
+ const { patientId, coachId, appointmentTime } = fields;
50
+ try {
51
+ const client = (0, wellinksGraphqlClient_1.initialiseClient)(settings);
52
+ if (!(0, lodash_1.isNil)(client)) {
53
+ const sdk = (0, wellinksSdk_1.getSdk)(client);
54
+ const { data } = await sdk.getConversationMemberships({
55
+ client_id: patientId,
56
+ });
57
+ if (!(0, lodash_1.isNil)(data.conversationMemberships)) {
58
+ const conversationMemberships = data.conversationMemberships.filter((conversation) => { var _a; return ((_a = conversation === null || conversation === void 0 ? void 0 : conversation.convo) === null || _a === void 0 ? void 0 : _a.dietitian_id) === coachId; });
59
+ for (const conversation of conversationMemberships) {
60
+ // check if dates are within 24 hours of each other
61
+ if (areDatesMoreThanADayApart(new Date((_b = (_a = conversation === null || conversation === void 0 ? void 0 : conversation.convo) === null || _a === void 0 ? void 0 : _a.updated_at) !== null && _b !== void 0 ? _b : ''), new Date(appointmentTime !== null && appointmentTime !== void 0 ? appointmentTime : ''))) {
62
+ await onComplete({
63
+ data_points: {
64
+ messageSent: 'true',
65
+ },
66
+ });
67
+ return;
68
+ }
69
+ }
70
+ await onComplete({
71
+ data_points: {
72
+ messageSent: 'false',
73
+ },
74
+ });
75
+ }
76
+ else {
77
+ await onError({
78
+ events: [
79
+ {
80
+ date: new Date().toISOString(),
81
+ text: {
82
+ en: 'conversationMemberships returned null or undefined',
83
+ },
84
+ error: {
85
+ category: 'SERVER_ERROR',
86
+ message: 'conversationMemberships returned null or undefined',
87
+ },
88
+ },
89
+ ],
90
+ });
91
+ }
92
+ }
93
+ else {
94
+ await onError({
95
+ events: [
96
+ {
97
+ date: new Date().toISOString(),
98
+ text: { en: 'API client requires an API url and API key' },
99
+ error: {
100
+ category: 'MISSING_SETTINGS',
101
+ message: 'Missing api url or api key',
102
+ },
103
+ },
104
+ ],
105
+ });
106
+ }
107
+ }
108
+ catch (err) {
109
+ const error = err;
110
+ await onError({
111
+ events: [
112
+ {
113
+ date: new Date().toISOString(),
114
+ text: { en: 'There was in error checking for a recent Chat' },
115
+ error: {
116
+ category: 'SERVER_ERROR',
117
+ message: error.message,
118
+ },
119
+ },
120
+ ],
121
+ });
122
+ }
123
+ },
124
+ };
125
+ function areDatesMoreThanADayApart(date1, date2) {
126
+ const oneDay = 1000 * 60 * 60 * 24;
127
+ return date1.getTime() > date2.getTime() + oneDay;
128
+ }
129
+ //# sourceMappingURL=checkForChat.js.map