@becollective/utils 1.10.2 → 2.0.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/.semaphore/utils.yml +1 -1
- package/index.ts +7 -0
- package/lib/FeatureFlag.d.ts +12 -0
- package/lib/FeatureFlag.js +51 -0
- package/lib/constants/allowedHtmlTags.d.ts +7 -0
- package/lib/constants/allowedHtmlTags.js +8 -0
- package/lib/constants/avatarColours.d.ts +35 -0
- package/lib/constants/avatarColours.js +36 -0
- package/lib/constants/countries.d.ts +253 -0
- package/lib/constants/countries.js +254 -0
- package/lib/constants/currencies.d.ts +29 -0
- package/lib/constants/currencies.js +36 -0
- package/lib/constants/customFields.d.ts +11 -0
- package/lib/constants/customFields.js +12 -0
- package/lib/constants/distancesUnits.d.ts +11 -0
- package/lib/constants/distancesUnits.js +13 -0
- package/lib/constants/groups.d.ts +13 -0
- package/lib/constants/groups.js +85 -0
- package/lib/constants/insuranceStatuses.d.ts +15 -0
- package/lib/constants/insuranceStatuses.js +7 -0
- package/lib/constants/insuranceTypes.d.ts +35 -0
- package/lib/constants/insuranceTypes.js +36 -0
- package/lib/constants/languages.d.ts +2 -0
- package/lib/constants/languages.js +194 -0
- package/lib/constants/locales.d.ts +119 -0
- package/lib/constants/locales.js +191 -0
- package/lib/constants/notifications.d.ts +47 -0
- package/lib/constants/notifications.js +31 -0
- package/lib/constants/opportunities.d.ts +72 -0
- package/lib/constants/opportunities.js +82 -0
- package/lib/constants/qualificationTypes.d.ts +4 -0
- package/lib/constants/qualificationTypes.js +18 -0
- package/lib/constants/rules.d.ts +13 -0
- package/lib/constants/rules.js +21 -0
- package/lib/constants/subscriptions.d.ts +9 -0
- package/lib/constants/subscriptions.js +10 -0
- package/lib/constants/surveys.d.ts +16 -0
- package/lib/constants/surveys.js +17 -0
- package/lib/constants.d.ts +1 -0
- package/lib/constants.js +76 -0
- package/lib/date-time.d.ts +28 -0
- package/lib/date-time.js +79 -0
- package/lib/forms.d.ts +1 -0
- package/lib/forms.js +728 -0
- package/lib/locality.d.ts +5 -0
- package/lib/locality.js +15 -0
- package/lib/money.d.ts +7 -0
- package/lib/money.js +32 -0
- package/lib/opportunity.d.ts +1 -0
- package/lib/opportunity.js +11 -0
- package/lib/opportunityUser.d.ts +8 -0
- package/lib/opportunityUser.js +29 -0
- package/lib/password.d.ts +8 -0
- package/lib/password.js +43 -0
- package/lib/rrule/date.d.ts +4 -0
- package/lib/rrule/date.js +30 -0
- package/lib/rrule/index.d.ts +2 -0
- package/lib/rrule/index.js +18 -0
- package/lib/rrule/parsing.d.ts +6 -0
- package/lib/rrule/parsing.js +130 -0
- package/lib/rrule/parsing.test.d.ts +1 -0
- package/lib/rrule/parsing.test.js +11 -0
- package/lib/rrule.d.ts +49 -0
- package/lib/rrule.js +303 -0
- package/lib/src/FeatureFlag.d.ts +12 -0
- package/lib/src/FeatureFlag.js +51 -0
- package/lib/src/date-time.d.ts +28 -0
- package/lib/src/date-time.js +79 -0
- package/lib/src/forms.d.ts +1 -0
- package/lib/src/forms.js +728 -0
- package/lib/src/locality.d.ts +5 -0
- package/lib/src/locality.js +15 -0
- package/lib/src/money.d.ts +7 -0
- package/lib/src/money.js +32 -0
- package/lib/src/opportunity.d.ts +1 -0
- package/lib/src/opportunity.js +11 -0
- package/lib/src/opportunityUser.d.ts +8 -0
- package/lib/src/opportunityUser.js +29 -0
- package/lib/src/password.d.ts +8 -0
- package/lib/src/password.js +43 -0
- package/package.json +15 -29
- package/src/FeatureFlag.ts +26 -10
- package/src/constants/allowedHtmlTags.ts +6 -0
- package/src/constants/avatarColours.ts +34 -0
- package/src/constants/countries.ts +252 -0
- package/src/constants/currencies.ts +33 -0
- package/src/constants/customFields.ts +10 -0
- package/src/constants/distancesUnits.ts +11 -0
- package/src/constants/groups.ts +83 -0
- package/src/constants/insuranceStatuses.ts +5 -0
- package/src/constants/insuranceTypes.ts +34 -0
- package/src/constants/languages.ts +192 -0
- package/src/constants/locales.ts +189 -0
- package/src/constants/notifications.ts +30 -0
- package/src/constants/opportunities.ts +84 -0
- package/src/constants/qualificationTypes.ts +17 -0
- package/src/constants/rules.ts +22 -0
- package/src/constants/subscriptions.ts +8 -0
- package/src/constants/surveys.ts +15 -0
- package/src/constants.ts +40 -0
- package/src/{date-time.js → date-time.ts} +18 -11
- package/src/forms.ts +807 -0
- package/src/{opportunityUser.js → opportunityUser.ts} +5 -1
- package/src/{password.js → password.ts} +2 -0
- package/src/rrule/date.ts +25 -0
- package/src/rrule/index.ts +2 -0
- package/src/rrule/parsing.ts +136 -0
- package/src/rrule.ts +367 -0
- package/tests/{date-time.test.js → date-time.test.ts} +48 -46
- package/tests/featureFlag.test.ts +36 -39
- package/tests/forms.test-data.json +43 -0
- package/tests/forms.test-schema.json +144 -0
- package/tests/forms.test-uischema.json +117 -0
- package/tests/forms.test.ts +674 -0
- package/tests/{money.test.js → money.test.ts} +2 -3
- package/tests/{password.test.js → password.test.ts} +7 -6
- package/tests/rrule/parsing.test.ts +12 -0
- package/tests/rrule.test.ts +625 -0
- package/tsconfig.json +15 -12
- package/bundle.js +0 -270
- package/index.js +0 -25
- package/rollup.config.js +0 -25
- /package/src/{locality.js → locality.ts} +0 -0
- /package/src/{money.js → money.ts} +0 -0
- /package/src/{opportunity.js → opportunity.ts} +0 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const distancesUnits_1 = __importDefault(require("./distancesUnits"));
|
|
7
|
+
const insuranceTypes_1 = __importDefault(require("./insuranceTypes"));
|
|
8
|
+
exports.default = {
|
|
9
|
+
europeanCountryCodes: [
|
|
10
|
+
'AL',
|
|
11
|
+
'AD',
|
|
12
|
+
'AM',
|
|
13
|
+
'AT',
|
|
14
|
+
'BY',
|
|
15
|
+
'BE',
|
|
16
|
+
'BA',
|
|
17
|
+
'BG',
|
|
18
|
+
'CH',
|
|
19
|
+
'CY',
|
|
20
|
+
'CZ',
|
|
21
|
+
'DE',
|
|
22
|
+
'DK',
|
|
23
|
+
'EE',
|
|
24
|
+
'ES',
|
|
25
|
+
'FO',
|
|
26
|
+
'FI',
|
|
27
|
+
'FR',
|
|
28
|
+
'GE',
|
|
29
|
+
'VA',
|
|
30
|
+
'GI',
|
|
31
|
+
'GR',
|
|
32
|
+
'HU',
|
|
33
|
+
'HR',
|
|
34
|
+
'IE',
|
|
35
|
+
'IS',
|
|
36
|
+
'IT',
|
|
37
|
+
'LT',
|
|
38
|
+
'LU',
|
|
39
|
+
'LV',
|
|
40
|
+
'MC',
|
|
41
|
+
'MK',
|
|
42
|
+
'MT',
|
|
43
|
+
'NO',
|
|
44
|
+
'NL',
|
|
45
|
+
'PO',
|
|
46
|
+
'PT',
|
|
47
|
+
'RO',
|
|
48
|
+
'RU',
|
|
49
|
+
'SE',
|
|
50
|
+
'SI',
|
|
51
|
+
'SK',
|
|
52
|
+
'SM',
|
|
53
|
+
'TR',
|
|
54
|
+
'UA',
|
|
55
|
+
],
|
|
56
|
+
regionOptions: {
|
|
57
|
+
au: {
|
|
58
|
+
name: 'Australia',
|
|
59
|
+
domain: 'https://app.becollective.com',
|
|
60
|
+
hostname: 'app.becollective.com',
|
|
61
|
+
trademark: 'Be Collective International Limited',
|
|
62
|
+
twitter: 'https://twitter.com/BeCollective_',
|
|
63
|
+
facebook: 'https://www.facebook.com/becollectiveintl/',
|
|
64
|
+
instagram: 'https://www.instagram.com/becollective_',
|
|
65
|
+
linkedin: 'https://www.linkedin.com/company/becollectiveintl',
|
|
66
|
+
privacyPolicyUrl: 'https://www.becollective.com/documents/Be-Collective-Global-Privacy-Policy-September-2021.pdf',
|
|
67
|
+
termsAndConditionsUrl: 'https://www.becollective.com/documents/Be-Collective-Global-General-Terms-February-2023.pdf',
|
|
68
|
+
privacyPolicyVersion: 2,
|
|
69
|
+
termsAndConditionsVersion: 6,
|
|
70
|
+
address: 'Level 16, 300 Flinders Street, Melbourne, VIC 3000',
|
|
71
|
+
},
|
|
72
|
+
nz: {
|
|
73
|
+
name: 'New Zealand',
|
|
74
|
+
domain: 'https://nz.becollective.com',
|
|
75
|
+
hostname: 'nz.becollective.com',
|
|
76
|
+
trademark: 'Be Collective New Zealand Limited',
|
|
77
|
+
twitter: 'https://twitter.com/BeCollective_',
|
|
78
|
+
facebook: 'https://www.facebook.com/becollectivenz/',
|
|
79
|
+
instagram: 'https://www.instagram.com/becollective_',
|
|
80
|
+
linkedin: 'https://www.linkedin.com/company/becollectiveintl',
|
|
81
|
+
privacyPolicyUrl: 'https://www.becollective.com/documents/Be-Collective-Global-Privacy-Policy-September-2021.pdf',
|
|
82
|
+
termsAndConditionsUrl: 'https://www.becollective.com/documents/Be-Collective-Global-General-Terms-February-2023.pdf',
|
|
83
|
+
privacyPolicyVersion: 2,
|
|
84
|
+
termsAndConditionsVersion: 6,
|
|
85
|
+
address: 'Level 3 Zephyr House, 82 Willis Street, Wellington',
|
|
86
|
+
},
|
|
87
|
+
// eu: {
|
|
88
|
+
// name: 'Europe',
|
|
89
|
+
// domain: 'https://eu.becollective.com',
|
|
90
|
+
// hostname: 'eu.becollective.com',
|
|
91
|
+
// trademark: 'Be Collective Europe Limited',
|
|
92
|
+
// twitter: 'https://twitter.com/BeCollective_',
|
|
93
|
+
// facebook: 'https://www.facebook.com/Be-Collective-Europe-2168455776525016/',
|
|
94
|
+
// instagram: 'https://www.instagram.com/becollective_',
|
|
95
|
+
// linkedin: 'https://www.linkedin.com/company/becollectiveintl',
|
|
96
|
+
// privacyPolicyUrl: 'https://www.becollective.com/documents/Be-Collective-Europe-Privacy-Notice-December-2020.pdf',
|
|
97
|
+
// termsAndConditionsUrl: 'https://www.becollective.com/documents/Be-Collective-Europe-General-Terms-May-2023.pdf',
|
|
98
|
+
// privacyPolicyVersion: 2,
|
|
99
|
+
// termsAndConditionsVersion: 4,
|
|
100
|
+
// address: 'Tintagel House, 92 Albert Embankment, Lambeth, London, SE1 7TY',
|
|
101
|
+
// },
|
|
102
|
+
uk: {
|
|
103
|
+
name: 'United Kingdom',
|
|
104
|
+
domain: 'https://uk.becollective.com',
|
|
105
|
+
hostname: 'uk.becollective.com',
|
|
106
|
+
trademark: 'Be Collective Europe Limited',
|
|
107
|
+
twitter: 'https://twitter.com/BeCollective_',
|
|
108
|
+
facebook: 'https://www.facebook.com/Be-Collective-Europe-2168455776525016/',
|
|
109
|
+
instagram: 'https://www.instagram.com/becollective_',
|
|
110
|
+
linkedin: 'https://www.linkedin.com/company/becollectiveintl',
|
|
111
|
+
privacyPolicyUrl: 'https://www.becollective.com/documents/Be-Collective-Europe-Privacy-Notice-December-2020.pdf',
|
|
112
|
+
termsAndConditionsUrl: 'https://www.becollective.com/documents/Be-Collective-Europe-General-Terms-May-2023.pdf',
|
|
113
|
+
privacyPolicyVersion: 2,
|
|
114
|
+
termsAndConditionsVersion: 4,
|
|
115
|
+
address: 'Tintagel House, 92 Albert Embankment, Lambeth, London, SE1 7TY',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
// Financial years from https://www.cia.gov/library/publications/the-world-factbook/fields/228.html
|
|
119
|
+
countryOptions: {
|
|
120
|
+
AU: {
|
|
121
|
+
financialYearEndDate: {
|
|
122
|
+
month: 5,
|
|
123
|
+
date: 30,
|
|
124
|
+
},
|
|
125
|
+
distanceUnit: distancesUnits_1.default.km,
|
|
126
|
+
regions: [
|
|
127
|
+
{
|
|
128
|
+
long: 'Australian Capital Territory',
|
|
129
|
+
short: 'ACT',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
long: 'New South Wales',
|
|
133
|
+
short: 'NSW',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
long: 'Northern Territory',
|
|
137
|
+
short: 'NT',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
long: 'Queensland',
|
|
141
|
+
short: 'QLD',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
long: 'South Australia',
|
|
145
|
+
short: 'SA',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
long: 'Tasmania',
|
|
149
|
+
short: 'TAS',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
long: 'Victoria',
|
|
153
|
+
short: 'VIC',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
long: 'Western Australia',
|
|
157
|
+
short: 'WA',
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
insuranceTypes: [insuranceTypes_1.default.publicLiabilityAU, insuranceTypes_1.default.volunteerAccidentAU],
|
|
161
|
+
},
|
|
162
|
+
NZ: {
|
|
163
|
+
financialYearEndDate: {
|
|
164
|
+
month: 2,
|
|
165
|
+
date: 31,
|
|
166
|
+
},
|
|
167
|
+
distanceUnit: distancesUnits_1.default.km,
|
|
168
|
+
insuranceTypes: [insuranceTypes_1.default.publicLiabilityNZ, insuranceTypes_1.default.volunteerAccidentNZ],
|
|
169
|
+
},
|
|
170
|
+
GB: {
|
|
171
|
+
financialYearEndDate: {
|
|
172
|
+
month: 3,
|
|
173
|
+
date: 5,
|
|
174
|
+
},
|
|
175
|
+
distanceUnit: distancesUnits_1.default.mi,
|
|
176
|
+
insuranceTypes: [insuranceTypes_1.default.publicLiabilityGB, insuranceTypes_1.default.volunteerAccidentGB],
|
|
177
|
+
},
|
|
178
|
+
// Reminder: this is Republic of Ireland. Northern Ireland is within GB.
|
|
179
|
+
IE: {
|
|
180
|
+
financialYearEndDate: {
|
|
181
|
+
month: 11,
|
|
182
|
+
date: 31,
|
|
183
|
+
},
|
|
184
|
+
distanceUnit: distancesUnits_1.default.km,
|
|
185
|
+
insuranceTypes: [insuranceTypes_1.default.publicLiabilityOthers, insuranceTypes_1.default.volunteerAccidentOthers],
|
|
186
|
+
},
|
|
187
|
+
Others: {
|
|
188
|
+
insuranceTypes: [insuranceTypes_1.default.publicLiabilityOthers, insuranceTypes_1.default.volunteerAccidentOthers],
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
types: (string | {
|
|
3
|
+
messengerUpdates: string;
|
|
4
|
+
volunteerUpdates: string;
|
|
5
|
+
groupMemberUpdates: string;
|
|
6
|
+
groupInvitations: string;
|
|
7
|
+
opportunityInvitations: string;
|
|
8
|
+
opportunitiesSharedWithMe: string;
|
|
9
|
+
licenseCertificateExpiryNotice: string;
|
|
10
|
+
certificates: string;
|
|
11
|
+
} | {
|
|
12
|
+
membershipApplications: string;
|
|
13
|
+
volunteerApplications: string;
|
|
14
|
+
opportunityUpdates: string;
|
|
15
|
+
timesheets: string;
|
|
16
|
+
partnerships: string;
|
|
17
|
+
endorsements: string;
|
|
18
|
+
socialCurrency: string;
|
|
19
|
+
groupUpdates: string;
|
|
20
|
+
licenseCertificateExpiryNotice: string;
|
|
21
|
+
})[];
|
|
22
|
+
typesMap: {
|
|
23
|
+
volunteer: {
|
|
24
|
+
messengerUpdates: string;
|
|
25
|
+
volunteerUpdates: string;
|
|
26
|
+
groupMemberUpdates: string;
|
|
27
|
+
groupInvitations: string;
|
|
28
|
+
opportunityInvitations: string;
|
|
29
|
+
opportunitiesSharedWithMe: string;
|
|
30
|
+
licenseCertificateExpiryNotice: string;
|
|
31
|
+
certificates: string;
|
|
32
|
+
};
|
|
33
|
+
manager: {
|
|
34
|
+
membershipApplications: string;
|
|
35
|
+
volunteerApplications: string;
|
|
36
|
+
opportunityUpdates: string;
|
|
37
|
+
timesheets: string;
|
|
38
|
+
partnerships: string;
|
|
39
|
+
endorsements: string;
|
|
40
|
+
socialCurrency: string;
|
|
41
|
+
groupUpdates: string;
|
|
42
|
+
licenseCertificateExpiryNotice: string;
|
|
43
|
+
};
|
|
44
|
+
acquired: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const notificationTypes = {
|
|
4
|
+
volunteer: {
|
|
5
|
+
messengerUpdates: 'messengerUpdates',
|
|
6
|
+
volunteerUpdates: 'volunteerUpdates',
|
|
7
|
+
groupMemberUpdates: 'groupMemberUpdates',
|
|
8
|
+
groupInvitations: 'groupInvitations',
|
|
9
|
+
opportunityInvitations: 'opportunityInvitations',
|
|
10
|
+
opportunitiesSharedWithMe: 'opportunitiesSharedWithMe',
|
|
11
|
+
licenseCertificateExpiryNotice: 'licenseCertificateExpiryNotice',
|
|
12
|
+
certificates: 'certificates',
|
|
13
|
+
},
|
|
14
|
+
manager: {
|
|
15
|
+
membershipApplications: 'membershipApplications',
|
|
16
|
+
volunteerApplications: 'volunteerApplications',
|
|
17
|
+
opportunityUpdates: 'opportunityUpdates',
|
|
18
|
+
timesheets: 'timesheets',
|
|
19
|
+
partnerships: 'partnerships',
|
|
20
|
+
endorsements: 'endorsements',
|
|
21
|
+
socialCurrency: 'socialCurrency',
|
|
22
|
+
groupUpdates: 'groupUpdates',
|
|
23
|
+
licenseCertificateExpiryNotice: 'licenseCertificateExpiryNotice',
|
|
24
|
+
},
|
|
25
|
+
acquired: 'acquired',
|
|
26
|
+
};
|
|
27
|
+
exports.default = {
|
|
28
|
+
// Filter out acquired, as backend model does not use it.
|
|
29
|
+
types: Object.values(notificationTypes).filter((x) => x !== notificationTypes.acquired),
|
|
30
|
+
typesMap: notificationTypes,
|
|
31
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
types: string[];
|
|
3
|
+
typesMap: {
|
|
4
|
+
roleFixed: string;
|
|
5
|
+
roleFlexible: string;
|
|
6
|
+
ongoing: string;
|
|
7
|
+
};
|
|
8
|
+
typesV2: string[];
|
|
9
|
+
typesMapV2: {
|
|
10
|
+
shift: string;
|
|
11
|
+
flexible: string;
|
|
12
|
+
};
|
|
13
|
+
statuses: string[];
|
|
14
|
+
volunteer: {
|
|
15
|
+
shiftStatus: {
|
|
16
|
+
approved: string;
|
|
17
|
+
cancelled: string;
|
|
18
|
+
left: string;
|
|
19
|
+
};
|
|
20
|
+
ruleStatus: {
|
|
21
|
+
approved: string;
|
|
22
|
+
cancelled: string;
|
|
23
|
+
};
|
|
24
|
+
volunteerStatus: {
|
|
25
|
+
approved: string;
|
|
26
|
+
pending: string;
|
|
27
|
+
invited: string;
|
|
28
|
+
declined: string;
|
|
29
|
+
left: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
checklist: {
|
|
33
|
+
key: string;
|
|
34
|
+
value: string;
|
|
35
|
+
}[];
|
|
36
|
+
defaultOptions: {
|
|
37
|
+
details: {
|
|
38
|
+
currentJobTitle: string;
|
|
39
|
+
dateOfBirth: string;
|
|
40
|
+
emergencyContactDetails: string;
|
|
41
|
+
gender: string;
|
|
42
|
+
homeAddress: string;
|
|
43
|
+
phoneNumber: string;
|
|
44
|
+
};
|
|
45
|
+
requirements: {
|
|
46
|
+
driversLicense: string;
|
|
47
|
+
firstAidCertificate: string;
|
|
48
|
+
orientation: string;
|
|
49
|
+
policeCheck: string;
|
|
50
|
+
training: string;
|
|
51
|
+
workingWithChildrenCheck: string;
|
|
52
|
+
};
|
|
53
|
+
suitability: {
|
|
54
|
+
families: string;
|
|
55
|
+
deafHardOfHearing: string;
|
|
56
|
+
intellectuallyDisabled: string;
|
|
57
|
+
largeGroups: string;
|
|
58
|
+
skilledVolunteers: string;
|
|
59
|
+
travellingShortTermVolunteers: string;
|
|
60
|
+
blindLowVision: string;
|
|
61
|
+
volunteersWithLimitedEnglish: string;
|
|
62
|
+
wheelchairUsers: string;
|
|
63
|
+
workingExperience: string;
|
|
64
|
+
employeeVolunteers: string;
|
|
65
|
+
socialPrescribing: string;
|
|
66
|
+
publicTransportUsers: string;
|
|
67
|
+
LGBTQIAPlusCommunity: string;
|
|
68
|
+
LongTermVolunteers: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export default _default;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typesMap = {
|
|
4
|
+
roleFixed: 'role-fixed',
|
|
5
|
+
roleFlexible: 'role-flexible',
|
|
6
|
+
ongoing: 'ongoing',
|
|
7
|
+
};
|
|
8
|
+
const typesMapV2 = {
|
|
9
|
+
shift: 'shift',
|
|
10
|
+
flexible: 'flexible',
|
|
11
|
+
};
|
|
12
|
+
const ruleStatus = {
|
|
13
|
+
approved: 'approved',
|
|
14
|
+
cancelled: 'cancelled',
|
|
15
|
+
};
|
|
16
|
+
const shiftStatus = {
|
|
17
|
+
approved: 'approved',
|
|
18
|
+
cancelled: 'cancelled',
|
|
19
|
+
left: 'left',
|
|
20
|
+
};
|
|
21
|
+
const volunteerStatus = {
|
|
22
|
+
approved: 'approved',
|
|
23
|
+
pending: 'pending',
|
|
24
|
+
invited: 'invited',
|
|
25
|
+
declined: 'declined',
|
|
26
|
+
left: 'left',
|
|
27
|
+
};
|
|
28
|
+
exports.default = {
|
|
29
|
+
types: Object.values(typesMap),
|
|
30
|
+
typesMap,
|
|
31
|
+
typesV2: Object.values(typesMapV2),
|
|
32
|
+
typesMapV2,
|
|
33
|
+
statuses: ['draft', 'pending', 'published', 'cancelled'],
|
|
34
|
+
volunteer: {
|
|
35
|
+
shiftStatus: shiftStatus,
|
|
36
|
+
ruleStatus: ruleStatus,
|
|
37
|
+
volunteerStatus: volunteerStatus,
|
|
38
|
+
},
|
|
39
|
+
checklist: [
|
|
40
|
+
{ key: 'interview', value: 'Interview' },
|
|
41
|
+
{ key: 'police-check', value: 'Police Check' },
|
|
42
|
+
{ key: 'reference-check', value: 'Reference Check' },
|
|
43
|
+
{ key: 'screening', value: 'Screening' },
|
|
44
|
+
{ key: 'training', value: 'Training' },
|
|
45
|
+
{ key: 'trial', value: 'Check' },
|
|
46
|
+
],
|
|
47
|
+
defaultOptions: {
|
|
48
|
+
details: {
|
|
49
|
+
currentJobTitle: 'Current Job Title',
|
|
50
|
+
dateOfBirth: 'Date of Birth',
|
|
51
|
+
emergencyContactDetails: 'Emergency Contact Details',
|
|
52
|
+
gender: 'Gender',
|
|
53
|
+
homeAddress: 'Home Address',
|
|
54
|
+
phoneNumber: 'Phone Number',
|
|
55
|
+
},
|
|
56
|
+
requirements: {
|
|
57
|
+
driversLicense: 'Drivers License',
|
|
58
|
+
firstAidCertificate: 'First Aid Certificate',
|
|
59
|
+
orientation: 'Orientation',
|
|
60
|
+
policeCheck: 'Police Check',
|
|
61
|
+
training: 'Training',
|
|
62
|
+
workingWithChildrenCheck: 'Working with Children Check',
|
|
63
|
+
},
|
|
64
|
+
suitability: {
|
|
65
|
+
families: 'Families',
|
|
66
|
+
deafHardOfHearing: 'Deaf/hard of hearing',
|
|
67
|
+
intellectuallyDisabled: 'Intellectual/learning disabilities',
|
|
68
|
+
largeGroups: 'Large groups (10+)',
|
|
69
|
+
skilledVolunteers: 'Skilled volunteers',
|
|
70
|
+
travellingShortTermVolunteers: 'Travelling/short term volunteers',
|
|
71
|
+
blindLowVision: 'Blind/low vision',
|
|
72
|
+
volunteersWithLimitedEnglish: 'Volunteers with limited English',
|
|
73
|
+
wheelchairUsers: 'Wheelchair users',
|
|
74
|
+
workingExperience: 'Work experience',
|
|
75
|
+
employeeVolunteers: 'Employee volunteers',
|
|
76
|
+
socialPrescribing: 'Social prescribing',
|
|
77
|
+
publicTransportUsers: 'Public transport users',
|
|
78
|
+
LGBTQIAPlusCommunity: 'LGBTQIA+ community',
|
|
79
|
+
LongTermVolunteers: 'Long term volunteers',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.educationalQualifications = exports.licencesAndCertifications = void 0;
|
|
4
|
+
exports.licencesAndCertifications = [
|
|
5
|
+
'Drivers Licence',
|
|
6
|
+
'First Aid Certification',
|
|
7
|
+
'Working with Children Check',
|
|
8
|
+
'Other', // Other option should always be anchored to the bottom.
|
|
9
|
+
];
|
|
10
|
+
exports.educationalQualifications = [
|
|
11
|
+
'Secondary / High School',
|
|
12
|
+
'Certificate or equivalent',
|
|
13
|
+
'Diploma or equivalent',
|
|
14
|
+
'Advanced Diploma or equivalent',
|
|
15
|
+
"Bachelor's Degree / Undergraduate",
|
|
16
|
+
"Master's Degree / Postgraduate and above",
|
|
17
|
+
];
|
|
18
|
+
exports.default = [...exports.licencesAndCertifications, ...exports.educationalQualifications];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const rrule_1 = require("rrule");
|
|
4
|
+
const daysOfTheWeek = [
|
|
5
|
+
{ label: 'Monday', value: rrule_1.RRule.MO, selected: false },
|
|
6
|
+
{ label: 'Tuesday', value: rrule_1.RRule.TU, selected: false },
|
|
7
|
+
{ label: 'Wednesday', value: rrule_1.RRule.WE, selected: false },
|
|
8
|
+
{ label: 'Thursday', value: rrule_1.RRule.TH, selected: false },
|
|
9
|
+
{ label: 'Friday', value: rrule_1.RRule.FR, selected: false },
|
|
10
|
+
{ label: 'Saturday', value: rrule_1.RRule.SA, selected: false },
|
|
11
|
+
{ label: 'Sunday', value: rrule_1.RRule.SU, selected: false },
|
|
12
|
+
];
|
|
13
|
+
const frequencyOptions = [
|
|
14
|
+
{ value: 0, label: 'in total', description: '' },
|
|
15
|
+
{ value: rrule_1.RRule.WEEKLY, label: 'per week', description: 'each week' },
|
|
16
|
+
{ value: rrule_1.RRule.MONTHLY, label: 'per month', description: 'each month' },
|
|
17
|
+
];
|
|
18
|
+
exports.default = {
|
|
19
|
+
daysOfTheWeek,
|
|
20
|
+
frequencyOptions,
|
|
21
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
participantStatuses: {
|
|
3
|
+
notSent: string;
|
|
4
|
+
sent: string;
|
|
5
|
+
reSent: string;
|
|
6
|
+
responded: string;
|
|
7
|
+
};
|
|
8
|
+
subscriptionDowngradeReasons: {
|
|
9
|
+
featureLack: string;
|
|
10
|
+
expense: string;
|
|
11
|
+
difficulty: string;
|
|
12
|
+
technicalIssues: string;
|
|
13
|
+
other: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
participantStatuses: {
|
|
5
|
+
notSent: 'not-sent',
|
|
6
|
+
sent: 'sent',
|
|
7
|
+
reSent: 're-sent',
|
|
8
|
+
responded: 'responded',
|
|
9
|
+
},
|
|
10
|
+
subscriptionDowngradeReasons: {
|
|
11
|
+
featureLack: 'Features not useful / missing features we need',
|
|
12
|
+
expense: 'Too expensive',
|
|
13
|
+
difficulty: 'Difficult to use',
|
|
14
|
+
technicalIssues: 'Technical issues',
|
|
15
|
+
other: 'Other',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/constants.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const allowedHtmlTags_1 = __importDefault(require("./constants/allowedHtmlTags"));
|
|
40
|
+
const avatarColours_1 = __importDefault(require("./constants/avatarColours"));
|
|
41
|
+
const countries_1 = __importDefault(require("./constants/countries"));
|
|
42
|
+
const customFields_1 = __importDefault(require("./constants/customFields"));
|
|
43
|
+
const languages_1 = __importDefault(require("./constants/languages"));
|
|
44
|
+
const currencies_1 = __importDefault(require("./constants/currencies"));
|
|
45
|
+
const distancesUnits_1 = __importDefault(require("./constants/distancesUnits"));
|
|
46
|
+
const groups_1 = __importDefault(require("./constants/groups"));
|
|
47
|
+
const insuranceStatuses_1 = __importDefault(require("./constants/insuranceStatuses"));
|
|
48
|
+
const insuranceTypes_1 = __importDefault(require("./constants/insuranceTypes"));
|
|
49
|
+
const locales_1 = __importDefault(require("./constants/locales"));
|
|
50
|
+
const notifications_1 = __importDefault(require("./constants/notifications"));
|
|
51
|
+
const opportunities_1 = __importDefault(require("./constants/opportunities"));
|
|
52
|
+
const rules_1 = __importDefault(require("./constants/rules"));
|
|
53
|
+
const subscriptions_1 = __importDefault(require("./constants/subscriptions"));
|
|
54
|
+
const surveys_1 = __importDefault(require("./constants/surveys"));
|
|
55
|
+
const qualificationTypes_1 = __importStar(require("./constants/qualificationTypes"));
|
|
56
|
+
module.exports = {
|
|
57
|
+
allowedHtmlTags: allowedHtmlTags_1.default,
|
|
58
|
+
avatarColours: avatarColours_1.default,
|
|
59
|
+
currencies: currencies_1.default,
|
|
60
|
+
customFields: customFields_1.default,
|
|
61
|
+
countries: countries_1.default,
|
|
62
|
+
languages: languages_1.default,
|
|
63
|
+
distanceUnits: distancesUnits_1.default,
|
|
64
|
+
groups: groups_1.default,
|
|
65
|
+
insuranceStatuses: insuranceStatuses_1.default,
|
|
66
|
+
insuranceTypes: insuranceTypes_1.default,
|
|
67
|
+
locales: locales_1.default,
|
|
68
|
+
notifications: notifications_1.default,
|
|
69
|
+
opportunities: opportunities_1.default,
|
|
70
|
+
qualificationTypes: qualificationTypes_1.default,
|
|
71
|
+
licencesAndCertifications: qualificationTypes_1.licencesAndCertifications,
|
|
72
|
+
educationalQualifications: qualificationTypes_1.educationalQualifications,
|
|
73
|
+
surveys: surveys_1.default,
|
|
74
|
+
subscriptions: subscriptions_1.default,
|
|
75
|
+
rules: rules_1.default,
|
|
76
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get current age based on the given birth date
|
|
3
|
+
* @param {string} dateOfBirth
|
|
4
|
+
* @param {string} unit the measurement of the the difference
|
|
5
|
+
* The supported measurements are:
|
|
6
|
+
* years, months, weeks, days, hours, minutes, and seconds.
|
|
7
|
+
* @returns {number} age
|
|
8
|
+
*/
|
|
9
|
+
export declare const getAge: (dateOfBirth: any, unit?: string) => number;
|
|
10
|
+
/**
|
|
11
|
+
* Check if a user requires parent(guardian) consent
|
|
12
|
+
* i.e. Is under the age of 16 years, based on GDPR
|
|
13
|
+
* https://gdpr-info.eu/art-8-gdpr/
|
|
14
|
+
* @param {string} dateOfBirth moment.js compatible date time
|
|
15
|
+
* @returns {boolean}
|
|
16
|
+
* NOTE:
|
|
17
|
+
* We used to not allow child (under 16) to register,
|
|
18
|
+
* and birthdate is not a required field for ghost user
|
|
19
|
+
* So an existing user could have no birthdate, we assume these users are adults
|
|
20
|
+
* TODO:
|
|
21
|
+
* Remove above logic after we migrated all legacy
|
|
22
|
+
* data to have a consistent birthdate property.
|
|
23
|
+
* Then we should throw error if birthdate is not valid
|
|
24
|
+
*/
|
|
25
|
+
export declare const isUnderSixteen: (dateOfBirth: any) => boolean;
|
|
26
|
+
export declare const isUnderAge: (dateOfBirth: any, limit: any, maxAcknowledgedAge?: number | null) => boolean;
|
|
27
|
+
export declare const datesByThemselves: (a: any, b: any) => number;
|
|
28
|
+
export declare const getShiftText: (from: any, to: any, timezone: any) => string;
|