@medipass/utils 11.69.2 → 11.69.3-feature-migrate-utils-to-ts.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 +96 -0
- package/{billable-items-01050ba2.js → billable-items-f8291b1e.js} +0 -0
- package/build-validation-schema.js +21 -8
- package/{businesses-e3a20604.js → businesses-2633ab9b.js} +0 -0
- package/chart.js +2 -0
- package/form-applications/assign-values-to-sections.js +2 -2
- package/{forms-f06ca97e.js → forms-e1c51a53.js} +0 -0
- package/get-env.js +6 -6
- package/get-select-options.js +1 -0
- package/google-addresses.js +17 -7
- package/{health-fund-accounts-3cd8650f.js → health-fund-accounts-88eac93c.js} +0 -0
- package/{health-fund-settings-43327826.js → health-fund-settings-e7a0f2ec.js} +0 -0
- package/{health-funds-300facef.js → health-funds-7fea63a0.js} +0 -0
- package/i18n/index.js +2 -2
- package/intercom.js +8 -3
- package/lib/__tests__/get-env.test.d.ts +1 -0
- package/lib/__tests__/get-staff-type-display-name.test.d.ts +1 -0
- package/lib/__tests__/redux-actions.test.d.ts +1 -0
- package/lib/__tests__/redux-reducer.test.d.ts +1 -0
- package/lib/__tests__/validate.test.d.ts +1 -0
- package/lib/build-validation-schema.d.ts +149 -0
- package/lib/chart.d.ts +9 -0
- package/lib/claim-payment-status-formatted.d.ts +6 -0
- package/lib/claim-payment-status-icons.d.ts +4 -0
- package/lib/claim-payment-status-text-classes.d.ts +4 -0
- package/lib/constants.d.ts +321 -0
- package/lib/countries.d.ts +10 -0
- package/lib/datetime.d.ts +2 -0
- package/lib/document-types-formatted.d.ts +9 -0
- package/lib/document-types-icons.d.ts +4 -0
- package/lib/document-types-text-classes.d.ts +4 -0
- package/lib/documents/workflow-state-formatted-text-classes.d.ts +6 -0
- package/lib/documents/workflow-state-formatted.d.ts +6 -0
- package/lib/documents/workflow-state-icons.d.ts +5 -0
- package/lib/form-applications/assign-values-to-sections.d.ts +5 -0
- package/lib/funders.d.ts +20 -0
- package/lib/get-env.d.ts +22 -0
- package/lib/get-select-options.d.ts +9 -0
- package/lib/get-staff-type-display-name.d.ts +2 -0
- package/lib/google-addresses.d.ts +3 -0
- package/lib/i18n/index.d.ts +8 -0
- package/lib/i18n/translations.d.ts +28 -0
- package/lib/intercom.d.ts +16 -0
- package/lib/normalise-abn.d.ts +2 -0
- package/lib/parse-health-fund-card-fields.d.ts +2 -0
- package/lib/payment-options.d.ts +13 -0
- package/lib/products.d.ts +4 -0
- package/lib/redux-actions.d.ts +35 -0
- package/lib/redux-reducer.d.ts +24 -0
- package/lib/sanitise-url.d.ts +4 -0
- package/lib/scroll.d.ts +2 -0
- package/lib/sensitive-keys.d.ts +3 -0
- package/lib/sentry.d.ts +15 -0
- package/lib/service-items.d.ts +40 -0
- package/lib/status-icons.d.ts +4 -0
- package/lib/status-text-classes.d.ts +4 -0
- package/lib/test-framework/fixtures/accounts.d.ts +28 -0
- package/lib/test-framework/fixtures/billable-items.d.ts +17 -0
- package/lib/test-framework/fixtures/businesses.d.ts +43 -0
- package/lib/test-framework/fixtures/documents.d.ts +113 -0
- package/lib/test-framework/fixtures/form-application-templates.d.ts +66 -0
- package/lib/test-framework/fixtures/form-applications.d.ts +30 -0
- package/lib/test-framework/fixtures/forms.d.ts +41 -0
- package/lib/test-framework/fixtures/health-fund-accounts.d.ts +10 -0
- package/lib/test-framework/fixtures/health-fund-settings.d.ts +12 -0
- package/lib/test-framework/fixtures/health-funds.d.ts +90 -0
- package/lib/test-framework/fixtures/index.d.ts +39 -0
- package/lib/test-framework/fixtures/members.d.ts +43 -0
- package/lib/test-framework/fixtures/message-mappings.d.ts +19 -0
- package/lib/test-framework/fixtures/modalities.d.ts +9 -0
- package/lib/test-framework/fixtures/patients.d.ts +36 -0
- package/lib/test-framework/fixtures/payment-methods.d.ts +16 -0
- package/lib/test-framework/fixtures/practices.d.ts +105 -0
- package/lib/test-framework/fixtures/products.d.ts +46 -0
- package/lib/test-framework/fixtures/professional-categories.d.ts +9 -0
- package/lib/test-framework/fixtures/services.d.ts +93 -0
- package/lib/test-framework/fixtures/specialties.d.ts +10 -0
- package/lib/test-framework/fixtures/staff.d.ts +139 -0
- package/lib/test-framework/fixtures/subscriptions.d.ts +142 -0
- package/lib/test-framework/fixtures/transaction-reports.d.ts +156 -0
- package/lib/test-framework/fixtures/transactions.d.ts +1832 -0
- package/lib/test-framework/fixtures/workflow-exceptions.d.ts +25 -0
- package/lib/test-framework/react.d.ts +8 -0
- package/lib/transaction-details-by-funder.d.ts +33 -0
- package/lib/transaction-status-formatted.d.ts +9 -0
- package/lib/transaction-status-helpers.d.ts +20 -0
- package/lib/transaction-status-icons.d.ts +4 -0
- package/lib/transaction-status-text-classes.d.ts +4 -0
- package/lib/transaction-status.d.ts +1 -0
- package/lib/validate-form.d.ts +45 -0
- package/lib/validate.d.ts +15 -0
- package/lib/webpack-config.d.ts +4 -0
- package/lib/workflow-state-formatted-text-classes.d.ts +5 -0
- package/lib/workflow-state-formatted.d.ts +4 -0
- package/{members-cb4f73a9.js → members-8eb8d8d0.js} +0 -0
- package/{modalities-b360d521.js → modalities-2dfbea63.js} +0 -0
- package/package.json +7 -5
- package/{patients-2083dd9c.js → patients-dd3709c1.js} +0 -0
- package/{payment-methods-4fa2d01f.js → payment-methods-d36bc018.js} +0 -0
- package/{practices-3e703f22.js → practices-d6c480f1.js} +0 -0
- package/{products-bd313cb4.js → products-0a392564.js} +0 -0
- package/{professional-categories-e2e5284b.js → professional-categories-157d1767.js} +0 -0
- package/redux-actions.js +13 -3
- package/redux-reducer.js +8 -7
- package/sentry.js +3 -1
- package/service-items.js +10 -6
- package/{services-2e25cdac.js → services-f8480eba.js} +0 -0
- package/{specialties-7640b7e3.js → specialties-25fbb171.js} +0 -0
- package/{staff-990794cd.js → staff-646053b7.js} +0 -0
- package/{subscriptions-45c1321a.js → subscriptions-aef302aa.js} +0 -0
- package/test-framework/fixtures/billable-items.js +1 -1
- package/test-framework/fixtures/businesses.js +1 -1
- package/test-framework/fixtures/forms.js +1 -1
- package/test-framework/fixtures/health-fund-accounts.js +1 -1
- package/test-framework/fixtures/health-fund-settings.js +1 -1
- package/test-framework/fixtures/health-funds.js +1 -1
- package/test-framework/fixtures/index.js +18 -18
- package/test-framework/fixtures/members.js +1 -1
- package/test-framework/fixtures/modalities.js +1 -1
- package/test-framework/fixtures/patients.js +1 -1
- package/test-framework/fixtures/payment-methods.js +1 -1
- package/test-framework/fixtures/practices.js +1 -1
- package/test-framework/fixtures/products.js +1 -1
- package/test-framework/fixtures/professional-categories.js +1 -1
- package/test-framework/fixtures/services.js +1 -1
- package/test-framework/fixtures/specialties.js +1 -1
- package/test-framework/fixtures/staff.js +1 -1
- package/test-framework/fixtures/subscriptions.js +1 -1
- package/test-framework/fixtures/transactions.js +1 -1
- package/test-framework/react.js +1 -1
- package/transaction-details-by-funder.js +1 -0
- package/{transactions-6e5fd92d.js → transactions-4a08e450.js} +0 -0
- package/tsconfig.json +32 -0
- package/webpack-config.js +1 -1
- package/.eslintrc +0 -3
- package/blah.js +0 -2
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['plugin:@typescript-eslint/eslint-recommended', 'prettier', 'react-app'],
|
|
3
|
+
ignorePatterns: ['lib', 'jest.setup.d.ts'],
|
|
4
|
+
plugins: ['@typescript-eslint', 'prettier'],
|
|
5
|
+
parser: '@typescript-eslint/parser',
|
|
6
|
+
parserOptions: {
|
|
7
|
+
ecmaFeatures: {
|
|
8
|
+
jsx: true
|
|
9
|
+
},
|
|
10
|
+
ecmaVersion: 'latest',
|
|
11
|
+
requireConfigFile: false,
|
|
12
|
+
sourceType: 'module'
|
|
13
|
+
},
|
|
14
|
+
rules: {
|
|
15
|
+
'prettier/prettier': [
|
|
16
|
+
'error',
|
|
17
|
+
{
|
|
18
|
+
bracketSpacing: true,
|
|
19
|
+
bracketSameLine: false,
|
|
20
|
+
printWidth: 120,
|
|
21
|
+
singleQuote: true,
|
|
22
|
+
trailingComma: 'none',
|
|
23
|
+
arrowParens: 'avoid'
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
'react/default-props-match-prop-types': [
|
|
27
|
+
1,
|
|
28
|
+
{
|
|
29
|
+
allowRequiredDefaults: true
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
'react/no-array-index-key': 'warn',
|
|
33
|
+
'react/no-children-prop': 'error',
|
|
34
|
+
'react/no-danger': 'error',
|
|
35
|
+
'react/no-danger-with-children': 'error',
|
|
36
|
+
'react/no-deprecated': 'error',
|
|
37
|
+
'react/no-did-update-set-state': 'error',
|
|
38
|
+
'react/no-direct-mutation-state': 'error',
|
|
39
|
+
'react/no-find-dom-node': 'error',
|
|
40
|
+
'react/no-is-mounted': 'error',
|
|
41
|
+
'react/no-redundant-should-component-update': 'error',
|
|
42
|
+
'react/no-render-return-value': 'error',
|
|
43
|
+
'react/no-string-refs': 'error',
|
|
44
|
+
'react/no-unescaped-entities': 'error',
|
|
45
|
+
'react/no-unknown-property': 'error',
|
|
46
|
+
'react/no-unused-prop-types': 'error',
|
|
47
|
+
'react/no-will-update-set-state': 'error',
|
|
48
|
+
'react/prop-types': 'error',
|
|
49
|
+
'react/react-in-jsx-scope': 'error',
|
|
50
|
+
'react/require-default-props': 'error',
|
|
51
|
+
'react/self-closing-comp': 'error',
|
|
52
|
+
'react/style-prop-object': 'error',
|
|
53
|
+
'react/void-dom-elements-no-children': 'error',
|
|
54
|
+
'react/jsx-boolean-value': 'error',
|
|
55
|
+
'react/jsx-closing-bracket-location': ['error', 'tag-aligned'],
|
|
56
|
+
'react/jsx-closing-tag-location': 'error',
|
|
57
|
+
'react/jsx-curly-spacing': ['error', 'never'],
|
|
58
|
+
'react/jsx-equals-spacing': ['error', 'never'],
|
|
59
|
+
'react/jsx-first-prop-new-line': ['error', 'multiline'],
|
|
60
|
+
'react/jsx-key': 'error',
|
|
61
|
+
'react/jsx-max-props-per-line': [
|
|
62
|
+
'error',
|
|
63
|
+
{
|
|
64
|
+
maximum: 1,
|
|
65
|
+
when: 'multiline'
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
'react/jsx-no-comment-textnodes': 'error',
|
|
69
|
+
'react/jsx-no-duplicate-props': [
|
|
70
|
+
'error',
|
|
71
|
+
{
|
|
72
|
+
ignoreCase: true
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
'react/jsx-no-target-blank': 'error',
|
|
76
|
+
'react/jsx-no-undef': 'error',
|
|
77
|
+
'react/jsx-sort-props': [
|
|
78
|
+
'error',
|
|
79
|
+
{
|
|
80
|
+
callbacksLast: false,
|
|
81
|
+
shorthandFirst: false,
|
|
82
|
+
noSortAlphabetically: true,
|
|
83
|
+
reservedFirst: true
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
'react/jsx-uses-react': 'error',
|
|
87
|
+
'react/jsx-uses-vars': 'error',
|
|
88
|
+
'react/jsx-wrap-multilines': 'error',
|
|
89
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
90
|
+
'react-hooks/exhaustive-deps': 'warn',
|
|
91
|
+
'react/jsx-handler-names': 'off',
|
|
92
|
+
'react/jsx-pascal-case': 'off',
|
|
93
|
+
'jsx-a11y/href-no-hash': 0,
|
|
94
|
+
'jsx-a11y/anchor-is-valid': 0
|
|
95
|
+
}
|
|
96
|
+
};
|
|
File without changes
|
|
@@ -1092,42 +1092,49 @@ var getFieldSchema = function getFieldSchema(field) {
|
|
|
1092
1092
|
switch (fieldAttributes.type) {
|
|
1093
1093
|
case 'string':
|
|
1094
1094
|
{
|
|
1095
|
+
// @ts-expect-error TS(2740): Type 'StringSchema<string, Record<string, any>, st... Remove this comment to see the full error message
|
|
1095
1096
|
schema = schema.string();
|
|
1096
1097
|
break;
|
|
1097
1098
|
}
|
|
1098
1099
|
|
|
1099
1100
|
case 'object':
|
|
1100
1101
|
{
|
|
1102
|
+
// @ts-expect-error TS(2740): Type 'OptionalObjectSchema<ObjectShape, Record<str... Remove this comment to see the full error message
|
|
1101
1103
|
schema = schema.object();
|
|
1102
1104
|
break;
|
|
1103
1105
|
}
|
|
1104
1106
|
|
|
1105
1107
|
case 'array':
|
|
1106
1108
|
{
|
|
1109
|
+
// @ts-expect-error TS(2740): Type 'OptionalArraySchema<AnySchema<any, any, any>... Remove this comment to see the full error message
|
|
1107
1110
|
schema = schema.array();
|
|
1108
1111
|
break;
|
|
1109
1112
|
}
|
|
1110
1113
|
|
|
1111
1114
|
case 'boolean':
|
|
1112
1115
|
{
|
|
1116
|
+
// @ts-expect-error TS(2740): Type 'BooleanSchema<boolean, Record<string, any>, ... Remove this comment to see the full error message
|
|
1113
1117
|
schema = schema.boolean();
|
|
1114
1118
|
break;
|
|
1115
1119
|
}
|
|
1116
1120
|
|
|
1117
1121
|
case 'date':
|
|
1118
1122
|
{
|
|
1123
|
+
// @ts-expect-error TS(2740): Type 'DateSchema<Date, Record<string, any>, Date>'... Remove this comment to see the full error message
|
|
1119
1124
|
schema = schema.date();
|
|
1120
1125
|
break;
|
|
1121
1126
|
}
|
|
1122
1127
|
|
|
1123
1128
|
case 'number':
|
|
1124
1129
|
{
|
|
1130
|
+
// @ts-expect-error TS(2740): Type 'NumberSchema<number, Record<string, any>, nu... Remove this comment to see the full error message
|
|
1125
1131
|
schema = schema.number();
|
|
1126
1132
|
break;
|
|
1127
1133
|
}
|
|
1128
1134
|
|
|
1129
1135
|
default:
|
|
1130
1136
|
{
|
|
1137
|
+
// @ts-expect-error TS(2322): Type 'StringSchema<string, Record<string, any>, st... Remove this comment to see the full error message
|
|
1131
1138
|
schema = schema.string();
|
|
1132
1139
|
}
|
|
1133
1140
|
}
|
|
@@ -1139,7 +1146,8 @@ var getFieldSchema = function getFieldSchema(field) {
|
|
|
1139
1146
|
{
|
|
1140
1147
|
if (defaultFieldExists && !field.required) {
|
|
1141
1148
|
return;
|
|
1142
|
-
}
|
|
1149
|
+
} // @ts-expect-error TS(2339): Property 'required' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
1150
|
+
|
|
1143
1151
|
|
|
1144
1152
|
schema = schema.required(validator.message);
|
|
1145
1153
|
break;
|
|
@@ -1147,30 +1155,35 @@ var getFieldSchema = function getFieldSchema(field) {
|
|
|
1147
1155
|
|
|
1148
1156
|
case 'test':
|
|
1149
1157
|
{
|
|
1158
|
+
// @ts-expect-error TS(2339): Property 'test' does not exist on type 'typeof imp... Remove this comment to see the full error message
|
|
1150
1159
|
schema = schema.test(field.name, validator.message, validator.fn);
|
|
1151
1160
|
break;
|
|
1152
1161
|
}
|
|
1153
1162
|
|
|
1154
1163
|
case 'email':
|
|
1155
1164
|
{
|
|
1165
|
+
// @ts-expect-error TS(2339): Property 'email' does not exist on type 'typeof im... Remove this comment to see the full error message
|
|
1156
1166
|
schema = schema.email(validator.message);
|
|
1157
1167
|
break;
|
|
1158
1168
|
}
|
|
1159
1169
|
|
|
1160
1170
|
case 'min':
|
|
1161
1171
|
{
|
|
1172
|
+
// @ts-expect-error TS(2339): Property 'min' does not exist on type 'typeof impo... Remove this comment to see the full error message
|
|
1162
1173
|
schema = schema.min(validator.length, validator.message);
|
|
1163
1174
|
break;
|
|
1164
1175
|
}
|
|
1165
1176
|
|
|
1166
1177
|
case 'matches':
|
|
1167
1178
|
{
|
|
1179
|
+
// @ts-expect-error TS(2339): Property 'matches' does not exist on type 'typeof ... Remove this comment to see the full error message
|
|
1168
1180
|
schema = schema.matches(validator.pattern, validator.message);
|
|
1169
1181
|
break;
|
|
1170
1182
|
}
|
|
1171
1183
|
|
|
1172
1184
|
case 'oneOf':
|
|
1173
1185
|
{
|
|
1186
|
+
// @ts-expect-error TS(2339): Property 'oneOf' does not exist on type 'typeof im... Remove this comment to see the full error message
|
|
1174
1187
|
schema = schema.oneOf([yup.ref(validator.fieldName), null], validator.message);
|
|
1175
1188
|
break;
|
|
1176
1189
|
}
|
|
@@ -1194,7 +1207,7 @@ var buildValidationSchema = (function (fields, overrideSchema) {
|
|
|
1194
1207
|
|
|
1195
1208
|
schema[field.name] = getFieldSchema(field);
|
|
1196
1209
|
});
|
|
1197
|
-
return yup.object().shape(_objectSpread({}, schema,
|
|
1210
|
+
return yup.object().shape(_objectSpread(_objectSpread({}, schema), overrideSchema));
|
|
1198
1211
|
});
|
|
1199
1212
|
/* ===== CUSTOM OVERRIDE SCHEMAS ===== */
|
|
1200
1213
|
|
|
@@ -1241,13 +1254,13 @@ var paymentMethodValidationSchema = [{
|
|
|
1241
1254
|
name: 'cvc'
|
|
1242
1255
|
}];
|
|
1243
1256
|
var getHealthFundAccountValidationSchema = function getHealthFundAccountValidationSchema(cardFields) {
|
|
1244
|
-
return _objectSpread({}, cardFields.cardNumber ? {
|
|
1257
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, cardFields.cardNumber ? {
|
|
1245
1258
|
cardNumber: yup.string().matches(new RegExp(_get(cardFields, 'cardNumber.validation.regex')), _get(cardFields, 'cardNumber.validation.message')).required("Please enter a " + _get(cardFields, 'cardNumber.displayName', 'card number').toLowerCase())
|
|
1246
|
-
} : {},
|
|
1259
|
+
} : {}), cardFields.membershipNumber ? {
|
|
1247
1260
|
membershipNumber: yup.string().min(_get(cardFields, 'membershipNumber.minLength'), _get(cardFields, 'membershipNumber.displayName', 'membership number') + " must be at least " + _get(cardFields, 'membershipNumber.minLength') + " numbers").max(_get(cardFields, 'membershipNumber.maxLength', 99), _get(cardFields, 'membershipNumber.displayName', 'membership number') + " must be less than " + _get(cardFields, 'membershipNumber.maxLength') + " numbers").matches(new RegExp(_get(cardFields, 'membershipNumber.validation.regex')), _get(cardFields, 'membershipNumber.validation.message')).required("Please enter a " + _get(cardFields, 'membershipNumber.displayName', 'membership number').toLowerCase())
|
|
1248
|
-
} : {},
|
|
1261
|
+
} : {}), cardFields.cardRank ? {
|
|
1249
1262
|
cardRank: yup.string().min(_get(cardFields, 'cardRank.minLength'), _get(cardFields, 'cardRank.displayName', 'card rank') + " must be at least " + _get(cardFields, 'cardRank.minLength') + " numbers").max(_get(cardFields, 'cardRank.maxLength', 99), _get(cardFields, 'cardRank.displayName', 'card rank') + " must be less than " + _get(cardFields, 'cardRank.maxLength') + " numbers").matches(new RegExp(_get(cardFields, 'cardRank.validation.regex')), _get(cardFields, 'cardRank.validation.message')).required("Please enter a " + _get(cardFields, 'cardRank.displayName', 'card rank').toLowerCase())
|
|
1250
|
-
} : {},
|
|
1263
|
+
} : {}), cardFields.issueDay || cardFields.issueMonth || cardFields.issueYear ? function () {
|
|
1251
1264
|
var issueDateSchema = yup.string().required('Please enter an issue date');
|
|
1252
1265
|
issueDateSchema = validateHealthFundDate(issueDateSchema, {
|
|
1253
1266
|
cardFields: cardFields,
|
|
@@ -1259,7 +1272,7 @@ var getHealthFundAccountValidationSchema = function getHealthFundAccountValidati
|
|
|
1259
1272
|
return {
|
|
1260
1273
|
issueDate: issueDateSchema
|
|
1261
1274
|
};
|
|
1262
|
-
}() : {},
|
|
1275
|
+
}() : {}), cardFields.expiryDay || cardFields.expiryMonth || cardFields.expiryYear ? function () {
|
|
1263
1276
|
var expiryDateSchema = yup.string().required('Please enter an expiry date');
|
|
1264
1277
|
expiryDateSchema = validateHealthFundDate(expiryDateSchema, {
|
|
1265
1278
|
cardFields: cardFields,
|
|
@@ -1271,7 +1284,7 @@ var getHealthFundAccountValidationSchema = function getHealthFundAccountValidati
|
|
|
1271
1284
|
return {
|
|
1272
1285
|
expiryDate: expiryDateSchema
|
|
1273
1286
|
};
|
|
1274
|
-
}() : {},
|
|
1287
|
+
}() : {}), cardFields.cardIssueNumber ? {
|
|
1275
1288
|
cardIssueNumber: yup.string().min(_get(cardFields, 'cardIssueNumber.minLength'), _get(cardFields, 'cardIssueNumber.displayName', 'issue number') + " must be at least " + _get(cardFields, 'cardIssueNumber.minLength') + " numbers").max(_get(cardFields, 'cardIssueNumber.maxLength', 99), _get(cardFields, 'cardIssueNumber.displayName', 'issue number') + " must be less than " + _get(cardFields, 'cardIssueNumber.maxLength') + " numbers").matches(new RegExp(_get(cardFields, 'cardIssueNumber.validation.regex')), _get(cardFields, 'cardIssueNumber.validation.message')).required("Please enter a " + _get(cardFields, 'cardIssueNumber.displayName', 'issue number').toLowerCase())
|
|
1276
1289
|
} : {});
|
|
1277
1290
|
};
|
|
File without changes
|
package/chart.js
CHANGED
|
@@ -14,7 +14,9 @@ var buildChartLabelsFromDataset = function buildChartLabelsFromDataset(dataset,
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
return dataset.map(function (data) {
|
|
17
|
+
// @ts-expect-error TS(2339): Property 'format' does not exist on type '{}'.
|
|
17
18
|
if (opts.format) {
|
|
19
|
+
// @ts-expect-error TS(2339): Property 'format' does not exist on type '{}'.
|
|
18
20
|
return moment(data[labelKey]).format(opts.format);
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -14,9 +14,9 @@ var assignValuesToSections = (function (_ref) {
|
|
|
14
14
|
var sections = _ref.sections,
|
|
15
15
|
values = _ref.values;
|
|
16
16
|
return sections.map(function (section) {
|
|
17
|
-
return _objectSpread({}, section, {
|
|
17
|
+
return _objectSpread(_objectSpread({}, section), {}, {
|
|
18
18
|
subsections: section.subsections.map(function (subsection) {
|
|
19
|
-
return _objectSpread({}, subsection, {
|
|
19
|
+
return _objectSpread(_objectSpread({}, subsection), {}, {
|
|
20
20
|
value: (values.find(function (value) {
|
|
21
21
|
return value._id === subsection._id;
|
|
22
22
|
}) || {}).value
|
|
File without changes
|
package/get-env.js
CHANGED
|
@@ -22,7 +22,7 @@ var REQUIRED_VARIABLES = ['APP_URL'];
|
|
|
22
22
|
|
|
23
23
|
var getEnv = function getEnv(env) {
|
|
24
24
|
var LOCAL = {
|
|
25
|
-
ENV: _objectSpread({}, _get(env, '_global', {}),
|
|
25
|
+
ENV: _objectSpread(_objectSpread(_objectSpread({}, _get(env, '_global', {})), _get(env, 'local', {})), {}, {
|
|
26
26
|
ENV_NAME: 'local',
|
|
27
27
|
FUNDER_URL: 'https://dev-funder.medipass.io',
|
|
28
28
|
CONNECT_URL: 'https://dev-connect.medipass.io',
|
|
@@ -33,7 +33,7 @@ var getEnv = function getEnv(env) {
|
|
|
33
33
|
})
|
|
34
34
|
};
|
|
35
35
|
var DEV = {
|
|
36
|
-
ENV: _objectSpread({}, _get(env, '_global', {}),
|
|
36
|
+
ENV: _objectSpread(_objectSpread(_objectSpread({}, _get(env, '_global', {})), _get(env, 'dev', {})), {}, {
|
|
37
37
|
ENV_NAME: 'dev',
|
|
38
38
|
FUNDER_URL: 'https://dev-funder.medipass.io',
|
|
39
39
|
CONNECT_URL: 'https://dev-connect.medipass.io',
|
|
@@ -44,7 +44,7 @@ var getEnv = function getEnv(env) {
|
|
|
44
44
|
})
|
|
45
45
|
};
|
|
46
46
|
var STAGING = {
|
|
47
|
-
ENV: _objectSpread({}, _get(env, '_global', {}),
|
|
47
|
+
ENV: _objectSpread(_objectSpread(_objectSpread({}, _get(env, '_global', {})), _get(env, 'staging', {})), {}, {
|
|
48
48
|
ENV_NAME: 'staging',
|
|
49
49
|
FUNDER_URL: 'https://stg-funder.medipass.io',
|
|
50
50
|
CONNECT_URL: 'https://stg-connect.medipass.io',
|
|
@@ -55,7 +55,7 @@ var getEnv = function getEnv(env) {
|
|
|
55
55
|
})
|
|
56
56
|
};
|
|
57
57
|
var PERF = {
|
|
58
|
-
ENV: _objectSpread({}, _get(env, '_global', {}),
|
|
58
|
+
ENV: _objectSpread(_objectSpread(_objectSpread({}, _get(env, '_global', {})), _get(env, 'perf', {})), {}, {
|
|
59
59
|
ENV_NAME: 'perf',
|
|
60
60
|
FUNDER_URL: 'https://perf-funder.medipass.io',
|
|
61
61
|
CONNECT_URL: 'https://perf-connect.medipass.io',
|
|
@@ -66,7 +66,7 @@ var getEnv = function getEnv(env) {
|
|
|
66
66
|
})
|
|
67
67
|
};
|
|
68
68
|
var PREPROD = {
|
|
69
|
-
ENV: _objectSpread({}, _get(env, '_global', {}),
|
|
69
|
+
ENV: _objectSpread(_objectSpread(_objectSpread({}, _get(env, '_global', {})), _get(env, 'preprod', {})), {}, {
|
|
70
70
|
ENV_NAME: 'pre-prod',
|
|
71
71
|
FUNDER_URL: 'https://funder-blue.medipass.io',
|
|
72
72
|
CONNECT_URL: 'https://connect-blue.medipass.io',
|
|
@@ -77,7 +77,7 @@ var getEnv = function getEnv(env) {
|
|
|
77
77
|
})
|
|
78
78
|
};
|
|
79
79
|
var PROD = {
|
|
80
|
-
ENV: _objectSpread({}, _get(env, '_global', {}),
|
|
80
|
+
ENV: _objectSpread(_objectSpread(_objectSpread({}, _get(env, '_global', {})), _get(env, 'prod', {})), {}, {
|
|
81
81
|
ENV_NAME: 'prod',
|
|
82
82
|
FUNDER_URL: 'https://funder.medipass.io',
|
|
83
83
|
CONNECT_URL: 'https://connect.medipass.io',
|
package/get-select-options.js
CHANGED
|
@@ -22,6 +22,7 @@ var getSelectOptions = function getSelectOptions(values, labelKey, valueKey, opt
|
|
|
22
22
|
return values.map(function (value, i) {
|
|
23
23
|
return {
|
|
24
24
|
key: _get(value, '_id', i),
|
|
25
|
+
// @ts-expect-error TS(2339): Property 'labelKeyFunc' does not exist on type '{}... Remove this comment to see the full error message
|
|
25
26
|
label: opts.labelKeyFunc ? opts.labelKeyFunc(value) : _get(value, labelKey),
|
|
26
27
|
value: valueKey ? _get(value, valueKey) : value
|
|
27
28
|
};
|
package/google-addresses.js
CHANGED
|
@@ -103,19 +103,29 @@ var parseAddress = function parseAddress(addressComponents) {
|
|
|
103
103
|
var requestData = {};
|
|
104
104
|
|
|
105
105
|
if (addressComponents) {
|
|
106
|
-
var address = mapAddressComponents(addressComponents);
|
|
106
|
+
var address = mapAddressComponents(addressComponents); // @ts-expect-error TS(2339): Property 'route' does not exist on type '{}'.
|
|
107
107
|
|
|
108
108
|
if (address.route) {
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
// @ts-expect-error TS(2339): Property 'address' does not exist on type '{}'.
|
|
110
|
+
requestData.address = // @ts-expect-error
|
|
111
|
+
"" + (address.subpremise ? address.subpremise.longName + "/" : '') + ( // @ts-expect-error
|
|
112
|
+
(address.streetNumber ? address.streetNumber.longName : '') + " ") + ( // @ts-expect-error
|
|
113
|
+
"" + address.route.longName);
|
|
114
|
+
} // @ts-expect-error TS(2339): Property 'country' does not exist on type '{}'.
|
|
115
|
+
|
|
111
116
|
|
|
112
117
|
if (address.country) {
|
|
113
|
-
|
|
118
|
+
// @ts-expect-error TS(2339): Property 'countryCode' does not exist on type '{}'... Remove this comment to see the full error message
|
|
119
|
+
requestData.countryCode = address.country.shortName; // @ts-expect-error TS(2339): Property 'country' does not exist on type '{}'.
|
|
120
|
+
|
|
114
121
|
requestData.country = address.country.longName;
|
|
115
|
-
}
|
|
122
|
+
} // @ts-expect-error TS(2339): Property 'state' does not exist on type '{}'.
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
requestData.state = address.state ? address.state.longName : null; // @ts-expect-error TS(2339): Property 'city' does not exist on type '{}'.
|
|
126
|
+
|
|
127
|
+
requestData.city = address.city ? address.city.longName : null; // @ts-expect-error TS(2339): Property 'postcode' does not exist on type '{}'.
|
|
116
128
|
|
|
117
|
-
requestData.state = address.state ? address.state.longName : null;
|
|
118
|
-
requestData.city = address.city ? address.city.longName : null;
|
|
119
129
|
requestData.postcode = address.postcode ? address.postcode.longName : null;
|
|
120
130
|
}
|
|
121
131
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/i18n/index.js
CHANGED
|
@@ -18,13 +18,13 @@ function getResources(translations$1) {
|
|
|
18
18
|
return translations.regionsList.reduce(function (resources, region) {
|
|
19
19
|
var _objectSpread3;
|
|
20
20
|
|
|
21
|
-
return _objectSpread({}, resources, (_objectSpread3 = {}, _objectSpread3[region] = {
|
|
21
|
+
return _objectSpread(_objectSpread({}, resources), {}, (_objectSpread3 = {}, _objectSpread3[region] = {
|
|
22
22
|
translation: Object.entries(translations$1).reduce(function (currentTranslations, _ref) {
|
|
23
23
|
var _objectSpread2;
|
|
24
24
|
|
|
25
25
|
var key = _ref[0],
|
|
26
26
|
value = _ref[1];
|
|
27
|
-
return _objectSpread({}, currentTranslations, (_objectSpread2 = {}, _objectSpread2[key] = value[region], _objectSpread2));
|
|
27
|
+
return _objectSpread(_objectSpread({}, currentTranslations), {}, (_objectSpread2 = {}, _objectSpread2[key] = value[region], _objectSpread2));
|
|
28
28
|
}, {})
|
|
29
29
|
}, _objectSpread3));
|
|
30
30
|
}, {});
|
package/intercom.js
CHANGED
|
@@ -21,7 +21,8 @@ var bootIntercom = /*#__PURE__*/function () {
|
|
|
21
21
|
while (1) {
|
|
22
22
|
switch (_context.prev = _context.next) {
|
|
23
23
|
case 0:
|
|
24
|
-
return _context.abrupt("return", window.Intercom('boot', _objectSpread({}, data, {
|
|
24
|
+
return _context.abrupt("return", window.Intercom('boot', _objectSpread(_objectSpread({}, data), {}, {
|
|
25
|
+
// @ts-expect-error TS(2339): Property 'INTERCOM_APP_ID' does not exist on type ... Remove this comment to see the full error message
|
|
25
26
|
app_id: getEnv.default.INTERCOM_APP_ID,
|
|
26
27
|
// eslint-disable-line camelcase
|
|
27
28
|
user_hash: data.intercomHash
|
|
@@ -38,14 +39,17 @@ var bootIntercom = /*#__PURE__*/function () {
|
|
|
38
39
|
return function bootIntercom(_x) {
|
|
39
40
|
return _ref.apply(this, arguments);
|
|
40
41
|
};
|
|
41
|
-
}();
|
|
42
|
+
}(); // @ts-expect-error TS(2339): Property 'Intercom' does not exist on type 'Window... Remove this comment to see the full error message
|
|
43
|
+
|
|
42
44
|
var showNewMessage = function showNewMessage(message) {
|
|
43
45
|
return window.Intercom('showNewMessage', typeof message === 'string' ? message : '');
|
|
44
46
|
}; // eslint-disable-line new-cap
|
|
47
|
+
// @ts-expect-error TS(2339): Property 'Intercom' does not exist on type 'Window... Remove this comment to see the full error message
|
|
45
48
|
|
|
46
49
|
var shutdownIntercom = function shutdownIntercom() {
|
|
47
50
|
return window.Intercom('shutdown');
|
|
48
51
|
}; // eslint-disable-line new-cap
|
|
52
|
+
// @ts-expect-error TS(2339): Property 'Intercom' does not exist on type 'Window... Remove this comment to see the full error message
|
|
49
53
|
|
|
50
54
|
var trackEvent = function trackEvent(name, data) {
|
|
51
55
|
return window.Intercom('trackEvent', name, data);
|
|
@@ -77,7 +81,8 @@ var trackCreateVirtualTerminalInvoice = function trackCreateVirtualTerminalInvoi
|
|
|
77
81
|
};
|
|
78
82
|
var trackCreateQuote = function trackCreateQuote(data) {
|
|
79
83
|
return trackEvent('created-quote', data);
|
|
80
|
-
};
|
|
84
|
+
}; // @ts-expect-error TS(2339): Property 'Intercom' does not exist on type 'Window... Remove this comment to see the full error message
|
|
85
|
+
|
|
81
86
|
var updateIntercom = function updateIntercom(data) {
|
|
82
87
|
return window.Intercom('update', data);
|
|
83
88
|
}; // eslint-disable-line new-cap
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const FIELD_VALIDATORS: {
|
|
3
|
+
firstName: {
|
|
4
|
+
type: string;
|
|
5
|
+
validators: {
|
|
6
|
+
type: string;
|
|
7
|
+
message: string;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
lastName: {
|
|
11
|
+
type: string;
|
|
12
|
+
validators: {
|
|
13
|
+
type: string;
|
|
14
|
+
message: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
dob: {
|
|
18
|
+
type: string;
|
|
19
|
+
validators: ({
|
|
20
|
+
type: string;
|
|
21
|
+
message: string;
|
|
22
|
+
fn?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
type: string;
|
|
25
|
+
message: string;
|
|
26
|
+
fn: (value: any) => boolean;
|
|
27
|
+
})[];
|
|
28
|
+
};
|
|
29
|
+
email: {
|
|
30
|
+
type: string;
|
|
31
|
+
validators: {
|
|
32
|
+
type: string;
|
|
33
|
+
message: string;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
36
|
+
mobile: {
|
|
37
|
+
type: string;
|
|
38
|
+
validators: ({
|
|
39
|
+
type: string;
|
|
40
|
+
message: string;
|
|
41
|
+
fn?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
type: string;
|
|
44
|
+
message: string;
|
|
45
|
+
fn: (value: any) => any;
|
|
46
|
+
})[];
|
|
47
|
+
};
|
|
48
|
+
password: {
|
|
49
|
+
type: string;
|
|
50
|
+
validators: {
|
|
51
|
+
type: string;
|
|
52
|
+
message: string;
|
|
53
|
+
}[];
|
|
54
|
+
};
|
|
55
|
+
newPassword: {
|
|
56
|
+
type: string;
|
|
57
|
+
validators: ({
|
|
58
|
+
key: string;
|
|
59
|
+
type: string;
|
|
60
|
+
message: string;
|
|
61
|
+
length?: undefined;
|
|
62
|
+
pattern?: undefined;
|
|
63
|
+
} | {
|
|
64
|
+
key: string;
|
|
65
|
+
type: string;
|
|
66
|
+
length: number;
|
|
67
|
+
message: string;
|
|
68
|
+
pattern?: undefined;
|
|
69
|
+
} | {
|
|
70
|
+
key: string;
|
|
71
|
+
type: string;
|
|
72
|
+
pattern: RegExp;
|
|
73
|
+
message: string;
|
|
74
|
+
length?: undefined;
|
|
75
|
+
})[];
|
|
76
|
+
};
|
|
77
|
+
repeatPassword: {
|
|
78
|
+
type: string;
|
|
79
|
+
validators: ({
|
|
80
|
+
type: string;
|
|
81
|
+
message: string;
|
|
82
|
+
fieldName?: undefined;
|
|
83
|
+
} | {
|
|
84
|
+
type: string;
|
|
85
|
+
fieldName: string;
|
|
86
|
+
message: string;
|
|
87
|
+
})[];
|
|
88
|
+
};
|
|
89
|
+
cardNumber: {
|
|
90
|
+
type: string;
|
|
91
|
+
validators: ({
|
|
92
|
+
type: string;
|
|
93
|
+
message: string;
|
|
94
|
+
fn?: undefined;
|
|
95
|
+
} | {
|
|
96
|
+
type: string;
|
|
97
|
+
message: string;
|
|
98
|
+
fn: (value: any) => any;
|
|
99
|
+
})[];
|
|
100
|
+
};
|
|
101
|
+
expiry: {
|
|
102
|
+
type: string;
|
|
103
|
+
validators: ({
|
|
104
|
+
type: string;
|
|
105
|
+
message: string;
|
|
106
|
+
fn?: undefined;
|
|
107
|
+
} | {
|
|
108
|
+
type: string;
|
|
109
|
+
message: string;
|
|
110
|
+
fn: (value: any) => any;
|
|
111
|
+
})[];
|
|
112
|
+
};
|
|
113
|
+
cvc: {
|
|
114
|
+
type: string;
|
|
115
|
+
validators: ({
|
|
116
|
+
type: string;
|
|
117
|
+
message: string;
|
|
118
|
+
fn?: undefined;
|
|
119
|
+
} | {
|
|
120
|
+
type: string;
|
|
121
|
+
message: string;
|
|
122
|
+
fn: (value: any) => any;
|
|
123
|
+
})[];
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
declare const _default: (fields: Array<{
|
|
127
|
+
name: string;
|
|
128
|
+
key?: string;
|
|
129
|
+
required?: boolean;
|
|
130
|
+
validators: Array<Record<string, any>>;
|
|
131
|
+
}>, overrideSchema?: Record<string, any>) => yup.ObjectSchema<{
|
|
132
|
+
[x: string]: yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>;
|
|
133
|
+
}, Record<string, any>, import("yup/lib/object").TypeOfShape<{
|
|
134
|
+
[x: string]: yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>;
|
|
135
|
+
}>, import("yup/lib/object").AssertsShape<{
|
|
136
|
+
[x: string]: yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>;
|
|
137
|
+
}>>;
|
|
138
|
+
export default _default;
|
|
139
|
+
export declare const paymentMethodValidationSchema: {
|
|
140
|
+
name: string;
|
|
141
|
+
}[];
|
|
142
|
+
export declare const getHealthFundAccountValidationSchema: (cardFields: Record<string, any>) => {
|
|
143
|
+
cardIssueNumber?: import("yup/lib/string").RequiredStringSchema<string, Record<string, any>>;
|
|
144
|
+
expiryDate?: import("yup/lib/string").RequiredStringSchema<string, Record<string, any>>;
|
|
145
|
+
issueDate?: import("yup/lib/string").RequiredStringSchema<string, Record<string, any>>;
|
|
146
|
+
cardRank?: import("yup/lib/string").RequiredStringSchema<string, Record<string, any>>;
|
|
147
|
+
membershipNumber?: import("yup/lib/string").RequiredStringSchema<string, Record<string, any>>;
|
|
148
|
+
cardNumber?: import("yup/lib/string").RequiredStringSchema<string, Record<string, any>>;
|
|
149
|
+
};
|
package/lib/chart.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const buildChartLabelsFromDataset: (dataset: any, labelKey: any, opts?: {}) => any;
|
|
2
|
+
export declare const buildDataPointsFromDataset: (dataset: any, dataKey: any) => any;
|
|
3
|
+
export declare const humanizePeriod: (period: any) => string;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
buildChartLabelsFromDataset: (dataset: any, labelKey: any, opts?: {}) => any;
|
|
6
|
+
buildDataPointsFromDataset: (dataset: any, dataKey: any) => any;
|
|
7
|
+
humanizePeriod: (period: any) => string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|