@medipass/web-sdk 11.38.1-feature-eclipse-reporting.0 → 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/babel.config.js +2 -1
- package/lib/index.d.ts +262 -0
- package/lib/index.js +83 -3
- package/lib/{regions-7b23080d.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 +3 -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-1ec3d500.js → staff-96febcd8.js} +345 -738
- 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 -97
- 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-4b403caa.js +0 -1300
- 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,64 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import platform from 'platform';
|
|
4
|
-
import medipassWebSdk from '../index';
|
|
5
|
-
import request from '../utils/request';
|
|
6
|
-
import storage from '../services/storage';
|
|
7
|
-
|
|
8
|
-
import type { MedipassRequestOpts } from '../_types';
|
|
9
|
-
|
|
10
|
-
const PATH__DEVICES = '/devices';
|
|
11
|
-
let isRegistering = false;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Register a device
|
|
15
|
-
* @param {Object} opts - Additional options
|
|
16
|
-
* @returns {Object} The device data
|
|
17
|
-
*/
|
|
18
|
-
export const registerDevice = async (opts?: MedipassRequestOpts): Promise<Object> => {
|
|
19
|
-
if (!isRegistering) {
|
|
20
|
-
try {
|
|
21
|
-
isRegistering = true;
|
|
22
|
-
const deviceData = {
|
|
23
|
-
deviceType: 'browser',
|
|
24
|
-
os: {
|
|
25
|
-
type: platform.os.family || 'Unknown',
|
|
26
|
-
ver: platform.os.version || '0'
|
|
27
|
-
},
|
|
28
|
-
app: {
|
|
29
|
-
appId: platform.ua || 'Unknown'
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const data = await request(
|
|
34
|
-
{ ...opts, path: PATH__DEVICES },
|
|
35
|
-
{ method: 'post', data: deviceData, skipDeviceCheck: true }
|
|
36
|
-
);
|
|
37
|
-
medipassWebSdk.device = data;
|
|
38
|
-
storage.set('device', data);
|
|
39
|
-
return data;
|
|
40
|
-
} finally {
|
|
41
|
-
isRegistering = false;
|
|
42
|
-
}
|
|
43
|
-
} else {
|
|
44
|
-
let data;
|
|
45
|
-
do {
|
|
46
|
-
await new Promise(resolve => setTimeout(resolve, 100));
|
|
47
|
-
data = medipassWebSdk.device;
|
|
48
|
-
} while (!data);
|
|
49
|
-
|
|
50
|
-
return data;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Check if the device exists, and set the device id request header.
|
|
56
|
-
*/
|
|
57
|
-
export const getDeviceId = async (): Promise<?void> => {
|
|
58
|
-
const device = medipassWebSdk.device || storage.get('device');
|
|
59
|
-
if (!device || !device.deviceId) {
|
|
60
|
-
const data = await registerDevice();
|
|
61
|
-
return data.deviceId;
|
|
62
|
-
}
|
|
63
|
-
return device.deviceId;
|
|
64
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import doesParamExist from '../utils/does-param-exist';
|
|
4
|
-
import request from '../utils/request';
|
|
5
|
-
import type { MedipassRequestOpts } from '../_types';
|
|
6
|
-
|
|
7
|
-
const PATH__DOC_ACCOUNTS = '/docaccounts';
|
|
8
|
-
const pathDocAccount = docAccountId => `/docaccounts/${docAccountId}`;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Get documentation accounts
|
|
12
|
-
* @param {Object} query - Query parameters
|
|
13
|
-
* @param {Object} opts - Additional options
|
|
14
|
-
*/
|
|
15
|
-
export const getDocAccounts = async (query?: Object = {}, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
16
|
-
return request({ ...opts, path: PATH__DOC_ACCOUNTS }, { method: 'get', params: query });
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Get documentation account
|
|
21
|
-
* @param {String} docAccountId - Documentation Account ID
|
|
22
|
-
* @param {Object} opts - Additional options
|
|
23
|
-
*/
|
|
24
|
-
export const getDocAccount = async (partnerId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
25
|
-
doesParamExist({ partnerId }, opts.hyperMediaEndpoint);
|
|
26
|
-
return request({ ...opts, path: pathDocAccount(partnerId) }, { method: 'get' });
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Create documentation account
|
|
31
|
-
* @param {Object} body - Request body
|
|
32
|
-
* @param {Object} opts - Additional options
|
|
33
|
-
*/
|
|
34
|
-
export const createDocAccount = async (body: Object, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
35
|
-
return request({ ...opts, path: PATH__DOC_ACCOUNTS }, { method: 'post', data: body });
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Update documentation account
|
|
40
|
-
* @param {String} docAccountId - Documentation Account ID
|
|
41
|
-
* @param {Object} body - Request body
|
|
42
|
-
* @param {Object} opts - Additional options
|
|
43
|
-
*/
|
|
44
|
-
export const updateDocAccount = async (
|
|
45
|
-
docAccountId: string,
|
|
46
|
-
body: Object,
|
|
47
|
-
opts?: MedipassRequestOpts = {}
|
|
48
|
-
): Promise<Object> => {
|
|
49
|
-
doesParamExist({ docAccountId }, opts.hyperMediaEndpoint);
|
|
50
|
-
return request({ ...opts, path: pathDocAccount(docAccountId) }, { method: 'put', data: body });
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Delete documentation account
|
|
55
|
-
* @param {String} docAccountId - Documentation Account ID
|
|
56
|
-
* @param {Object} opts - Additional options
|
|
57
|
-
*/
|
|
58
|
-
export const deleteDocAccount = async (docAccountId: string, opts?: MedipassRequestOpts = {}): Promise<Object> => {
|
|
59
|
-
doesParamExist({ docAccountId }, opts.hyperMediaEndpoint);
|
|
60
|
-
return request({ ...opts, path: pathDocAccount(docAccountId) }, { method: 'delete' });
|
|
61
|
-
};
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import doesParamExist from '../utils/does-param-exist';
|
|
4
|
-
import request from '../utils/request';
|
|
5
|
-
import type {
|
|
6
|
-
BusinessDocumentsQuery,
|
|
7
|
-
BusinessDocumentResponse,
|
|
8
|
-
BusinessDocumentsResponse,
|
|
9
|
-
CeaseHealthFundDocumentBody,
|
|
10
|
-
DeclineHealthFundDocumentBody,
|
|
11
|
-
HealthFundDocumentResponse,
|
|
12
|
-
HealthFundDocumentsResponse,
|
|
13
|
-
HealthFundDocumentsQuery,
|
|
14
|
-
ParkHealthFundDocumentBody,
|
|
15
|
-
MedipassRequestOpts
|
|
16
|
-
} from '../_types';
|
|
17
|
-
|
|
18
|
-
export const pathBusinessDocuments = (businessId: string) => `/businesses/${businessId}/documents`;
|
|
19
|
-
export const pathBusinessDocument = (businessId: string, documentId: string) =>
|
|
20
|
-
`/businesses/${businessId}/documents/${documentId}`;
|
|
21
|
-
export const pathBusinessDocumentCancel = (businessId: string, documentId: string) =>
|
|
22
|
-
`/businesses/${businessId}/documents/${documentId}/cancellations`;
|
|
23
|
-
export const pathHealthFundDocument = (healthFundId: string, documentId: string) =>
|
|
24
|
-
`/healthfunds/${healthFundId}/documents/${documentId}`;
|
|
25
|
-
export const pathHealthFundDocumentApprove = (healthFundId: string, documentId: string) =>
|
|
26
|
-
`/healthfunds/${healthFundId}/documents/${documentId}/approvals`;
|
|
27
|
-
export const pathHealthFundDocumentAssignToMe = (healthFundId: string, documentId: string) =>
|
|
28
|
-
`/healthfunds/${healthFundId}/documents/${documentId}/assigntome`;
|
|
29
|
-
export const pathHealthFundDocumentDecline = (healthFundId: string, documentId: string) =>
|
|
30
|
-
`/healthfunds/${healthFundId}/documents/${documentId}/decline`;
|
|
31
|
-
export const pathHealthFundDocumentCease = (healthFundId: string, documentId: string) =>
|
|
32
|
-
`/healthfunds/${healthFundId}/documents/${documentId}/cease`;
|
|
33
|
-
export const pathHealthFundDocumentPark = (healthFundId: string, documentId: string) =>
|
|
34
|
-
`/healthfunds/${healthFundId}/documents/${documentId}/park`;
|
|
35
|
-
export const pathHealthFundDocumentTag = (healthFundId: string, documentId: string, tagId: string) =>
|
|
36
|
-
`/healthfunds/${healthFundId}/documents/${documentId}/tags/${tagId}`;
|
|
37
|
-
export const pathHealthFundDocuments = (healthFundId: string) => `/healthfunds/${healthFundId}/documents`;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Approve health fund document
|
|
41
|
-
* @param {String} healthFundId - Business ID
|
|
42
|
-
* @param {String} documentId - Document ID
|
|
43
|
-
* @param {Object} opts - Additional options
|
|
44
|
-
*/
|
|
45
|
-
export const approveHealthFundDocument = (
|
|
46
|
-
healthFundId: string,
|
|
47
|
-
documentId: string,
|
|
48
|
-
opts?: MedipassRequestOpts = {}
|
|
49
|
-
): Promise<HealthFundDocumentResponse> => {
|
|
50
|
-
doesParamExist({ healthFundId, documentId }, opts.hyperMediaEndpoint);
|
|
51
|
-
return request({ ...opts, path: pathHealthFundDocumentApprove(healthFundId, documentId) }, { method: 'post' });
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Get business documents
|
|
56
|
-
* @param {String} businessId - Business ID
|
|
57
|
-
* @param {Object} query - Query parameters
|
|
58
|
-
* @param {Object} opts - Additional options
|
|
59
|
-
*/
|
|
60
|
-
export const assignHealthFundDocumentToMe = (
|
|
61
|
-
healthFundId: string,
|
|
62
|
-
documentId: string,
|
|
63
|
-
opts?: MedipassRequestOpts = {}
|
|
64
|
-
): Promise<HealthFundDocumentResponse> => {
|
|
65
|
-
doesParamExist({ healthFundId, documentId }, opts.hyperMediaEndpoint);
|
|
66
|
-
return request({ ...opts, path: pathHealthFundDocumentAssignToMe(healthFundId, documentId) }, { method: 'put' });
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Cancel business document
|
|
71
|
-
* @param {String} businessId - Business ID
|
|
72
|
-
* @param {String} documentId - Document ID
|
|
73
|
-
* @param {Object} opts - Additional options
|
|
74
|
-
*/
|
|
75
|
-
export const cancelBusinessDocument = (
|
|
76
|
-
businessId: string,
|
|
77
|
-
documentId: string,
|
|
78
|
-
opts?: MedipassRequestOpts = {}
|
|
79
|
-
): Promise<HealthFundDocumentResponse> => {
|
|
80
|
-
doesParamExist({ businessId, documentId }, opts.hyperMediaEndpoint);
|
|
81
|
-
return request({ ...opts, path: pathBusinessDocumentCancel(businessId, documentId) }, { method: 'post' });
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Decline health fund document
|
|
86
|
-
* @param {String} healthFundId - Business ID
|
|
87
|
-
* @param {String} documentId - Document ID
|
|
88
|
-
* @param {Object} opts - Additional options
|
|
89
|
-
*/
|
|
90
|
-
export const declineHealthFundDocument = (
|
|
91
|
-
healthFundId: string,
|
|
92
|
-
documentId: string,
|
|
93
|
-
body: DeclineHealthFundDocumentBody,
|
|
94
|
-
opts?: MedipassRequestOpts = {}
|
|
95
|
-
): Promise<HealthFundDocumentResponse> => {
|
|
96
|
-
doesParamExist({ healthFundId, documentId }, opts.hyperMediaEndpoint);
|
|
97
|
-
return request(
|
|
98
|
-
{ ...opts, path: pathHealthFundDocumentDecline(healthFundId, documentId) },
|
|
99
|
-
{ method: 'post', data: body }
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Cease health fund document
|
|
105
|
-
* @param {String} healthFundId - Business ID
|
|
106
|
-
* @param {String} documentId - Document ID
|
|
107
|
-
* @param {Object} opts - Additional options
|
|
108
|
-
*/
|
|
109
|
-
export const ceaseHealthFundDocument = (
|
|
110
|
-
healthFundId: string,
|
|
111
|
-
documentId: string,
|
|
112
|
-
body: CeaseHealthFundDocumentBody,
|
|
113
|
-
opts?: MedipassRequestOpts = {}
|
|
114
|
-
): Promise<HealthFundDocumentResponse> => {
|
|
115
|
-
doesParamExist({ healthFundId, documentId }, opts.hyperMediaEndpoint);
|
|
116
|
-
return request(
|
|
117
|
-
{ ...opts, path: pathHealthFundDocumentCease(healthFundId, documentId) },
|
|
118
|
-
{ method: 'post', data: body }
|
|
119
|
-
);
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Delete business document tag
|
|
124
|
-
* @param {String} businessId - Business ID
|
|
125
|
-
* @param {String} documentId - Document ID
|
|
126
|
-
* @param {String} tagId - Tag ID
|
|
127
|
-
* @param {Object} opts - Additional options
|
|
128
|
-
*/
|
|
129
|
-
export const deleteHealthFundDocumentTag = (
|
|
130
|
-
healthFundId: string,
|
|
131
|
-
documentId: string,
|
|
132
|
-
tagId: string,
|
|
133
|
-
opts?: MedipassRequestOpts = {}
|
|
134
|
-
): Promise<null> => {
|
|
135
|
-
doesParamExist({ healthFundId, documentId, tagId }, opts.hyperMediaEndpoint);
|
|
136
|
-
return request({ ...opts, path: pathHealthFundDocumentTag(healthFundId, documentId, tagId) }, { method: 'delete' });
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Get business documents
|
|
141
|
-
* @param {String} businessId - Business ID
|
|
142
|
-
* @param {Object} query - Query parameters
|
|
143
|
-
* @param {Object} opts - Additional options
|
|
144
|
-
*/
|
|
145
|
-
export const getBusinessDocuments = (
|
|
146
|
-
businessId: string,
|
|
147
|
-
query: BusinessDocumentsQuery,
|
|
148
|
-
opts?: MedipassRequestOpts = {}
|
|
149
|
-
): Promise<BusinessDocumentsResponse> => {
|
|
150
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
151
|
-
return request({ ...opts, path: pathBusinessDocuments(businessId) }, { method: 'get', params: query });
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Get business document
|
|
156
|
-
* @param {String} businessId - Business ID
|
|
157
|
-
* @param {String} documentId - Document ID
|
|
158
|
-
* @param {Object} opts - Additional options
|
|
159
|
-
*/
|
|
160
|
-
export const getBusinessDocument = (
|
|
161
|
-
businessId: string,
|
|
162
|
-
documentId: string,
|
|
163
|
-
opts?: MedipassRequestOpts = {}
|
|
164
|
-
): Promise<BusinessDocumentResponse> => {
|
|
165
|
-
doesParamExist({ businessId }, opts.hyperMediaEndpoint);
|
|
166
|
-
return request({ ...opts, path: pathBusinessDocument(businessId, documentId) }, { method: 'get' });
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Get health fund documents
|
|
171
|
-
* @param {String} healthFundId - Business ID
|
|
172
|
-
* @param {Object} query - Query parameters
|
|
173
|
-
* @param {Object} opts - Additional options
|
|
174
|
-
*/
|
|
175
|
-
export const getHealthFundDocuments = (
|
|
176
|
-
healthFundId: string,
|
|
177
|
-
query: HealthFundDocumentsQuery,
|
|
178
|
-
opts?: MedipassRequestOpts = {}
|
|
179
|
-
): Promise<HealthFundDocumentsResponse> => {
|
|
180
|
-
doesParamExist({ healthFundId }, opts.hyperMediaEndpoint);
|
|
181
|
-
return request({ ...opts, path: pathHealthFundDocuments(healthFundId) }, { method: 'get', params: query });
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Get health fund document
|
|
186
|
-
* @param {String} healthFundId - Business ID
|
|
187
|
-
* @param {String} documentId - Document ID
|
|
188
|
-
* @param {Object} opts - Additional options
|
|
189
|
-
*/
|
|
190
|
-
export const getHealthFundDocument = (
|
|
191
|
-
healthFundId: string,
|
|
192
|
-
documentId: string,
|
|
193
|
-
opts?: MedipassRequestOpts = {}
|
|
194
|
-
): Promise<HealthFundDocumentResponse> => {
|
|
195
|
-
doesParamExist({ healthFundId, documentId }, opts.hyperMediaEndpoint);
|
|
196
|
-
return request({ ...opts, path: pathHealthFundDocument(healthFundId, documentId) }, { method: 'get' });
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Park a health fund document
|
|
201
|
-
* @param {String} healthFundId - Business ID
|
|
202
|
-
* @param {String} documentId - Document ID
|
|
203
|
-
* @param {Object} opts - Additional options
|
|
204
|
-
*/
|
|
205
|
-
export const parkHealthFundDocument = (
|
|
206
|
-
healthFundId: string,
|
|
207
|
-
documentId: string,
|
|
208
|
-
body: ParkHealthFundDocumentBody,
|
|
209
|
-
opts?: MedipassRequestOpts = {}
|
|
210
|
-
): Promise<HealthFundDocumentResponse> => {
|
|
211
|
-
doesParamExist({ healthFundId, documentId }, opts.hyperMediaEndpoint);
|
|
212
|
-
return request(
|
|
213
|
-
{ ...opts, path: pathHealthFundDocumentPark(healthFundId, documentId) },
|
|
214
|
-
{ method: 'post', data: body }
|
|
215
|
-
);
|
|
216
|
-
};
|
|
@@ -1,96 +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 healthFundEmailSections = (healthFundId: string, emailTemplateId: string) =>
|
|
8
|
-
`/healthfunds/${healthFundId}/emailtemplates/${emailTemplateId}/emailsections`;
|
|
9
|
-
export const healthFundEmailTemplates = (healthFundId: string) => `/healthfunds/${healthFundId}/emailtemplates`;
|
|
10
|
-
export const healthFundTransactionEmail = (healthFundId: string, transactionId: string) =>
|
|
11
|
-
`/healthfunds/${healthFundId}/transactions/${transactionId}/emails`;
|
|
12
|
-
export const healthFundDocumentEmail = (healthFundId: string, documentId: string) =>
|
|
13
|
-
`/healthfunds/${healthFundId}/documents/${documentId}/emails`;
|
|
14
|
-
export const transactionEmailPackages = (transactionId: string) => `/transactions/${transactionId}/emailpackages`;
|
|
15
|
-
export const transactionEmailPackage = (transactionId: string, emailPackageId: string) =>
|
|
16
|
-
`/transactions/${transactionId}/emailpackages/${emailPackageId}`;
|
|
17
|
-
|
|
18
|
-
export const getHealthFundEmailSections = (
|
|
19
|
-
healthFundId: string,
|
|
20
|
-
emailTemplateId: string,
|
|
21
|
-
query?: Object = {},
|
|
22
|
-
opts?: MedipassRequestOpts = {}
|
|
23
|
-
): Promise<Object> => {
|
|
24
|
-
doesParamExist({ healthFundId, emailTemplateId }, opts.hyperMediaEndpoint);
|
|
25
|
-
return request(
|
|
26
|
-
{ ...opts, path: healthFundEmailSections(healthFundId, emailTemplateId) },
|
|
27
|
-
{ method: 'get', params: query }
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const getHealthFundEmailTemplates = (
|
|
32
|
-
healthFundId: string,
|
|
33
|
-
query?: Object = {},
|
|
34
|
-
opts?: MedipassRequestOpts = {}
|
|
35
|
-
): Promise<Object> => {
|
|
36
|
-
doesParamExist({ healthFundId }, opts.hyperMediaEndpoint);
|
|
37
|
-
return request({ ...opts, path: healthFundEmailTemplates(healthFundId) }, { method: 'get', params: query });
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const generateEmailTemplate = (
|
|
41
|
-
healthFundId: string,
|
|
42
|
-
transactionId: string,
|
|
43
|
-
body: Object,
|
|
44
|
-
opts?: MedipassRequestOpts = {}
|
|
45
|
-
): Promise<Object> => {
|
|
46
|
-
doesParamExist({ healthFundId, transactionId }, opts.hyperMediaEndpoint);
|
|
47
|
-
return request(
|
|
48
|
-
{ ...opts, path: healthFundTransactionEmail(healthFundId, transactionId) },
|
|
49
|
-
{ method: 'post', data: body }
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const generateDocumentEmailTemplate = (
|
|
54
|
-
healthFundId: string,
|
|
55
|
-
documentId: string,
|
|
56
|
-
body: Object,
|
|
57
|
-
opts?: MedipassRequestOpts = {}
|
|
58
|
-
): Promise<Object> => {
|
|
59
|
-
doesParamExist({ healthFundId, documentId }, opts.hyperMediaEndpoint);
|
|
60
|
-
return request({ ...opts, path: healthFundDocumentEmail(healthFundId, documentId) }, { method: 'post', data: body });
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const createEmailPackage = (
|
|
64
|
-
transactionId: string,
|
|
65
|
-
body?: Object,
|
|
66
|
-
opts?: MedipassRequestOpts = {}
|
|
67
|
-
): Promise<Object> => {
|
|
68
|
-
doesParamExist({ transactionId }, opts.hyperMediaEndpoint);
|
|
69
|
-
return request({ ...opts, path: transactionEmailPackages(transactionId) }, { method: 'post', data: body });
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const updateEmailPackage = (
|
|
73
|
-
transactionId: string,
|
|
74
|
-
emailPackageId: string,
|
|
75
|
-
body: Object,
|
|
76
|
-
opts?: MedipassRequestOpts = {}
|
|
77
|
-
): Promise<Object> => {
|
|
78
|
-
doesParamExist({ transactionId, emailPackageId }, opts.hyperMediaEndpoint);
|
|
79
|
-
return request(
|
|
80
|
-
{ ...opts, path: transactionEmailPackage(transactionId, emailPackageId) },
|
|
81
|
-
{ method: 'put', data: body }
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export const sendEmailPackage = (
|
|
86
|
-
transactionId: string,
|
|
87
|
-
emailPackageId: string,
|
|
88
|
-
body?: Object,
|
|
89
|
-
opts?: MedipassRequestOpts = {}
|
|
90
|
-
): Promise<Object> => {
|
|
91
|
-
doesParamExist({ transactionId, emailPackageId }, opts.hyperMediaEndpoint);
|
|
92
|
-
return request(
|
|
93
|
-
{ ...opts, path: `${transactionEmailPackage(transactionId, emailPackageId)}/send` },
|
|
94
|
-
{ method: 'post', data: body }
|
|
95
|
-
);
|
|
96
|
-
};
|
|
@@ -1,52 +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
|
-
|
|
6
|
-
export const pathBusinessFormApplicationTemplate = (
|
|
7
|
-
businessId: string,
|
|
8
|
-
formId: string,
|
|
9
|
-
formApplicationTemplateId: string
|
|
10
|
-
) => `/businesses/${businessId}/forms/${formId}/formapplicationtemplates/${formApplicationTemplateId}`;
|
|
11
|
-
export const pathHealthFundFormApplicationTemplate = (healthFundId: string, formApplicationTemplateId: string) =>
|
|
12
|
-
`/healthfunds/${healthFundId}/formapplicationtemplates/${formApplicationTemplateId}`;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Get business form application template
|
|
16
|
-
* @param {String} businessId - Business ID
|
|
17
|
-
* @param {String} formId - Form ID
|
|
18
|
-
* @param {String} formApplicationTemplateId - Form ID
|
|
19
|
-
* @param {Object} query - Query parameters
|
|
20
|
-
* @param {Object} opts - Additional options
|
|
21
|
-
*/
|
|
22
|
-
export const getBusinessFormApplicationTemplate = (
|
|
23
|
-
businessId: string,
|
|
24
|
-
formId: string,
|
|
25
|
-
formApplicationTemplateId: string,
|
|
26
|
-
opts?: MedipassRequestOpts = {}
|
|
27
|
-
): Promise<Object> => {
|
|
28
|
-
doesParamExist({ businessId, formId, formApplicationTemplateId }, opts.hyperMediaEndpoint);
|
|
29
|
-
return request(
|
|
30
|
-
{ ...opts, path: pathBusinessFormApplicationTemplate(businessId, formId, formApplicationTemplateId) },
|
|
31
|
-
{ method: 'get' }
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Get health fund form application template
|
|
37
|
-
* @param {String} healthFundId - Health fund ID
|
|
38
|
-
* @param {String} formApplicationTemplateId - Form ID
|
|
39
|
-
* @param {Object} query - Query parameters
|
|
40
|
-
* @param {Object} opts - Additional options
|
|
41
|
-
*/
|
|
42
|
-
export const getHealthFundFormApplicationTemplate = (
|
|
43
|
-
healthFundId: string,
|
|
44
|
-
formApplicationTemplateId: string,
|
|
45
|
-
opts?: MedipassRequestOpts = {}
|
|
46
|
-
): Promise<Object> => {
|
|
47
|
-
doesParamExist({ healthFundId, formApplicationTemplateId }, opts.hyperMediaEndpoint);
|
|
48
|
-
return request(
|
|
49
|
-
{ ...opts, path: pathHealthFundFormApplicationTemplate(healthFundId, formApplicationTemplateId) },
|
|
50
|
-
{ method: 'get' }
|
|
51
|
-
);
|
|
52
|
-
};
|
|
@@ -1,62 +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
|
-
|
|
6
|
-
export const pathBusinessFormApplication = (businessId: string, formApplicationId: string) =>
|
|
7
|
-
`/businesses/${businessId}/formapplications/${formApplicationId}`;
|
|
8
|
-
export const pathHealthFundFormApplication = (healthFundId: string, formApplicationId: string) =>
|
|
9
|
-
`/healthfunds/${healthFundId}/formapplications/${formApplicationId}`;
|
|
10
|
-
export const pathUpdatePracticeRepresentative = (healthFundId: string, formApplicationId: string) =>
|
|
11
|
-
`/healthfunds/${healthFundId}/formapplications/${formApplicationId}/practicerepresentative`;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Get business form application
|
|
15
|
-
* @param {String} businessId - Business ID
|
|
16
|
-
* @param {String} formApplicationId - Form ID
|
|
17
|
-
* @param {Object} query - Query parameters
|
|
18
|
-
* @param {Object} opts - Additional options
|
|
19
|
-
*/
|
|
20
|
-
export const getBusinessFormApplication = (
|
|
21
|
-
businessId: string,
|
|
22
|
-
formApplicationId: string,
|
|
23
|
-
opts?: MedipassRequestOpts = {}
|
|
24
|
-
): Promise<Object> => {
|
|
25
|
-
doesParamExist({ businessId, formApplicationId }, opts.hyperMediaEndpoint);
|
|
26
|
-
return request({ ...opts, path: pathBusinessFormApplication(businessId, formApplicationId) }, { method: 'get' });
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Get health fund form application
|
|
31
|
-
* @param {String} healthFundId - Business ID
|
|
32
|
-
* @param {String} formApplicationId - Form ID
|
|
33
|
-
* @param {Object} query - Query parameters
|
|
34
|
-
* @param {Object} opts - Additional options
|
|
35
|
-
*/
|
|
36
|
-
export const getHealthFundFormApplication = (
|
|
37
|
-
healthFundId: string,
|
|
38
|
-
formApplicationId: string,
|
|
39
|
-
opts?: MedipassRequestOpts = {}
|
|
40
|
-
): Promise<Object> => {
|
|
41
|
-
doesParamExist({ healthFundId, formApplicationId }, opts.hyperMediaEndpoint);
|
|
42
|
-
return request({ ...opts, path: pathHealthFundFormApplication(healthFundId, formApplicationId) }, { method: 'get' });
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Update form practice representative details
|
|
47
|
-
* @param {Object} healthFundId - Health fund ID
|
|
48
|
-
* @param {Object} body - Health fund details
|
|
49
|
-
* @param {Object} opts - Additional options
|
|
50
|
-
*/
|
|
51
|
-
export const updatePracticeRepresentative = async (
|
|
52
|
-
healthFundId: string,
|
|
53
|
-
formApplicationId: string,
|
|
54
|
-
body: Object,
|
|
55
|
-
opts?: MedipassRequestOpts = {}
|
|
56
|
-
): Promise<Object> => {
|
|
57
|
-
doesParamExist({ healthFundId, formApplicationId }, opts.hyperMediaEndpoint);
|
|
58
|
-
return request(
|
|
59
|
-
{ ...opts, path: pathUpdatePracticeRepresentative(healthFundId, formApplicationId) },
|
|
60
|
-
{ method: 'put', data: body }
|
|
61
|
-
);
|
|
62
|
-
};
|