@medipass/web-sdk 11.38.1-feature-eclipse-reporting.0 → 11.38.1-feature-typescript-claudia.2

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 +96 -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-7b23080d.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-1ec3d500.js → staff-96febcd8.js} +345 -738
  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-4b403caa.js +0 -1300
  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,445 +0,0 @@
1
- // @flow
2
- import _get from 'lodash/get';
3
- import sdk from '../index';
4
- import doesParamExist from '../utils/does-param-exist';
5
- import request from '../utils/request';
6
- import type { MedipassRequestOpts } from '../_types';
7
-
8
- const PATH__ACCOUNTS = '/accounts';
9
- const pathAccountsByAccountId = accountId => `/accounts/${accountId}`;
10
- const pathAccountExists = () => `/accounts/exists`;
11
- const pathAccountRolesByAccountId = accountId => `/accounts/${accountId}/roles`;
12
- const pathAccountSecretKeysByAccountId = accountId => `/accounts/${accountId}/secretkeys`;
13
- const pathAccountSecretKey = (accountId, secretKey) => `/accounts/${accountId}/secretkeys/${secretKey}`;
14
- const pathAccountTransactions = accountId => `/accounts/${accountId}/transactions`;
15
- const pathBusinessStaffAccount = (businessId, staffId) => `/businesses/${businessId}/staff/${staffId}/account`;
16
- const pathChangePassword = () => `/accounts/changepassword`;
17
- const pathEnableAccount = accountId => `/accounts/${accountId}/enable`;
18
- const pathDisableAccount = accountId => `/accounts/${accountId}/disable`;
19
- const pathRequestVerifyAccount = accountId => `/accounts/${accountId}/verify/request`;
20
- const pathHealthFundAccounts = healthFundId => `/healthfunds/${healthFundId}/accounts`;
21
- const pathHealthFundAccount = (healthFundId, accountId) => `/healthfunds/${healthFundId}/accounts/${accountId}`;
22
- const pathOrganisationAccounts = organisationId => `/organisations/${organisationId}/accounts`;
23
- const pathAccountPractices = accountId => `/accounts/${accountId}/practices`;
24
- const PATH__ACCEPT_ACCOUNT_INVITE = '/accounts/invites/accept';
25
- const PATH__REQUEST_ACCOUNT_RESET = '/accounts/reset/request';
26
- const PATH__REQUEST_PASSWORD_RESET = '/accounts/reset/password/request';
27
- const PATH__REQUEST_MOBILE_RESET = '/accounts/reset/mobile/request';
28
- const PATH__ACCOUNT_RESET = '/accounts/reset';
29
- const PATH__ACCOUNT_PASSWORD_RESET = '/accounts/reset/password';
30
- const PATH__ACCOUNT_MOBILE_RESET = '/accounts/reset/mobile';
31
- const PATH__ACCOUNT_VERIFY = '/accounts/verify';
32
- const PATH__SIGN_UP = '/signup';
33
-
34
- /**
35
- * Create account secret key
36
- * @param {String} accountId - Account ID
37
- * @param {Object} opts - Additional options
38
- */
39
- export const createAccountSecretKey = async (accountId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
40
- doesParamExist({ accountId }, opts.hyperMediaEndpoint);
41
- return request({ ...opts, path: pathAccountSecretKeysByAccountId(accountId) }, { method: 'post' });
42
- };
43
-
44
- /**
45
- * Create organisation account
46
- * @param {String} organisationId - Organisation ID
47
- * @param {Object} body - Response body
48
- * @param {Object} opts - Additional options
49
- */
50
- export const createOrganisationAccount = async (
51
- organisationId: string,
52
- body: Object,
53
- opts?: MedipassRequestOpts = {}
54
- ): Promise<Object> => {
55
- doesParamExist({ organisationId }, opts.hyperMediaEndpoint);
56
- return request({ ...opts, path: pathOrganisationAccounts(organisationId) }, { method: 'post', data: body });
57
- };
58
-
59
- /**
60
- * Delete account secret key
61
- * @param {String} accountId - Account ID
62
- * @param {String} secretKey - Secret Key
63
- * @param {Object} opts - Additional options
64
- */
65
- export const deleteAccountSecretKey = async (
66
- accountId: string,
67
- secretKey: string,
68
- opts?: MedipassRequestOpts = {}
69
- ): Promise<Object> => {
70
- doesParamExist({ accountId, secretKey }, opts.hyperMediaEndpoint);
71
- return request({ ...opts, path: pathAccountSecretKey(accountId, secretKey) }, { method: 'delete' });
72
- };
73
-
74
- /**
75
- * Delete account
76
- * @param {String} accountId - Account ID
77
- * @param {Object} opts - Additional options
78
- */
79
- export const deleteAccount = async (accountId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
80
- doesParamExist({ accountId }, opts.hyperMediaEndpoint);
81
- return request({ ...opts, path: pathAccountsByAccountId(accountId) }, { method: 'delete' });
82
- };
83
-
84
- /**
85
- * Disable account
86
- * @param {String} accountId - Account ID
87
- * @param {Object} opts - Additional options
88
- */
89
- export const disableAccount = async (accountId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
90
- doesParamExist({ accountId }, opts.hyperMediaEndpoint);
91
- return request({ ...opts, path: pathDisableAccount(accountId) }, { method: 'put' });
92
- };
93
-
94
- /**
95
- * Enable account
96
- * @param {String} accountId - Account ID
97
- * @param {Object} opts - Additional options
98
- */
99
- export const enableAccount = async (accountId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
100
- doesParamExist({ accountId }, opts.hyperMediaEndpoint);
101
- return request({ ...opts, path: pathEnableAccount(accountId) }, { method: 'put' });
102
- };
103
-
104
- /**
105
- * Request reset for account # DEPRECATED
106
- * @param {String} email - Account email address
107
- * @param {String} accountType - Account type (business, consumer, healthfund)
108
- * @param {Object} opts - Additional options
109
- */
110
- export const requestAccountReset = async (
111
- email: string,
112
- accountType: string,
113
- opts?: MedipassRequestOpts = {}
114
- ): Promise<Object> => {
115
- return request({ ...opts, path: PATH__REQUEST_ACCOUNT_RESET }, { method: 'post', data: { email, accountType } });
116
- };
117
-
118
- /**
119
- * Request password reset for username-based Medipass accounts
120
- * @param {Object} opts - Account ID or email
121
- * @param {String} accountType - Account type (business, consumer, healthfund). Will fail for consumer account.
122
- * @param {Object} opts - Additional options
123
- */
124
- export const requestPasswordReset = async (
125
- { accountId, email }: { accountId?: ?string, email?: ?string },
126
- accountType: string,
127
- opts?: MedipassRequestOpts = {}
128
- ): Promise<Object> => {
129
- let data = { accountType };
130
- if (email) {
131
- data = { ...data, email };
132
- } else if (accountId) {
133
- data = { ...data, accountId };
134
- }
135
- return request({ ...opts, path: PATH__REQUEST_PASSWORD_RESET }, { method: 'post', data });
136
- };
137
-
138
- /**
139
- * Request mobile reset for mobile-based Medipass accounts
140
- * @param {Object} opts - Account ID or mobile
141
- * @param {String} accountType - Account type (business, consumer, healthfund). Will fail for non consumer accounts.
142
- * @param {Object} opts - Additional options
143
- */
144
- export const requestMobileReset = async (
145
- { accountId, email }: { accountId?: ?string, email?: ?string },
146
- accountType: string,
147
- opts?: MedipassRequestOpts = {}
148
- ): Promise<Object> => {
149
- let data = { accountType };
150
- if (email) {
151
- data = { ...data, email };
152
- } else if (accountId) {
153
- data = { ...data, accountId };
154
- }
155
- return request({ ...opts, path: PATH__REQUEST_MOBILE_RESET }, { method: 'post', data });
156
- };
157
-
158
- /**
159
- * Reset an account # DEPRECATED
160
- * @param {Object} body - Object body
161
- * @param {Object} opts - Additional options
162
- */
163
- export const resetAccount = async (body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
164
- return request({ ...opts, path: PATH__ACCOUNT_RESET }, { method: 'post', data: body });
165
- };
166
-
167
- /**
168
- * Reset a password for username-based Medipass accounts
169
- * @param {Object} body - Object body
170
- * @param {Object} opts - Additional options
171
- */
172
- export const resetPassword = async (body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
173
- return request({ ...opts, path: PATH__ACCOUNT_PASSWORD_RESET }, { method: 'post', data: body });
174
- };
175
-
176
- /**
177
- * Reset a mobile number for mobile-based Medipass accounts
178
- * @param {Object} body - Object body
179
- * @param {Object} opts - Additional options
180
- */
181
- export const resetMobile = async (body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
182
- return request({ ...opts, path: PATH__ACCOUNT_MOBILE_RESET }, { method: 'post', data: body });
183
- };
184
-
185
- /**
186
- * Verify an account
187
- * @param {Object} body - Object body
188
- * @param {Object} opts - Additional options
189
- */
190
- export const verifyAccount = async (body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
191
- return request({ ...opts, path: PATH__ACCOUNT_VERIFY }, { method: 'post', data: body });
192
- };
193
-
194
- /**
195
- * Get accounts
196
- * @param {Object} query - Query parameters
197
- * @param {Object} opts - Additional options
198
- */
199
- export const getAccounts = async (query?: Object = {}, opts?: MedipassRequestOpts = {}): Promise<Object> => {
200
- return request({ ...opts, path: PATH__ACCOUNTS }, { method: 'get', params: query });
201
- };
202
-
203
- /**
204
- * Get health fund account
205
- * @param {String} healthFundId - The health fund ID
206
- * @param {String} accountId - The account ID
207
- * @param {Object} opts - Additional options
208
- */
209
- export const getHealthFundAccount = async (
210
- healthFundId: string,
211
- accountId: string,
212
- opts?: MedipassRequestOpts = {}
213
- ): Promise<Object> => {
214
- doesParamExist({ accountId, healthFundId }, opts.hyperMediaEndpoint);
215
- return request({ ...opts, path: pathHealthFundAccount(healthFundId, accountId) }, { method: 'get' });
216
- };
217
-
218
- /**
219
- * Get health fund accounts
220
- * @param {String} healthFundId - The health fund ID
221
- * @param {Object} query - Query parameters
222
- * @param {Object} opts - Additional options
223
- */
224
- export const getHealthFundAccounts = async (
225
- healthFundId: string,
226
- query?: Object = {},
227
- opts?: MedipassRequestOpts = {}
228
- ): Promise<Object> => {
229
- doesParamExist({ healthFundId }, opts.hyperMediaEndpoint);
230
- return request({ ...opts, path: pathHealthFundAccounts(healthFundId) }, { method: 'get', params: query });
231
- };
232
-
233
- /**
234
- * Get organisation accounts
235
- * @param {String} organisationId - The organisation ID
236
- * @param {Object} query - Query parameters
237
- * @param {Object} opts - Additional options
238
- */
239
- export const getOrganisationAccounts = async (
240
- organisationId: string,
241
- query?: Object = {},
242
- opts?: MedipassRequestOpts = {}
243
- ): Promise<Object> => {
244
- doesParamExist({ organisationId }, opts.hyperMediaEndpoint);
245
- return request({ ...opts, path: pathOrganisationAccounts(organisationId) }, { method: 'get', params: query });
246
- };
247
-
248
- /**
249
- * Get account
250
- * @param {String} accountId - Account ID
251
- * @param {Object} opts - Additional options
252
- */
253
- export const getAccount = async (accountId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
254
- doesParamExist({ accountId }, opts.hyperMediaEndpoint);
255
- const account: Object = await request({ ...opts, path: pathAccountsByAccountId(accountId) }, { method: 'get' });
256
- if (accountId === _get(sdk, 'account._id')) {
257
- sdk.setAccount(account);
258
- }
259
- return account;
260
- };
261
-
262
- /**
263
- * Get business staff account
264
- * @param {String} businessId - Business ID
265
- * @param {String} staffId - Staff ID
266
- * @param {Object} opts - Additional options
267
- */
268
- export const getBusinessStaffAccount = async (
269
- businessId: string,
270
- staffId: string,
271
- opts?: MedipassRequestOpts = {}
272
- ): Promise<Object> => {
273
- doesParamExist({ businessId, staffId }, opts.hyperMediaEndpoint);
274
- return await request({ ...opts, path: pathBusinessStaffAccount(businessId, staffId) }, { method: 'get' });
275
- };
276
-
277
- /**
278
- * Check if account exists
279
- * @param {String} query - Query parameters
280
- * @param {Object} opts - Additional options
281
- */
282
- export const getAccountExists = async (query?: Object = {}, opts?: MedipassRequestOpts = {}): Promise<Object> => {
283
- return request({ ...opts, path: pathAccountExists() }, { method: 'get', params: query });
284
- };
285
-
286
- /**
287
- * Get account roles
288
- * @param {String} accountId - Account ID
289
- * @param {Object} opts - Additional options
290
- */
291
- export const getAccountRoles = async (accountId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
292
- doesParamExist({ accountId }, opts.hyperMediaEndpoint);
293
- return request({ ...opts, path: pathAccountRolesByAccountId(accountId) }, { method: 'get' });
294
- };
295
-
296
- /**
297
- * Get account secret keys
298
- * @param {String} accountId - Account ID
299
- * @param {Object} opts - Additional options
300
- */
301
- export const getAccountSecretKeys = async (
302
- accountId: string,
303
- opts?: MedipassRequestOpts = {}
304
- ): Promise<Array<Object>> => {
305
- doesParamExist({ accountId }, opts.hyperMediaEndpoint);
306
- return request({ ...opts, path: pathAccountSecretKeysByAccountId(accountId) }, { method: 'get' });
307
- };
308
-
309
- /**
310
- * Get account transactions
311
- * @param {String} accountId - Account ID
312
- * @param {Object} query - query parameters
313
- * @param {Object} opts - Additional options
314
- */
315
- export const getAccountTransactions = async (
316
- accountId: string,
317
- query?: Object = {},
318
- opts?: MedipassRequestOpts = {}
319
- ): Promise<Object> => {
320
- doesParamExist({ accountId }, opts.hyperMediaEndpoint);
321
- return request({ ...opts, path: pathAccountTransactions(accountId) }, { method: 'get', params: query });
322
- };
323
-
324
- /**
325
- * Invite health fund account
326
- * @param {String} healthFundId - The health fund ID
327
- * @param {Object} requestBody - Request body
328
- * @param {Object} opts - Additional options
329
- */
330
- export const inviteHealthFundAccount = async (
331
- healthFundId: string,
332
- body: Object,
333
- opts?: MedipassRequestOpts = {}
334
- ): Promise<Object> => {
335
- doesParamExist({ healthFundId }, opts.hyperMediaEndpoint);
336
- return request({ ...opts, path: `${pathHealthFundAccounts(healthFundId)}/invites` }, { method: 'post', data: body });
337
- };
338
-
339
- /**
340
- * Remove health fund from account
341
- * @param {String} healthFundId - Health fund ID
342
- * @param {String} accountId - Account ID
343
- * @param {Object} opts - Additional options
344
- */
345
- export const removeHealthFundFromAccount = async (
346
- healthFundId: string,
347
- accountId: string,
348
- opts?: MedipassRequestOpts = {}
349
- ): Promise<Object> => {
350
- doesParamExist({ accountId, healthFundId }, opts.hyperMediaEndpoint);
351
- return request({ ...opts, path: pathHealthFundAccount(healthFundId, accountId) }, { method: 'delete' });
352
- };
353
-
354
- /**
355
- * Request to verify an account
356
- * @param {String} accountId - Account ID
357
- * @param {Object} opts - Additional options
358
- */
359
- export const requestToVerifyAccount = async (accountId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
360
- doesParamExist({ accountId }, opts.hyperMediaEndpoint);
361
- return request({ ...opts, path: pathRequestVerifyAccount(accountId) }, { method: 'post' });
362
- };
363
-
364
- /**
365
- * Sign up for an account
366
- * @param {String} email - Account email address
367
- * @param {String} mobile - Mobile number
368
- * @param {Object} body - Object body
369
- * @param {Object} opts - Additional options
370
- */
371
- export const signUp = async (
372
- email: string,
373
- mobile: string,
374
- body: Object,
375
- opts?: MedipassRequestOpts = {}
376
- ): Promise<Object> => {
377
- doesParamExist({ email, mobile }, opts.hyperMediaEndpoint);
378
- return request({ ...opts, path: PATH__SIGN_UP }, { method: 'post', data: { email, mobile, ...body } });
379
- };
380
-
381
- /**
382
- * Accept an invite
383
- * @param {Object} body - Object body
384
- * @param {Object} opts - Additional options
385
- */
386
- export const acceptInvite = async (body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
387
- return request({ ...opts, path: PATH__ACCEPT_ACCOUNT_INVITE }, { method: 'post', data: body });
388
- };
389
-
390
- /**
391
- * Update account
392
- * @param {String} accountId - Account ID
393
- * @param {Object} body - Object body
394
- * @param {Object} opts - Additional options
395
- */
396
- export const updateAccount = async (
397
- accountId: string,
398
- body: Object,
399
- opts?: MedipassRequestOpts = {}
400
- ): Promise<Object> => {
401
- doesParamExist({ accountId }, opts.hyperMediaEndpoint);
402
- const account = await request({ ...opts, path: pathAccountsByAccountId(accountId) }, { method: 'put', data: body });
403
- if (accountId === _get(sdk, 'account._id')) {
404
- sdk.setAccount(account);
405
- }
406
- return account;
407
- };
408
-
409
- /**
410
- * Update account roles
411
- * @param {String} accountId - Account ID
412
- * @param {Object} opts - Additional options
413
- */
414
- export const updateAccountRoles = async (
415
- accountId: string,
416
- body: Object,
417
- opts?: MedipassRequestOpts = {}
418
- ): Promise<Object> => {
419
- doesParamExist({ accountId }, opts.hyperMediaEndpoint);
420
- return request({ ...opts, path: pathAccountRolesByAccountId(accountId) }, { method: 'put', data: body });
421
- };
422
-
423
- /**
424
- * Get account practices
425
- * @param {String} accountId - Account ID
426
- * @param {Object} query - query parameters
427
- * @param {Object} opts - Additional options
428
- */
429
- export const getAccountPractices = async (
430
- accountId: string,
431
- query?: Object = {},
432
- opts?: MedipassRequestOpts = {}
433
- ): Promise<Object> => {
434
- doesParamExist({ accountId }, opts.hyperMediaEndpoint);
435
- return request({ ...opts, path: pathAccountPractices(accountId) }, { method: 'get', params: query });
436
- };
437
-
438
- /**
439
- * Change password
440
- * @param {Object} body - Object body
441
- * @param {Object} opts - Additional options
442
- */
443
- export const changePassword = async (body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
444
- return request({ ...opts, path: pathChangePassword() }, { method: 'post', data: body });
445
- };
@@ -1,25 +0,0 @@
1
- // @flow
2
-
3
- import request from '../utils/request';
4
- import type { MedipassRequestOpts } from '../_types';
5
-
6
- const PATH__ACTIONS = '/actions';
7
- const pathAction = actionId => `${PATH__ACTIONS}/${actionId}`;
8
-
9
- /**
10
- * Get actions
11
- * @param {Object} query - Query parameters
12
- * @param {Object} opts - Additional options
13
- */
14
- export const getActions = async (query?: Object = {}, opts?: MedipassRequestOpts = {}): Promise<Object> => {
15
- return request({ ...opts, path: PATH__ACTIONS }, { method: 'get', params: query });
16
- };
17
-
18
- /**
19
- * Get action
20
- * @param {String} actionId - Action ID
21
- * @param {Object} opts - Additional options
22
- */
23
- export const getAction = async (actionId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
24
- return request({ ...opts, path: pathAction(actionId) }, { method: 'get' });
25
- };
@@ -1,54 +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 pathApiKeysByBusinessId = (businessId: string) => `/businesses/${businessId}/apikeys`;
8
- export const pathApiKeyByApiKeyId = (businessId: string, apiKeyId: string) =>
9
- `/businesses/${businessId}/apikeys/${apiKeyId}`;
10
-
11
- /**
12
- * Create an Api Key
13
- * @param {String} businessId - Business ID
14
- * @param {Object} body - Request body
15
- * @param {Object} opts - Additional options
16
- */
17
- export const createApiKey = async (
18
- businessId: string,
19
- body: Object,
20
- opts?: MedipassRequestOpts = {}
21
- ): Promise<Object> => {
22
- doesParamExist({ businessId }, opts.hyperMediaEndpoint);
23
- return request({ ...opts, path: pathApiKeysByBusinessId(businessId) }, { method: 'post', data: body });
24
- };
25
-
26
- /**
27
- * Get Api Keys for a business
28
- * @param {String} businessId - Business ID
29
- * @param {Object} query - query parameters
30
- * @param {Object} opts - Additional options
31
- */
32
- export const getBusinessApiKeys = async (
33
- businessId: string,
34
- query: Object,
35
- opts?: MedipassRequestOpts = {}
36
- ): Promise<Object> => {
37
- doesParamExist({ businessId }, opts.hyperMediaEndpoint);
38
- return request({ ...opts, path: pathApiKeysByBusinessId(businessId) }, { method: 'get', params: query });
39
- };
40
-
41
- /**
42
- * Delete Api Key by apiKeyId
43
- * @param {String} businessId - Business ID
44
- * @param {String} apiKeyId - Api Key ID
45
- * @param {Object} opts - Additional options
46
- */
47
- export const deleteApiKey = async (
48
- businessId: string,
49
- apiKeyId: string,
50
- opts?: MedipassRequestOpts = {}
51
- ): Promise<Object> => {
52
- doesParamExist({ businessId, apiKeyId }, opts.hyperMediaEndpoint);
53
- return request({ ...opts, path: pathApiKeyByApiKeyId(businessId, apiKeyId) }, { method: 'delete' });
54
- };
@@ -1,60 +0,0 @@
1
- // @flow
2
-
3
- import request from '../utils/request';
4
- import type { MedipassRequestOpts } from '../_types';
5
- import doesParamExist from '../utils/does-param-exist';
6
-
7
- const PATH__APPLICATIONS = '/applications';
8
- const PATH__SELF_APPLICATION = '/applications/me';
9
- const pathApplication = applicationId => `/applications/${applicationId}`;
10
-
11
- /**
12
- * Get self application
13
- * @param {Object} opts - Additional options
14
- */
15
- export const getSelfApplication = (opts?: MedipassRequestOpts = {}): Promise<Object> => {
16
- return request({ ...opts, path: PATH__SELF_APPLICATION }, { method: 'get' });
17
- };
18
-
19
- /**
20
- * Get applications
21
- * @param {Object} query - Query parameters
22
- * @param {Object} opts - Additional options
23
- */
24
- export const getApplications = (query?: Object = {}, opts?: MedipassRequestOpts = {}): Promise<Object> => {
25
- return request({ ...opts, path: PATH__APPLICATIONS }, { method: 'get', params: query });
26
- };
27
-
28
- /**
29
- * Get application
30
- * @param {String} applicationId - Application ID
31
- * @param {Object} opts - Additional options
32
- */
33
- export const getApplication = (applicationId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
34
- doesParamExist({ applicationId }, opts.hyperMediaEndpoint);
35
- return request({ ...opts, path: pathApplication(applicationId) }, { method: 'get' });
36
- };
37
-
38
- /**
39
- * Update application
40
- * @param {String} applicationId - Application ID
41
- * @param {Object} body - Request body
42
- * @param {Object} opts - Additional options
43
- */
44
- export const updateApplication = (
45
- applicationId: string,
46
- body: Object,
47
- opts?: MedipassRequestOpts = {}
48
- ): Promise<Object> => {
49
- doesParamExist({ applicationId }, opts.hyperMediaEndpoint);
50
- return request({ ...opts, path: pathApplication(applicationId) }, { method: 'put', data: body });
51
- };
52
-
53
- /**
54
- * Create application
55
- * @param {Object} body - Request body
56
- * @param {Object} opts - Additional options
57
- */
58
- export const createApplication = (body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
59
- return request({ ...opts, path: PATH__APPLICATIONS }, { method: 'post', data: body });
60
- };
@@ -1,75 +0,0 @@
1
- // @flow
2
- import doesParamExist from '../utils/does-param-exist';
3
- import request from '../utils/request';
4
- import type { MedipassRequestOpts } from '../_types';
5
- export const pathGetClaimAttachmentUrl = (businessId: string, practiceId: string, staffId: string) =>
6
- `/businesses/${businessId}/practices/${practiceId}/staff/${staffId}/attachments/uploadurl`;
7
- export const pathGetS3SignedUrl = (businessId: string, practiceId: string, staffId: string, s3SignedUrlId: string) =>
8
- `/businesses/${businessId}/practices/${practiceId}/staff/${staffId}/attachments/s3signedurls/${s3SignedUrlId}`;
9
- export const pathScanClaimFile = (businessId: string, practiceId: string, staffId: string) =>
10
- `/businesses/${businessId}/practices/${practiceId}/staff/${staffId}/attachments/virusscan`;
11
-
12
- /**
13
- * Get url to upload a file associated to a claim
14
- * @param {String} businessId - Business ID
15
- * @param {String} practiceId - Practice ID
16
- * @param {String} staffId - Staff ID
17
- * @param {Object} body - Request body
18
- * @param {Object} opts - Additional options
19
- */
20
- export const getClaimAttachmentUrl = (
21
- businessId: string,
22
- practiceId: string,
23
- staffId: string,
24
- query: Object,
25
- opts?: MedipassRequestOpts = {}
26
- ): Promise<Object> => {
27
- doesParamExist({ businessId, practiceId, staffId }, opts.hyperMediaEndpoint);
28
- return request(
29
- { ...opts, path: pathGetClaimAttachmentUrl(businessId, practiceId, staffId) },
30
- { method: 'get', params: query }
31
- );
32
- };
33
-
34
- /**
35
- * Scan a file associated to a claim
36
- * @param {String} businessId - Business ID
37
- * @param {String} practiceId - Practice ID
38
- * @param {String} staffId - Staff ID
39
- * @param {Object} body - Request body
40
- * @param {Object} opts - Additional options
41
- */
42
- export const scanClaimFile = (
43
- businessId: string,
44
- practiceId: string,
45
- staffId: string,
46
- body: Object,
47
- opts?: MedipassRequestOpts = {}
48
- ): Promise<Object> => {
49
- doesParamExist({ businessId, practiceId, staffId }, opts.hyperMediaEndpoint);
50
- return request({ ...opts, path: pathScanClaimFile(businessId, practiceId, staffId) }, { method: 'post', data: body });
51
- };
52
-
53
- /**
54
- * Get s3 signed url
55
- * @param {String} businessId - Business ID
56
- * @param {String} practiceId - Practice ID
57
- * @param {String} staffId - Staff ID
58
- * @param {String} s3SignedUrlId - Internal s3 signed url ID
59
- * @param {Object} body - Request body
60
- * @param {Object} opts - Additional options
61
- */
62
- export const getS3SignedUrl = (
63
- businessId: string,
64
- practiceId: string,
65
- staffId: string,
66
- s3SignedUrlId: string,
67
- query: Object,
68
- opts?: MedipassRequestOpts = {}
69
- ): Promise<Object> => {
70
- doesParamExist({ businessId, practiceId, staffId, s3SignedUrlId }, opts.hyperMediaEndpoint);
71
- return request(
72
- { ...opts, path: pathGetS3SignedUrl(businessId, practiceId, staffId, s3SignedUrlId) },
73
- { method: 'get', params: query }
74
- );
75
- };