@awell-health/awell-extensions 2.0.8 → 2.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (321) hide show
  1. package/dist/extensions/healthie/actions/applyTagToPatient/applyTagToPatient.js +3 -3
  2. package/dist/extensions/healthie/actions/applyTagToPatient/applyTagToPatient.js.map +1 -1
  3. package/dist/extensions/healthie/actions/applyTagToPatient/applyTagToPatient.test.js +4 -4
  4. package/dist/extensions/healthie/actions/applyTagToPatient/applyTagToPatient.test.js.map +1 -1
  5. package/dist/extensions/healthie/actions/archivePatient/archivePatient.js +3 -3
  6. package/dist/extensions/healthie/actions/archivePatient/archivePatient.js.map +1 -1
  7. package/dist/extensions/healthie/actions/archivePatient/archivePatient.test.js +4 -4
  8. package/dist/extensions/healthie/actions/archivePatient/archivePatient.test.js.map +1 -1
  9. package/dist/extensions/healthie/actions/assignPatientToGroup/assignPatientToGroup.js +3 -3
  10. package/dist/extensions/healthie/actions/assignPatientToGroup/assignPatientToGroup.js.map +1 -1
  11. package/dist/extensions/healthie/actions/assignPatientToGroup/assignPatientToGroup.test.js +4 -4
  12. package/dist/extensions/healthie/actions/assignPatientToGroup/assignPatientToGroup.test.js.map +1 -1
  13. package/dist/extensions/healthie/actions/cancelAppointment/cancelAppointment.js +3 -3
  14. package/dist/extensions/healthie/actions/cancelAppointment/cancelAppointment.js.map +1 -1
  15. package/dist/extensions/healthie/actions/cancelAppointment/cancelAppointment.test.js +4 -4
  16. package/dist/extensions/healthie/actions/cancelAppointment/cancelAppointment.test.js.map +1 -1
  17. package/dist/extensions/healthie/actions/checkPatientTag/checkPatientTag.js +3 -3
  18. package/dist/extensions/healthie/actions/checkPatientTag/checkPatientTag.js.map +1 -1
  19. package/dist/extensions/healthie/actions/checkPatientTag/checkPatientTag.test.js +4 -4
  20. package/dist/extensions/healthie/actions/checkPatientTag/checkPatientTag.test.js.map +1 -1
  21. package/dist/extensions/healthie/actions/checkScheduledAppointments/checkScheduledAppointments.js +3 -3
  22. package/dist/extensions/healthie/actions/checkScheduledAppointments/checkScheduledAppointments.js.map +1 -1
  23. package/dist/extensions/healthie/actions/checkScheduledAppointments/checkScheduledAppointments.test.js +4 -4
  24. package/dist/extensions/healthie/actions/checkScheduledAppointments/checkScheduledAppointments.test.js.map +1 -1
  25. package/dist/extensions/healthie/actions/closeChatConversation/closeChatConversation.js +3 -3
  26. package/dist/extensions/healthie/actions/closeChatConversation/closeChatConversation.js.map +1 -1
  27. package/dist/extensions/healthie/actions/closeChatConversation/closeChatConversation.test.js +4 -4
  28. package/dist/extensions/healthie/actions/closeChatConversation/closeChatConversation.test.js.map +1 -1
  29. package/dist/extensions/healthie/actions/completeTask/completeTask.js +3 -3
  30. package/dist/extensions/healthie/actions/completeTask/completeTask.js.map +1 -1
  31. package/dist/extensions/healthie/actions/completeTask/completeTask.test.js +4 -4
  32. package/dist/extensions/healthie/actions/completeTask/completeTask.test.js.map +1 -1
  33. package/dist/extensions/healthie/actions/createAppointment/createAppointment.test.js +4 -4
  34. package/dist/extensions/healthie/actions/createAppointment/createAppointment.test.js.map +1 -1
  35. package/dist/extensions/healthie/actions/createChartingNote/createChartingNote.js +3 -3
  36. package/dist/extensions/healthie/actions/createChartingNote/createChartingNote.js.map +1 -1
  37. package/dist/extensions/healthie/actions/createChartingNote/createChartingNote.test.js +4 -4
  38. package/dist/extensions/healthie/actions/createChartingNote/createChartingNote.test.js.map +1 -1
  39. package/dist/extensions/healthie/actions/createGoal/config/fields.d.ts +13 -3
  40. package/dist/extensions/healthie/actions/createGoal/config/fields.js +28 -9
  41. package/dist/extensions/healthie/actions/createGoal/config/fields.js.map +1 -1
  42. package/dist/extensions/healthie/actions/createGoal/createGoal.js +20 -9
  43. package/dist/extensions/healthie/actions/createGoal/createGoal.js.map +1 -1
  44. package/dist/extensions/healthie/actions/createGoal/createGoal.test.d.ts +1 -0
  45. package/dist/extensions/healthie/actions/createGoal/createGoal.test.js +72 -40
  46. package/dist/extensions/healthie/actions/createGoal/createGoal.test.js.map +1 -1
  47. package/dist/extensions/healthie/actions/createJournalEntry/createJournalEntry.js +3 -3
  48. package/dist/extensions/healthie/actions/createJournalEntry/createJournalEntry.js.map +1 -1
  49. package/dist/extensions/healthie/actions/createJournalEntry/createJournalEntry.test.js +4 -4
  50. package/dist/extensions/healthie/actions/createJournalEntry/createJournalEntry.test.js.map +1 -1
  51. package/dist/extensions/healthie/actions/createLocation/createLocation.js +3 -3
  52. package/dist/extensions/healthie/actions/createLocation/createLocation.js.map +1 -1
  53. package/dist/extensions/healthie/actions/createLocation/createLocation.test.js +4 -4
  54. package/dist/extensions/healthie/actions/createLocation/createLocation.test.js.map +1 -1
  55. package/dist/extensions/healthie/actions/createMetricEntry/createMetricEntry.js +3 -3
  56. package/dist/extensions/healthie/actions/createMetricEntry/createMetricEntry.js.map +1 -1
  57. package/dist/extensions/healthie/actions/createMetricEntry/createMetricEntry.test.js +4 -4
  58. package/dist/extensions/healthie/actions/createMetricEntry/createMetricEntry.test.js.map +1 -1
  59. package/dist/extensions/healthie/actions/createPatient/createPatient.js +3 -3
  60. package/dist/extensions/healthie/actions/createPatient/createPatient.js.map +1 -1
  61. package/dist/extensions/healthie/actions/createPatient/createPatient.test.js +4 -4
  62. package/dist/extensions/healthie/actions/createPatient/createPatient.test.js.map +1 -1
  63. package/dist/extensions/healthie/actions/createTask/createTask.js +3 -3
  64. package/dist/extensions/healthie/actions/createTask/createTask.js.map +1 -1
  65. package/dist/extensions/healthie/actions/createTask/createTask.test.js +4 -4
  66. package/dist/extensions/healthie/actions/createTask/createTask.test.js.map +1 -1
  67. package/dist/extensions/healthie/actions/deleteAppointment/deleteAppointment.js +3 -3
  68. package/dist/extensions/healthie/actions/deleteAppointment/deleteAppointment.js.map +1 -1
  69. package/dist/extensions/healthie/actions/deleteAppointment/deleteAppointment.test.js +4 -4
  70. package/dist/extensions/healthie/actions/deleteAppointment/deleteAppointment.test.js.map +1 -1
  71. package/dist/extensions/healthie/actions/deleteGoal/config/datapoints.d.ts +1 -0
  72. package/dist/extensions/healthie/actions/deleteGoal/config/datapoints.js +5 -0
  73. package/dist/extensions/healthie/actions/deleteGoal/config/datapoints.js.map +1 -0
  74. package/dist/extensions/healthie/actions/deleteGoal/config/fields.d.ts +18 -0
  75. package/dist/extensions/healthie/actions/deleteGoal/config/fields.js +21 -0
  76. package/dist/extensions/healthie/actions/deleteGoal/config/fields.js.map +1 -0
  77. package/dist/extensions/healthie/actions/deleteGoal/config/index.d.ts +2 -0
  78. package/dist/extensions/healthie/actions/deleteGoal/config/index.js +9 -0
  79. package/dist/extensions/healthie/actions/deleteGoal/config/index.js.map +1 -0
  80. package/dist/extensions/healthie/actions/deleteGoal/deleteGoal.d.ts +4 -0
  81. package/dist/extensions/healthie/actions/deleteGoal/deleteGoal.js +35 -0
  82. package/dist/extensions/healthie/actions/deleteGoal/deleteGoal.js.map +1 -0
  83. package/dist/extensions/healthie/actions/deleteGoal/deleteGoal.test.js +42 -0
  84. package/dist/extensions/healthie/actions/deleteGoal/deleteGoal.test.js.map +1 -0
  85. package/dist/extensions/healthie/actions/deleteGoal/index.d.ts +1 -0
  86. package/dist/extensions/healthie/actions/deleteGoal/index.js +18 -0
  87. package/dist/extensions/healthie/actions/deleteGoal/index.js.map +1 -0
  88. package/dist/extensions/healthie/actions/deleteTask/deleteTask.js +3 -3
  89. package/dist/extensions/healthie/actions/deleteTask/deleteTask.js.map +1 -1
  90. package/dist/extensions/healthie/actions/deleteTask/deleteTask.test.js +4 -4
  91. package/dist/extensions/healthie/actions/deleteTask/deleteTask.test.js.map +1 -1
  92. package/dist/extensions/healthie/actions/getAppointment/getAppointment.js +3 -3
  93. package/dist/extensions/healthie/actions/getAppointment/getAppointment.js.map +1 -1
  94. package/dist/extensions/healthie/actions/getAppointment/getAppointment.test.js +4 -4
  95. package/dist/extensions/healthie/actions/getAppointment/getAppointment.test.js.map +1 -1
  96. package/dist/extensions/healthie/actions/getFormAnswers/getFormAnswers.test.js +2 -2
  97. package/dist/extensions/healthie/actions/getFormAnswers/getFormAnswers.test.js.map +1 -1
  98. package/dist/extensions/healthie/actions/getMetricEntry/getMetricEntry.js +3 -3
  99. package/dist/extensions/healthie/actions/getMetricEntry/getMetricEntry.js.map +1 -1
  100. package/dist/extensions/healthie/actions/getMetricEntry/getMetricEntry.test.js +4 -4
  101. package/dist/extensions/healthie/actions/getMetricEntry/getMetricEntry.test.js.map +1 -1
  102. package/dist/extensions/healthie/actions/getPatient/getPatient.js +3 -3
  103. package/dist/extensions/healthie/actions/getPatient/getPatient.js.map +1 -1
  104. package/dist/extensions/healthie/actions/getPatient/getPatient.test.js +4 -4
  105. package/dist/extensions/healthie/actions/getPatient/getPatient.test.js.map +1 -1
  106. package/dist/extensions/healthie/actions/getSetPasswordLink/config/datapoints.d.ts +6 -0
  107. package/dist/extensions/healthie/actions/getSetPasswordLink/config/datapoints.js +10 -0
  108. package/dist/extensions/healthie/actions/getSetPasswordLink/config/datapoints.js.map +1 -0
  109. package/dist/extensions/healthie/actions/getSetPasswordLink/config/fields.d.ts +18 -0
  110. package/dist/extensions/healthie/actions/getSetPasswordLink/config/fields.js +21 -0
  111. package/dist/extensions/healthie/actions/getSetPasswordLink/config/fields.js.map +1 -0
  112. package/dist/extensions/healthie/actions/getSetPasswordLink/config/index.d.ts +2 -0
  113. package/dist/extensions/healthie/actions/getSetPasswordLink/config/index.js +9 -0
  114. package/dist/extensions/healthie/actions/getSetPasswordLink/config/index.js.map +1 -0
  115. package/dist/extensions/healthie/actions/getSetPasswordLink/getSetPasswordLink.d.ts +4 -0
  116. package/dist/extensions/healthie/actions/getSetPasswordLink/getSetPasswordLink.js +39 -0
  117. package/dist/extensions/healthie/actions/getSetPasswordLink/getSetPasswordLink.js.map +1 -0
  118. package/dist/extensions/healthie/actions/getSetPasswordLink/getSetPasswordLink.test.d.ts +1 -0
  119. package/dist/extensions/healthie/actions/getSetPasswordLink/getSetPasswordLink.test.js +48 -0
  120. package/dist/extensions/healthie/actions/getSetPasswordLink/getSetPasswordLink.test.js.map +1 -0
  121. package/dist/extensions/healthie/actions/getSetPasswordLink/index.d.ts +1 -0
  122. package/dist/extensions/healthie/actions/getSetPasswordLink/index.js +18 -0
  123. package/dist/extensions/healthie/actions/getSetPasswordLink/index.js.map +1 -0
  124. package/dist/extensions/healthie/actions/index.d.ts +56 -1
  125. package/dist/extensions/healthie/actions/index.js +4 -0
  126. package/dist/extensions/healthie/actions/index.js.map +1 -1
  127. package/dist/extensions/healthie/actions/removeTagFromPatient/removeTagFromPatient.js +3 -3
  128. package/dist/extensions/healthie/actions/removeTagFromPatient/removeTagFromPatient.js.map +1 -1
  129. package/dist/extensions/healthie/actions/removeTagFromPatient/removeTagFromPatient.test.js +4 -4
  130. package/dist/extensions/healthie/actions/removeTagFromPatient/removeTagFromPatient.test.js.map +1 -1
  131. package/dist/extensions/healthie/actions/sendChatMessage/sendChatMessage.js +3 -3
  132. package/dist/extensions/healthie/actions/sendChatMessage/sendChatMessage.js.map +1 -1
  133. package/dist/extensions/healthie/actions/sendChatMessage/sendChatMessage.test.js +4 -4
  134. package/dist/extensions/healthie/actions/sendChatMessage/sendChatMessage.test.js.map +1 -1
  135. package/dist/extensions/healthie/actions/sendFormCompletionRequest/sendFormCompletionRequest.js +3 -3
  136. package/dist/extensions/healthie/actions/sendFormCompletionRequest/sendFormCompletionRequest.js.map +1 -1
  137. package/dist/extensions/healthie/actions/sendFormCompletionRequest/sendFormCompletionRequest.test.js +4 -4
  138. package/dist/extensions/healthie/actions/sendFormCompletionRequest/sendFormCompletionRequest.test.js.map +1 -1
  139. package/dist/extensions/healthie/actions/updatePatient/updatePatient.js +3 -3
  140. package/dist/extensions/healthie/actions/updatePatient/updatePatient.js.map +1 -1
  141. package/dist/extensions/healthie/actions/updatePatient/updatePatient.test.js +4 -4
  142. package/dist/extensions/healthie/actions/updatePatient/updatePatient.test.js.map +1 -1
  143. package/dist/extensions/healthie/actions/updatePatientQuickNote/updatePatientQuickNote.js +3 -3
  144. package/dist/extensions/healthie/actions/updatePatientQuickNote/updatePatientQuickNote.js.map +1 -1
  145. package/dist/extensions/healthie/actions/updatePatientQuickNote/updatePatientQuickNote.test.js +4 -4
  146. package/dist/extensions/healthie/actions/updatePatientQuickNote/updatePatientQuickNote.test.js.map +1 -1
  147. package/dist/extensions/healthie/index.js +1 -1
  148. package/dist/extensions/healthie/index.js.map +1 -1
  149. package/dist/extensions/healthie/lib/sdk/genql/HealthieSdk.d.ts +29 -0
  150. package/dist/extensions/healthie/lib/sdk/genql/HealthieSdk.js +30 -0
  151. package/dist/extensions/healthie/lib/sdk/genql/HealthieSdk.js.map +1 -0
  152. package/dist/extensions/healthie/lib/sdk/genql/generateSdk.d.ts +1 -0
  153. package/dist/extensions/healthie/lib/sdk/genql/generateSdk.js +21 -0
  154. package/dist/extensions/healthie/lib/sdk/genql/generateSdk.js.map +1 -0
  155. package/dist/extensions/healthie/lib/sdk/genql/generated/index.d.ts +29 -0
  156. package/dist/extensions/healthie/lib/sdk/genql/generated/index.js +51 -0
  157. package/dist/extensions/healthie/lib/sdk/genql/generated/index.js.map +1 -0
  158. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/batcher.d.ts +105 -0
  159. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/batcher.js +205 -0
  160. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/batcher.js.map +1 -0
  161. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/createClient.d.ts +23 -0
  162. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/createClient.js +29 -0
  163. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/createClient.js.map +1 -0
  164. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/error.d.ts +18 -0
  165. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/error.js +20 -0
  166. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/error.js.map +1 -0
  167. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/fetcher.d.ts +10 -0
  168. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/fetcher.js +72 -0
  169. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/fetcher.js.map +1 -0
  170. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/generateGraphqlOperation.d.ts +30 -0
  171. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/generateGraphqlOperation.js +134 -0
  172. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/generateGraphqlOperation.js.map +1 -0
  173. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/index.d.ts +11 -0
  174. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/index.js +19 -0
  175. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/index.js.map +1 -0
  176. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/linkTypeMap.d.ts +9 -0
  177. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/linkTypeMap.js +102 -0
  178. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/linkTypeMap.js.map +1 -0
  179. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/typeSelection.d.ts +28 -0
  180. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/typeSelection.js +5 -0
  181. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/typeSelection.js.map +1 -0
  182. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/types.d.ts +55 -0
  183. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/types.js +4 -0
  184. package/dist/extensions/healthie/lib/sdk/genql/generated/runtime/types.js.map +1 -0
  185. package/dist/extensions/healthie/lib/sdk/genql/generated/schema.d.ts +42906 -0
  186. package/dist/extensions/healthie/lib/sdk/genql/generated/schema.js +5072 -0
  187. package/dist/extensions/healthie/lib/sdk/genql/generated/schema.js.map +1 -0
  188. package/dist/extensions/healthie/lib/sdk/genql/generated/types.d.ts +14934 -0
  189. package/dist/extensions/healthie/lib/sdk/genql/generated/types.js +39502 -0
  190. package/dist/extensions/healthie/lib/sdk/genql/generated/types.js.map +1 -0
  191. package/dist/extensions/healthie/lib/sdk/genql/index.d.ts +2 -0
  192. package/dist/extensions/healthie/lib/sdk/genql/index.js +21 -0
  193. package/dist/extensions/healthie/lib/sdk/genql/index.js.map +1 -0
  194. package/dist/extensions/healthie/lib/sdk/graphql-codegen/codegen.d.ts +7 -0
  195. package/dist/extensions/healthie/lib/sdk/{codegen.js → graphql-codegen/codegen.js} +6 -2
  196. package/dist/extensions/healthie/lib/sdk/graphql-codegen/codegen.js.map +1 -0
  197. package/dist/extensions/healthie/lib/sdk/{createSdk.d.ts → graphql-codegen/createSdk.d.ts} +5 -1
  198. package/dist/extensions/healthie/lib/sdk/{createSdk.js → graphql-codegen/createSdk.js} +4 -1
  199. package/dist/extensions/healthie/lib/sdk/graphql-codegen/createSdk.js.map +1 -0
  200. package/dist/extensions/healthie/lib/sdk/graphql-codegen/errors.js.map +1 -0
  201. package/dist/extensions/healthie/lib/sdk/{generated → graphql-codegen/generated}/sdk.d.ts +147 -34
  202. package/dist/extensions/healthie/lib/sdk/{generated → graphql-codegen/generated}/sdk.js +475 -383
  203. package/dist/extensions/healthie/lib/sdk/graphql-codegen/generated/sdk.js.map +1 -0
  204. package/dist/extensions/healthie/lib/sdk/{graphqlClient.d.ts → graphql-codegen/graphqlClient.d.ts} +5 -1
  205. package/dist/extensions/healthie/lib/sdk/{graphqlClient.js → graphql-codegen/graphqlClient.js} +4 -0
  206. package/dist/extensions/healthie/lib/sdk/graphql-codegen/graphqlClient.js.map +1 -0
  207. package/dist/extensions/healthie/lib/sdk/graphql-codegen/graphqlClient.test.d.ts +1 -0
  208. package/dist/extensions/healthie/lib/sdk/graphql-codegen/graphqlClient.test.js.map +1 -0
  209. package/dist/extensions/healthie/lib/sdk/validatePayloadAndCreateSdk.d.ts +7 -1
  210. package/dist/extensions/healthie/lib/sdk/validatePayloadAndCreateSdk.js +12 -4
  211. package/dist/extensions/healthie/lib/sdk/validatePayloadAndCreateSdk.js.map +1 -1
  212. package/dist/extensions/healthie/lib/types.d.ts +1 -1
  213. package/dist/extensions/healthie/lib/validation/getPatient.zod.d.ts +1 -1
  214. package/dist/extensions/healthie/webhooks/appliedTagCreated.js +2 -2
  215. package/dist/extensions/healthie/webhooks/appliedTagCreated.js.map +1 -1
  216. package/dist/extensions/healthie/webhooks/appliedTagDeleted.js +6 -3
  217. package/dist/extensions/healthie/webhooks/appliedTagDeleted.js.map +1 -1
  218. package/dist/extensions/healthie/webhooks/appointmentCreated.js +2 -2
  219. package/dist/extensions/healthie/webhooks/appointmentCreated.js.map +1 -1
  220. package/dist/extensions/healthie/webhooks/appointmentDeleted.js +2 -2
  221. package/dist/extensions/healthie/webhooks/appointmentDeleted.js.map +1 -1
  222. package/dist/extensions/healthie/webhooks/appointmentUpdated.js +2 -2
  223. package/dist/extensions/healthie/webhooks/appointmentUpdated.js.map +1 -1
  224. package/dist/extensions/healthie/webhooks/formAnswerGroupCreated.js +3 -3
  225. package/dist/extensions/healthie/webhooks/formAnswerGroupCreated.js.map +1 -1
  226. package/dist/extensions/healthie/webhooks/formAnswerGroupDeleted.js +2 -2
  227. package/dist/extensions/healthie/webhooks/formAnswerGroupDeleted.js.map +1 -1
  228. package/dist/extensions/healthie/webhooks/formAnswerGroupLocked.js +2 -2
  229. package/dist/extensions/healthie/webhooks/formAnswerGroupLocked.js.map +1 -1
  230. package/dist/extensions/healthie/webhooks/formAnswerGroupSigned.js +2 -2
  231. package/dist/extensions/healthie/webhooks/formAnswerGroupSigned.js.map +1 -1
  232. package/dist/extensions/healthie/webhooks/goalCreated.js +3 -3
  233. package/dist/extensions/healthie/webhooks/goalCreated.js.map +1 -1
  234. package/dist/extensions/healthie/webhooks/goalUpdated.js +3 -3
  235. package/dist/extensions/healthie/webhooks/goalUpdated.js.map +1 -1
  236. package/dist/extensions/healthie/webhooks/labOrderCreated.js +2 -2
  237. package/dist/extensions/healthie/webhooks/labOrderCreated.js.map +1 -1
  238. package/dist/extensions/healthie/webhooks/labOrderUpdated.js +2 -2
  239. package/dist/extensions/healthie/webhooks/labOrderUpdated.js.map +1 -1
  240. package/dist/extensions/healthie/webhooks/messageCreated.js +7 -5
  241. package/dist/extensions/healthie/webhooks/messageCreated.js.map +1 -1
  242. package/dist/extensions/healthie/webhooks/messageDeleted.js +6 -4
  243. package/dist/extensions/healthie/webhooks/messageDeleted.js.map +1 -1
  244. package/dist/extensions/healthie/webhooks/metricEntryCreated.js +2 -2
  245. package/dist/extensions/healthie/webhooks/metricEntryCreated.js.map +1 -1
  246. package/dist/extensions/healthie/webhooks/metricEntryUpdated.js +2 -2
  247. package/dist/extensions/healthie/webhooks/metricEntryUpdated.js.map +1 -1
  248. package/dist/extensions/healthie/webhooks/requestedFormCompletionCreated.js +5 -3
  249. package/dist/extensions/healthie/webhooks/requestedFormCompletionCreated.js.map +1 -1
  250. package/dist/extensions/healthie/webhooks/requestedFormCompletionUpdated.js +5 -3
  251. package/dist/extensions/healthie/webhooks/requestedFormCompletionUpdated.js.map +1 -1
  252. package/dist/extensions/healthie/webhooks/taskCreated.js +2 -2
  253. package/dist/extensions/healthie/webhooks/taskCreated.js.map +1 -1
  254. package/dist/extensions/healthie/webhooks/taskUpdated.js +3 -3
  255. package/dist/extensions/healthie/webhooks/taskUpdated.js.map +1 -1
  256. package/dist/extensions/healthie/webhooks/webhooks.test.js +4 -4
  257. package/dist/extensions/healthie/webhooks/webhooks.test.js.map +1 -1
  258. package/dist/extensions/index.js +2 -0
  259. package/dist/extensions/index.js.map +1 -1
  260. package/dist/extensions/markdown.json +4 -0
  261. package/dist/extensions/shelly/actions/index.d.ts +34 -0
  262. package/dist/extensions/shelly/actions/index.js +8 -0
  263. package/dist/extensions/shelly/actions/index.js.map +1 -0
  264. package/dist/extensions/shelly/actions/summarizeForm/config/datapoints.d.ts +6 -0
  265. package/dist/extensions/shelly/actions/summarizeForm/config/datapoints.js +10 -0
  266. package/dist/extensions/shelly/actions/summarizeForm/config/datapoints.js.map +1 -0
  267. package/dist/extensions/shelly/actions/summarizeForm/config/fields.d.ts +18 -0
  268. package/dist/extensions/shelly/actions/summarizeForm/config/fields.js +21 -0
  269. package/dist/extensions/shelly/actions/summarizeForm/config/fields.js.map +1 -0
  270. package/dist/extensions/shelly/actions/summarizeForm/config/index.d.ts +2 -0
  271. package/dist/extensions/shelly/actions/summarizeForm/config/index.js +9 -0
  272. package/dist/extensions/shelly/actions/summarizeForm/config/index.js.map +1 -0
  273. package/dist/extensions/shelly/actions/summarizeForm/index.d.ts +1 -0
  274. package/dist/extensions/shelly/actions/summarizeForm/index.js +6 -0
  275. package/dist/extensions/shelly/actions/summarizeForm/index.js.map +1 -0
  276. package/dist/extensions/shelly/actions/summarizeForm/lib/getResponseText/getResponseText.d.ts +12 -0
  277. package/dist/extensions/shelly/actions/summarizeForm/lib/getResponseText/getResponseText.js +73 -0
  278. package/dist/extensions/shelly/actions/summarizeForm/lib/getResponseText/getResponseText.js.map +1 -0
  279. package/dist/extensions/shelly/actions/summarizeForm/lib/getResponseText/index.d.ts +1 -0
  280. package/dist/extensions/shelly/actions/summarizeForm/lib/getResponseText/index.js +6 -0
  281. package/dist/extensions/shelly/actions/summarizeForm/lib/getResponseText/index.js.map +1 -0
  282. package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.d.ts +4 -0
  283. package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.js +65 -0
  284. package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.js.map +1 -0
  285. package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.test.d.ts +1 -0
  286. package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.test.js +57 -0
  287. package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.test.js.map +1 -0
  288. package/dist/extensions/shelly/index.d.ts +2 -0
  289. package/dist/extensions/shelly/index.js +22 -0
  290. package/dist/extensions/shelly/index.js.map +1 -0
  291. package/dist/extensions/shelly/lib/constants.d.ts +1 -0
  292. package/dist/extensions/shelly/lib/constants.js +5 -0
  293. package/dist/extensions/shelly/lib/constants.js.map +1 -0
  294. package/dist/extensions/shelly/lib/index.d.ts +1 -0
  295. package/dist/extensions/shelly/lib/index.js +6 -0
  296. package/dist/extensions/shelly/lib/index.js.map +1 -0
  297. package/dist/extensions/shelly/lib/utils/getLatestFormInStep.d.ts +11 -0
  298. package/dist/extensions/shelly/lib/utils/getLatestFormInStep.js +79 -0
  299. package/dist/extensions/shelly/lib/utils/getLatestFormInStep.js.map +1 -0
  300. package/dist/extensions/shelly/lib/utils/index.d.ts +1 -0
  301. package/dist/extensions/shelly/lib/utils/index.js +6 -0
  302. package/dist/extensions/shelly/lib/utils/index.js.map +1 -0
  303. package/dist/extensions/shelly/lib/validatePayloadAndCreateSdk.d.ts +18 -0
  304. package/dist/extensions/shelly/lib/validatePayloadAndCreateSdk.js +31 -0
  305. package/dist/extensions/shelly/lib/validatePayloadAndCreateSdk.js.map +1 -0
  306. package/dist/extensions/shelly/settings.d.ts +37 -0
  307. package/dist/extensions/shelly/settings.js +33 -0
  308. package/dist/extensions/shelly/settings.js.map +1 -0
  309. package/dist/extensions/stripe/actions/embeddedCheckout/config/fields.d.ts +1 -1
  310. package/package.json +8 -4
  311. package/dist/extensions/healthie/lib/sdk/codegen.d.ts +0 -3
  312. package/dist/extensions/healthie/lib/sdk/codegen.js.map +0 -1
  313. package/dist/extensions/healthie/lib/sdk/createSdk.js.map +0 -1
  314. package/dist/extensions/healthie/lib/sdk/errors.js.map +0 -1
  315. package/dist/extensions/healthie/lib/sdk/generated/sdk.js.map +0 -1
  316. package/dist/extensions/healthie/lib/sdk/graphqlClient.js.map +0 -1
  317. package/dist/extensions/healthie/lib/sdk/graphqlClient.test.js.map +0 -1
  318. /package/dist/extensions/healthie/{lib/sdk/graphqlClient.test.d.ts → actions/deleteGoal/deleteGoal.test.d.ts} +0 -0
  319. /package/dist/extensions/healthie/lib/sdk/{errors.d.ts → graphql-codegen/errors.d.ts} +0 -0
  320. /package/dist/extensions/healthie/lib/sdk/{errors.js → graphql-codegen/errors.js} +0 -0
  321. /package/dist/extensions/healthie/lib/sdk/{graphqlClient.test.js → graphql-codegen/graphqlClient.test.js} +0 -0
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HealthieSdk = void 0;
4
+ const generated_1 = require("./generated");
5
+ /**
6
+ * A class representing the Healthie SDK.
7
+ */
8
+ class HealthieSdk {
9
+ /**
10
+ * Creates an instance of the Healthie SDK.
11
+ *
12
+ * @param {Object} opts - The options for configuring the SDK.
13
+ * @param {string} [opts.apiUrl] - The API URL.
14
+ * @param {string} opts.apiKey - The API key to use for authentication.
15
+ */
16
+ constructor(opts) {
17
+ this.apiKey = opts.apiKey;
18
+ this.apiUrl = opts.apiUrl;
19
+ const client = (0, generated_1.createClient)({
20
+ url: this.apiUrl,
21
+ headers: {
22
+ Authorization: `Basic ${this.apiKey}`,
23
+ AuthorizationSource: 'API',
24
+ },
25
+ });
26
+ this.client = client;
27
+ }
28
+ }
29
+ exports.HealthieSdk = HealthieSdk;
30
+ //# sourceMappingURL=HealthieSdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HealthieSdk.js","sourceRoot":"","sources":["../../../../../../extensions/healthie/lib/sdk/genql/HealthieSdk.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AAEvD;;GAEG;AACH,MAAa,WAAW;IAgBtB;;;;;;OAMG;IACH,YAAY,IAAwC;QAClD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QACzB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QAEzB,MAAM,MAAM,GAAG,IAAA,wBAAY,EAAC;YAC1B,GAAG,EAAE,IAAI,CAAC,MAAM;YAChB,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,IAAI,CAAC,MAAM,EAAE;gBACrC,mBAAmB,EAAE,KAAK;aAC3B;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CACF;AArCD,kCAqCC"}
@@ -0,0 +1 @@
1
+ import 'dotenv/config';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const cli_1 = require("@genql/cli");
7
+ require("dotenv/config");
8
+ const path_1 = __importDefault(require("path"));
9
+ /**
10
+ * Run with the below command:
11
+ * yarn generate-healthie-sdk
12
+ */
13
+ (0, cli_1.generate)({
14
+ endpoint: process.env.HEALTHIE_API_URL,
15
+ output: path_1.default.join(__dirname, 'generated'),
16
+ // headers: {
17
+ // Authorization: `Basic ${process.env.HEALTHIE_API_KEY ?? ''}`,
18
+ // AuthorizationSource: 'API',
19
+ // },
20
+ }).catch(console.error);
21
+ //# sourceMappingURL=generateSdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateSdk.js","sourceRoot":"","sources":["../../../../../../extensions/healthie/lib/sdk/genql/generateSdk.ts"],"names":[],"mappings":";;;;;AAAA,oCAAqC;AACrC,yBAAsB;AACtB,gDAAuB;AAEvB;;;GAGG;AACH,IAAA,cAAQ,EAAC;IACP,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;IACtC,MAAM,EAAE,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC;IACzC,aAAa;IACb,kEAAkE;IAClE,gCAAgC;IAChC,KAAK;CACN,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA"}
@@ -0,0 +1,29 @@
1
+ import type { QueryGenqlSelection, Query, MutationGenqlSelection, Mutation, SubscriptionGenqlSelection, Subscription } from './schema';
2
+ import { type FieldsSelection, type GraphqlOperation, type ClientOptions, GenqlError } from './runtime';
3
+ export type { FieldsSelection } from './runtime';
4
+ export { GenqlError };
5
+ export * from './schema';
6
+ export interface Client {
7
+ query<R extends QueryGenqlSelection>(request: R & {
8
+ __name?: string;
9
+ }): Promise<FieldsSelection<Query, R>>;
10
+ mutation<R extends MutationGenqlSelection>(request: R & {
11
+ __name?: string;
12
+ }): Promise<FieldsSelection<Mutation, R>>;
13
+ }
14
+ export declare const createClient: (options?: ClientOptions) => Client;
15
+ export declare const everything: {
16
+ __scalar: boolean;
17
+ };
18
+ export type QueryResult<fields extends QueryGenqlSelection> = FieldsSelection<Query, fields>;
19
+ export declare const generateQueryOp: (fields: QueryGenqlSelection & {
20
+ __name?: string;
21
+ }) => GraphqlOperation;
22
+ export type MutationResult<fields extends MutationGenqlSelection> = FieldsSelection<Mutation, fields>;
23
+ export declare const generateMutationOp: (fields: MutationGenqlSelection & {
24
+ __name?: string;
25
+ }) => GraphqlOperation;
26
+ export type SubscriptionResult<fields extends SubscriptionGenqlSelection> = FieldsSelection<Subscription, fields>;
27
+ export declare const generateSubscriptionOp: (fields: SubscriptionGenqlSelection & {
28
+ __name?: string;
29
+ }) => GraphqlOperation;
@@ -0,0 +1,51 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.generateSubscriptionOp = exports.generateMutationOp = exports.generateQueryOp = exports.everything = exports.createClient = exports.GenqlError = void 0;
21
+ const runtime_1 = require("./runtime");
22
+ Object.defineProperty(exports, "GenqlError", { enumerable: true, get: function () { return runtime_1.GenqlError; } });
23
+ const types_1 = __importDefault(require("./types"));
24
+ __exportStar(require("./schema"), exports);
25
+ const typeMap = (0, runtime_1.linkTypeMap)(types_1.default);
26
+ const createClient = function (options) {
27
+ return (0, runtime_1.createClient)({
28
+ url: 'https://staging-api.gethealthie.com/graphql',
29
+ ...options,
30
+ queryRoot: typeMap.Query,
31
+ mutationRoot: typeMap.Mutation,
32
+ subscriptionRoot: typeMap.Subscription,
33
+ });
34
+ };
35
+ exports.createClient = createClient;
36
+ exports.everything = {
37
+ __scalar: true,
38
+ };
39
+ const generateQueryOp = function (fields) {
40
+ return (0, runtime_1.generateGraphqlOperation)('query', typeMap.Query, fields);
41
+ };
42
+ exports.generateQueryOp = generateQueryOp;
43
+ const generateMutationOp = function (fields) {
44
+ return (0, runtime_1.generateGraphqlOperation)('mutation', typeMap.Mutation, fields);
45
+ };
46
+ exports.generateMutationOp = generateMutationOp;
47
+ const generateSubscriptionOp = function (fields) {
48
+ return (0, runtime_1.generateGraphqlOperation)('subscription', typeMap.Subscription, fields);
49
+ };
50
+ exports.generateSubscriptionOp = generateSubscriptionOp;
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../extensions/healthie/lib/sdk/genql/generated/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AASA,uCAQkB;AAET,2FAHP,oBAAU,OAGO;AAEnB,oDAA2B;AAC3B,2CAAwB;AACxB,MAAM,OAAO,GAAG,IAAA,qBAAW,EAAC,eAAY,CAAC,CAAA;AAYlC,MAAM,YAAY,GAAG,UAAU,OAAuB;IAC3D,OAAO,IAAA,sBAAoB,EAAC;QAC1B,GAAG,EAAE,6CAA6C;QAElD,GAAG,OAAO;QACV,SAAS,EAAE,OAAO,CAAC,KAAM;QACzB,YAAY,EAAE,OAAO,CAAC,QAAS;QAC/B,gBAAgB,EAAE,OAAO,CAAC,YAAa;KACxC,CAAQ,CAAA;AACX,CAAC,CAAA;AATY,QAAA,YAAY,gBASxB;AAEY,QAAA,UAAU,GAAG;IACxB,QAAQ,EAAE,IAAI;CACf,CAAA;AAMM,MAAM,eAAe,GAEJ,UAAU,MAAM;IACtC,OAAO,IAAA,kCAAwB,EAAC,OAAO,EAAE,OAAO,CAAC,KAAM,EAAE,MAAa,CAAC,CAAA;AACzE,CAAC,CAAA;AAJY,QAAA,eAAe,mBAI3B;AAIM,MAAM,kBAAkB,GAEP,UAAU,MAAM;IACtC,OAAO,IAAA,kCAAwB,EAAC,UAAU,EAAE,OAAO,CAAC,QAAS,EAAE,MAAa,CAAC,CAAA;AAC/E,CAAC,CAAA;AAJY,QAAA,kBAAkB,sBAI9B;AAIM,MAAM,sBAAsB,GAEX,UAAU,MAAM;IACtC,OAAO,IAAA,kCAAwB,EAC7B,cAAc,EACd,OAAO,CAAC,YAAa,EACrB,MAAa,CACd,CAAA;AACH,CAAC,CAAA;AARY,QAAA,sBAAsB,0BAQlC"}
@@ -0,0 +1,105 @@
1
+ import type { GraphqlOperation } from './generateGraphqlOperation';
2
+ type Variables = Record<string, any>;
3
+ type QueryError = Error & {
4
+ message: string;
5
+ locations?: Array<{
6
+ line: number;
7
+ column: number;
8
+ }>;
9
+ path?: any;
10
+ rid: string;
11
+ details?: Record<string, any>;
12
+ };
13
+ type Result = {
14
+ data: Record<string, any>;
15
+ errors: Array<QueryError>;
16
+ };
17
+ type Fetcher = (batchedQuery: GraphqlOperation | Array<GraphqlOperation>) => Promise<Array<Result>>;
18
+ type Options = {
19
+ batchInterval?: number;
20
+ shouldBatch?: boolean;
21
+ maxBatchSize?: number;
22
+ };
23
+ type Queue = Array<{
24
+ request: GraphqlOperation;
25
+ resolve: (...args: Array<any>) => any;
26
+ reject: (...args: Array<any>) => any;
27
+ }>;
28
+ /**
29
+ * Create a batcher client.
30
+ * @param {Fetcher} fetcher - A function that can handle the network requests to graphql endpoint
31
+ * @param {Options} options - the options to be used by client
32
+ * @param {boolean} options.shouldBatch - should the client batch requests. (default true)
33
+ * @param {integer} options.batchInterval - duration (in MS) of each batch window. (default 6)
34
+ * @param {integer} options.maxBatchSize - max number of requests in a batch. (default 0)
35
+ * @param {boolean} options.defaultHeaders - default headers to include with every request
36
+ *
37
+ * @example
38
+ * const fetcher = batchedQuery => fetch('path/to/graphql', {
39
+ * method: 'post',
40
+ * headers: {
41
+ * Accept: 'application/json',
42
+ * 'Content-Type': 'application/json',
43
+ * },
44
+ * body: JSON.stringify(batchedQuery),
45
+ * credentials: 'include',
46
+ * })
47
+ * .then(response => response.json())
48
+ *
49
+ * const client = new QueryBatcher(fetcher, { maxBatchSize: 10 })
50
+ */
51
+ export declare class QueryBatcher {
52
+ fetcher: Fetcher;
53
+ _options: Options;
54
+ _queue: Queue;
55
+ constructor(fetcher: Fetcher, { batchInterval, shouldBatch, maxBatchSize, }?: Options);
56
+ /**
57
+ * Fetch will send a graphql request and return the parsed json.
58
+ * @param {string} query - the graphql query.
59
+ * @param {Variables} variables - any variables you wish to inject as key/value pairs.
60
+ * @param {[string]} operationName - the graphql operationName.
61
+ * @param {Options} overrides - the client options overrides.
62
+ *
63
+ * @return {promise} resolves to parsed json of server response
64
+ *
65
+ * @example
66
+ * client.fetch(`
67
+ * query getHuman($id: ID!) {
68
+ * human(id: $id) {
69
+ * name
70
+ * height
71
+ * }
72
+ * }
73
+ * `, { id: "1001" }, 'getHuman')
74
+ * .then(human => {
75
+ * // do something with human
76
+ * console.log(human);
77
+ * });
78
+ */
79
+ fetch(query: string, variables?: Variables, operationName?: string, overrides?: Options): Promise<Result>;
80
+ /**
81
+ * Fetch will send a graphql request and return the parsed json.
82
+ * @param {string} query - the graphql query.
83
+ * @param {Variables} variables - any variables you wish to inject as key/value pairs.
84
+ * @param {[string]} operationName - the graphql operationName.
85
+ * @param {Options} overrides - the client options overrides.
86
+ *
87
+ * @return {Promise<Array<Result>>} resolves to parsed json of server response
88
+ *
89
+ * @example
90
+ * client.forceFetch(`
91
+ * query getHuman($id: ID!) {
92
+ * human(id: $id) {
93
+ * name
94
+ * height
95
+ * }
96
+ * }
97
+ * `, { id: "1001" }, 'getHuman')
98
+ * .then(human => {
99
+ * // do something with human
100
+ * console.log(human);
101
+ * });
102
+ */
103
+ forceFetch(query: string, variables?: Variables, operationName?: string, overrides?: Options): Promise<Result>;
104
+ }
105
+ export {};
@@ -0,0 +1,205 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueryBatcher = void 0;
4
+ const error_1 = require("./error");
5
+ /**
6
+ * takes a list of requests (queue) and batches them into a single server request.
7
+ * It will then resolve each individual requests promise with the appropriate data.
8
+ * @private
9
+ * @param {QueryBatcher} client - the client to use
10
+ * @param {Queue} queue - the list of requests to batch
11
+ */
12
+ function dispatchQueueBatch(client, queue) {
13
+ let batchedQuery = queue.map((item) => item.request);
14
+ if (batchedQuery.length === 1) {
15
+ batchedQuery = batchedQuery[0];
16
+ }
17
+ (() => {
18
+ try {
19
+ return client.fetcher(batchedQuery);
20
+ }
21
+ catch (e) {
22
+ return Promise.reject(e);
23
+ }
24
+ })().then((responses) => {
25
+ if (queue.length === 1 && !Array.isArray(responses)) {
26
+ if (responses.errors && responses.errors.length) {
27
+ queue[0].reject(new error_1.GenqlError(responses.errors, responses.data));
28
+ return;
29
+ }
30
+ queue[0].resolve(responses);
31
+ return;
32
+ }
33
+ else if (responses.length !== queue.length) {
34
+ throw new Error('response length did not match query length');
35
+ }
36
+ for (let i = 0; i < queue.length; i++) {
37
+ if (responses[i].errors && responses[i].errors.length) {
38
+ queue[i].reject(new error_1.GenqlError(responses[i].errors, responses[i].data));
39
+ }
40
+ else {
41
+ queue[i].resolve(responses[i]);
42
+ }
43
+ }
44
+ })
45
+ .catch((e) => {
46
+ for (let i = 0; i < queue.length; i++) {
47
+ queue[i].reject(e);
48
+ }
49
+ });
50
+ }
51
+ /**
52
+ * creates a list of requests to batch according to max batch size.
53
+ * @private
54
+ * @param {QueryBatcher} client - the client to create list of requests from from
55
+ * @param {Options} options - the options for the batch
56
+ */
57
+ function dispatchQueue(client, options) {
58
+ const queue = client._queue;
59
+ const maxBatchSize = options.maxBatchSize || 0;
60
+ client._queue = [];
61
+ if (maxBatchSize > 0 && maxBatchSize < queue.length) {
62
+ for (let i = 0; i < queue.length / maxBatchSize; i++) {
63
+ dispatchQueueBatch(client, queue.slice(i * maxBatchSize, (i + 1) * maxBatchSize));
64
+ }
65
+ }
66
+ else {
67
+ dispatchQueueBatch(client, queue);
68
+ }
69
+ }
70
+ /**
71
+ * Create a batcher client.
72
+ * @param {Fetcher} fetcher - A function that can handle the network requests to graphql endpoint
73
+ * @param {Options} options - the options to be used by client
74
+ * @param {boolean} options.shouldBatch - should the client batch requests. (default true)
75
+ * @param {integer} options.batchInterval - duration (in MS) of each batch window. (default 6)
76
+ * @param {integer} options.maxBatchSize - max number of requests in a batch. (default 0)
77
+ * @param {boolean} options.defaultHeaders - default headers to include with every request
78
+ *
79
+ * @example
80
+ * const fetcher = batchedQuery => fetch('path/to/graphql', {
81
+ * method: 'post',
82
+ * headers: {
83
+ * Accept: 'application/json',
84
+ * 'Content-Type': 'application/json',
85
+ * },
86
+ * body: JSON.stringify(batchedQuery),
87
+ * credentials: 'include',
88
+ * })
89
+ * .then(response => response.json())
90
+ *
91
+ * const client = new QueryBatcher(fetcher, { maxBatchSize: 10 })
92
+ */
93
+ class QueryBatcher {
94
+ constructor(fetcher, { batchInterval = 6, shouldBatch = true, maxBatchSize = 0, } = {}) {
95
+ this.fetcher = fetcher;
96
+ this._options = {
97
+ batchInterval,
98
+ shouldBatch,
99
+ maxBatchSize,
100
+ };
101
+ this._queue = [];
102
+ }
103
+ /**
104
+ * Fetch will send a graphql request and return the parsed json.
105
+ * @param {string} query - the graphql query.
106
+ * @param {Variables} variables - any variables you wish to inject as key/value pairs.
107
+ * @param {[string]} operationName - the graphql operationName.
108
+ * @param {Options} overrides - the client options overrides.
109
+ *
110
+ * @return {promise} resolves to parsed json of server response
111
+ *
112
+ * @example
113
+ * client.fetch(`
114
+ * query getHuman($id: ID!) {
115
+ * human(id: $id) {
116
+ * name
117
+ * height
118
+ * }
119
+ * }
120
+ * `, { id: "1001" }, 'getHuman')
121
+ * .then(human => {
122
+ * // do something with human
123
+ * console.log(human);
124
+ * });
125
+ */
126
+ fetch(query, variables, operationName, overrides = {}) {
127
+ const request = {
128
+ query,
129
+ };
130
+ const options = Object.assign({}, this._options, overrides);
131
+ if (variables) {
132
+ request.variables = variables;
133
+ }
134
+ if (operationName) {
135
+ request.operationName = operationName;
136
+ }
137
+ const promise = new Promise((resolve, reject) => {
138
+ this._queue.push({
139
+ request,
140
+ resolve,
141
+ reject,
142
+ });
143
+ if (this._queue.length === 1) {
144
+ if (options.shouldBatch) {
145
+ setTimeout(() => dispatchQueue(this, options), options.batchInterval);
146
+ }
147
+ else {
148
+ dispatchQueue(this, options);
149
+ }
150
+ }
151
+ });
152
+ return promise;
153
+ }
154
+ /**
155
+ * Fetch will send a graphql request and return the parsed json.
156
+ * @param {string} query - the graphql query.
157
+ * @param {Variables} variables - any variables you wish to inject as key/value pairs.
158
+ * @param {[string]} operationName - the graphql operationName.
159
+ * @param {Options} overrides - the client options overrides.
160
+ *
161
+ * @return {Promise<Array<Result>>} resolves to parsed json of server response
162
+ *
163
+ * @example
164
+ * client.forceFetch(`
165
+ * query getHuman($id: ID!) {
166
+ * human(id: $id) {
167
+ * name
168
+ * height
169
+ * }
170
+ * }
171
+ * `, { id: "1001" }, 'getHuman')
172
+ * .then(human => {
173
+ * // do something with human
174
+ * console.log(human);
175
+ * });
176
+ */
177
+ forceFetch(query, variables, operationName, overrides = {}) {
178
+ const request = {
179
+ query,
180
+ };
181
+ const options = Object.assign({}, this._options, overrides, {
182
+ shouldBatch: false,
183
+ });
184
+ if (variables) {
185
+ request.variables = variables;
186
+ }
187
+ if (operationName) {
188
+ request.operationName = operationName;
189
+ }
190
+ const promise = new Promise((resolve, reject) => {
191
+ const client = new QueryBatcher(this.fetcher, this._options);
192
+ client._queue = [
193
+ {
194
+ request,
195
+ resolve,
196
+ reject,
197
+ },
198
+ ];
199
+ dispatchQueue(client, options);
200
+ });
201
+ return promise;
202
+ }
203
+ }
204
+ exports.QueryBatcher = QueryBatcher;
205
+ //# sourceMappingURL=batcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batcher.js","sourceRoot":"","sources":["../../../../../../../../extensions/healthie/lib/sdk/genql/generated/runtime/batcher.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,23 @@
1
+ import { type BatchOptions } from './fetcher';
2
+ import type { ExecutionResult, LinkedType } from './types';
3
+ import { type GraphqlOperation } from './generateGraphqlOperation';
4
+ export type Headers = HeadersInit | (() => HeadersInit) | (() => Promise<HeadersInit>);
5
+ export type BaseFetcher = (operation: GraphqlOperation | GraphqlOperation[]) => Promise<ExecutionResult | ExecutionResult[]>;
6
+ export type ClientOptions = Omit<RequestInit, 'body' | 'headers'> & {
7
+ url?: string;
8
+ batch?: BatchOptions | boolean;
9
+ fetcher?: BaseFetcher;
10
+ fetch?: Function;
11
+ headers?: Headers;
12
+ };
13
+ export declare const createClient: ({ queryRoot, mutationRoot, subscriptionRoot, ...options }: Omit<RequestInit, "headers" | "body"> & {
14
+ url?: string | undefined;
15
+ batch?: boolean | BatchOptions | undefined;
16
+ fetcher?: BaseFetcher | undefined;
17
+ fetch?: Function | undefined;
18
+ headers?: Headers | undefined;
19
+ } & {
20
+ queryRoot?: LinkedType | undefined;
21
+ mutationRoot?: LinkedType | undefined;
22
+ subscriptionRoot?: LinkedType | undefined;
23
+ }) => any;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.createClient = void 0;
5
+ const fetcher_1 = require("./fetcher");
6
+ const generateGraphqlOperation_1 = require("./generateGraphqlOperation");
7
+ const createClient = ({ queryRoot, mutationRoot, subscriptionRoot, ...options }) => {
8
+ const fetcher = (0, fetcher_1.createFetcher)(options);
9
+ const client = {};
10
+ if (queryRoot) {
11
+ client.query = (request) => {
12
+ if (!queryRoot)
13
+ throw new Error('queryRoot argument is missing');
14
+ const resultPromise = fetcher((0, generateGraphqlOperation_1.generateGraphqlOperation)('query', queryRoot, request));
15
+ return resultPromise;
16
+ };
17
+ }
18
+ if (mutationRoot) {
19
+ client.mutation = (request) => {
20
+ if (!mutationRoot)
21
+ throw new Error('mutationRoot argument is missing');
22
+ const resultPromise = fetcher((0, generateGraphqlOperation_1.generateGraphqlOperation)('mutation', mutationRoot, request));
23
+ return resultPromise;
24
+ };
25
+ }
26
+ return client;
27
+ };
28
+ exports.createClient = createClient;
29
+ //# sourceMappingURL=createClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createClient.js","sourceRoot":"","sources":["../../../../../../../../extensions/healthie/lib/sdk/genql/generated/runtime/createClient.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,uCAA6D;AAE7D,yEAGmC;AAmB5B,MAAM,YAAY,GAAG,CAAC,EACzB,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,GAAG,OAAO,EAKb,EAAE,EAAE;IACD,MAAM,OAAO,GAAG,IAAA,uBAAa,EAAC,OAAO,CAAC,CAAA;IACtC,MAAM,MAAM,GAGR,EAAE,CAAA;IAEN,IAAI,SAAS,EAAE;QACX,MAAM,CAAC,KAAK,GAAG,CAAC,OAAY,EAAE,EAAE;YAC5B,IAAI,CAAC,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;YAEhE,MAAM,aAAa,GAAG,OAAO,CACzB,IAAA,mDAAwB,EAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CACxD,CAAA;YAED,OAAO,aAAa,CAAA;QACxB,CAAC,CAAA;KACJ;IACD,IAAI,YAAY,EAAE;QACd,MAAM,CAAC,QAAQ,GAAG,CAAC,OAAY,EAAE,EAAE;YAC/B,IAAI,CAAC,YAAY;gBACb,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAA;YAEvD,MAAM,aAAa,GAAG,OAAO,CACzB,IAAA,mDAAwB,EAAC,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,CAC9D,CAAA;YAED,OAAO,aAAa,CAAA;QACxB,CAAC,CAAA;KACJ;IAED,OAAO,MAAa,CAAA;AACxB,CAAC,CAAA;AAzCY,QAAA,YAAY,gBAyCxB"}
@@ -0,0 +1,18 @@
1
+ export declare class GenqlError extends Error {
2
+ errors: Array<GraphqlError>;
3
+ /**
4
+ * Partial data returned by the server
5
+ */
6
+ data?: any;
7
+ constructor(errors: any[], data: any);
8
+ }
9
+ interface GraphqlError {
10
+ message: string;
11
+ locations?: Array<{
12
+ line: number;
13
+ column: number;
14
+ }>;
15
+ path?: string[];
16
+ extensions?: Record<string, any>;
17
+ }
18
+ export {};
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GenqlError = void 0;
4
+ // @ts-nocheck
5
+ class GenqlError extends Error {
6
+ constructor(errors, data) {
7
+ let message = Array.isArray(errors)
8
+ ? errors.map((x) => (x === null || x === void 0 ? void 0 : x.message) || '').join('\n')
9
+ : '';
10
+ if (!message) {
11
+ message = 'GraphQL error';
12
+ }
13
+ super(message);
14
+ this.errors = [];
15
+ this.errors = errors;
16
+ this.data = data;
17
+ }
18
+ }
19
+ exports.GenqlError = GenqlError;
20
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../../../../../extensions/healthie/lib/sdk/genql/generated/runtime/error.ts"],"names":[],"mappings":";;;AAAA,cAAc;AACd,MAAa,UAAW,SAAQ,KAAK;IAMjC,YAAY,MAAa,EAAE,IAAS;QAChC,IAAI,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAC/B,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,KAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAChD,CAAC,CAAC,EAAE,CAAA;QACR,IAAI,CAAC,OAAO,EAAE;YACV,OAAO,GAAG,eAAe,CAAA;SAC5B;QACD,KAAK,CAAC,OAAO,CAAC,CAAA;QAZlB,WAAM,GAAwB,EAAE,CAAA;QAa5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACpB,CAAC;CACJ;AAjBD,gCAiBC"}
@@ -0,0 +1,10 @@
1
+ import type { ClientOptions } from './createClient';
2
+ import type { GraphqlOperation } from './generateGraphqlOperation';
3
+ export interface Fetcher {
4
+ (gql: GraphqlOperation): Promise<any>;
5
+ }
6
+ export type BatchOptions = {
7
+ batchInterval?: number;
8
+ maxBatchSize?: number;
9
+ };
10
+ export declare const createFetcher: ({ url, headers, fetcher, fetch: _fetch, batch, ...rest }: ClientOptions) => Fetcher;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createFetcher = void 0;
4
+ // @ts-nocheck
5
+ const batcher_1 = require("./batcher");
6
+ const error_1 = require("./error");
7
+ const DEFAULT_BATCH_OPTIONS = {
8
+ maxBatchSize: 10,
9
+ batchInterval: 40,
10
+ };
11
+ const createFetcher = ({ url, headers = {}, fetcher, fetch: _fetch, batch = false, ...rest }) => {
12
+ if (!url && !fetcher) {
13
+ throw new Error('url or fetcher is required');
14
+ }
15
+ fetcher = fetcher || (async (body) => {
16
+ let headersObject = typeof headers == 'function' ? await headers() : headers;
17
+ headersObject = headersObject || {};
18
+ if (typeof fetch === 'undefined' && !_fetch) {
19
+ throw new Error('Global `fetch` function is not available, pass a fetch polyfill to Genql `createClient`');
20
+ }
21
+ let fetchImpl = _fetch || fetch;
22
+ const res = await fetchImpl(url, {
23
+ headers: {
24
+ 'Content-Type': 'application/json',
25
+ ...headersObject,
26
+ },
27
+ method: 'POST',
28
+ body: JSON.stringify(body),
29
+ ...rest,
30
+ });
31
+ if (!res.ok) {
32
+ throw new Error(`${res.statusText}: ${await res.text()}`);
33
+ }
34
+ const json = await res.json();
35
+ return json;
36
+ });
37
+ if (!batch) {
38
+ return async (body) => {
39
+ var _a;
40
+ const json = await fetcher(body);
41
+ if (Array.isArray(json)) {
42
+ return json.map((json) => {
43
+ var _a;
44
+ if ((_a = json === null || json === void 0 ? void 0 : json.errors) === null || _a === void 0 ? void 0 : _a.length) {
45
+ throw new error_1.GenqlError(json.errors || [], json.data);
46
+ }
47
+ return json.data;
48
+ });
49
+ }
50
+ else {
51
+ if ((_a = json === null || json === void 0 ? void 0 : json.errors) === null || _a === void 0 ? void 0 : _a.length) {
52
+ throw new error_1.GenqlError(json.errors || [], json.data);
53
+ }
54
+ return json.data;
55
+ }
56
+ };
57
+ }
58
+ const batcher = new batcher_1.QueryBatcher(async (batchedQuery) => {
59
+ // console.log(batchedQuery) // [{ query: 'query{user{age}}', variables: {} }, ...]
60
+ const json = await fetcher(batchedQuery);
61
+ return json;
62
+ }, batch === true ? DEFAULT_BATCH_OPTIONS : batch);
63
+ return async ({ query, variables }) => {
64
+ const json = await batcher.fetch(query, variables);
65
+ if (json === null || json === void 0 ? void 0 : json.data) {
66
+ return json.data;
67
+ }
68
+ throw new Error('Genql batch fetcher returned unexpected result ' + JSON.stringify(json));
69
+ };
70
+ };
71
+ exports.createFetcher = createFetcher;
72
+ //# sourceMappingURL=fetcher.js.map