@medipass/web-sdk 11.37.8 → 11.38.1-feature-typescript-claudia.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +95 -0
- package/CHANGELOG.md +11 -0
- package/babel.config.js +2 -1
- package/lib/index.d.ts +262 -0
- package/lib/index.js +83 -3
- package/lib/{regions-ed54f163.js → regions-a0a28864.js} +2 -2
- package/lib/resources/accounts.d.ts +215 -0
- package/lib/resources/accounts.js +3 -3
- package/lib/resources/actions.d.ts +13 -0
- package/lib/resources/actions.js +3 -3
- package/lib/resources/api-keys.d.ts +24 -0
- package/lib/resources/api-keys.js +3 -3
- package/lib/resources/applications.d.ts +31 -0
- package/lib/resources/applications.js +3 -3
- package/lib/resources/attachments.d.ts +32 -0
- package/lib/resources/attachments.js +3 -3
- package/lib/resources/auth.d.ts +59 -0
- package/lib/resources/auth.js +3 -3
- package/lib/resources/bulk-submits.d.ts +17 -0
- package/lib/resources/bulk-submits.js +3 -3
- package/lib/resources/bulk-uploads.d.ts +26 -0
- package/lib/resources/bulk-uploads.js +3 -3
- package/lib/resources/business-profiles.d.ts +18 -0
- package/lib/resources/business-profiles.js +3 -3
- package/lib/resources/businesses.d.ts +132 -0
- package/lib/resources/businesses.js +3 -3
- package/lib/resources/claim-items.d.ts +31 -0
- package/lib/resources/claim-items.js +3 -3
- package/lib/resources/devices.d.ts +11 -0
- package/lib/resources/devices.js +3 -3
- package/lib/resources/doc-accounts.d.ts +32 -0
- package/lib/resources/doc-accounts.js +3 -3
- package/lib/resources/documents.d.ts +90 -0
- package/lib/resources/documents.js +3 -3
- package/lib/resources/emails.d.ts +14 -0
- package/lib/resources/emails.js +3 -3
- package/lib/resources/form-application-templates.d.ts +20 -0
- package/lib/resources/form-application-templates.js +3 -3
- package/lib/resources/form-applications.d.ts +27 -0
- package/lib/resources/form-applications.js +3 -3
- package/lib/resources/forms.d.ts +100 -0
- package/lib/resources/forms.js +3 -3
- package/lib/resources/funder-services.d.ts +8 -0
- package/lib/resources/funder-services.js +3 -3
- package/lib/resources/funder-settings.d.ts +8 -0
- package/lib/resources/funder-settings.js +3 -3
- package/lib/resources/funders.d.ts +5 -0
- package/lib/resources/funders.js +3 -3
- package/lib/resources/futures.d.ts +85 -0
- package/lib/resources/futures.js +3 -3
- package/lib/resources/health-fund-accounts.d.ts +78 -0
- package/lib/resources/health-fund-accounts.js +3 -3
- package/lib/resources/health-fund-settings.d.ts +39 -0
- package/lib/resources/health-fund-settings.js +3 -3
- package/lib/resources/healthfunds.d.ts +64 -0
- package/lib/resources/healthfunds.js +3 -3
- package/lib/resources/icditems.d.ts +14 -0
- package/lib/resources/icditems.js +3 -3
- package/lib/resources/invoice-scans.d.ts +26 -0
- package/lib/resources/invoice-scans.js +3 -3
- package/lib/resources/jhcs.d.ts +7 -0
- package/lib/resources/jhcs.js +3 -3
- package/lib/resources/kyc.d.ts +109 -0
- package/lib/resources/kyc.js +3 -3
- package/lib/resources/logs.d.ts +16 -0
- package/lib/resources/logs.js +3 -3
- package/lib/resources/members.d.ts +92 -0
- package/lib/resources/members.js +3 -3
- package/lib/resources/message-mappings.d.ts +9 -0
- package/lib/resources/message-mappings.js +3 -3
- package/lib/resources/minions.d.ts +40 -0
- package/lib/resources/minions.js +3 -3
- package/lib/resources/modalities.d.ts +19 -0
- package/lib/resources/modalities.js +3 -3
- package/lib/resources/notes.d.ts +17 -0
- package/lib/resources/notes.js +3 -3
- package/lib/resources/onboarding-applications.d.ts +52 -0
- package/lib/resources/onboarding-applications.js +3 -3
- package/lib/resources/onboarding-requests.d.ts +39 -0
- package/lib/resources/onboarding-requests.js +3 -3
- package/lib/resources/ops.d.ts +60 -0
- package/lib/resources/ops.js +3 -3
- package/lib/resources/organisations.d.ts +7 -0
- package/lib/resources/organisations.js +3 -3
- package/lib/resources/partners.d.ts +50 -0
- package/lib/resources/partners.js +3 -3
- package/lib/resources/patients.d.ts +44 -0
- package/lib/resources/patients.js +3 -3
- package/lib/resources/payments.d.ts +155 -0
- package/lib/resources/payments.js +3 -3
- package/lib/resources/pms.d.ts +43 -0
- package/lib/resources/pms.js +3 -3
- package/lib/resources/practice-profiles.d.ts +20 -0
- package/lib/resources/practice-profiles.js +3 -3
- package/lib/resources/practice-types.d.ts +6 -0
- package/lib/resources/practice-types.js +3 -3
- package/lib/resources/practices.d.ts +137 -0
- package/lib/resources/practices.js +3 -3
- package/lib/resources/products.d.ts +23 -0
- package/lib/resources/products.js +3 -3
- package/lib/resources/professional-categories.d.ts +23 -0
- package/lib/resources/professional-categories.js +3 -3
- package/lib/resources/provider-number-types.d.ts +16 -0
- package/lib/resources/provider-number-types.js +3 -3
- package/lib/resources/provider-registration-types.d.ts +15 -0
- package/lib/resources/provider-registration-types.js +3 -3
- package/lib/resources/provider-requests.d.ts +17 -0
- package/lib/resources/provider-requests.js +3 -3
- package/lib/resources/provider-types.d.ts +6 -0
- package/lib/resources/provider-types.js +3 -3
- package/lib/resources/ref-sources.d.ts +6 -0
- package/lib/resources/ref-sources.js +3 -3
- package/lib/resources/risk.d.ts +13 -0
- package/lib/resources/risk.js +3 -3
- package/lib/resources/rnas.d.ts +43 -0
- package/lib/resources/rnas.js +3 -3
- package/lib/resources/roles.d.ts +7 -0
- package/lib/resources/roles.js +3 -3
- package/lib/resources/self-checkout-sessions.d.ts +134 -0
- package/lib/resources/self-checkout-sessions.js +3 -3
- package/lib/resources/services.d.ts +88 -0
- package/lib/resources/services.js +3 -3
- package/lib/resources/settlements.d.ts +37 -0
- package/lib/resources/settlements.js +4 -3
- package/lib/resources/sign-up.d.ts +5 -0
- package/lib/resources/sign-up.js +3 -3
- package/lib/resources/specialties.d.ts +23 -0
- package/lib/resources/specialties.js +3 -3
- package/lib/resources/staff-profiles.d.ts +20 -0
- package/lib/resources/staff-profiles.js +3 -3
- package/lib/resources/staff.d.ts +242 -0
- package/lib/resources/staff.js +3 -3
- package/lib/resources/statistics.d.ts +56 -0
- package/lib/resources/statistics.js +3 -3
- package/lib/resources/subscriptions.d.ts +32 -0
- package/lib/resources/subscriptions.js +3 -3
- package/lib/resources/terminals.d.ts +71 -0
- package/lib/resources/terminals.js +3 -3
- package/lib/resources/transaction-export.d.ts +18 -0
- package/lib/resources/transaction-export.js +3 -3
- package/lib/resources/transactions.d.ts +466 -0
- package/lib/resources/transactions.js +3 -3
- package/lib/resources/triggers.d.ts +20 -0
- package/lib/resources/triggers.js +3 -3
- package/lib/resources/vendors.d.ts +9 -0
- package/lib/resources/vendors.js +3 -3
- package/lib/resources/verify.d.ts +9 -0
- package/lib/resources/verify.js +3 -3
- package/lib/resources/workers.d.ts +3 -0
- package/lib/resources/workers.js +3 -3
- package/lib/resources/workflow-exceptions.d.ts +5 -0
- package/lib/resources/workflow-exceptions.js +3 -3
- package/lib/services/aws.d.ts +54 -0
- package/lib/services/aws.js +3 -3
- package/lib/services/storage.d.ts +28 -0
- package/lib/services/storage.js +126 -18
- package/lib/services/version.d.ts +21 -0
- package/lib/services/version.js +3 -3
- package/lib/{staff-df3df93e.js → staff-96febcd8.js} +217 -582
- package/lib/types/documents.d.ts +115 -0
- package/lib/types/documents.js +2 -0
- package/lib/types/forms.d.ts +67 -0
- package/lib/types/forms.js +2 -0
- package/lib/types/index.d.ts +42 -0
- package/lib/types/index.js +2 -0
- package/lib/types/message-mappings.d.ts +18 -0
- package/lib/types/message-mappings.js +2 -0
- package/lib/types/notes.d.ts +5 -0
- package/lib/types/notes.js +2 -0
- package/lib/types/products.d.ts +34 -0
- package/lib/types/products.js +2 -0
- package/lib/types/professional-categories.d.ts +20 -0
- package/lib/types/professional-categories.js +2 -0
- package/lib/types/specialties.d.ts +22 -0
- package/lib/types/specialties.js +2 -0
- package/lib/types/subscriptions.d.ts +52 -0
- package/lib/types/subscriptions.js +2 -0
- package/lib/utils/application.d.ts +1 -0
- package/lib/utils/application.js +3 -3
- package/lib/utils/base-urls/core.d.ts +19 -0
- package/lib/utils/base-urls/index.d.ts +37 -0
- package/lib/utils/base-urls/risk.d.ts +17 -0
- package/lib/utils/does-param-exist.d.ts +2 -0
- package/lib/utils/get-axios-error.d.ts +2 -0
- package/lib/utils/param-error.d.ts +3 -0
- package/lib/utils/professions.d.ts +3 -0
- package/lib/utils/professions.js +3 -3
- package/lib/utils/regions.d.ts +1 -0
- package/lib/utils/regions.js +2 -2
- package/lib/utils/request.d.ts +3 -0
- package/lib/utils/request.js +3 -3
- package/lib/utils/staff.d.ts +8 -0
- package/lib/utils/staff.js +3 -3
- package/package.json +19 -9
- package/tsconfig.json +33 -0
- package/.eslintrc +0 -3
- package/lib/_types/documents.js.flow +0 -118
- package/lib/_types/forms.js.flow +0 -57
- package/lib/_types/index.js.flow +0 -47
- package/lib/_types/message-mappings.js.flow +0 -22
- package/lib/_types/notes.js.flow +0 -7
- package/lib/_types/products.js.flow +0 -40
- package/lib/_types/professional-categories.js.flow +0 -25
- package/lib/_types/specialties.js.flow +0 -27
- package/lib/_types/subscriptions.js.flow +0 -58
- package/lib/index.js.flow +0 -438
- package/lib/resources/accounts.js.flow +0 -445
- package/lib/resources/actions.js.flow +0 -25
- package/lib/resources/api-keys.js.flow +0 -54
- package/lib/resources/applications.js.flow +0 -60
- package/lib/resources/attachments.js.flow +0 -75
- package/lib/resources/auth.js.flow +0 -185
- package/lib/resources/bulk-submits.js.flow +0 -43
- package/lib/resources/bulk-uploads.js.flow +0 -56
- package/lib/resources/business-profiles.js.flow +0 -45
- package/lib/resources/businesses.js.flow +0 -267
- package/lib/resources/claim-items.js.flow +0 -76
- package/lib/resources/devices.js.flow +0 -64
- package/lib/resources/doc-accounts.js.flow +0 -61
- package/lib/resources/documents.js.flow +0 -216
- package/lib/resources/emails.js.flow +0 -96
- package/lib/resources/form-application-templates.js.flow +0 -52
- package/lib/resources/form-applications.js.flow +0 -62
- package/lib/resources/forms.js.flow +0 -222
- package/lib/resources/funder-services.js.flow +0 -17
- package/lib/resources/funder-settings.js.flow +0 -58
- package/lib/resources/funders.js.flow +0 -15
- package/lib/resources/futures.js.flow +0 -154
- package/lib/resources/health-fund-accounts.js.flow +0 -198
- package/lib/resources/health-fund-settings.js.flow +0 -104
- package/lib/resources/healthfunds.js.flow +0 -139
- package/lib/resources/icditems.js.flow +0 -36
- package/lib/resources/invoice-scans.js.flow +0 -56
- package/lib/resources/jhcs.js.flow +0 -20
- package/lib/resources/kyc.js.flow +0 -216
- package/lib/resources/logs.js.flow +0 -32
- package/lib/resources/members.js.flow +0 -196
- package/lib/resources/message-mappings.js.flow +0 -25
- package/lib/resources/minions.js.flow +0 -96
- package/lib/resources/modalities.js.flow +0 -46
- package/lib/resources/notes.js.flow +0 -112
- package/lib/resources/onboarding-applications.js.flow +0 -142
- package/lib/resources/onboarding-requests.js.flow +0 -97
- package/lib/resources/ops.js.flow +0 -116
- package/lib/resources/organisations.js.flow +0 -15
- package/lib/resources/partners.js.flow +0 -118
- package/lib/resources/patients.js.flow +0 -102
- package/lib/resources/payments.js.flow +0 -523
- package/lib/resources/pms.js.flow +0 -102
- package/lib/resources/practice-profiles.js.flow +0 -51
- package/lib/resources/practice-types.js.flow +0 -14
- package/lib/resources/practices.js.flow +0 -314
- package/lib/resources/products.js.flow +0 -48
- package/lib/resources/professional-categories.js.flow +0 -56
- package/lib/resources/provider-number-types.js.flow +0 -32
- package/lib/resources/provider-registration-types.js.flow +0 -32
- package/lib/resources/provider-requests.js.flow +0 -46
- package/lib/resources/provider-types.js.flow +0 -14
- package/lib/resources/ref-sources.js.flow +0 -16
- package/lib/resources/risk.js.flow +0 -29
- package/lib/resources/rnas.js.flow +0 -108
- package/lib/resources/roles.js.flow +0 -12
- package/lib/resources/self-checkout-sessions.js.flow +0 -382
- package/lib/resources/services.js.flow +0 -219
- package/lib/resources/settlements.js.flow +0 -79
- package/lib/resources/sign-up.js.flow +0 -15
- package/lib/resources/specialties.js.flow +0 -46
- package/lib/resources/staff-profiles.js.flow +0 -51
- package/lib/resources/staff.js.flow +0 -583
- package/lib/resources/statistics.js.flow +0 -147
- package/lib/resources/subscriptions.js.flow +0 -81
- package/lib/resources/terminals.js.flow +0 -161
- package/lib/resources/transaction-export.js.flow +0 -48
- package/lib/resources/transactions.js.flow +0 -1097
- package/lib/resources/triggers.js.flow +0 -36
- package/lib/resources/vendors.js.flow +0 -28
- package/lib/resources/verify.js.flow +0 -14
- package/lib/resources/workers.js.flow +0 -10
- package/lib/resources/workflow-exceptions.js.flow +0 -17
- package/lib/services/__mocks__/storage.js.flow +0 -30
- package/lib/services/aws.js.flow +0 -339
- package/lib/services/storage.js.flow +0 -92
- package/lib/services/version.js.flow +0 -73
- package/lib/storage-16fd26f8.js +0 -1268
- package/lib/utils/application.js.flow +0 -23
- package/lib/utils/base-urls/core.js.flow +0 -18
- package/lib/utils/base-urls/index.js.flow +0 -7
- package/lib/utils/base-urls/risk.js.flow +0 -16
- package/lib/utils/does-param-exist.js.flow +0 -23
- package/lib/utils/get-axios-error.js.flow +0 -8
- package/lib/utils/param-error.js.flow +0 -8
- package/lib/utils/professions.js.flow +0 -66
- package/lib/utils/regions.js.flow +0 -21
- package/lib/utils/request.js.flow +0 -36
- package/lib/utils/staff.js.flow +0 -81
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import request from '../utils/request';
|
|
4
|
-
import doesParamExist from '../utils/does-param-exist';
|
|
5
|
-
import type { MedipassRequestOpts } from '../_types';
|
|
6
|
-
|
|
7
|
-
const pathTransactionStatsForPractice = (businessId, practiceId) =>
|
|
8
|
-
`/businesses/${businessId}/practices/${practiceId}/transactionstats`;
|
|
9
|
-
const pathTransactionStatsForBusiness = businessId => `/businesses/${businessId}/transactionstats`;
|
|
10
|
-
const pathTransactionStatsForOrganisation = organisationId => `/organisations/${organisationId}/transactionstats`;
|
|
11
|
-
const pathTransactionStatsForHealthFundId = healthFundId => `/healthfunds/${healthFundId}/transactionstats`;
|
|
12
|
-
const pathTransactionStatsCSVForHealthFundId = healthFundId => `/healthfunds/${healthFundId}/transactionstats/csv`;
|
|
13
|
-
const pathHealthFundAccountStatsForHealthFundId = healthFundId => `/healthfunds/${healthFundId}/healthfundaccountstats`;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Get transaction statistics for a health fund
|
|
17
|
-
* @param {String} healthFundId - Health fund ID
|
|
18
|
-
* @param {String} from - From date in YYYY-MM-DD format
|
|
19
|
-
* @param {String} to - To date in YYYY-MM-DD format
|
|
20
|
-
* @param {Object} query - Extra query parameters
|
|
21
|
-
* @param {Object} opts - Additional options
|
|
22
|
-
*/
|
|
23
|
-
export const getTransactionStatsForHealthFundId = async (
|
|
24
|
-
healthFundId: string,
|
|
25
|
-
from: ?string,
|
|
26
|
-
to: ?string,
|
|
27
|
-
query?: Object = {},
|
|
28
|
-
opts?: MedipassRequestOpts = {}
|
|
29
|
-
): Promise<Array<Object>> => {
|
|
30
|
-
doesParamExist({ healthFundId }, opts.hyperMediaEndpoint);
|
|
31
|
-
return request(
|
|
32
|
-
{ ...opts, path: pathTransactionStatsForHealthFundId(healthFundId) },
|
|
33
|
-
{ method: 'get', params: { from, to, ...query } }
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Get transaction statistics as CSV for a health fund
|
|
39
|
-
* @param {String} healthFundId - Health fund ID
|
|
40
|
-
* @param {String} from - From date in YYYY-MM-DD format
|
|
41
|
-
* @param {String} to - To date in YYYY-MM-DD format
|
|
42
|
-
* @param {Object} query - Extra query parameters
|
|
43
|
-
* @param {Object} opts - Additional options
|
|
44
|
-
*/
|
|
45
|
-
export const getTransactionStatsCSVForHealthFundId = async (
|
|
46
|
-
healthFundId: string,
|
|
47
|
-
from: ?string,
|
|
48
|
-
to: ?string,
|
|
49
|
-
query?: Object = {},
|
|
50
|
-
opts?: MedipassRequestOpts = {}
|
|
51
|
-
): Promise<Object> => {
|
|
52
|
-
doesParamExist({ healthFundId }, opts.hyperMediaEndpoint);
|
|
53
|
-
return request(
|
|
54
|
-
{ ...opts, path: pathTransactionStatsCSVForHealthFundId(healthFundId) },
|
|
55
|
-
{ method: 'get', params: { from, to, ...query } }
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Get health fund account stats for a health fund
|
|
61
|
-
* @param {String} healthFundId - Health fund ID
|
|
62
|
-
* @param {String} from - From date in YYYY-MM-DD format
|
|
63
|
-
* @param {String} to - To date in YYYY-MM-DD format
|
|
64
|
-
* @param {Object} query - Extra query parameters
|
|
65
|
-
* @param {Object} opts - Additional options
|
|
66
|
-
*/
|
|
67
|
-
export const getHealthFundAccountStatsForHealthFundId = async (
|
|
68
|
-
healthFundId: string,
|
|
69
|
-
from: ?string,
|
|
70
|
-
to: ?string,
|
|
71
|
-
query?: Object = {},
|
|
72
|
-
opts?: MedipassRequestOpts = {}
|
|
73
|
-
): Promise<Object> => {
|
|
74
|
-
doesParamExist({ healthFundId }, opts.hyperMediaEndpoint);
|
|
75
|
-
return request(
|
|
76
|
-
{ ...opts, path: pathHealthFundAccountStatsForHealthFundId(healthFundId) },
|
|
77
|
-
{ method: 'get', params: { from, to, ...query } }
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Get transaction statistics for a business
|
|
83
|
-
* @param {String} businessId - Business ID
|
|
84
|
-
* @param {String} from - From date in YYYY-MM-DD format
|
|
85
|
-
* @param {String} to - To date in YYYY-MM-DD format
|
|
86
|
-
* @param {Object} query - Extra query parameters
|
|
87
|
-
* @param {Object} opts - Additional options
|
|
88
|
-
*/
|
|
89
|
-
export const getTransactionStatsForBusiness = async (
|
|
90
|
-
businessId: string,
|
|
91
|
-
from: ?string,
|
|
92
|
-
to: ?string,
|
|
93
|
-
query?: Object = {},
|
|
94
|
-
opts?: MedipassRequestOpts = {}
|
|
95
|
-
): Promise<Object> => {
|
|
96
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
97
|
-
return request(
|
|
98
|
-
{ ...opts, path: pathTransactionStatsForBusiness(businessId) },
|
|
99
|
-
{ method: 'get', params: { from, to, ...query } }
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Get transaction statistics for a practice
|
|
105
|
-
* @param {String} businessId - Business ID
|
|
106
|
-
* @param {String} practiceId - Practice ID
|
|
107
|
-
* @param {String} from - From date in YYYY-MM-DD format
|
|
108
|
-
* @param {String} to - To date in YYYY-MM-DD format
|
|
109
|
-
* @param {Object} query - Extra query parameters
|
|
110
|
-
* @param {Object} opts - Additional options
|
|
111
|
-
*/
|
|
112
|
-
export const getTransactionStatsForPractice = async (
|
|
113
|
-
businessId: string,
|
|
114
|
-
practiceId: string,
|
|
115
|
-
from: ?string,
|
|
116
|
-
to: ?string,
|
|
117
|
-
query?: Object = {},
|
|
118
|
-
opts?: MedipassRequestOpts = {}
|
|
119
|
-
): Promise<Object> => {
|
|
120
|
-
doesParamExist({ businessId, practiceId }, opts.hyperMediaEndpoint);
|
|
121
|
-
return request(
|
|
122
|
-
{ ...opts, path: pathTransactionStatsForPractice(businessId, practiceId) },
|
|
123
|
-
{ method: 'get', params: { from, to, ...query } }
|
|
124
|
-
);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Get transaction statistics for an organisation
|
|
129
|
-
* @param {String} organisationId - Organisation ID
|
|
130
|
-
* @param {String} from - From date in YYYY-MM-DD format
|
|
131
|
-
* @param {String} to - To date in YYYY-MM-DD format
|
|
132
|
-
* @param {Object} query - Extra query parameters
|
|
133
|
-
* @param {Object} opts - Additional options
|
|
134
|
-
*/
|
|
135
|
-
export const getTransactionStatsForOrganisation = async (
|
|
136
|
-
organisationId: string,
|
|
137
|
-
from: ?string,
|
|
138
|
-
to: ?string,
|
|
139
|
-
query?: Object = {},
|
|
140
|
-
opts?: MedipassRequestOpts = {}
|
|
141
|
-
): Promise<Object> => {
|
|
142
|
-
doesParamExist({ organisationId }, opts.hyperMediaEndpoint);
|
|
143
|
-
return request(
|
|
144
|
-
{ ...opts, path: pathTransactionStatsForOrganisation(organisationId) },
|
|
145
|
-
{ method: 'get', params: { from, to, ...query } }
|
|
146
|
-
);
|
|
147
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import doesParamExist from '../utils/does-param-exist';
|
|
4
|
-
import request from '../utils/request';
|
|
5
|
-
import type {
|
|
6
|
-
MedipassRequestOpts,
|
|
7
|
-
CreateBusinessSubscriptionBody,
|
|
8
|
-
GetBusinessSubscriptionsQuery,
|
|
9
|
-
UpdateBusinessSubscriptionBody,
|
|
10
|
-
SubscriptionResponse,
|
|
11
|
-
SubscriptionsResponse
|
|
12
|
-
} from '../_types';
|
|
13
|
-
|
|
14
|
-
export const pathBusinessSubscriptions = (businessId: string) => `/businesses/${businessId}/subscriptions`;
|
|
15
|
-
export const pathBusinessSubscription = (businessId: string, subscriptionId: string) =>
|
|
16
|
-
`/businesses/${businessId}/subscriptions/${subscriptionId}`;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Create business subscription
|
|
20
|
-
* @param {String} businessId - Business ID
|
|
21
|
-
* @param {Object} body - Request body
|
|
22
|
-
* @param {Object} opts - Additional options
|
|
23
|
-
*/
|
|
24
|
-
export const createBusinessSubscription = (
|
|
25
|
-
businessId: string,
|
|
26
|
-
body?: CreateBusinessSubscriptionBody,
|
|
27
|
-
opts?: MedipassRequestOpts = {}
|
|
28
|
-
): Promise<SubscriptionResponse> => {
|
|
29
|
-
doesParamExist({ businessId });
|
|
30
|
-
return request({ ...opts, path: pathBusinessSubscriptions(businessId) }, { method: 'post', data: body });
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Get business subscriptions
|
|
35
|
-
* @param {String} businessId - Business ID
|
|
36
|
-
* @param {Object} query - Query parameters
|
|
37
|
-
* @param {Object} opts - Additional options
|
|
38
|
-
*/
|
|
39
|
-
export const getBusinessSubscriptions = (
|
|
40
|
-
businessId: string,
|
|
41
|
-
query?: GetBusinessSubscriptionsQuery,
|
|
42
|
-
opts?: MedipassRequestOpts = {}
|
|
43
|
-
): Promise<SubscriptionsResponse> => {
|
|
44
|
-
doesParamExist({ businessId });
|
|
45
|
-
return request({ ...opts, path: pathBusinessSubscriptions(businessId) }, { method: 'get', params: query });
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Get business subscription
|
|
50
|
-
* @param {String} businessId - Business ID
|
|
51
|
-
* @param {String} subscriptionId - Subscription ID
|
|
52
|
-
* @param {Object} opts - Additional options
|
|
53
|
-
*/
|
|
54
|
-
export const getBusinessSubscription = (
|
|
55
|
-
businessId: string,
|
|
56
|
-
subscriptionId: string,
|
|
57
|
-
opts?: MedipassRequestOpts = {}
|
|
58
|
-
): Promise<SubscriptionResponse> => {
|
|
59
|
-
doesParamExist({ businessId, subscriptionId });
|
|
60
|
-
return request({ ...opts, path: pathBusinessSubscription(businessId, subscriptionId) }, { method: 'get' });
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Update business subscription
|
|
65
|
-
* @param {String} businessId - Business ID
|
|
66
|
-
* @param {String} subscriptionId - Subscription ID
|
|
67
|
-
* @param {Object} body - Request body
|
|
68
|
-
* @param {Object} opts - Additional options
|
|
69
|
-
*/
|
|
70
|
-
export const updateBusinessSubscription = (
|
|
71
|
-
businessId: string,
|
|
72
|
-
subscriptionId: string,
|
|
73
|
-
body: UpdateBusinessSubscriptionBody,
|
|
74
|
-
opts?: MedipassRequestOpts = {}
|
|
75
|
-
): Promise<SubscriptionResponse> => {
|
|
76
|
-
doesParamExist({ businessId, subscriptionId });
|
|
77
|
-
return request(
|
|
78
|
-
{ ...opts, path: pathBusinessSubscription(businessId, subscriptionId) },
|
|
79
|
-
{ method: 'put', data: body }
|
|
80
|
-
);
|
|
81
|
-
};
|
|
@@ -1,161 +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 pathTerminalsByBusinessId = (businessId: string) => `/businesses/${businessId}/terminals`;
|
|
8
|
-
export const pathTerminalsByPracticeId = (businessId: string, practiceId: string) =>
|
|
9
|
-
`/businesses/${businessId}/practices/${practiceId}/terminals`;
|
|
10
|
-
export const pathTerminalByTerminalId = (businessId: string, practiceId: string, terminalId: string) =>
|
|
11
|
-
`/businesses/${businessId}/practices/${practiceId}/terminals/${terminalId}`;
|
|
12
|
-
export const pathResetTerminal = (businessId: string, practiceId: string, terminalId: string) =>
|
|
13
|
-
`/businesses/${businessId}/practices/${practiceId}/terminals/${terminalId}/reset`;
|
|
14
|
-
export const pathClientTokenByPracticeId = (businessId: string, practiceId: string) =>
|
|
15
|
-
`/businesses/${businessId}/practices/${practiceId}/terminals/clienttoken`;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Register a terminal
|
|
19
|
-
* @param {String} businessId - Business ID
|
|
20
|
-
* @param {String} practiceId - Practice ID
|
|
21
|
-
* @param {Object} body - Request body
|
|
22
|
-
* @param {Object} opts - Additional options
|
|
23
|
-
*/
|
|
24
|
-
export const registerTerminal = async (
|
|
25
|
-
businessId: string,
|
|
26
|
-
practiceId: string,
|
|
27
|
-
body: Object,
|
|
28
|
-
opts?: MedipassRequestOpts = {}
|
|
29
|
-
): Promise<Object> => {
|
|
30
|
-
doesParamExist({ businessId, practiceId }, opts.hyperMediaEndpoint);
|
|
31
|
-
return request({ ...opts, path: pathTerminalsByPracticeId(businessId, practiceId) }, { method: 'post', data: body });
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Get terminals for a business
|
|
36
|
-
* @param {String} businessId - Business ID
|
|
37
|
-
* @param {Object} query - query parameters
|
|
38
|
-
* @param {Object} opts - Additional options
|
|
39
|
-
*/
|
|
40
|
-
export const getBusinessTerminals = async (
|
|
41
|
-
businessId: string,
|
|
42
|
-
query: Object,
|
|
43
|
-
opts?: MedipassRequestOpts = {}
|
|
44
|
-
): Promise<Object> => {
|
|
45
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
46
|
-
return request({ ...opts, path: pathTerminalsByBusinessId(businessId) }, { method: 'get', params: query });
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Get registered terminals for a practice
|
|
51
|
-
* @param {String} businessId - Business ID
|
|
52
|
-
* @param {String} practiceId - Practice ID
|
|
53
|
-
* @param {Object} query - query parameters
|
|
54
|
-
* @param {Object} opts - Additional options
|
|
55
|
-
*/
|
|
56
|
-
export const getTerminals = async (
|
|
57
|
-
businessId: string,
|
|
58
|
-
practiceId: string,
|
|
59
|
-
query: Object,
|
|
60
|
-
opts?: MedipassRequestOpts = {}
|
|
61
|
-
): Promise<Object> => {
|
|
62
|
-
doesParamExist({ businessId, practiceId }, opts.hyperMediaEndpoint);
|
|
63
|
-
return request(
|
|
64
|
-
{ ...opts, path: pathTerminalsByPracticeId(businessId, practiceId) },
|
|
65
|
-
{ method: 'get', params: query }
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Get terminal by terminalId
|
|
71
|
-
* @param {String} businessId - Business ID
|
|
72
|
-
* @param {String} practiceId - Practice ID
|
|
73
|
-
* @param {String} terminalId - Terminal ID
|
|
74
|
-
* @param {Object} body - Request body
|
|
75
|
-
* @param {Object} opts - Additional options
|
|
76
|
-
*/
|
|
77
|
-
export const getTerminal = async (
|
|
78
|
-
businessId: string,
|
|
79
|
-
practiceId: string,
|
|
80
|
-
terminalId: string,
|
|
81
|
-
opts?: MedipassRequestOpts = {}
|
|
82
|
-
): Promise<Object> => {
|
|
83
|
-
doesParamExist({ businessId, practiceId, terminalId }, opts.hyperMediaEndpoint);
|
|
84
|
-
return request({ ...opts, path: pathTerminalByTerminalId(businessId, practiceId, terminalId) }, { method: 'get' });
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Update terminal by terminalId
|
|
89
|
-
* @param {String} businessId - Business ID
|
|
90
|
-
* @param {String} practiceId - Practice ID
|
|
91
|
-
* @param {String} terminalId - Terminal ID
|
|
92
|
-
* @param {Object} body - Request body
|
|
93
|
-
* @param {Object} opts - Additional options
|
|
94
|
-
*/
|
|
95
|
-
export const updateTerminal = async (
|
|
96
|
-
businessId: string,
|
|
97
|
-
practiceId: string,
|
|
98
|
-
terminalId: string,
|
|
99
|
-
body: Object,
|
|
100
|
-
opts?: MedipassRequestOpts = {}
|
|
101
|
-
): Promise<Object> => {
|
|
102
|
-
doesParamExist({ businessId, practiceId, terminalId }, opts.hyperMediaEndpoint);
|
|
103
|
-
return request(
|
|
104
|
-
{ ...opts, path: pathTerminalByTerminalId(businessId, practiceId, terminalId) },
|
|
105
|
-
{ method: 'put', data: body }
|
|
106
|
-
);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Delete terminal by terminalId
|
|
111
|
-
* @param {String} businessId - Business ID
|
|
112
|
-
* @param {String} practiceId - Practice ID
|
|
113
|
-
* @param {String} terminalId - Terminal ID
|
|
114
|
-
* @param {Object} opts - Additional options
|
|
115
|
-
*/
|
|
116
|
-
export const deleteTerminal = async (
|
|
117
|
-
businessId: string,
|
|
118
|
-
practiceId: string,
|
|
119
|
-
terminalId: string,
|
|
120
|
-
opts?: MedipassRequestOpts = {}
|
|
121
|
-
): Promise<Object> => {
|
|
122
|
-
doesParamExist({ businessId, practiceId, terminalId }, opts.hyperMediaEndpoint);
|
|
123
|
-
return request({ ...opts, path: pathTerminalByTerminalId(businessId, practiceId, terminalId) }, { method: 'delete' });
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Get client token
|
|
128
|
-
* @param {String} businessId - Business ID
|
|
129
|
-
* @param {String} practiceId - Practice ID
|
|
130
|
-
* @param {Object} opts - Additional options
|
|
131
|
-
*/
|
|
132
|
-
export const getClientToken = async (
|
|
133
|
-
businessId: string,
|
|
134
|
-
practiceId: string,
|
|
135
|
-
opts?: MedipassRequestOpts = {}
|
|
136
|
-
): Promise<Object> => {
|
|
137
|
-
doesParamExist({ businessId, practiceId }, opts.hyperMediaEndpoint);
|
|
138
|
-
return request({ ...opts, path: pathClientTokenByPracticeId(businessId, practiceId) }, { method: 'get' });
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Reset terminal by terminalId - only to be used on tyro simulato terminals
|
|
143
|
-
* @param {String} businessId - Business ID
|
|
144
|
-
* @param {String} practiceId - Practice ID
|
|
145
|
-
* @param {String} terminalId - Terminal ID
|
|
146
|
-
* @param {Object} body - Request body
|
|
147
|
-
* @param {Object} opts - Additional options
|
|
148
|
-
*/
|
|
149
|
-
export const resetTerminal = async (
|
|
150
|
-
businessId: string,
|
|
151
|
-
practiceId: string,
|
|
152
|
-
terminalId: string,
|
|
153
|
-
body: Object,
|
|
154
|
-
opts?: MedipassRequestOpts = {}
|
|
155
|
-
): Promise<Object> => {
|
|
156
|
-
doesParamExist({ businessId, practiceId, terminalId }, opts.hyperMediaEndpoint);
|
|
157
|
-
return request(
|
|
158
|
-
{ ...opts, path: pathResetTerminal(businessId, practiceId, terminalId) },
|
|
159
|
-
{ method: 'post', data: body }
|
|
160
|
-
);
|
|
161
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import request from '../utils/request';
|
|
4
|
-
import doesParamExist from '../utils/does-param-exist';
|
|
5
|
-
import type { MedipassRequestOpts } from '../_types';
|
|
6
|
-
|
|
7
|
-
export const pathCreateHealthFundTransactionExport = (healthFundId: string) =>
|
|
8
|
-
`/healthfunds/${healthFundId}/transactionexport`;
|
|
9
|
-
export const pathGetHealthFundTransactionExport = (healthFundId: string, transactionExportId: string) =>
|
|
10
|
-
`/healthfunds/${healthFundId}/transactionexports/${transactionExportId}`;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Get a transaction export for a healthfund
|
|
14
|
-
* @param {String} healthFundId - Health fund ID
|
|
15
|
-
* @param {Object} body - Request body
|
|
16
|
-
* @param {Object} opts - Additional options
|
|
17
|
-
*/
|
|
18
|
-
export const createHealthFundTransactionExport = async (
|
|
19
|
-
healthFundId: string,
|
|
20
|
-
body: Object,
|
|
21
|
-
opts?: MedipassRequestOpts = {}
|
|
22
|
-
): Promise<Object> => {
|
|
23
|
-
doesParamExist({ healthFundId }, opts.hyperMediaEndpoint);
|
|
24
|
-
return request(
|
|
25
|
-
{ ...opts, path: pathCreateHealthFundTransactionExport(healthFundId) },
|
|
26
|
-
{ method: 'post', data: body }
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Get transaction export for a healthfund
|
|
32
|
-
* @param {String} healthFundId - Health Fund ID
|
|
33
|
-
* @param {String} transactionExportId - Transaction Export ID
|
|
34
|
-
* @param {Object} query - query parameters
|
|
35
|
-
* @param {Object} opts - Additional options
|
|
36
|
-
*/
|
|
37
|
-
export const getHealthFundTransactionExport = async (
|
|
38
|
-
healthFundId: string,
|
|
39
|
-
transactionExportId: string,
|
|
40
|
-
query?: Object = {},
|
|
41
|
-
opts?: MedipassRequestOpts = {}
|
|
42
|
-
): Promise<Object> => {
|
|
43
|
-
doesParamExist({ healthFundId, transactionExportId }, opts.hyperMediaEndpoint);
|
|
44
|
-
return request(
|
|
45
|
-
{ ...opts, path: pathGetHealthFundTransactionExport(healthFundId, transactionExportId) },
|
|
46
|
-
{ method: 'get', params: query }
|
|
47
|
-
);
|
|
48
|
-
};
|