@medipass/web-sdk 11.38.0 → 11.38.1-feature-typescript-claudia.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/.eslintrc.cjs +95 -0
  2. package/babel.config.js +2 -1
  3. package/lib/index.d.ts +262 -0
  4. package/lib/index.js +83 -3
  5. package/lib/{regions-ed54f163.js → regions-a0a28864.js} +2 -2
  6. package/lib/resources/accounts.d.ts +215 -0
  7. package/lib/resources/accounts.js +3 -3
  8. package/lib/resources/actions.d.ts +13 -0
  9. package/lib/resources/actions.js +3 -3
  10. package/lib/resources/api-keys.d.ts +24 -0
  11. package/lib/resources/api-keys.js +3 -3
  12. package/lib/resources/applications.d.ts +31 -0
  13. package/lib/resources/applications.js +3 -3
  14. package/lib/resources/attachments.d.ts +32 -0
  15. package/lib/resources/attachments.js +3 -3
  16. package/lib/resources/auth.d.ts +59 -0
  17. package/lib/resources/auth.js +3 -3
  18. package/lib/resources/bulk-submits.d.ts +17 -0
  19. package/lib/resources/bulk-submits.js +3 -3
  20. package/lib/resources/bulk-uploads.d.ts +26 -0
  21. package/lib/resources/bulk-uploads.js +3 -3
  22. package/lib/resources/business-profiles.d.ts +18 -0
  23. package/lib/resources/business-profiles.js +3 -3
  24. package/lib/resources/businesses.d.ts +132 -0
  25. package/lib/resources/businesses.js +3 -3
  26. package/lib/resources/claim-items.d.ts +31 -0
  27. package/lib/resources/claim-items.js +3 -3
  28. package/lib/resources/devices.d.ts +11 -0
  29. package/lib/resources/devices.js +3 -3
  30. package/lib/resources/doc-accounts.d.ts +32 -0
  31. package/lib/resources/doc-accounts.js +3 -3
  32. package/lib/resources/documents.d.ts +90 -0
  33. package/lib/resources/documents.js +3 -3
  34. package/lib/resources/emails.d.ts +14 -0
  35. package/lib/resources/emails.js +3 -3
  36. package/lib/resources/form-application-templates.d.ts +20 -0
  37. package/lib/resources/form-application-templates.js +3 -3
  38. package/lib/resources/form-applications.d.ts +27 -0
  39. package/lib/resources/form-applications.js +3 -3
  40. package/lib/resources/forms.d.ts +100 -0
  41. package/lib/resources/forms.js +3 -3
  42. package/lib/resources/funder-services.d.ts +8 -0
  43. package/lib/resources/funder-services.js +3 -3
  44. package/lib/resources/funder-settings.d.ts +8 -0
  45. package/lib/resources/funder-settings.js +3 -3
  46. package/lib/resources/funders.d.ts +5 -0
  47. package/lib/resources/funders.js +3 -3
  48. package/lib/resources/futures.d.ts +85 -0
  49. package/lib/resources/futures.js +3 -3
  50. package/lib/resources/health-fund-accounts.d.ts +78 -0
  51. package/lib/resources/health-fund-accounts.js +3 -3
  52. package/lib/resources/health-fund-settings.d.ts +39 -0
  53. package/lib/resources/health-fund-settings.js +3 -3
  54. package/lib/resources/healthfunds.d.ts +64 -0
  55. package/lib/resources/healthfunds.js +3 -3
  56. package/lib/resources/icditems.d.ts +14 -0
  57. package/lib/resources/icditems.js +3 -3
  58. package/lib/resources/invoice-scans.d.ts +26 -0
  59. package/lib/resources/invoice-scans.js +3 -3
  60. package/lib/resources/jhcs.d.ts +7 -0
  61. package/lib/resources/jhcs.js +3 -3
  62. package/lib/resources/kyc.d.ts +109 -0
  63. package/lib/resources/kyc.js +3 -3
  64. package/lib/resources/logs.d.ts +16 -0
  65. package/lib/resources/logs.js +3 -3
  66. package/lib/resources/members.d.ts +92 -0
  67. package/lib/resources/members.js +3 -3
  68. package/lib/resources/message-mappings.d.ts +9 -0
  69. package/lib/resources/message-mappings.js +3 -3
  70. package/lib/resources/minions.d.ts +40 -0
  71. package/lib/resources/minions.js +3 -3
  72. package/lib/resources/modalities.d.ts +19 -0
  73. package/lib/resources/modalities.js +3 -3
  74. package/lib/resources/notes.d.ts +17 -0
  75. package/lib/resources/notes.js +3 -3
  76. package/lib/resources/onboarding-applications.d.ts +52 -0
  77. package/lib/resources/onboarding-applications.js +3 -3
  78. package/lib/resources/onboarding-requests.d.ts +39 -0
  79. package/lib/resources/onboarding-requests.js +3 -3
  80. package/lib/resources/ops.d.ts +60 -0
  81. package/lib/resources/ops.js +3 -3
  82. package/lib/resources/organisations.d.ts +7 -0
  83. package/lib/resources/organisations.js +3 -3
  84. package/lib/resources/partners.d.ts +50 -0
  85. package/lib/resources/partners.js +3 -3
  86. package/lib/resources/patients.d.ts +44 -0
  87. package/lib/resources/patients.js +3 -3
  88. package/lib/resources/payments.d.ts +155 -0
  89. package/lib/resources/payments.js +3 -3
  90. package/lib/resources/pms.d.ts +43 -0
  91. package/lib/resources/pms.js +3 -3
  92. package/lib/resources/practice-profiles.d.ts +20 -0
  93. package/lib/resources/practice-profiles.js +3 -3
  94. package/lib/resources/practice-types.d.ts +6 -0
  95. package/lib/resources/practice-types.js +3 -3
  96. package/lib/resources/practices.d.ts +137 -0
  97. package/lib/resources/practices.js +3 -3
  98. package/lib/resources/products.d.ts +23 -0
  99. package/lib/resources/products.js +3 -3
  100. package/lib/resources/professional-categories.d.ts +23 -0
  101. package/lib/resources/professional-categories.js +3 -3
  102. package/lib/resources/provider-number-types.d.ts +16 -0
  103. package/lib/resources/provider-number-types.js +3 -3
  104. package/lib/resources/provider-registration-types.d.ts +15 -0
  105. package/lib/resources/provider-registration-types.js +3 -3
  106. package/lib/resources/provider-requests.d.ts +17 -0
  107. package/lib/resources/provider-requests.js +3 -3
  108. package/lib/resources/provider-types.d.ts +6 -0
  109. package/lib/resources/provider-types.js +3 -3
  110. package/lib/resources/ref-sources.d.ts +6 -0
  111. package/lib/resources/ref-sources.js +3 -3
  112. package/lib/resources/risk.d.ts +13 -0
  113. package/lib/resources/risk.js +3 -3
  114. package/lib/resources/rnas.d.ts +43 -0
  115. package/lib/resources/rnas.js +3 -3
  116. package/lib/resources/roles.d.ts +7 -0
  117. package/lib/resources/roles.js +3 -3
  118. package/lib/resources/self-checkout-sessions.d.ts +134 -0
  119. package/lib/resources/self-checkout-sessions.js +3 -3
  120. package/lib/resources/services.d.ts +88 -0
  121. package/lib/resources/services.js +3 -3
  122. package/lib/resources/settlements.d.ts +37 -0
  123. package/lib/resources/settlements.js +3 -3
  124. package/lib/resources/sign-up.d.ts +5 -0
  125. package/lib/resources/sign-up.js +3 -3
  126. package/lib/resources/specialties.d.ts +23 -0
  127. package/lib/resources/specialties.js +3 -3
  128. package/lib/resources/staff-profiles.d.ts +20 -0
  129. package/lib/resources/staff-profiles.js +3 -3
  130. package/lib/resources/staff.d.ts +242 -0
  131. package/lib/resources/staff.js +3 -3
  132. package/lib/resources/statistics.d.ts +56 -0
  133. package/lib/resources/statistics.js +3 -3
  134. package/lib/resources/subscriptions.d.ts +32 -0
  135. package/lib/resources/subscriptions.js +3 -3
  136. package/lib/resources/terminals.d.ts +71 -0
  137. package/lib/resources/terminals.js +3 -3
  138. package/lib/resources/transaction-export.d.ts +18 -0
  139. package/lib/resources/transaction-export.js +3 -3
  140. package/lib/resources/transactions.d.ts +466 -0
  141. package/lib/resources/transactions.js +3 -3
  142. package/lib/resources/triggers.d.ts +20 -0
  143. package/lib/resources/triggers.js +3 -3
  144. package/lib/resources/vendors.d.ts +9 -0
  145. package/lib/resources/vendors.js +3 -3
  146. package/lib/resources/verify.d.ts +9 -0
  147. package/lib/resources/verify.js +3 -3
  148. package/lib/resources/workers.d.ts +3 -0
  149. package/lib/resources/workers.js +3 -3
  150. package/lib/resources/workflow-exceptions.d.ts +5 -0
  151. package/lib/resources/workflow-exceptions.js +3 -3
  152. package/lib/services/aws.d.ts +54 -0
  153. package/lib/services/aws.js +3 -3
  154. package/lib/services/storage.d.ts +28 -0
  155. package/lib/services/storage.js +126 -18
  156. package/lib/services/version.d.ts +21 -0
  157. package/lib/services/version.js +3 -3
  158. package/lib/{staff-f19eb168.js → staff-96febcd8.js} +188 -581
  159. package/lib/types/documents.d.ts +115 -0
  160. package/lib/types/documents.js +2 -0
  161. package/lib/types/forms.d.ts +67 -0
  162. package/lib/types/forms.js +2 -0
  163. package/lib/types/index.d.ts +42 -0
  164. package/lib/types/index.js +2 -0
  165. package/lib/types/message-mappings.d.ts +18 -0
  166. package/lib/types/message-mappings.js +2 -0
  167. package/lib/types/notes.d.ts +5 -0
  168. package/lib/types/notes.js +2 -0
  169. package/lib/types/products.d.ts +34 -0
  170. package/lib/types/products.js +2 -0
  171. package/lib/types/professional-categories.d.ts +20 -0
  172. package/lib/types/professional-categories.js +2 -0
  173. package/lib/types/specialties.d.ts +22 -0
  174. package/lib/types/specialties.js +2 -0
  175. package/lib/types/subscriptions.d.ts +52 -0
  176. package/lib/types/subscriptions.js +2 -0
  177. package/lib/utils/application.d.ts +1 -0
  178. package/lib/utils/application.js +3 -3
  179. package/lib/utils/base-urls/core.d.ts +19 -0
  180. package/lib/utils/base-urls/index.d.ts +37 -0
  181. package/lib/utils/base-urls/risk.d.ts +17 -0
  182. package/lib/utils/does-param-exist.d.ts +2 -0
  183. package/lib/utils/get-axios-error.d.ts +2 -0
  184. package/lib/utils/param-error.d.ts +3 -0
  185. package/lib/utils/professions.d.ts +3 -0
  186. package/lib/utils/professions.js +3 -3
  187. package/lib/utils/regions.d.ts +1 -0
  188. package/lib/utils/regions.js +2 -2
  189. package/lib/utils/request.d.ts +3 -0
  190. package/lib/utils/request.js +3 -3
  191. package/lib/utils/staff.d.ts +8 -0
  192. package/lib/utils/staff.js +3 -3
  193. package/package.json +19 -9
  194. package/tsconfig.json +33 -0
  195. package/types/globals.d.ts +7 -0
  196. package/types/index.d.ts +1 -0
  197. package/.eslintrc +0 -3
  198. package/lib/_types/documents.js.flow +0 -118
  199. package/lib/_types/forms.js.flow +0 -57
  200. package/lib/_types/index.js.flow +0 -47
  201. package/lib/_types/message-mappings.js.flow +0 -22
  202. package/lib/_types/notes.js.flow +0 -7
  203. package/lib/_types/products.js.flow +0 -40
  204. package/lib/_types/professional-categories.js.flow +0 -25
  205. package/lib/_types/specialties.js.flow +0 -27
  206. package/lib/_types/subscriptions.js.flow +0 -58
  207. package/lib/index.js.flow +0 -438
  208. package/lib/resources/accounts.js.flow +0 -445
  209. package/lib/resources/actions.js.flow +0 -25
  210. package/lib/resources/api-keys.js.flow +0 -54
  211. package/lib/resources/applications.js.flow +0 -60
  212. package/lib/resources/attachments.js.flow +0 -75
  213. package/lib/resources/auth.js.flow +0 -185
  214. package/lib/resources/bulk-submits.js.flow +0 -43
  215. package/lib/resources/bulk-uploads.js.flow +0 -56
  216. package/lib/resources/business-profiles.js.flow +0 -45
  217. package/lib/resources/businesses.js.flow +0 -267
  218. package/lib/resources/claim-items.js.flow +0 -76
  219. package/lib/resources/devices.js.flow +0 -64
  220. package/lib/resources/doc-accounts.js.flow +0 -61
  221. package/lib/resources/documents.js.flow +0 -216
  222. package/lib/resources/emails.js.flow +0 -96
  223. package/lib/resources/form-application-templates.js.flow +0 -52
  224. package/lib/resources/form-applications.js.flow +0 -62
  225. package/lib/resources/forms.js.flow +0 -222
  226. package/lib/resources/funder-services.js.flow +0 -17
  227. package/lib/resources/funder-settings.js.flow +0 -58
  228. package/lib/resources/funders.js.flow +0 -15
  229. package/lib/resources/futures.js.flow +0 -154
  230. package/lib/resources/health-fund-accounts.js.flow +0 -198
  231. package/lib/resources/health-fund-settings.js.flow +0 -104
  232. package/lib/resources/healthfunds.js.flow +0 -139
  233. package/lib/resources/icditems.js.flow +0 -36
  234. package/lib/resources/invoice-scans.js.flow +0 -56
  235. package/lib/resources/jhcs.js.flow +0 -20
  236. package/lib/resources/kyc.js.flow +0 -216
  237. package/lib/resources/logs.js.flow +0 -32
  238. package/lib/resources/members.js.flow +0 -196
  239. package/lib/resources/message-mappings.js.flow +0 -25
  240. package/lib/resources/minions.js.flow +0 -96
  241. package/lib/resources/modalities.js.flow +0 -46
  242. package/lib/resources/notes.js.flow +0 -112
  243. package/lib/resources/onboarding-applications.js.flow +0 -142
  244. package/lib/resources/onboarding-requests.js.flow +0 -97
  245. package/lib/resources/ops.js.flow +0 -116
  246. package/lib/resources/organisations.js.flow +0 -15
  247. package/lib/resources/partners.js.flow +0 -118
  248. package/lib/resources/patients.js.flow +0 -102
  249. package/lib/resources/payments.js.flow +0 -523
  250. package/lib/resources/pms.js.flow +0 -102
  251. package/lib/resources/practice-profiles.js.flow +0 -51
  252. package/lib/resources/practice-types.js.flow +0 -14
  253. package/lib/resources/practices.js.flow +0 -314
  254. package/lib/resources/products.js.flow +0 -48
  255. package/lib/resources/professional-categories.js.flow +0 -56
  256. package/lib/resources/provider-number-types.js.flow +0 -32
  257. package/lib/resources/provider-registration-types.js.flow +0 -32
  258. package/lib/resources/provider-requests.js.flow +0 -46
  259. package/lib/resources/provider-types.js.flow +0 -14
  260. package/lib/resources/ref-sources.js.flow +0 -16
  261. package/lib/resources/risk.js.flow +0 -29
  262. package/lib/resources/rnas.js.flow +0 -108
  263. package/lib/resources/roles.js.flow +0 -12
  264. package/lib/resources/self-checkout-sessions.js.flow +0 -382
  265. package/lib/resources/services.js.flow +0 -219
  266. package/lib/resources/settlements.js.flow +0 -97
  267. package/lib/resources/sign-up.js.flow +0 -15
  268. package/lib/resources/specialties.js.flow +0 -46
  269. package/lib/resources/staff-profiles.js.flow +0 -51
  270. package/lib/resources/staff.js.flow +0 -583
  271. package/lib/resources/statistics.js.flow +0 -147
  272. package/lib/resources/subscriptions.js.flow +0 -81
  273. package/lib/resources/terminals.js.flow +0 -161
  274. package/lib/resources/transaction-export.js.flow +0 -48
  275. package/lib/resources/transactions.js.flow +0 -1097
  276. package/lib/resources/triggers.js.flow +0 -36
  277. package/lib/resources/vendors.js.flow +0 -28
  278. package/lib/resources/verify.js.flow +0 -14
  279. package/lib/resources/workers.js.flow +0 -10
  280. package/lib/resources/workflow-exceptions.js.flow +0 -17
  281. package/lib/services/__mocks__/storage.js.flow +0 -30
  282. package/lib/services/aws.js.flow +0 -339
  283. package/lib/services/storage.js.flow +0 -92
  284. package/lib/services/version.js.flow +0 -73
  285. package/lib/storage-16fd26f8.js +0 -1268
  286. package/lib/utils/application.js.flow +0 -23
  287. package/lib/utils/base-urls/core.js.flow +0 -18
  288. package/lib/utils/base-urls/index.js.flow +0 -7
  289. package/lib/utils/base-urls/risk.js.flow +0 -16
  290. package/lib/utils/does-param-exist.js.flow +0 -23
  291. package/lib/utils/get-axios-error.js.flow +0 -8
  292. package/lib/utils/param-error.js.flow +0 -8
  293. package/lib/utils/professions.js.flow +0 -66
  294. package/lib/utils/regions.js.flow +0 -21
  295. package/lib/utils/request.js.flow +0 -36
  296. package/lib/utils/staff.js.flow +0 -81
