@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,583 +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 pathBusinessPracticeStaffMembers = (businessId, practiceId) =>
|
|
8
|
-
`/businesses/${businessId}/practices/${practiceId}/staff`;
|
|
9
|
-
const pathBusinessPracticeStaffMember = (businessId, practiceId, staffId) =>
|
|
10
|
-
`/businesses/${businessId}/practices/${practiceId}/staff/${staffId}`;
|
|
11
|
-
const pathBusinessFormPracticeStaffMembers = (businessId, formId, practiceId) =>
|
|
12
|
-
`/businesses/${businessId}/forms/${formId}/practices/${practiceId}/staff`;
|
|
13
|
-
const pathBusinessServiceStaffMembers = (businessId, serviceId) =>
|
|
14
|
-
`/businesses/${businessId}/services/${serviceId}/staff`;
|
|
15
|
-
const pathBusinessStaff = businessId => `/businesses/${businessId}/staff`;
|
|
16
|
-
const pathBusinessStaffMember = (businessId, staffId) => `/businesses/${businessId}/staff/${staffId}`;
|
|
17
|
-
const pathOrganisationStaff = organisationId => `/organisations/${organisationId}/staff`;
|
|
18
|
-
const pathOrganisationStaffMember = (organisationId, staffId) => `/organisations/${organisationId}/staff/${staffId}`;
|
|
19
|
-
const pathStaffMember = staffId => `/staff/${staffId}`;
|
|
20
|
-
const pathProviderSetItems = (businessId, staffId) => `/businesses/${businessId}/staff/${staffId}/providersetitems`;
|
|
21
|
-
const pathProviderSetItem = (businessId, staffId, providerSetItemId) =>
|
|
22
|
-
`/businesses/${businessId}/staff/${staffId}/providersetitems/${providerSetItemId}`;
|
|
23
|
-
const pathProvidersStatus = '/providers/status';
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Create business staff member
|
|
27
|
-
* @param {String} businessId - Organisation ID
|
|
28
|
-
* @param {Object} body - Request body
|
|
29
|
-
* @param {Object} opts - Additional options
|
|
30
|
-
*/
|
|
31
|
-
export const createBusinessStaffMember = async (
|
|
32
|
-
businessId: string,
|
|
33
|
-
body: Object,
|
|
34
|
-
opts?: MedipassRequestOpts = {}
|
|
35
|
-
): Promise<Object> => {
|
|
36
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
37
|
-
return request({ ...opts, path: pathBusinessStaff(businessId) }, { method: 'post', data: body });
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Create organisation staff member
|
|
42
|
-
* @param {String} organisationId - Organisation ID
|
|
43
|
-
* @param {Object} body - Request body
|
|
44
|
-
* @param {Object} opts - Additional options
|
|
45
|
-
*/
|
|
46
|
-
export const createOrganisationStaffMember = async (
|
|
47
|
-
organisationId: string,
|
|
48
|
-
body: Object,
|
|
49
|
-
opts?: MedipassRequestOpts = {}
|
|
50
|
-
): Promise<Object> => {
|
|
51
|
-
doesParamExist({ organisationId }, opts.hyperMediaEndpoint);
|
|
52
|
-
return request({ ...opts, path: pathOrganisationStaff(organisationId) }, { method: 'post', data: body });
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Delete business staff member
|
|
57
|
-
* @param {String} businessId - Business ID
|
|
58
|
-
* @param {String} staffId - Staff ID
|
|
59
|
-
* @param {Object} opts - Additional options
|
|
60
|
-
*/
|
|
61
|
-
export const deleteBusinessStaffMember = async (
|
|
62
|
-
businessId: string,
|
|
63
|
-
staffId: string,
|
|
64
|
-
opts?: MedipassRequestOpts = {}
|
|
65
|
-
): Promise<Object> => {
|
|
66
|
-
doesParamExist({ businessId, staffId }, opts.hyperMediaEndpoint);
|
|
67
|
-
return request({ ...opts, path: pathBusinessStaffMember(businessId, staffId) }, { method: 'delete' });
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Delete business staff member email
|
|
72
|
-
* @param {String} businessId - Business ID
|
|
73
|
-
* @param {String} staffId - Staff ID
|
|
74
|
-
* @param {Object} opts - Additional options
|
|
75
|
-
*/
|
|
76
|
-
export const deleteBusinessStaffMemberEmail = async (
|
|
77
|
-
businessId: string,
|
|
78
|
-
staffId: string,
|
|
79
|
-
opts?: MedipassRequestOpts = {}
|
|
80
|
-
): Promise<Object> => {
|
|
81
|
-
doesParamExist({ businessId, staffId }, opts.hyperMediaEndpoint);
|
|
82
|
-
return request({ ...opts, path: `${pathBusinessStaffMember(businessId, staffId)}/email` }, { method: 'delete' });
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Get business staff member
|
|
87
|
-
* @param {Object} businessId - Business ID
|
|
88
|
-
* @param {Object} staffId - Staff ID
|
|
89
|
-
* @param {Object} opts - Additional options
|
|
90
|
-
*/
|
|
91
|
-
export const getBusinessStaffMember = async (
|
|
92
|
-
businessId: string,
|
|
93
|
-
staffId: string,
|
|
94
|
-
opts?: MedipassRequestOpts = {}
|
|
95
|
-
): Promise<Object> => {
|
|
96
|
-
doesParamExist({ businessId, staffId }, opts.hyperMediaEndpoint);
|
|
97
|
-
return request({ ...opts, path: pathBusinessStaffMember(businessId, staffId) }, { method: 'get' });
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Get business staff member roles
|
|
102
|
-
* @param {String} businessId - Business ID
|
|
103
|
-
* @param {String} staffId - Staff ID
|
|
104
|
-
* @param {String} roleFullName - Role
|
|
105
|
-
* @param {Object} opts - Additional options
|
|
106
|
-
*/
|
|
107
|
-
export const getBusinessStaffMemberRoles = async (
|
|
108
|
-
businessId: string,
|
|
109
|
-
staffId: string,
|
|
110
|
-
roleFullName: string,
|
|
111
|
-
opts?: MedipassRequestOpts = {}
|
|
112
|
-
): Promise<Object> => {
|
|
113
|
-
doesParamExist({ businessId, staffId }, opts.hyperMediaEndpoint);
|
|
114
|
-
return request(
|
|
115
|
-
{ ...opts, path: `${pathBusinessStaffMember(businessId, staffId)}/roles` },
|
|
116
|
-
{ method: 'get', params: { fullName: roleFullName } }
|
|
117
|
-
);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Get business practice staff member
|
|
122
|
-
* @param {Object} businessId - Business ID
|
|
123
|
-
* @param {Object} practiceId - Practice ID
|
|
124
|
-
* @param {Object} staffId - Staff ID
|
|
125
|
-
* @param {Object} opts - Additional options
|
|
126
|
-
*/
|
|
127
|
-
export const getBusinessPracticeStaffMember = async (
|
|
128
|
-
businessId: string,
|
|
129
|
-
practiceId: string,
|
|
130
|
-
staffId: string,
|
|
131
|
-
opts?: MedipassRequestOpts = {}
|
|
132
|
-
): Promise<Object> => {
|
|
133
|
-
doesParamExist({ businessId, practiceId, staffId }, opts.hyperMediaEndpoint);
|
|
134
|
-
return request(
|
|
135
|
-
{ ...opts, path: pathBusinessPracticeStaffMember(businessId, practiceId, staffId) },
|
|
136
|
-
{ method: 'get' }
|
|
137
|
-
);
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Get business practice staff member modalities
|
|
142
|
-
* @param {Object} businessId - Business ID
|
|
143
|
-
* @param {Object} practiceId - Practice ID
|
|
144
|
-
* @param {Object} staffId - Staff ID
|
|
145
|
-
* @param {Object} query - Query parameters
|
|
146
|
-
* @param {Object} opts - Additional options
|
|
147
|
-
*/
|
|
148
|
-
export const getBusinessPracticeStaffMemberModalities = async (
|
|
149
|
-
businessId: string,
|
|
150
|
-
practiceId: string,
|
|
151
|
-
staffId: string,
|
|
152
|
-
query?: Object = {},
|
|
153
|
-
opts?: MedipassRequestOpts = {}
|
|
154
|
-
): Promise<Array<Object>> => {
|
|
155
|
-
doesParamExist({ businessId, practiceId, staffId }, opts.hyperMediaEndpoint);
|
|
156
|
-
return request(
|
|
157
|
-
{ ...opts, path: `${pathBusinessPracticeStaffMember(businessId, practiceId, staffId)}/modalities` },
|
|
158
|
-
{ method: 'get', params: query }
|
|
159
|
-
);
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Get business practice staff members
|
|
164
|
-
* @param {Object} businessId - Business ID
|
|
165
|
-
* @param {Object} practiceId - Practice ID
|
|
166
|
-
* @param {Object} query - Query parameters
|
|
167
|
-
* @param {Object} opts - Additional options
|
|
168
|
-
*/
|
|
169
|
-
export const getBusinessPracticeStaffMembers = async (
|
|
170
|
-
businessId: string,
|
|
171
|
-
practiceId: string,
|
|
172
|
-
query?: Object,
|
|
173
|
-
opts?: MedipassRequestOpts = {}
|
|
174
|
-
): Promise<Object> => {
|
|
175
|
-
doesParamExist({ businessId, practiceId }, opts.hyperMediaEndpoint);
|
|
176
|
-
return request(
|
|
177
|
-
{ ...opts, path: pathBusinessPracticeStaffMembers(businessId, practiceId) },
|
|
178
|
-
{ method: 'get', params: query }
|
|
179
|
-
);
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Get business form practice staff members
|
|
184
|
-
* @param {Object} businessId - Business ID
|
|
185
|
-
* @param {Object} formId - Form ID
|
|
186
|
-
* @param {Object} practiceId - Practice ID
|
|
187
|
-
* @param {Object} query - Query parameters
|
|
188
|
-
* @param {Object} opts - Additional options
|
|
189
|
-
*/
|
|
190
|
-
export const getBusinessFormPracticeStaffMembers = async (
|
|
191
|
-
businessId: string,
|
|
192
|
-
formId: string,
|
|
193
|
-
practiceId: string,
|
|
194
|
-
query?: Object,
|
|
195
|
-
opts?: MedipassRequestOpts = {}
|
|
196
|
-
): Promise<Object> => {
|
|
197
|
-
doesParamExist({ businessId, formId, practiceId }, opts.hyperMediaEndpoint);
|
|
198
|
-
return request(
|
|
199
|
-
{ ...opts, path: pathBusinessFormPracticeStaffMembers(businessId, formId, practiceId) },
|
|
200
|
-
{ method: 'get', params: query }
|
|
201
|
-
);
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Get business service staff members
|
|
206
|
-
* @param {Object} businessId - Business ID
|
|
207
|
-
* @param {Object} serviceId - Service ID
|
|
208
|
-
* @param {Object} query - Query parameters
|
|
209
|
-
* @param {Object} opts - Additional options
|
|
210
|
-
*/
|
|
211
|
-
export const getBusinessServiceStaffMembers = async (
|
|
212
|
-
businessId: string,
|
|
213
|
-
serviceId: string,
|
|
214
|
-
query?: Object = {},
|
|
215
|
-
opts?: MedipassRequestOpts = {}
|
|
216
|
-
): Promise<Object> => {
|
|
217
|
-
doesParamExist({ businessId, serviceId }, opts.hyperMediaEndpoint);
|
|
218
|
-
return request(
|
|
219
|
-
{ ...opts, path: pathBusinessServiceStaffMembers(businessId, serviceId) },
|
|
220
|
-
{ method: 'get', params: query }
|
|
221
|
-
);
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Get business staff members
|
|
226
|
-
* @param {Object} opts - Additional options
|
|
227
|
-
*/
|
|
228
|
-
export const getBusinessStaffMembers = async (
|
|
229
|
-
businessId: string,
|
|
230
|
-
query?: Object,
|
|
231
|
-
opts?: MedipassRequestOpts = {}
|
|
232
|
-
): Promise<Object> => {
|
|
233
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
234
|
-
return request({ ...opts, path: pathBusinessStaff(businessId) }, { method: 'get', params: query });
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Get business staff upload urls
|
|
239
|
-
* @param {String} businessId - Business ID
|
|
240
|
-
* @param {String} staffId - Staff ID
|
|
241
|
-
* @param {String} contentType - Mime type
|
|
242
|
-
* @param {Object} opts - Additional options
|
|
243
|
-
*/
|
|
244
|
-
export const getBusinessStaffUploadUrl = async (
|
|
245
|
-
businessId: string,
|
|
246
|
-
staffId: string,
|
|
247
|
-
contentType: string,
|
|
248
|
-
opts?: MedipassRequestOpts = {}
|
|
249
|
-
): Promise<Object> => {
|
|
250
|
-
doesParamExist({ businessId, staffId, contentType }, opts.hyperMediaEndpoint);
|
|
251
|
-
return request(
|
|
252
|
-
{ ...opts, path: `${pathBusinessStaffMember(businessId, staffId)}/uploadurlv2` },
|
|
253
|
-
{ method: 'get', params: { contentType } }
|
|
254
|
-
);
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Get organisation staff members
|
|
259
|
-
* @param {String} organisationId - Organisation ID
|
|
260
|
-
* @param {Object} opts - Additional options
|
|
261
|
-
*/
|
|
262
|
-
export const getOrganisationStaffMembers = async (
|
|
263
|
-
organisationId: string,
|
|
264
|
-
query?: Object = {},
|
|
265
|
-
opts?: MedipassRequestOpts = {}
|
|
266
|
-
): Promise<Object> => {
|
|
267
|
-
doesParamExist({ organisationId }, opts.hyperMediaEndpoint);
|
|
268
|
-
return request({ ...opts, path: pathOrganisationStaff(organisationId) }, { method: 'get', params: query });
|
|
269
|
-
};
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Get staff member
|
|
273
|
-
* @param {String} staffId - Staff ID
|
|
274
|
-
* @param {Object} opts - Additional options
|
|
275
|
-
*/
|
|
276
|
-
export const getStaffMember = async (staffId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
277
|
-
doesParamExist({ staffId }, opts.hyperMediaEndpoint);
|
|
278
|
-
return request({ ...opts, path: pathStaffMember(staffId) }, { method: 'get' });
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Grant business practice staff role
|
|
283
|
-
* @param {String} businessId - Business ID
|
|
284
|
-
* @param {String} practiceId - Practice ID
|
|
285
|
-
* @param {String} staffId - Staff ID
|
|
286
|
-
* @param {String} roleFullName - Role
|
|
287
|
-
* @param {Object} opts - Additional options
|
|
288
|
-
*/
|
|
289
|
-
export const grantBusinessPracticeStaffRole = async (
|
|
290
|
-
businessId: string,
|
|
291
|
-
practiceId: string,
|
|
292
|
-
staffId: string,
|
|
293
|
-
roleFullName: string,
|
|
294
|
-
opts?: MedipassRequestOpts = {}
|
|
295
|
-
): Promise<Object> => {
|
|
296
|
-
doesParamExist({ businessId, practiceId, staffId }, opts.hyperMediaEndpoint);
|
|
297
|
-
return request(
|
|
298
|
-
{ ...opts, path: `${pathBusinessPracticeStaffMember(businessId, practiceId, staffId)}/roles` },
|
|
299
|
-
{ method: 'post', data: { roleFullName } }
|
|
300
|
-
);
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Grant business practice staff role
|
|
305
|
-
* @param {String} businessId - Business ID
|
|
306
|
-
* @param {String} staffId - Staff ID
|
|
307
|
-
* @param {String} roleFullName - Role
|
|
308
|
-
* @param {Object} body - Request body
|
|
309
|
-
* @param {Object} opts - Additional options
|
|
310
|
-
*/
|
|
311
|
-
export const grantBusinessStaffRole = async (
|
|
312
|
-
businessId: string,
|
|
313
|
-
staffId: string,
|
|
314
|
-
roleFullName: string,
|
|
315
|
-
body?: Object,
|
|
316
|
-
opts?: MedipassRequestOpts = {}
|
|
317
|
-
): Promise<Object> => {
|
|
318
|
-
doesParamExist({ businessId, staffId }, opts.hyperMediaEndpoint);
|
|
319
|
-
return request(
|
|
320
|
-
{ ...opts, path: `${pathBusinessStaffMember(businessId, staffId)}/roles` },
|
|
321
|
-
{ method: 'post', data: { roleFullName, ...body } }
|
|
322
|
-
);
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Invite a new business staff member
|
|
327
|
-
* @param {String} businessId - Business ID
|
|
328
|
-
* @param {Object} body - Request body
|
|
329
|
-
* @param {Object} opts - Additional options
|
|
330
|
-
*/
|
|
331
|
-
export const inviteNewBusinessStaffMember = async (
|
|
332
|
-
businessId: string,
|
|
333
|
-
body?: Object,
|
|
334
|
-
opts?: MedipassRequestOpts = {}
|
|
335
|
-
): Promise<Object> => {
|
|
336
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
337
|
-
return request({ ...opts, path: `${pathBusinessStaff(businessId)}/invites` }, { method: 'post', data: body });
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Invite business staff
|
|
342
|
-
* @param {String} businessId - Business ID
|
|
343
|
-
* @param {String} staffId - Staff ID
|
|
344
|
-
* @param {Object} opts - Additional options
|
|
345
|
-
*/
|
|
346
|
-
export const inviteBusinessStaffMember = async (
|
|
347
|
-
businessId: string,
|
|
348
|
-
staffId: string,
|
|
349
|
-
body?: Object = { createNewAccount: false },
|
|
350
|
-
opts?: MedipassRequestOpts = {}
|
|
351
|
-
): Promise<Object> => {
|
|
352
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
353
|
-
return request(
|
|
354
|
-
{ ...opts, path: `${pathBusinessStaffMember(businessId, staffId)}/invites` },
|
|
355
|
-
{ method: 'post', data: body }
|
|
356
|
-
);
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* Revoke business practice staff role
|
|
361
|
-
* @param {String} businessId - Business ID
|
|
362
|
-
* @param {String} practiceId - Practice ID
|
|
363
|
-
* @param {String} staffId - Staff ID
|
|
364
|
-
* @param {String} roleFullName - Role
|
|
365
|
-
* @param {Object} opts - Additional options
|
|
366
|
-
*/
|
|
367
|
-
export const revokeBusinessPracticeStaffRole = async (
|
|
368
|
-
businessId: string,
|
|
369
|
-
practiceId: string,
|
|
370
|
-
staffId: string,
|
|
371
|
-
roleFullName: string,
|
|
372
|
-
opts?: MedipassRequestOpts = {}
|
|
373
|
-
): Promise<Object> => {
|
|
374
|
-
doesParamExist({ businessId, practiceId, staffId }, opts.hyperMediaEndpoint);
|
|
375
|
-
return request(
|
|
376
|
-
{ ...opts, path: `${pathBusinessPracticeStaffMember(businessId, practiceId, staffId)}/roles` },
|
|
377
|
-
{ method: 'delete', data: { roleFullName } }
|
|
378
|
-
);
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* Revoke business practice staff role
|
|
383
|
-
* @param {String} businessId - Business ID
|
|
384
|
-
* @param {String} staffId - Staff ID
|
|
385
|
-
* @param {String} roleFullName - Role
|
|
386
|
-
* @param {Object} body - Request body
|
|
387
|
-
* @param {Object} opts - Additional options
|
|
388
|
-
*/
|
|
389
|
-
export const revokeBusinessStaffRole = async (
|
|
390
|
-
businessId: string,
|
|
391
|
-
staffId: string,
|
|
392
|
-
roleFullName: string,
|
|
393
|
-
body?: Object,
|
|
394
|
-
opts?: MedipassRequestOpts = {}
|
|
395
|
-
): Promise<Object> => {
|
|
396
|
-
doesParamExist({ businessId, staffId }, opts.hyperMediaEndpoint);
|
|
397
|
-
return request(
|
|
398
|
-
{ ...opts, path: `${pathBusinessStaffMember(businessId, staffId)}/roles` },
|
|
399
|
-
{ method: 'delete', data: { roleFullName, ...body } }
|
|
400
|
-
);
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
/**
|
|
404
|
-
* Update business staff member
|
|
405
|
-
* @param {String} businessId - Business ID
|
|
406
|
-
* @param {String} staffId - Staff ID
|
|
407
|
-
* @param {Object} body - Request body
|
|
408
|
-
* @param {Object} opts - Additional options
|
|
409
|
-
*/
|
|
410
|
-
export const updateBusinessStaffMember = async (
|
|
411
|
-
businessId: string,
|
|
412
|
-
staffId: string,
|
|
413
|
-
body: Object,
|
|
414
|
-
opts?: MedipassRequestOpts = {}
|
|
415
|
-
): Promise<Object> => {
|
|
416
|
-
doesParamExist({ businessId, staffId }, opts.hyperMediaEndpoint);
|
|
417
|
-
return request({ ...opts, path: pathBusinessStaffMember(businessId, staffId) }, { method: 'put', data: body });
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
/**
|
|
421
|
-
* Create or resend a magic link to update current staff's email
|
|
422
|
-
* @param {String} businessId - Business ID
|
|
423
|
-
* @param {String} staffId - Staff ID
|
|
424
|
-
* @param {Object} body - Request body
|
|
425
|
-
* @param {Object} opts - Additional options
|
|
426
|
-
*/
|
|
427
|
-
export const updateBusinessStaffMemberEmail = async (
|
|
428
|
-
businessId: string,
|
|
429
|
-
staffId: string,
|
|
430
|
-
body: Object,
|
|
431
|
-
opts?: MedipassRequestOpts = {}
|
|
432
|
-
): Promise<Object> => {
|
|
433
|
-
doesParamExist({ businessId, staffId }, opts.hyperMediaEndpoint);
|
|
434
|
-
return request(
|
|
435
|
-
{ ...opts, path: `${pathBusinessStaffMember(businessId, staffId)}/changeemail` },
|
|
436
|
-
{ method: 'post', data: body }
|
|
437
|
-
);
|
|
438
|
-
};
|
|
439
|
-
|
|
440
|
-
/**
|
|
441
|
-
* Update organisation staff member
|
|
442
|
-
* @param {String} organisationId - Organisation ID
|
|
443
|
-
* @param {String} staffId - Staff ID
|
|
444
|
-
* @param {Object} body - Request body
|
|
445
|
-
* @param {Object} opts - Additional options
|
|
446
|
-
*/
|
|
447
|
-
export const updateOrganisationStaffMember = async (
|
|
448
|
-
organisationId: string,
|
|
449
|
-
staffId: string,
|
|
450
|
-
body: Object,
|
|
451
|
-
opts?: MedipassRequestOpts = {}
|
|
452
|
-
): Promise<Object> => {
|
|
453
|
-
doesParamExist({ organisationId, staffId }, opts.hyperMediaEndpoint);
|
|
454
|
-
return request(
|
|
455
|
-
{ ...opts, path: pathOrganisationStaffMember(organisationId, staffId) },
|
|
456
|
-
{ method: 'put', data: body }
|
|
457
|
-
);
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* Verify staff member
|
|
462
|
-
* @param {String} staffId - Staff ID
|
|
463
|
-
* @param {Object} body - Request body
|
|
464
|
-
* @param {Object} opts - Additional options
|
|
465
|
-
*/
|
|
466
|
-
export const verifyStaffMember = async (
|
|
467
|
-
staffId: string,
|
|
468
|
-
body: Object,
|
|
469
|
-
opts?: MedipassRequestOpts = {}
|
|
470
|
-
): Promise<Object> => {
|
|
471
|
-
doesParamExist({ staffId }, opts.hyperMediaEndpoint);
|
|
472
|
-
return request({ ...opts, path: `${pathStaffMember(staffId)}/verify` }, { method: 'post', data: body });
|
|
473
|
-
};
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* Clone staff member into another business
|
|
477
|
-
* @param {String} staffId - Staff ID
|
|
478
|
-
* @param {Object} body - Request body
|
|
479
|
-
* @param {Object} opts - Additional options
|
|
480
|
-
*/
|
|
481
|
-
export const cloneStaffMemberIntoBusiness = async (
|
|
482
|
-
staffId: string,
|
|
483
|
-
body: Object,
|
|
484
|
-
opts?: MedipassRequestOpts = {}
|
|
485
|
-
): Promise<Object> => {
|
|
486
|
-
doesParamExist({ staffId }, opts.hyperMediaEndpoint);
|
|
487
|
-
return request({ ...opts, path: `${pathStaffMember(staffId)}/clone` }, { method: 'post', data: body });
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
/**
|
|
491
|
-
* Check if email exists
|
|
492
|
-
* @param {String} businessId - Business ID
|
|
493
|
-
* @param {Object} query - Query parameters
|
|
494
|
-
* @param {Object} opts - Additional options
|
|
495
|
-
*/
|
|
496
|
-
export const checkStaffMemberEmailExists = (
|
|
497
|
-
businessId: string,
|
|
498
|
-
query: { email: string },
|
|
499
|
-
opts?: MedipassRequestOpts = {}
|
|
500
|
-
): Promise<Object> => {
|
|
501
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
502
|
-
return request({ ...opts, path: `${pathBusinessStaff(businessId)}/exists` }, { method: 'get', params: query });
|
|
503
|
-
};
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* Create business staff provider set item
|
|
507
|
-
* @param {String} businessId - Business ID
|
|
508
|
-
* @param {String} staffId - Staff ID
|
|
509
|
-
* @param {Object} body - Request body
|
|
510
|
-
* @param {Object} opts - Additional options
|
|
511
|
-
*/
|
|
512
|
-
export const createStaffProviderSetItem = async (
|
|
513
|
-
businessId: string,
|
|
514
|
-
staffId: string,
|
|
515
|
-
body: Object,
|
|
516
|
-
opts?: MedipassRequestOpts = {}
|
|
517
|
-
): Promise<Object> => {
|
|
518
|
-
doesParamExist({ businessId, staffId }, opts.hyperMediaEndpoint);
|
|
519
|
-
return request({ ...opts, path: `${pathProviderSetItems(businessId, staffId)}` }, { method: 'post', data: body });
|
|
520
|
-
};
|
|
521
|
-
|
|
522
|
-
/**
|
|
523
|
-
* Update business staff provider set item
|
|
524
|
-
* @param {String} businessId - Business ID
|
|
525
|
-
* @param {String} staffId - Staff ID
|
|
526
|
-
* @param {String} providerSetItemId - Provider set item ID
|
|
527
|
-
* @param {Object} body - Request body
|
|
528
|
-
* @param {Object} opts - Additional options
|
|
529
|
-
*/
|
|
530
|
-
export const updateStaffProviderSetItem = async (
|
|
531
|
-
businessId: string,
|
|
532
|
-
staffId: string,
|
|
533
|
-
providerSetItemId: string,
|
|
534
|
-
body: Object,
|
|
535
|
-
opts?: MedipassRequestOpts = {}
|
|
536
|
-
): Promise<Object> => {
|
|
537
|
-
doesParamExist({ businessId, staffId, providerSetItemId }, opts.hyperMediaEndpoint);
|
|
538
|
-
return request(
|
|
539
|
-
{ ...opts, path: pathProviderSetItem(businessId, staffId, providerSetItemId) },
|
|
540
|
-
{ method: 'put', data: body }
|
|
541
|
-
);
|
|
542
|
-
};
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* Delete business staff provider set item
|
|
546
|
-
* @param {String} businessId - Business ID
|
|
547
|
-
* @param {String} staffId - Staff ID
|
|
548
|
-
* @param {String} providerSetItemId - Provider set item ID
|
|
549
|
-
* @param {Object} opts - Additional options
|
|
550
|
-
*/
|
|
551
|
-
export const deleteStaffProviderSetItem = async (
|
|
552
|
-
businessId: string,
|
|
553
|
-
staffId: string,
|
|
554
|
-
providerSetItemId: string,
|
|
555
|
-
opts?: MedipassRequestOpts = {}
|
|
556
|
-
): Promise<Object> => {
|
|
557
|
-
doesParamExist({ businessId, staffId, providerSetItemId }, opts.hyperMediaEndpoint);
|
|
558
|
-
return request({ ...opts, path: pathProviderSetItem(businessId, staffId, providerSetItemId) }, { method: 'delete' });
|
|
559
|
-
};
|
|
560
|
-
|
|
561
|
-
/**
|
|
562
|
-
* Gets a list of providers and their current status.
|
|
563
|
-
* @param {String} businessId - Business ID
|
|
564
|
-
* @param {Object} query - Query parameters
|
|
565
|
-
* @param {Object} opts - Additional options
|
|
566
|
-
*/
|
|
567
|
-
export const getProvidersStatus = (
|
|
568
|
-
businessId: string,
|
|
569
|
-
query: { providerNumber?: string },
|
|
570
|
-
opts?: MedipassRequestOpts = {}
|
|
571
|
-
): Promise<Object> => {
|
|
572
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
573
|
-
return request(
|
|
574
|
-
{ ...opts, path: pathProvidersStatus },
|
|
575
|
-
{
|
|
576
|
-
method: 'get',
|
|
577
|
-
params: {
|
|
578
|
-
...query,
|
|
579
|
-
businessId
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
);
|
|
583
|
-
};
|