@medipass/utils 11.79.2-chore-environment-variables.1 → 11.79.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abn.js +27 -22
- package/build-validation-schema.js +46 -15
- package/chart.js +8 -7
- package/constants.js +22 -20
- package/datetime.js +6 -5
- package/form-applications/assign-values-to-sections.js +4 -3
- package/funders.js +3 -2
- package/get-env.js +56 -24
- package/get-select-options.js +4 -3
- package/get-staff-type-display-name.js +2 -2
- package/google-addresses.js +29 -20
- package/i18n/index.js +6 -2
- package/index.js +0 -1
- package/intercom.js +24 -23
- package/package.json +2 -2
- package/parse-health-fund-card-fields.js +1 -2
- package/payment-options.js +20 -21
- package/products.js +1 -0
- package/redux-actions.js +37 -25
- package/redux-reducer.js +51 -43
- package/sanitise-url.js +1 -1
- package/scroll.js +2 -4
- package/sentry.js +26 -16
- package/service-items.js +34 -11
- package/test-framework/fixtures/transaction-reports.js +2 -2
- package/test-framework/react.js +4 -2
- package/transaction-details-by-funder.js +3 -3
- package/transaction-status-helpers.js +27 -18
- package/transaction-status.js +8 -1
- package/validate-form.d.ts +3 -0
- package/validate-form.js +125 -83
- package/validate.js +10 -9
- package/webpack-config.js +7 -6
- package/env.d.ts +0 -9
- package/env.js +0 -40
package/abn.js
CHANGED
|
@@ -5,77 +5,82 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var ABN_LENGTH = 11;
|
|
6
6
|
var ACN_LENGTH = 9;
|
|
7
7
|
var normaliseAbn = function normaliseAbn(abn) {
|
|
8
|
-
var trimmedABN = abn == null ? void 0 : abn.replace(/\s/g, '');
|
|
8
|
+
var trimmedABN = abn == null ? void 0 : abn.replace(/\s/g, ''); // The input is an ABN, in which case the format should be 99 999 999 999
|
|
9
9
|
|
|
10
|
-
// The input is an ABN, in which case the format should be 99 999 999 999
|
|
11
10
|
if (trimmedABN.length === ABN_LENGTH) {
|
|
12
11
|
return trimmedABN.substring(0, 2) + ' ' + trimmedABN.substring(2, 5) + ' ' + trimmedABN.substring(5, 8) + ' ' + trimmedABN.substring(8);
|
|
13
|
-
}
|
|
12
|
+
} //The input is an ACN, in which case the format should be 999 999 999
|
|
13
|
+
|
|
14
14
|
|
|
15
|
-
//The input is an ACN, in which case the format should be 999 999 999
|
|
16
15
|
if (trimmedABN.length === ACN_LENGTH) {
|
|
17
16
|
return trimmedABN.substring(0, 3) + ' ' + trimmedABN.substring(3, 6) + ' ' + trimmedABN.substring(6);
|
|
18
17
|
}
|
|
18
|
+
|
|
19
19
|
return abn;
|
|
20
20
|
};
|
|
21
21
|
var isValidAbn = function isValidAbn(abn) {
|
|
22
|
-
var VALID_ABN_LENGTH = 11;
|
|
22
|
+
var VALID_ABN_LENGTH = 11; // strip whitespace from value
|
|
23
23
|
|
|
24
|
-
// strip whitespace from value
|
|
25
24
|
abn = String(abn).replace(/\s+/g, '');
|
|
25
|
+
|
|
26
26
|
if (abn.length === VALID_ABN_LENGTH) {
|
|
27
27
|
var weights = [10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19];
|
|
28
28
|
var abnArray = [];
|
|
29
|
+
|
|
29
30
|
for (var i = 0; i < abn.length; i++) {
|
|
30
31
|
abnArray[i] = abn.charAt(i);
|
|
31
|
-
}
|
|
32
|
-
// subtract 1 from the left-most digit
|
|
32
|
+
} // subtract 1 from the left-most digit
|
|
33
33
|
// @ts-expect-error TS(2362): The left-hand side of an arithmetic operation must... Remove this comment to see the full error message
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
abnArray[0] -= 1; // multiply each of the digits by its weighting factor
|
|
37
|
+
|
|
36
38
|
for (var _i = 0; _i < abnArray.length; _i++) {
|
|
37
39
|
// @ts-expect-error TS(2362): The left-hand side of an arithmetic operation must... Remove this comment to see the full error message
|
|
38
40
|
abnArray[_i] *= weights[_i];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
+
} // sum all the digits
|
|
42
|
+
|
|
43
|
+
|
|
41
44
|
var abnSum = 0;
|
|
45
|
+
|
|
42
46
|
for (var _i2 = 0; _i2 < abnArray.length; _i2++) {
|
|
43
47
|
// @ts-expect-error TS(2322): Type 'string' is not assignable to type 'number'.
|
|
44
48
|
abnSum += abnArray[_i2];
|
|
45
49
|
}
|
|
50
|
+
|
|
46
51
|
return abnSum % 89 === 0;
|
|
47
52
|
} else {
|
|
48
53
|
return false;
|
|
49
54
|
}
|
|
50
55
|
};
|
|
51
56
|
var isValidAcn = function isValidAcn(acn) {
|
|
52
|
-
var VALID_ACN_LENGTH = 9;
|
|
57
|
+
var VALID_ACN_LENGTH = 9; // strip whitespace from value
|
|
53
58
|
|
|
54
|
-
// strip whitespace from value
|
|
55
59
|
acn = String(acn).replace(/\s+/g, '');
|
|
60
|
+
|
|
56
61
|
if (acn.length === VALID_ACN_LENGTH) {
|
|
57
62
|
var weights = [8, 7, 6, 5, 4, 3, 2, 1];
|
|
58
63
|
var acnArray = [];
|
|
64
|
+
|
|
59
65
|
for (var i = 0; i < acn.length; i++) {
|
|
60
66
|
acnArray[i] = parseInt(acn.charAt(i));
|
|
61
67
|
}
|
|
62
|
-
var acnSum = 0;
|
|
63
68
|
|
|
64
|
-
// sum the digits 1-8
|
|
69
|
+
var acnSum = 0; // sum the digits 1-8
|
|
70
|
+
|
|
65
71
|
for (var _i3 = 0; _i3 < weights.length; _i3++) {
|
|
66
72
|
acnSum = acnSum + acnArray[_i3] * weights[_i3];
|
|
67
|
-
}
|
|
73
|
+
} // divide by 10 and take remainder
|
|
68
74
|
|
|
69
|
-
// divide by 10 and take remainder
|
|
70
|
-
var remainder = acnSum % 10;
|
|
71
75
|
|
|
72
|
-
// complement the remainder to 10
|
|
73
|
-
|
|
76
|
+
var remainder = acnSum % 10; // complement the remainder to 10
|
|
77
|
+
|
|
78
|
+
var complement = 10 - remainder; // if the complement equals 10, set it to 0
|
|
74
79
|
|
|
75
|
-
// if the complement equals 10, set it to 0
|
|
76
80
|
if (complement === 10) {
|
|
77
81
|
complement = 0;
|
|
78
82
|
}
|
|
83
|
+
|
|
79
84
|
return acnArray[8] === complement;
|
|
80
85
|
} else {
|
|
81
86
|
return false;
|
|
@@ -892,6 +892,7 @@ var lib$1 = createCommonjsModule(function (module) {
|
|
|
892
892
|
});
|
|
893
893
|
|
|
894
894
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
895
|
+
|
|
895
896
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
896
897
|
var FIELD_VALIDATORS = {
|
|
897
898
|
firstName: {
|
|
@@ -921,7 +922,9 @@ var FIELD_VALIDATORS = {
|
|
|
921
922
|
if (!value) {
|
|
922
923
|
return;
|
|
923
924
|
}
|
|
925
|
+
|
|
924
926
|
var day = _get(value.split('/'), '[0]', '').split(' ').join('');
|
|
927
|
+
|
|
925
928
|
return day ? /^0[1-9]|[12][0-9]|3[01]$/.test(day) : true;
|
|
926
929
|
}
|
|
927
930
|
}, {
|
|
@@ -932,7 +935,9 @@ var FIELD_VALIDATORS = {
|
|
|
932
935
|
if (!value) {
|
|
933
936
|
return;
|
|
934
937
|
}
|
|
938
|
+
|
|
935
939
|
var month = _get(value.split('/'), '[1]', '');
|
|
940
|
+
|
|
936
941
|
return month ? /^(0[1-9]|1[012])$/.test(month) : true;
|
|
937
942
|
}
|
|
938
943
|
}, {
|
|
@@ -943,7 +948,9 @@ var FIELD_VALIDATORS = {
|
|
|
943
948
|
if (!value) {
|
|
944
949
|
return;
|
|
945
950
|
}
|
|
951
|
+
|
|
946
952
|
var year = _get(value.split('/'), '[2]', '');
|
|
953
|
+
|
|
947
954
|
return year ? /^[0-9]{4}$/.test(year) : true;
|
|
948
955
|
}
|
|
949
956
|
}, {
|
|
@@ -954,7 +961,9 @@ var FIELD_VALIDATORS = {
|
|
|
954
961
|
if (!value) {
|
|
955
962
|
return;
|
|
956
963
|
}
|
|
964
|
+
|
|
957
965
|
var year = _get(value.split('/'), '[2]', '');
|
|
966
|
+
|
|
958
967
|
return year ? parseInt(year, 10) >= 1900 : true;
|
|
959
968
|
}
|
|
960
969
|
}, {
|
|
@@ -965,7 +974,9 @@ var FIELD_VALIDATORS = {
|
|
|
965
974
|
if (!value) {
|
|
966
975
|
return;
|
|
967
976
|
}
|
|
977
|
+
|
|
968
978
|
var year = _get(value.split('/'), '[2]', '');
|
|
979
|
+
|
|
969
980
|
return year ? parseInt(year, 10) <= new Date().getFullYear() : true;
|
|
970
981
|
}
|
|
971
982
|
}]
|
|
@@ -1082,16 +1093,16 @@ var FIELD_VALIDATORS = {
|
|
|
1082
1093
|
}
|
|
1083
1094
|
}]
|
|
1084
1095
|
}
|
|
1085
|
-
};
|
|
1096
|
+
}; // @ts-expect-error TS(7006): Parameter 'field' implicitly has an 'any' type.
|
|
1086
1097
|
|
|
1087
|
-
// @ts-expect-error TS(7006): Parameter 'field' implicitly has an 'any' type.
|
|
1088
1098
|
var getFieldSchema = function getFieldSchema(field) {
|
|
1089
|
-
var key = field.key || field.name;
|
|
1090
|
-
|
|
1091
|
-
var defaultFieldExists = Boolean(FIELD_VALIDATORS[key]);
|
|
1092
|
-
|
|
1099
|
+
var key = field.key || field.name; // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
|
1100
|
+
|
|
1101
|
+
var defaultFieldExists = Boolean(FIELD_VALIDATORS[key]); // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
|
1102
|
+
|
|
1093
1103
|
var fieldAttributes = defaultFieldExists ? FIELD_VALIDATORS[key] : field;
|
|
1094
1104
|
var schema = yup;
|
|
1105
|
+
|
|
1095
1106
|
switch (fieldAttributes.type) {
|
|
1096
1107
|
case 'string':
|
|
1097
1108
|
{
|
|
@@ -1099,42 +1110,49 @@ var getFieldSchema = function getFieldSchema(field) {
|
|
|
1099
1110
|
schema = schema.string();
|
|
1100
1111
|
break;
|
|
1101
1112
|
}
|
|
1113
|
+
|
|
1102
1114
|
case 'object':
|
|
1103
1115
|
{
|
|
1104
1116
|
// @ts-expect-error TS(2740): Type 'OptionalObjectSchema<ObjectShape, Record<str... Remove this comment to see the full error message
|
|
1105
1117
|
schema = schema.object();
|
|
1106
1118
|
break;
|
|
1107
1119
|
}
|
|
1120
|
+
|
|
1108
1121
|
case 'array':
|
|
1109
1122
|
{
|
|
1110
1123
|
// @ts-expect-error TS(2740): Type 'OptionalArraySchema<AnySchema<any, any, any>... Remove this comment to see the full error message
|
|
1111
1124
|
schema = schema.array();
|
|
1112
1125
|
break;
|
|
1113
1126
|
}
|
|
1127
|
+
|
|
1114
1128
|
case 'boolean':
|
|
1115
1129
|
{
|
|
1116
1130
|
// @ts-expect-error TS(2740): Type 'BooleanSchema<boolean, Record<string, any>, ... Remove this comment to see the full error message
|
|
1117
1131
|
schema = schema.boolean();
|
|
1118
1132
|
break;
|
|
1119
1133
|
}
|
|
1134
|
+
|
|
1120
1135
|
case 'date':
|
|
1121
1136
|
{
|
|
1122
1137
|
// @ts-expect-error TS(2740): Type 'DateSchema<Date, Record<string, any>, Date>'... Remove this comment to see the full error message
|
|
1123
1138
|
schema = schema.date();
|
|
1124
1139
|
break;
|
|
1125
1140
|
}
|
|
1141
|
+
|
|
1126
1142
|
case 'number':
|
|
1127
1143
|
{
|
|
1128
1144
|
// @ts-expect-error TS(2740): Type 'NumberSchema<number, Record<string, any>, nu... Remove this comment to see the full error message
|
|
1129
1145
|
schema = schema.number();
|
|
1130
1146
|
break;
|
|
1131
1147
|
}
|
|
1148
|
+
|
|
1132
1149
|
default:
|
|
1133
1150
|
{
|
|
1134
1151
|
// @ts-expect-error TS(2322): Type 'StringSchema<string, Record<string, any>, st... Remove this comment to see the full error message
|
|
1135
1152
|
schema = schema.string();
|
|
1136
1153
|
}
|
|
1137
1154
|
}
|
|
1155
|
+
|
|
1138
1156
|
if (fieldAttributes.validators) {
|
|
1139
1157
|
// @ts-expect-error TS(7006): Parameter 'validator' implicitly has an 'any' type... Remove this comment to see the full error message
|
|
1140
1158
|
fieldAttributes.validators.forEach(function (validator) {
|
|
@@ -1143,36 +1161,41 @@ var getFieldSchema = function getFieldSchema(field) {
|
|
|
1143
1161
|
{
|
|
1144
1162
|
if (defaultFieldExists && !field.required) {
|
|
1145
1163
|
return;
|
|
1146
|
-
}
|
|
1164
|
+
} // @ts-expect-error TS(2339): Property 'required' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
1165
|
+
|
|
1147
1166
|
|
|
1148
|
-
// @ts-expect-error TS(2339): Property 'required' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
1149
1167
|
schema = schema.required(validator.message);
|
|
1150
1168
|
break;
|
|
1151
1169
|
}
|
|
1170
|
+
|
|
1152
1171
|
case 'test':
|
|
1153
1172
|
{
|
|
1154
1173
|
// @ts-expect-error TS(2339): Property 'test' does not exist on type 'typeof imp... Remove this comment to see the full error message
|
|
1155
1174
|
schema = schema.test(field.name, validator.message, validator.fn);
|
|
1156
1175
|
break;
|
|
1157
1176
|
}
|
|
1177
|
+
|
|
1158
1178
|
case 'email':
|
|
1159
1179
|
{
|
|
1160
1180
|
// @ts-expect-error TS(2339): Property 'email' does not exist on type 'typeof im... Remove this comment to see the full error message
|
|
1161
1181
|
schema = schema.email(validator.message);
|
|
1162
1182
|
break;
|
|
1163
1183
|
}
|
|
1184
|
+
|
|
1164
1185
|
case 'min':
|
|
1165
1186
|
{
|
|
1166
1187
|
// @ts-expect-error TS(2339): Property 'min' does not exist on type 'typeof impo... Remove this comment to see the full error message
|
|
1167
1188
|
schema = schema.min(validator.length, validator.message);
|
|
1168
1189
|
break;
|
|
1169
1190
|
}
|
|
1191
|
+
|
|
1170
1192
|
case 'matches':
|
|
1171
1193
|
{
|
|
1172
1194
|
// @ts-expect-error TS(2339): Property 'matches' does not exist on type 'typeof ... Remove this comment to see the full error message
|
|
1173
1195
|
schema = schema.matches(validator.pattern, validator.message);
|
|
1174
1196
|
break;
|
|
1175
1197
|
}
|
|
1198
|
+
|
|
1176
1199
|
case 'oneOf':
|
|
1177
1200
|
{
|
|
1178
1201
|
// @ts-expect-error TS(2339): Property 'oneOf' does not exist on type 'typeof im... Remove this comment to see the full error message
|
|
@@ -1182,33 +1205,37 @@ var getFieldSchema = function getFieldSchema(field) {
|
|
|
1182
1205
|
}
|
|
1183
1206
|
});
|
|
1184
1207
|
}
|
|
1208
|
+
|
|
1185
1209
|
return schema;
|
|
1186
1210
|
};
|
|
1211
|
+
|
|
1187
1212
|
var buildValidationSchema = function buildValidationSchema(fields, overrideSchema) {
|
|
1188
1213
|
if (overrideSchema === void 0) {
|
|
1189
1214
|
overrideSchema = {};
|
|
1190
1215
|
}
|
|
1216
|
+
|
|
1191
1217
|
var schema = {};
|
|
1192
1218
|
fields.forEach(function (field) {
|
|
1193
1219
|
if (!field) {
|
|
1194
1220
|
return;
|
|
1195
|
-
}
|
|
1221
|
+
} // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
|
1222
|
+
|
|
1196
1223
|
|
|
1197
|
-
// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
|
1198
1224
|
schema[field.name] = getFieldSchema(field);
|
|
1199
1225
|
});
|
|
1200
1226
|
return yup.object().shape(_objectSpread({}, schema, {}, overrideSchema));
|
|
1201
1227
|
};
|
|
1202
1228
|
/* ===== CUSTOM OVERRIDE SCHEMAS ===== */
|
|
1203
|
-
|
|
1204
1229
|
// @ts-expect-error TS(7006): Parameter 'schema' implicitly has an 'any' type.
|
|
1230
|
+
|
|
1205
1231
|
var validateHealthFundDate = function validateHealthFundDate(schema, _ref) {
|
|
1206
1232
|
var cardFields = _ref.cardFields,
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1233
|
+
fieldKey = _ref.fieldKey,
|
|
1234
|
+
dayKey = _ref.dayKey,
|
|
1235
|
+
monthKey = _ref.monthKey,
|
|
1236
|
+
yearKey = _ref.yearKey;
|
|
1211
1237
|
var newSchema = schema;
|
|
1238
|
+
|
|
1212
1239
|
if (cardFields[dayKey]) {
|
|
1213
1240
|
// @ts-expect-error TS(7006): Parameter 'value' implicitly has an 'any' type.
|
|
1214
1241
|
newSchema = newSchema.test(fieldKey, _get(cardFields, dayKey + ".validation.message"), function (value) {
|
|
@@ -1217,6 +1244,7 @@ var validateHealthFundDate = function validateHealthFundDate(schema, _ref) {
|
|
|
1217
1244
|
return new RegExp(_get(cardFields, dayKey + ".validation.regex")).test(day);
|
|
1218
1245
|
});
|
|
1219
1246
|
}
|
|
1247
|
+
|
|
1220
1248
|
if (cardFields[monthKey]) {
|
|
1221
1249
|
// @ts-expect-error TS(7006): Parameter 'value' implicitly has an 'any' type.
|
|
1222
1250
|
newSchema = newSchema.test(fieldKey, _get(cardFields, monthKey + ".validation.message"), function (value) {
|
|
@@ -1225,6 +1253,7 @@ var validateHealthFundDate = function validateHealthFundDate(schema, _ref) {
|
|
|
1225
1253
|
return new RegExp(_get(cardFields, monthKey + ".validation.regex")).test(month);
|
|
1226
1254
|
});
|
|
1227
1255
|
}
|
|
1256
|
+
|
|
1228
1257
|
if (cardFields[yearKey]) {
|
|
1229
1258
|
// @ts-expect-error TS(7006): Parameter 'value' implicitly has an 'any' type.
|
|
1230
1259
|
newSchema = newSchema.test(fieldKey, _get(cardFields, yearKey + ".validation.message"), function (value) {
|
|
@@ -1233,8 +1262,10 @@ var validateHealthFundDate = function validateHealthFundDate(schema, _ref) {
|
|
|
1233
1262
|
return new RegExp(_get(cardFields, yearKey + ".validation.regex")).test(year);
|
|
1234
1263
|
});
|
|
1235
1264
|
}
|
|
1265
|
+
|
|
1236
1266
|
return newSchema;
|
|
1237
1267
|
};
|
|
1268
|
+
|
|
1238
1269
|
var paymentMethodValidationSchema = [{
|
|
1239
1270
|
name: 'cardNumber'
|
|
1240
1271
|
}, {
|
package/chart.js
CHANGED
|
@@ -8,34 +8,35 @@ var _capitalize = _interopDefault(require('lodash/capitalize'));
|
|
|
8
8
|
var _get = _interopDefault(require('lodash/get'));
|
|
9
9
|
var moment = _interopDefault(require('moment'));
|
|
10
10
|
|
|
11
|
-
// @ts-expect-error TS(7006): Parameter 'dataset' implicitly has an 'any' type.
|
|
12
11
|
var buildChartLabelsFromDataset = function buildChartLabelsFromDataset(dataset, labelKey, opts) {
|
|
13
12
|
if (opts === void 0) {
|
|
14
13
|
opts = {};
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
|
|
16
|
+
return (// @ts-expect-error TS(7006): Parameter 'data' implicitly has an 'any' type.
|
|
18
17
|
dataset.map(function (data) {
|
|
19
18
|
// @ts-expect-error TS(2339): Property 'format' does not exist on type '{}'.
|
|
20
19
|
if (opts.format) {
|
|
21
20
|
// @ts-expect-error TS(2339): Property 'format' does not exist on type '{}'.
|
|
22
21
|
return moment(data[labelKey]).format(opts.format);
|
|
23
22
|
}
|
|
23
|
+
|
|
24
24
|
return data[labelKey];
|
|
25
25
|
})
|
|
26
26
|
);
|
|
27
|
-
};
|
|
28
|
-
|
|
27
|
+
}; // @ts-expect-error TS(7006): Parameter 'dataset' implicitly has an 'any' type.
|
|
28
|
+
|
|
29
29
|
var buildDataPointsFromDataset = function buildDataPointsFromDataset(dataset, dataKey) {
|
|
30
30
|
return dataset.map(function (data) {
|
|
31
31
|
return _get(data, dataKey);
|
|
32
32
|
});
|
|
33
|
-
};
|
|
34
|
-
|
|
33
|
+
}; // @ts-expect-error TS(7006): Parameter 'period' implicitly has an 'any' type.
|
|
34
|
+
|
|
35
35
|
var humanizePeriod = function humanizePeriod(period) {
|
|
36
36
|
if (period && period.includes('--')) {
|
|
37
37
|
return '';
|
|
38
38
|
}
|
|
39
|
+
|
|
39
40
|
return _capitalize(period);
|
|
40
41
|
};
|
|
41
42
|
var chart = {
|
package/constants.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _FUNDERS_FORMATTED;
|
|
6
|
+
|
|
6
7
|
/* ====== START: ERRORS ======= */
|
|
7
8
|
var ERROR_MESSAGES = {
|
|
8
9
|
INTERNET_ERROR: 'We are unable to establish an internet connection. We will take you back once you are connected to the internet.',
|
|
@@ -36,10 +37,10 @@ var STANDALONE_ERRORS = {
|
|
|
36
37
|
message: 'Provider number does not match the given funder.'
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
|
-
|
|
40
40
|
/* ====== END: ERRORS ======= */
|
|
41
41
|
|
|
42
42
|
/* ====== START: DOCUMENTS ======= */
|
|
43
|
+
|
|
43
44
|
var DOCUMENT_STATUSES = {
|
|
44
45
|
AVAILABLE: 'available',
|
|
45
46
|
PENDING: 'pending',
|
|
@@ -63,28 +64,28 @@ var DOCUMENT_WORKFLOW_STATES_HUMANIZED = {
|
|
|
63
64
|
UNDER_REVIEW: 'Under review',
|
|
64
65
|
APPROVED: 'Approved'
|
|
65
66
|
};
|
|
66
|
-
|
|
67
67
|
/* ====== END: DOCUMENTS ======= */
|
|
68
68
|
|
|
69
69
|
/* ====== START: FORMS ======= */
|
|
70
|
+
|
|
70
71
|
var FORM_STATUSES = {
|
|
71
72
|
PUBLISHED: 'published',
|
|
72
73
|
DRAFT: 'draft'
|
|
73
74
|
};
|
|
74
|
-
|
|
75
75
|
/* ====== END: FORMS ======= */
|
|
76
76
|
|
|
77
77
|
/* ====== START: FORM APPLICATIONS ======= */
|
|
78
|
+
|
|
78
79
|
var FORM_APPLICATION_STATUSES = {
|
|
79
80
|
PENDING: 'pending',
|
|
80
81
|
APPROVED: 'approved',
|
|
81
82
|
DECLINED: 'declined',
|
|
82
83
|
CANCELLED: 'cancelled'
|
|
83
84
|
};
|
|
84
|
-
|
|
85
85
|
/* ====== END: FORM APPLICATIONS ======= */
|
|
86
86
|
|
|
87
87
|
/* ====== START: FUNDERS ======= */
|
|
88
|
+
|
|
88
89
|
var FUNDERS = {
|
|
89
90
|
// Note: maps to funder.code
|
|
90
91
|
COMCARE: 'comcare',
|
|
@@ -103,10 +104,10 @@ var FUNDERS = {
|
|
|
103
104
|
WSV: 'wsv'
|
|
104
105
|
};
|
|
105
106
|
var FUNDERS_FORMATTED = (_FUNDERS_FORMATTED = {}, _FUNDERS_FORMATTED[FUNDERS.COMCARE] = 'Comcare', _FUNDERS_FORMATTED[FUNDERS.ECLIPSE] = 'Eclipse', _FUNDERS_FORMATTED[FUNDERS.HBF] = 'HBF', _FUNDERS_FORMATTED[FUNDERS.HEALTHPOINT] = 'HEALTHPOINT', _FUNDERS_FORMATTED[FUNDERS.HICAPS] = 'HICAPS', _FUNDERS_FORMATTED[FUNDERS.ICARE] = 'icare', _FUNDERS_FORMATTED[FUNDERS.MEDICARE] = 'Medicare', _FUNDERS_FORMATTED[FUNDERS.NDIS] = 'NDIS', _FUNDERS_FORMATTED[FUNDERS.NIB] = 'NIB', _FUNDERS_FORMATTED[FUNDERS.OHC] = 'Overseas health cover', _FUNDERS_FORMATTED[FUNDERS.PATIENT] = 'Patient funded', _FUNDERS_FORMATTED[FUNDERS.WCQ] = 'Workcover Queensland', _FUNDERS_FORMATTED[FUNDERS.WSV] = 'WorkSafe Victoria', _FUNDERS_FORMATTED);
|
|
106
|
-
|
|
107
107
|
/* ====== END: FUNDERS ======= */
|
|
108
108
|
|
|
109
109
|
/* ====== START: FUTURES ======= */
|
|
110
|
+
|
|
110
111
|
var FUTURE_STATUSES = {
|
|
111
112
|
ACTIVE: 'active',
|
|
112
113
|
PENDING: 'pending',
|
|
@@ -125,24 +126,24 @@ var FUTURE_LABELS = {
|
|
|
125
126
|
subscription: 'Subscription',
|
|
126
127
|
'instalment-plan': 'Instalment plan'
|
|
127
128
|
};
|
|
128
|
-
|
|
129
129
|
/* ====== END: FUTURES ======= */
|
|
130
130
|
|
|
131
131
|
/* ====== START: GATEWAY ======= */
|
|
132
|
+
|
|
132
133
|
var GATEWAY_CODES = {
|
|
133
134
|
HICAPS_ERROR: '12',
|
|
134
135
|
HICAPS_DOWN: '91',
|
|
135
136
|
MEDICARE_DOWN: '3004'
|
|
136
137
|
};
|
|
137
|
-
|
|
138
138
|
/* ====== END: GATEWAY ======= */
|
|
139
139
|
|
|
140
140
|
/* ====== START: MISC ======= */
|
|
141
|
-
var AUS_STATES = ['Victoria', 'Tasmania', 'Western Australia', 'South Australia', 'Queensland', 'New South Wales', 'Australian Capital Territory', 'Northern Territory'];
|
|
142
141
|
|
|
142
|
+
var AUS_STATES = ['Victoria', 'Tasmania', 'Western Australia', 'South Australia', 'Queensland', 'New South Wales', 'Australian Capital Territory', 'Northern Territory'];
|
|
143
143
|
/* ====== END: MISC ======= */
|
|
144
144
|
|
|
145
145
|
/* ====== START: PAYMENTS ======= */
|
|
146
|
+
|
|
146
147
|
var PAYMENT_FACILITIES = {
|
|
147
148
|
HICAPS_GO: 'hicaps-go',
|
|
148
149
|
MEDIPASS_PAYMENTS: 'medipass-payments'
|
|
@@ -152,10 +153,10 @@ var PAYMENT_PROVIDERS = {
|
|
|
152
153
|
APPLE_PAY: 'apple-pay',
|
|
153
154
|
PAYMENT_CARD: 'payment-card'
|
|
154
155
|
};
|
|
155
|
-
|
|
156
156
|
/* ====== START: PAYMENTS ======= */
|
|
157
157
|
|
|
158
158
|
/* ====== START: PRODUCT ======= */
|
|
159
|
+
|
|
159
160
|
var PRODUCTS = {
|
|
160
161
|
BASIC: 'basic',
|
|
161
162
|
PRO: 'pro'
|
|
@@ -177,10 +178,10 @@ var PRODUCT_FEATURES = {
|
|
|
177
178
|
PMS_INTEGRATION: 'pms:integration',
|
|
178
179
|
REPORTING: 'reporting'
|
|
179
180
|
};
|
|
180
|
-
|
|
181
181
|
/* ====== END: PRODUCT ======= */
|
|
182
182
|
|
|
183
183
|
/* ====== START: STATUSES ======= */
|
|
184
|
+
|
|
184
185
|
var STATUSES = {
|
|
185
186
|
ACTIVE: 'ACTIVE',
|
|
186
187
|
DISABLED: 'DISABLED',
|
|
@@ -193,10 +194,10 @@ var STATUSES = {
|
|
|
193
194
|
PENDING: 'PENDING',
|
|
194
195
|
EXPIRED: 'EXPIRED'
|
|
195
196
|
};
|
|
196
|
-
|
|
197
197
|
/* ====== END: STATUSES ======= */
|
|
198
198
|
|
|
199
199
|
/* ====== START: BUSINESS STATUSES ======= */
|
|
200
|
+
|
|
200
201
|
var BUSINESS_STATUSES = {
|
|
201
202
|
ACTIVE: 'ACTIVE',
|
|
202
203
|
SUSPENDED: 'SUSPENDED'
|
|
@@ -204,6 +205,7 @@ var BUSINESS_STATUSES = {
|
|
|
204
205
|
/* ====== END: BUSINESS STATUSES ======= */
|
|
205
206
|
|
|
206
207
|
/* ====== START: PAYMENT STATUSES ======= */
|
|
208
|
+
|
|
207
209
|
var PAYMENT_STATUSES = {
|
|
208
210
|
ACCEPTED: 'accepted',
|
|
209
211
|
APPROVED: 'approved',
|
|
@@ -211,10 +213,10 @@ var PAYMENT_STATUSES = {
|
|
|
211
213
|
PENDING: 'pending',
|
|
212
214
|
SETTLING: 'settling'
|
|
213
215
|
};
|
|
214
|
-
|
|
215
216
|
/* ====== END: PAYMENT STATUSES ======= */
|
|
216
217
|
|
|
217
218
|
/* ====== START: TRANSACTIONS ======= */
|
|
219
|
+
|
|
218
220
|
var PAYMENT_TYPES = {
|
|
219
221
|
SALE: 'sale',
|
|
220
222
|
REFUND: 'refund',
|
|
@@ -292,42 +294,42 @@ var ICARE_WORKFLOW_STATES_HUMANIZED = {
|
|
|
292
294
|
COMPLETED: 'Completed',
|
|
293
295
|
REJECTED: 'Rejected'
|
|
294
296
|
};
|
|
295
|
-
|
|
296
297
|
/* ====== END: TRANSACTIONS ======= */
|
|
297
298
|
|
|
298
299
|
/* ====== START: MEDICARE ======= */
|
|
300
|
+
|
|
299
301
|
var MEDICARE_FORMS = {
|
|
300
302
|
ONLINE_CLAIMING_PROVIDER_AGREEMENT: 'Online Claiming Provider Agreement'
|
|
301
303
|
};
|
|
302
|
-
|
|
303
304
|
/* ====== END: MEDICARE ======= */
|
|
304
305
|
|
|
305
306
|
/* ====== START: HICAPS FORMS ======= */
|
|
307
|
+
|
|
306
308
|
var HICAPS_FORMS = {
|
|
307
309
|
CLAIMING_PROVIDER_APPLICATION: 'HICAPS Claiming Application'
|
|
308
310
|
};
|
|
309
|
-
|
|
310
311
|
/* ====== END: HICAPS FORMS ======= */
|
|
311
312
|
|
|
312
313
|
/* ====== START: PMS ======= */
|
|
313
|
-
var PMS = ['Best Practice (Allied)', 'Best Practice (Premier)', 'Clinic to Cloud', 'Cliniko', 'Coreplus', 'Coviu', 'Dental4Windows', 'Doctors on Demand', 'Exact', 'Front Desk', 'Genie', 'Gensolve', 'Gentu', 'Halaxy / HealthKit', 'Iconpractice', 'Kalysys', 'Lysn', 'Medical Director', 'Medilink', 'Medirecords', 'MedTech', 'My Appointments', 'Myhealth1st', 'Nookal', 'Oasis', 'Owner.health', 'Optomate', 'Powerdiary', 'PPMP', 'PracSuite', 'Shexie', 'Splose', 'Sunix', 'TM2', 'VisitBase', 'ZedMed', 'Zurili', 'Other'];
|
|
314
314
|
|
|
315
|
+
var PMS = ['Best Practice (Allied)', 'Best Practice (Premier)', 'Clinic to Cloud', 'Cliniko', 'Coreplus', 'Coviu', 'Dental4Windows', 'Doctors on Demand', 'Exact', 'Front Desk', 'Genie', 'Gensolve', 'Gentu', 'Halaxy / HealthKit', 'Iconpractice', 'Kalysys', 'Lysn', 'Medical Director', 'Medilink', 'Medirecords', 'MedTech', 'My Appointments', 'Myhealth1st', 'Nookal', 'Oasis', 'Owner.health', 'Optomate', 'Powerdiary', 'PPMP', 'PracSuite', 'Shexie', 'Splose', 'Sunix', 'TM2', 'VisitBase', 'ZedMed', 'Zurili', 'Other'];
|
|
315
316
|
/* ====== END: PMS ======= */
|
|
316
317
|
|
|
317
318
|
/* ====== START: REGIONS ======= */
|
|
319
|
+
|
|
318
320
|
var REGIONS = {
|
|
319
321
|
au: 'au',
|
|
320
322
|
uk: 'uk'
|
|
321
323
|
};
|
|
322
|
-
|
|
323
324
|
/* ====== END: REGIONS ======= */
|
|
324
325
|
|
|
325
326
|
/* ====== START: VERIFY MEMBER HEALTH FUNDS ======= */
|
|
326
|
-
var VERIFY_MEMBER_HEALTH_FUNDS_CODES = ['BUP'];
|
|
327
327
|
|
|
328
|
+
var VERIFY_MEMBER_HEALTH_FUNDS_CODES = ['BUP'];
|
|
328
329
|
/* ====== END: VERIFY MEMBER HEALTH FUNDS ======= */
|
|
329
330
|
|
|
330
331
|
/* ====== START: INVOICE_ORIGINATING_FLOW ======= */
|
|
332
|
+
|
|
331
333
|
var INVOICE_ORIGINATING_FLOW = {
|
|
332
334
|
ALLIED_PHI: 'allied-phi',
|
|
333
335
|
COMCARE: 'comcare',
|
|
@@ -346,18 +348,18 @@ var INVOICE_ORIGINATING_FLOW = {
|
|
|
346
348
|
WORK_COVER_QUEENSLAND: 'wcq',
|
|
347
349
|
WORKSAFE_VICTORIA: 'wsv'
|
|
348
350
|
};
|
|
349
|
-
|
|
350
351
|
/* ====== END: INVOICE_ORIGINATING_FLOW ======= */
|
|
351
352
|
|
|
352
353
|
/* ====== START: STAFF ======= */
|
|
354
|
+
|
|
353
355
|
var STAFF_TYPES = {
|
|
354
356
|
LOCATION: 'location',
|
|
355
357
|
PERSON: 'person'
|
|
356
358
|
};
|
|
357
|
-
|
|
358
359
|
/* ====== END: STAFF ======= */
|
|
359
360
|
|
|
360
361
|
/* ====== START: ECLIPSE ======= */
|
|
362
|
+
|
|
361
363
|
var ECLIPSE_SUB_TYPE = {
|
|
362
364
|
ONLINE_ELIGIBILITY_CHECK: 'onlineEligibilityCheck',
|
|
363
365
|
IN_PATIENT: 'inPatient',
|
package/datetime.js
CHANGED
|
@@ -8,27 +8,28 @@ var startOfMinute = _interopDefault(require('date-fns/startOfMinute'));
|
|
|
8
8
|
var setMinutes = _interopDefault(require('date-fns/setMinutes'));
|
|
9
9
|
var getMinutes = _interopDefault(require('date-fns/getMinutes'));
|
|
10
10
|
|
|
11
|
-
// @ts-expect-error TS(7006): Parameter 'date' implicitly has an 'any' type.
|
|
12
11
|
var roundToNearestMinutes = function roundToNearestMinutes(date, interval) {
|
|
13
12
|
var roundedMinutes = Math.floor(getMinutes(date) / interval) * interval;
|
|
14
13
|
return setMinutes(startOfMinute(date), roundedMinutes);
|
|
15
|
-
};
|
|
14
|
+
}; // @ts-expect-error TS(7006): Parameter 'date' implicitly has an 'any' type.
|
|
16
15
|
|
|
17
|
-
// @ts-expect-error TS(7006): Parameter 'date' implicitly has an 'any' type.
|
|
18
16
|
var isValidDate = function isValidDate(date) {
|
|
19
17
|
return /\d{4}-\d{2}-\d{2}/.test(date);
|
|
20
|
-
};
|
|
18
|
+
}; // @ts-expect-error TS(7006): Parameter 'date' implicitly has an 'any' type.
|
|
19
|
+
|
|
21
20
|
|
|
22
|
-
// @ts-expect-error TS(7006): Parameter 'date' implicitly has an 'any' type.
|
|
23
21
|
var parseDate = function parseDate(date) {
|
|
24
22
|
if (!date) {
|
|
25
23
|
return;
|
|
26
24
|
}
|
|
25
|
+
|
|
27
26
|
var serviceDateArray = date.split('/');
|
|
28
27
|
var serviceDateString = serviceDateArray[2] + "-" + serviceDateArray[1] + "-" + serviceDateArray[0];
|
|
28
|
+
|
|
29
29
|
if (!isValidDate(serviceDateString)) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
+
|
|
32
33
|
return serviceDateString;
|
|
33
34
|
};
|
|
34
35
|
|
|
@@ -7,13 +7,14 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
7
7
|
var _defineProperty = _interopDefault(require('@babel/runtime/helpers/defineProperty'));
|
|
8
8
|
|
|
9
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
+
|
|
10
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
+
|
|
11
13
|
// @ts-expect-error TS(7031): Binding element 'sections' implicitly has an 'any'... Remove this comment to see the full error message
|
|
12
14
|
var assignValuesToSections = function assignValuesToSections(_ref) {
|
|
13
15
|
var sections = _ref.sections,
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
// @ts-expect-error TS(7006): Parameter 'section' implicitly has an 'any' type.
|
|
16
|
+
values = _ref.values;
|
|
17
|
+
return (// @ts-expect-error TS(7006): Parameter 'section' implicitly has an 'any' type.
|
|
17
18
|
sections.map(function (section) {
|
|
18
19
|
return _objectSpread({}, section, {
|
|
19
20
|
// @ts-expect-error TS(7006): Parameter 'subsection' implicitly has an 'any' typ... Remove this comment to see the full error message
|
package/funders.js
CHANGED
|
@@ -41,6 +41,7 @@ var getFunderCodeFromTransaction = function getFunderCodeFromTransaction(transac
|
|
|
41
41
|
} else if (funderCode === constants.FUNDERS.ECLIPSE) {
|
|
42
42
|
return constants.FUNDERS.ECLIPSE;
|
|
43
43
|
}
|
|
44
|
+
|
|
44
45
|
return constants.FUNDERS.PATIENT;
|
|
45
46
|
};
|
|
46
47
|
var isComcare = function isComcare(funderCode) {
|
|
@@ -84,8 +85,8 @@ var isWCQ = function isWCQ(funderCode) {
|
|
|
84
85
|
};
|
|
85
86
|
var isWSV = function isWSV(funderCode) {
|
|
86
87
|
return funderCode === constants.FUNDERS.WSV;
|
|
87
|
-
};
|
|
88
|
-
|
|
88
|
+
}; // @ts-expect-error
|
|
89
|
+
|
|
89
90
|
var isFunderClaimable = function isFunderClaimable(funderCode) {
|
|
90
91
|
return CLAIMABLE_FUNDERS.includes(funderCode);
|
|
91
92
|
};
|