@@ -1,222 +0,0 @@
1
- // @flow
2
- import doesParamExist from '../utils/does-param-exist';
3
- import request from '../utils/request';
4
- import type {
5
- ApplyForBusinessFormRequestBody,
6
- CreateHealthFundFormRequestBody,
7
- GetHealthFundFormsQuery,
8
- GetHealthFundFormUploadUrlQuery,
9
- MedipassRequestOpts,
10
- UpdateHealthFundFormRequestBody
11
- } from '../_types';
12
-
13
- export const pathBusinessForm = (businessId: string, formId: string) => `/businesses/${businessId}/forms/${formId}`;
14
- export const pathBusinessFormApplications = (businessId: string, formId: string) =>
15
- `/businesses/${businessId}/forms/${formId}/formapplications`;
16
- export const pathHealthFundForm = (healthFundId: string, formId: string) =>
17
- `/healthfunds/${healthFundId}/forms/${formId}`;
18
- export const pathHealthFundFormPublish = (healthFundId: string, formId: string) =>
19
- `/healthfunds/${healthFundId}/forms/${formId}/publish`;
20
- export const pathHealthFundFormUnpublish = (healthFundId: string, formId: string) =>
21
- `/healthfunds/${healthFundId}/forms/${formId}/unpublish`;
22
- export const pathHealthFundForms = (healthFundId: string) => `/healthfunds/${healthFundId}/forms`;
23
- export const pathHealthFundFormUploadUrl = (healthFundId: string) => `/healthfunds/${healthFundId}/forms/uploadurlv2`;
24
- export const pathGetLatestApprovedDocument = (businessId: string, practiceId: string, formId: string) =>
25
- `/businesses/${businessId}/practices/${practiceId}/forms/${formId}/latestapproved`;
26
- export const pathGetManualFormUploadUrl = (businessId: string, practiceId: string, formId: string) =>
27
- `/businesses/${businessId}/practices/${practiceId}/forms/${formId}/uploadurlv2`;
28
-
29
- /**
30
- * Apply for a business form
31
- * @param {String} healthFundId - Health fund ID
32
- * @param {String} formId - Form ID
33
- * @param {Object} body - Request body
34
- * @param {Object} opts - Additional options
35
- */
36
- export const applyForBusinessForm = (
37
- businessId: string,
38
- formId: string,
39
- body: ApplyForBusinessFormRequestBody,
40
- opts?: MedipassRequestOpts = {}
41
- ): Promise<Object> => {
42
- doesParamExist({ businessId, formId }, opts.hyperMediaEndpoint);
43
- return request({ ...opts, path: pathBusinessFormApplications(businessId, formId) }, { method: 'post', data: body });
44
- };
45
-
46
- /**
47
- * Create health fund form
48
- * @param {String} healthFundId - Health fund ID
49
- * @param {Object} body - Request body
50
- * @param {Object} opts - Additional options
51
- */
52
- export const createHealthFundForm = (
53
- healthFundId: string,
54
- body: CreateHealthFundFormRequestBody,
55
- opts?: MedipassRequestOpts = {}
56
- ): Promise<Object> => {
57
- doesParamExist({ healthFundId }, opts.hyperMediaEndpoint);
58
- return request({ ...opts, path: pathHealthFundForms(healthFundId) }, { method: 'post', data: body });
59
- };
60
-
61
- /**
62
- * Delete health fund form
63
- * @param {String} healthFundId - Health fund ID
64
- * @param {String} formId - Form ID
65
- * @param {Object} opts - Additional options
66
- */
67
- export const deleteHealthFundForm = (
68
- healthFundId: string,
69
- formId: string,
70
- opts?: MedipassRequestOpts = {}
71
- ): Promise<Object> => {
72
- doesParamExist({ healthFundId, formId }, opts.hyperMediaEndpoint);
73
- return request({ ...opts, path: pathHealthFundForm(healthFundId, formId) }, { method: 'delete' });
74
- };
75
-
76
- /**
77
- * Get business form
78
- * @param {String} businessId - Business ID
79
- * @param {String} formId - Form ID
80
- * @param {Object} query - Query parameters
81
- * @param {Object} opts - Additional options
82
- */
83
- export const getBusinessForm = (
84
- businessId: string,
85
- formId: string,
86
- opts?: MedipassRequestOpts = {}
87
- ): Promise<Object> => {
88
- doesParamExist({ businessId, formId }, opts.hyperMediaEndpoint);
89
- return request({ ...opts, path: pathBusinessForm(businessId, formId) }, { method: 'get' });
90
- };
91
-
92
- /**
93
- * Get health fund forms
94
- * @param {String} healthFundId - Health fund ID
95
- * @param {Object} query - Query parameters
96
- * @param {Object} opts - Additional options
97
- */
98
- export const getHealthFundForms = (
99
- healthFundId: string,
100
- query?: GetHealthFundFormsQuery = {},
101
- opts?: MedipassRequestOpts = {}
102
- ): Promise<Object> => {
103
- doesParamExist({ healthFundId }, opts.hyperMediaEndpoint);
104
- return request({ ...opts, path: pathHealthFundForms(healthFundId) }, { method: 'get', params: query });
105
- };
106
-
107
- /**
108
- * Get health fund form
109
- * @param {String} healthFundId - Health fund ID
110
- * @param {String} formId - Form ID
111
- * @param {Object} opts - Additional options
112
- */
113
- export const getHealthFundForm = (
114
- healthFundId: string,
115
- formId: string,
116
- opts?: MedipassRequestOpts = {}
117
- ): Promise<Object> => {
118
- doesParamExist({ healthFundId, formId }, opts.hyperMediaEndpoint);
119
- return request({ ...opts, path: pathHealthFundForm(healthFundId, formId) }, { method: 'get' });
120
- };
121
-
122
- /**
123
- * Get health fund form
124
- * @param {String} healthFundId - Health fund ID
125
- * @param {String} formId - Form ID
126
- * @param {Object} opts - Additional options
127
- */
128
- export const getHealthFundFormUploadUrl = (
129
- healthFundId: string,
130
- query: GetHealthFundFormUploadUrlQuery,
131
- opts?: MedipassRequestOpts = {}
132
- ): Promise<Object> => {
133
- const { contentType, fileName } = query;
134
- doesParamExist({ healthFundId, contentType, fileName }, opts.hyperMediaEndpoint);
135
- return request({ ...opts, path: pathHealthFundFormUploadUrl(healthFundId) }, { method: 'get', params: query });
136
- };
137
-
138
- /**
139
- * Publish a health fund form
140
- * @param {String} healthFundId - Health fund ID
141
- * @param {String} formId - Form ID
142
- * @param {Object} opts - Additional options
143
- */
144
- export const publishHealthFundForm = (
145
- healthFundId: string,
146
- formId: string,
147
- opts?: MedipassRequestOpts = {}
148
- ): Promise<Object> => {
149
- doesParamExist({ healthFundId, formId }, opts.hyperMediaEndpoint);
150
- return request({ ...opts, path: pathHealthFundFormPublish(healthFundId, formId) }, { method: 'post' });
151
- };
152
-
153
- /**
154
- * Update health fund form
155
- * @param {String} healthFundId - Health fund ID
156
- * @param {String} formId - Form ID
157
- * @param {Object} body - Request body
158
- * @param {Object} opts - Additional options
159
- */
160
- export const updateHealthFundForm = (
161
- healthFundId: string,
162
- formId: string,
163
- body: UpdateHealthFundFormRequestBody,
164
- opts?: MedipassRequestOpts = {}
165
- ): Promise<Object> => {
166
- doesParamExist({ healthFundId, formId }, opts.hyperMediaEndpoint);
167
- return request({ ...opts, path: pathHealthFundForm(healthFundId, formId) }, { method: 'put', data: body });
168
- };
169
-
170
- /**
171
- * Unpublish a health fund form
172
- * @param {String} healthFundId - Health fund ID
173
- * @param {String} formId - Form ID
174
- * @param {Object} opts - Additional options
175
- */
176
- export const unpublishHealthFundForm = (
177
- healthFundId: string,
178
- formId: string,
179
- opts?: MedipassRequestOpts = {}
180
- ): Promise<Object> => {
181
- doesParamExist({ healthFundId, formId }, opts.hyperMediaEndpoint);
182
- return request({ ...opts, path: pathHealthFundFormUnpublish(healthFundId, formId) }, { method: 'post' });
183
- };
184
-
185
- /**
186
- * Get latest approved document
187
- * @param {String} businessId - business ID
188
- * @param {String} practiceId - practice ID
189
- * @param {String} formId - Form ID
190
- * @param {Object} opts - Additional options
191
- */
192
- export const getLatestApprovedDocument = (
193
- businessId: string,
194
- practiceId: string,
195
- formId: string,
196
- opts?: MedipassRequestOpts = {}
197
- ): Promise<Object> => {
198
- doesParamExist({ businessId, practiceId, formId }, opts.hyperMediaEndpoint);
199
- return request({ ...opts, path: pathGetLatestApprovedDocument(businessId, practiceId, formId) }, { method: 'get' });
200
- };
201
-
202
- /**
203
- * Get url to upload a file associated to a manual form
204
- * @param {String} businessId - business ID
205
- * @param {String} practiceId - practice ID
206
- * @param {String} formId - Form ID
207
- * @param {Object} body - Request body
208
- * @param {Object} opts - Additional options
209
- */
210
- export const getManualFormUploadUrl = (
211
- businessId: string,
212
- practiceId: string,
213
- formId: string,
214
- query: Object,
215
- opts?: MedipassRequestOpts = {}
216
- ): Promise<Object> => {
217
- doesParamExist({ businessId, practiceId, formId }, opts.hyperMediaEndpoint);
218
- return request(
219
- { ...opts, path: pathGetManualFormUploadUrl(businessId, practiceId, formId) },
220
- { method: 'get', params: query }
221
- );
222
- };
@@ -1,17 +0,0 @@
1
- // @flow
2
-
3
- import doesParamExist from '../utils/does-param-exist';
4
- import request from '../utils/request';
5
- import type { MedipassRequestOpts } from '../_types';
6
-
7
- export const pathVerifyEclipse = () => `/eclipse/opvw`;
8
-
9
- /**
10
- * Verifies Eclipse patient
11
- * @param {Object} body - Request body
12
- * @param {Object} opts - Additional options
13
- */
14
- export const verifyEclipse = (body: Object, opts?: MedipassRequestOpts = {}): Promise<Array<Object>> => {
15
- doesParamExist({ body }, opts.hyperMediaEndpoint);
16
- return request({ ...opts, path: pathVerifyEclipse() }, { method: 'post', data: body });
17
- };
@@ -1,58 +0,0 @@
1
- // @flow
2
-
3
- import doesParamExist from '../utils/does-param-exist';
4
- import request from '../utils/request';
5
- import type { MedipassRequestOpts } from '../_types';
6
-
7
- export const pathFunderSettings = (businessId: string) => `/businesses/${businessId}/fundersettings`;
8
- export const pathFunderSettingsById = (businessId: string, funderSettingsId: string) =>
9
- `/businesses/${businessId}/fundersettings/${funderSettingsId}`;
10
-
11
- export const getBusinessFunderSettings = (
12
- businessId: string,
13
- query?: Object = {},
14
- opts?: MedipassRequestOpts = {}
15
- ): Promise<Array<Object>> => {
16
- doesParamExist({ businessId }, opts.hyperMediaEndpoint);
17
- return request({ ...opts, path: pathFunderSettings(businessId) }, { method: 'get', params: query });
18
- };
19
-
20
- export const getBusinesFunderSettingsById = (
21
- businessId: string,
22
- funderSettingsId: string,
23
- opts?: MedipassRequestOpts = {}
24
- ): Promise<Array<Object>> => {
25
- doesParamExist({ businessId, funderSettingsId }, opts.hyperMediaEndpoint);
26
- return request({ ...opts, path: pathFunderSettingsById(businessId, funderSettingsId) }, { method: 'get' });
27
- };
28
-
29
- export const updateBusinesFunderSettings = (
30
- businessId: string,
31
- funderSettingsId: string,
32
- body: Object,
33
- opts?: MedipassRequestOpts = {}
34
- ): Promise<Array<Object>> => {
35
- doesParamExist({ businessId, funderSettingsId }, opts.hyperMediaEndpoint);
36
- return request(
37
- { ...opts, path: pathFunderSettingsById(businessId, funderSettingsId) },
38
- { method: 'put', data: body }
39
- );
40
- };
41
-
42
- export const createBusinesFunderSettings = (
43
- businessId: string,
44
- body: Object,
45
- opts?: MedipassRequestOpts = {}
46
- ): Promise<Array<Object>> => {
47
- doesParamExist({ businessId }, opts.hyperMediaEndpoint);
48
- return request({ ...opts, path: pathFunderSettings(businessId) }, { method: 'post', data: body });
49
- };
50
-
51
- export const deleteBusinesFunderSettings = (
52
- businessId: string,
53
- funderSettingsId: string,
54
- opts?: MedipassRequestOpts = {}
55
- ): Promise<Array<Object>> => {
56
- doesParamExist({ businessId, funderSettingsId }, opts.hyperMediaEndpoint);
57
- return request({ ...opts, path: pathFunderSettingsById(businessId, funderSettingsId) }, { method: 'delete' });
58
- };
@@ -1,15 +0,0 @@
1
- // @flow
2
-
3
- import request from '../utils/request';
4
- import type { MedipassRequestOpts } from '../_types';
5
-
6
- export const PATH__FUNDERS = '/funders';
7
- export const pathFunder = (funderId: string) => `/funders/${funderId}`;
8
-
9
- export const getFunders = (opts?: MedipassRequestOpts = {}): Promise<Array<Object>> => {
10
- return request({ ...opts, path: PATH__FUNDERS }, { method: 'get' });
11
- };
12
-
13
- export const getFunder = (funderId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
14
- return request({ ...opts, path: pathFunder(funderId) }, { method: 'get' });
15
- };
@@ -1,154 +0,0 @@
1
- // @flow
2
-
3
- import doesParamExist from '../utils/does-param-exist';
4
- import request from '../utils/request';
5
- import type { MedipassRequestOpts } from '../_types';
6
-
7
- export const pathBusinessFutures = (businessId: string) => `/businesses/${businessId}/futures`;
8
- export const pathBusinessFuture = (businessId: string, futureId: string) =>
9
- `/businesses/${businessId}/futures/${futureId}`;
10
- export const pathBusinessHolds = (businessId: string) => `/businesses/${businessId}/futures/holds`;
11
- export const pathBusinessInstalmentPlans = (businessId: string) => `/businesses/${businessId}/futures/instalmentplans`;
12
- export const pathFuture = (futureId: string) => `/futures/${futureId}`;
13
- export const pathProcessingRequests = (futureId: string) => `/futures/${futureId}/processingrequests`;
14
- export const pathPaymentLink = (futureId: string) => `/futures/${futureId}/paymentlink`;
15
- export const pathCancels = (futureId: string) => `/futures/${futureId}/cancels`;
16
- export const pathSubmits = (futureId: string) => `/futures/${futureId}/submits`;
17
- export const pathSendReceipt = (futureId: string) => `/futures/${futureId}/sendreceipts`;
18
- /**
19
- * Create business hold
20
- * @param {String} businessId - Business ID
21
- * @param {Object} body - Request body
22
- * @param {Object} opts - Additional options
23
- */
24
- export const createBusinessHold = (
25
- businessId: string,
26
- body: Object,
27
- opts?: MedipassRequestOpts = {}
28
- ): Promise<Object> => {
29
- doesParamExist({ businessId }, opts.hyperMediaEndpoint);
30
- return request({ ...opts, path: pathBusinessHolds(businessId) }, { method: 'post', data: body });
31
- };
32
-
33
- /**
34
- * Create business instalment plan
35
- * @param {String} businessId - Business ID
36
- * @param {Object} body - Request body
37
- * @param {Object} opts - Additional options
38
- */
39
- export const createBusinessInstalmentPlan = (
40
- businessId: string,
41
- body: Object,
42
- opts?: MedipassRequestOpts = {}
43
- ): Promise<Object> => {
44
- doesParamExist({ businessId }, opts.hyperMediaEndpoint);
45
- return request({ ...opts, path: pathBusinessInstalmentPlans(businessId) }, { method: 'post', data: body });
46
- };
47
-
48
- /**
49
- * Cancel a future
50
- * @param {String} futureId - Future ID
51
- * @param {Object} opts - Additional options
52
- */
53
- export const cancel = (futureId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
54
- doesParamExist({ futureId }, opts.hyperMediaEndpoint);
55
- return request({ ...opts, path: pathCancels(futureId) }, { method: 'post' });
56
- };
57
-
58
- /**
59
- * Get business futures
60
- * @param {String} businessId - Business ID
61
- * @param {Object} query - Request query
62
- * @param {Object} opts - Additional options
63
- */
64
- export const getBusinessFutures = (
65
- businessId: string,
66
- query?: Object,
67
- opts?: MedipassRequestOpts = {}
68
- ): Promise<Object> => {
69
- doesParamExist({ businessId }, opts.hyperMediaEndpoint);
70
- return request({ ...opts, path: pathBusinessFutures(businessId) }, { method: 'get', params: query });
71
- };
72
-
73
- /**
74
- * Get business future
75
- * @param {String} businessId - Business ID
76
- * @param {String} futureId - Future ID
77
- * @param {Object} opts - Additional options
78
- */
79
- export const getBusinessFuture = (
80
- businessId: string,
81
- futureId: string,
82
- opts?: MedipassRequestOpts = {}
83
- ): Promise<Object> => {
84
- doesParamExist({ businessId, futureId }, opts.hyperMediaEndpoint);
85
- return request({ ...opts, path: pathBusinessFuture(businessId, futureId) }, { method: 'get' });
86
- };
87
-
88
- /**
89
- * Get a future
90
- * @param {String} futureId - Future ID
91
- * @param {Object} opts - Additional options
92
- */
93
- export const getFuture = (futureId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
94
- doesParamExist({ futureId }, opts.hyperMediaEndpoint);
95
- return request({ ...opts, path: pathFuture(futureId) }, { method: 'get' });
96
- };
97
-
98
- /**
99
- * Get payment link
100
- * @param {String} futureId - Future ID
101
- * @param {Object} opts - Additional options
102
- */
103
- export const getPaymentLink = async (futureId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
104
- doesParamExist({ futureId }, opts.hyperMediaEndpoint);
105
- return request({ ...opts, path: pathPaymentLink(futureId) }, { method: 'get' });
106
- };
107
-
108
- /**
109
- * Send processing request
110
- * @param {String} futureId - Future ID
111
- * @param {Object} body - Request body
112
- * @param {Object} opts - Additional options
113
- */
114
- export const sendProcessingRequest = (
115
- futureId: string,
116
- body: Object,
117
- opts?: MedipassRequestOpts = {}
118
- ): Promise<Object> => {
119
- doesParamExist({ futureId }, opts.hyperMediaEndpoint);
120
- return request({ ...opts, path: pathProcessingRequests(futureId) }, { method: 'post', data: body });
121
- };
122
-
123
- /**
124
- * Submit a future
125
- * @param {String} futureId - Future ID
126
- * @param {Object} body - Request body
127
- * @param {Object} opts - Additional options
128
- */
129
- export const submit = (futureId: string, body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
130
- doesParamExist({ futureId }, opts.hyperMediaEndpoint);
131
- return request({ ...opts, path: pathSubmits(futureId) }, { method: 'post', data: body });
132
- };
133
-
134
- /**
135
- * Update a future
136
- * @param {String} futureId - Future ID
137
- * @param {Object} body - Request body
138
- * @param {Object} opts - Additional options
139
- */
140
- export const update = (futureId: string, body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
141
- doesParamExist({ futureId }, opts.hyperMediaEndpoint);
142
- return request({ ...opts, path: pathFuture(futureId) }, { method: 'put', data: body });
143
- };
144
-
145
- /**
146
- * Send a payment receipt for a future
147
- * @param {String} futureId - Future ID
148
- * @param {Object} body - Request body
149
- * @param {Object} opts - Additional options
150
- */
151
- export const sendReceipt = (futureId: string, body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
152
- doesParamExist({ futureId }, opts.hyperMediaEndpoint);
153
- return request({ ...opts, path: pathSendReceipt(futureId) }, { method: 'post', data: body });
154
- };
@@ -1,198 +0,0 @@
1
- // @flow
2
-
3
- import doesParamExist from '../utils/does-param-exist';
4
- import request from '../utils/request';
5
- import type { MedipassRequestOpts } from '../_types';
6
-
7
- const pathBusinessPatientHealthFundAccounts = (businessId, patientId) =>
8
- `/businesses/${businessId}/patients/${patientId}/healthfundaccounts`;
9
- const pathBusinessPatientHealthFundAccount = (businessId, patientId, healthFundAccountId) =>
10
- `/businesses/${businessId}/patients/${patientId}/healthfundaccounts/${healthFundAccountId}`;
11
- const pathMemberHealthFundAccounts = memberId => `/members/${memberId}/healthfundaccounts`;
12
- const pathMemberHealthFundAccount = (memberId, healthFundAccountId) =>
13
- `/members/${memberId}/healthfundaccounts/${healthFundAccountId}`;
14
-
15
- /**
16
- * Create a member's health fund account
17
- * @param {String} memberId - Member ID
18
- * @param {Object} body - Request body
19
- * @param {Object} opts - Additional options
20
- */
21
- export const createMembersHealthFundAccount = async (
22
- memberId: string,
23
- body: Object,
24
- opts?: MedipassRequestOpts = {}
25
- ): Promise<Object> => {
26
- doesParamExist({ memberId }, opts.hyperMediaEndpoint);
27
- return request({ ...opts, path: `${pathMemberHealthFundAccounts(memberId)}` }, { method: 'post', data: body });
28
- };
29
-
30
- /**
31
- * Create a business patient health fund account
32
- * @param {String} businessId - Business ID
33
- * @param {String} patientId - Patient ID
34
- * @param {Object} body - Request body
35
- * @param {Object} opts - Additional options
36
- */
37
- export const createBusinessPatientHealthFundAccount = async (
38
- businessId: string,
39
- patientId: string,
40
- body: Object,
41
- opts?: MedipassRequestOpts = {}
42
- ): Promise<Object> => {
43
- doesParamExist({ businessId, patientId }, opts.hyperMediaEndpoint);
44
- return request(
45
- { ...opts, path: `${pathBusinessPatientHealthFundAccounts(businessId, patientId)}` },
46
- { method: 'post', data: body }
47
- );
48
- };
49
-
50
- /**
51
- * Delete a member's health fund account
52
- * @param {String} memberId - Member ID
53
- * @param {String} healthFundAccountId - healthFundAccountId
54
- * @param {Object} opts - Additional options
55
- */
56
- export const deleteMembersHealthFundAccount = async (
57
- memberId: string,
58
- healthFundAccountId: string,
59
- opts?: MedipassRequestOpts = {}
60
- ): Promise<Object> => {
61
- doesParamExist({ memberId, healthFundAccountId }, opts.hyperMediaEndpoint);
62
- return request(
63
- { ...opts, path: `${pathMemberHealthFundAccounts(memberId)}/${healthFundAccountId}` },
64
- { method: 'delete' }
65
- );
66
- };
67
-
68
- /**
69
- * Delete a business patient's health fund account
70
- * @param {String} businessId - Business ID
71
- * @param {String} patientId - Patient ID
72
- * @param {String} healthFundAccountId - healthFundAccountId
73
- * @param {Object} opts - Additional options
74
- */
75
- export const deleteBusinessPatientHealthFundAccount = async (
76
- businessId: string,
77
- patientId: string,
78
- healthFundAccountId: string,
79
- opts?: MedipassRequestOpts = {}
80
- ): Promise<Object> => {
81
- doesParamExist({ businessId, patientId, healthFundAccountId }, opts.hyperMediaEndpoint);
82
- return request(
83
- { ...opts, path: `${pathBusinessPatientHealthFundAccount(businessId, patientId, healthFundAccountId)}` },
84
- { method: 'delete' }
85
- );
86
- };
87
-
88
- /**
89
- * Get a member's health fund accounts
90
- * @param {String} memberId - Member ID
91
- * @param {Object} query - Query parameters
92
- * @param {Object} opts - Additional options
93
- */
94
- export const getMembersHealthFundAccounts = async (
95
- memberId: string,
96
- query?: Object,
97
- opts?: MedipassRequestOpts = {}
98
- ): Promise<Object> => {
99
- doesParamExist({ memberId }, opts.hyperMediaEndpoint);
100
- return request({ ...opts, path: pathMemberHealthFundAccounts(memberId) }, { method: 'get', params: query });
101
- };
102
-
103
- /**
104
- * Get a business patient's health fund accounts
105
- * @param {String} businessId - Business ID
106
- * @param {String} patientId - Patient ID
107
- * @param {Object} query - Query parameters
108
- * @param {Object} opts - Additional options
109
- */
110
- export const getBusinessPatientHealthFundAccounts = async (
111
- businessId: string,
112
- patientId: string,
113
- query?: Object,
114
- opts?: MedipassRequestOpts = {}
115
- ): Promise<Object> => {
116
- doesParamExist({ businessId, patientId }, opts.hyperMediaEndpoint);
117
- return request(
118
- { ...opts, path: pathBusinessPatientHealthFundAccounts(businessId, patientId) },
119
- { method: 'get', params: query }
120
- );
121
- };
122
-
123
- /**
124
- * Get a member's health fund account
125
- * @param {String} memberId - Member ID
126
- * @param {String} healthFundAccount - Health fund account ID
127
- * @param {Object} opts - Additional options
128
- */
129
- export const getMembersHealthFundAccount = async (
130
- memberId: string,
131
- healthFundAccountId: string,
132
- opts?: MedipassRequestOpts = {}
133
- ): Promise<Object> => {
134
- doesParamExist({ memberId, healthFundAccountId }, opts.hyperMediaEndpoint);
135
- return request({ ...opts, path: pathMemberHealthFundAccount(memberId, healthFundAccountId) }, { method: 'get' });
136
- };
137
-
138
- /**
139
- * Get a business patient's health fund account
140
- * @param {String} businessId - Business ID
141
- * @param {String} patientId - Patient ID
142
- * @param {String} healthFundAccount - Health fund account ID
143
- * @param {Object} opts - Additional options
144
- */
145
- export const getBusinessPatientHealthFundAccount = async (
146
- businessId: string,
147
- patientId: string,
148
- healthFundAccountId: string,
149
- opts?: MedipassRequestOpts = {}
150
- ): Promise<Object> => {
151
- doesParamExist({ businessId, patientId, healthFundAccountId }, opts.hyperMediaEndpoint);
152
- return request(
153
- { ...opts, path: pathBusinessPatientHealthFundAccount(businessId, patientId, healthFundAccountId) },
154
- { method: 'get' }
155
- );
156
- };
157
-
158
- /**
159
- * Update a member's health fund account
160
- * @param {String} memberId - Member ID
161
- * @param {String} healthFundAccountId - healthFundAccountId
162
- * @param {Object} body - Request body
163
- * @param {Object} opts - Additional options
164
- */
165
- export const updateMembersHealthFundAccounts = async (
166
- memberId: string,
167
- healthFundAccountId: string,
168
- body: Object,
169
- opts?: MedipassRequestOpts = {}
170
- ): Promise<Object> => {
171
- doesParamExist({ memberId, healthFundAccountId }, opts.hyperMediaEndpoint);
172
- return request(
173
- { ...opts, path: `${pathMemberHealthFundAccounts(memberId)}/${healthFundAccountId}` },
174
- { method: 'put', data: body }
175
- );
176
- };
177
-
178
- /**
179
- * Update a business patients's health fund account
180
- * @param {String} businessId - Business ID
181
- * @param {String} patientId - Patient ID
182
- * @param {String} healthFundAccountId - healthFundAccountId
183
- * @param {Object} body - Request body
184
- * @param {Object} opts - Additional options
185
- */
186
- export const updateBusinessPatientHealthFundAccount = async (
187
- businessId: string,
188
- patientId: string,
189
- healthFundAccountId: string,
190
- body: Object,
191
- opts?: MedipassRequestOpts = {}
192
- ): Promise<Object> => {
193
- doesParamExist({ businessId, patientId, healthFundAccountId }, opts.hyperMediaEndpoint);
194
- return request(
195
- { ...opts, path: `${pathBusinessPatientHealthFundAccount(businessId, patientId, healthFundAccountId)}` },
196
- { method: 'put', data: body }
197
- );
198
- };