@nanas-home/hub-common 0.51.1152 → 0.52.1185
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/dist/chunk/{J5QFZZVU.js → CNSK7ZOR.js} +92 -1
- package/dist/index.css +1 -1
- package/dist/node-utils/index.d.ts +104 -22
- package/dist/node-utils/index.js +322 -982
- package/dist/{textValidation-BC4ZdmvE.d.ts → textValidation-CchEXsUj.d.ts} +38 -1
- package/dist/web/index.d.ts +41 -4
- package/dist/web/index.js +1555 -1259
- package/dist/web/index.jsx +1841 -1531
- package/package.json +2 -2
|
@@ -51,6 +51,10 @@ var nanasFonts = {
|
|
|
51
51
|
default: "https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,100..900;1,100..900&display=swap"
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
// src/constants/language.ts
|
|
55
|
+
var supportedLanguageMap = { en: null, nl: null };
|
|
56
|
+
var SupportedLanguageArray = Object.keys(supportedLanguageMap);
|
|
57
|
+
|
|
54
58
|
// src/constants/links.ts
|
|
55
59
|
var socialLinks = {
|
|
56
60
|
instagram: "https://www.instagram.com/nanas.home.petconcierge/",
|
|
@@ -73,6 +77,19 @@ var MouseButton = {
|
|
|
73
77
|
right: 2
|
|
74
78
|
};
|
|
75
79
|
|
|
80
|
+
// src/constants/theme.ts
|
|
81
|
+
var NANAS_PALLETTE = {
|
|
82
|
+
"nanas-backyard": "#97A571",
|
|
83
|
+
"cream-paw": "#F7F2ED",
|
|
84
|
+
"shadow-collar": "#393834",
|
|
85
|
+
"pine-collar": "#263A38",
|
|
86
|
+
"warm-biscuit": "#C88F65",
|
|
87
|
+
"whisker-white": "#ffffff",
|
|
88
|
+
"couch-breather": "#DCE5E3",
|
|
89
|
+
"snout-clay": "#9D8478",
|
|
90
|
+
"paw-ink": "#000000"
|
|
91
|
+
};
|
|
92
|
+
|
|
76
93
|
// src/constants/validation.ts
|
|
77
94
|
var minUrlLength = 5;
|
|
78
95
|
var portalGlyphLength = 12;
|
|
@@ -132,6 +149,7 @@ var apiRoute = {
|
|
|
132
149
|
confirmEmail: `/confirm-email/${apiRouteParam.linkUuid}`,
|
|
133
150
|
requestPasswordResetLink: `/password-reset`,
|
|
134
151
|
passwordResetFromTempLink: `/password-reset/${apiRouteParam.linkUuid}`,
|
|
152
|
+
changePassword: `/change-password`,
|
|
135
153
|
swagger: { name: "Auth", description: "Endpoints for login, sign up etc" },
|
|
136
154
|
token: {
|
|
137
155
|
prefix: "/token",
|
|
@@ -169,6 +187,7 @@ var apiRoute = {
|
|
|
169
187
|
withRelationships: `/with-relationships/${apiRouteParam.bookingUuid}`,
|
|
170
188
|
assignHost: `/assign-host/${apiRouteParam.bookingUuid}/${apiRouteParam.userUuid}`,
|
|
171
189
|
removeHost: `/remove-host/${apiRouteParam.bookingUuid}`,
|
|
190
|
+
calendarOverview: "/calendar-overview",
|
|
172
191
|
swagger: { name: "Bookings", description: "Endpoints for managing bookings" }
|
|
173
192
|
},
|
|
174
193
|
bugReport: {
|
|
@@ -1128,6 +1147,75 @@ var addToParallelTasks = async (tasks, newTask, numTasksInParallel = 5) => {
|
|
|
1128
1147
|
return tasks;
|
|
1129
1148
|
};
|
|
1130
1149
|
|
|
1150
|
+
// src/helpers/bookingCalendarHelper.ts
|
|
1151
|
+
var getBookingStatusLabelForAdmin = (status) => {
|
|
1152
|
+
switch (status) {
|
|
1153
|
+
case 0 /* Cancelled */:
|
|
1154
|
+
return "Cancelled";
|
|
1155
|
+
case 3 /* FindPlacement */:
|
|
1156
|
+
return "Find Placement";
|
|
1157
|
+
case 1 /* IntakeCall */:
|
|
1158
|
+
return "Intake call";
|
|
1159
|
+
case 4 /* Matched */:
|
|
1160
|
+
return "Matched";
|
|
1161
|
+
case 5 /* MeetAndGreet */:
|
|
1162
|
+
return "Meet & Greet";
|
|
1163
|
+
case 8 /* Paid */:
|
|
1164
|
+
return "Paid";
|
|
1165
|
+
case 7 /* PaymentRequested */:
|
|
1166
|
+
return "Payment Requested";
|
|
1167
|
+
case 2 /* RequestMatchFee */:
|
|
1168
|
+
return "Request Match Fee";
|
|
1169
|
+
case 6 /* RequestPayment */:
|
|
1170
|
+
return "Request Payment";
|
|
1171
|
+
default:
|
|
1172
|
+
return BookingStatusType[status] ?? "Unknown";
|
|
1173
|
+
}
|
|
1174
|
+
};
|
|
1175
|
+
var getMembershipTypeLabel = (type) => {
|
|
1176
|
+
switch (type) {
|
|
1177
|
+
case 1 /* Club */:
|
|
1178
|
+
return "Club";
|
|
1179
|
+
case 2 /* ClubPlus */:
|
|
1180
|
+
return "Club+";
|
|
1181
|
+
case 0 /* None */:
|
|
1182
|
+
default:
|
|
1183
|
+
return "None";
|
|
1184
|
+
}
|
|
1185
|
+
};
|
|
1186
|
+
var formatBookingCalendarLabel = (item) => {
|
|
1187
|
+
const status = getBookingStatusLabelForAdmin(item.status);
|
|
1188
|
+
const pets = item.petNames.join(", ") || "No pets";
|
|
1189
|
+
const membership = getMembershipTypeLabel(item.ownerMembershipType);
|
|
1190
|
+
const hostPart = item.hostNames.length > 0 ? ` with ${item.hostNames.join(", ")}` : "";
|
|
1191
|
+
return `${status}: ${pets}, ${membership} (${item.ownerName})${hostPart}`;
|
|
1192
|
+
};
|
|
1193
|
+
var BOOKING_OVERVIEW_STATUSES = [
|
|
1194
|
+
1 /* IntakeCall */,
|
|
1195
|
+
2 /* RequestMatchFee */,
|
|
1196
|
+
3 /* FindPlacement */,
|
|
1197
|
+
4 /* Matched */,
|
|
1198
|
+
5 /* MeetAndGreet */,
|
|
1199
|
+
6 /* RequestPayment */,
|
|
1200
|
+
7 /* PaymentRequested */,
|
|
1201
|
+
8 /* Paid */,
|
|
1202
|
+
0 /* Cancelled */
|
|
1203
|
+
];
|
|
1204
|
+
var computeBookingStatusCounts = (bookings) => {
|
|
1205
|
+
const counts = {};
|
|
1206
|
+
for (const status of BOOKING_OVERVIEW_STATUSES) {
|
|
1207
|
+
counts[status] = 0;
|
|
1208
|
+
}
|
|
1209
|
+
for (const booking of bookings) {
|
|
1210
|
+
counts[booking.status] = (counts[booking.status] ?? 0) + 1;
|
|
1211
|
+
}
|
|
1212
|
+
return counts;
|
|
1213
|
+
};
|
|
1214
|
+
var filterBookingsByOverviewStatus = (bookings, status) => {
|
|
1215
|
+
if (status == null) return bookings;
|
|
1216
|
+
return bookings.filter((booking) => booking.status === status);
|
|
1217
|
+
};
|
|
1218
|
+
|
|
1131
1219
|
// src/components/form/calendar/calendarPicker.functions.ts
|
|
1132
1220
|
var convertToFullDateSelection = (newDate) => {
|
|
1133
1221
|
return {
|
|
@@ -1551,6 +1639,9 @@ var urlRef = (url) => {
|
|
|
1551
1639
|
return url + `?ref=${ref}`;
|
|
1552
1640
|
};
|
|
1553
1641
|
|
|
1642
|
+
// src/helpers/userAccountFlagHelper.ts
|
|
1643
|
+
var userMustChangePassword = (flags) => flags?.includes(1 /* ChangePassword */) === true;
|
|
1644
|
+
|
|
1554
1645
|
// src/helpers/userMembershipHelper.ts
|
|
1555
1646
|
var getActiveUserMembership = (userMemberships) => {
|
|
1556
1647
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -1853,4 +1944,4 @@ var shouldBeYoutubeUrl = (value) => {
|
|
|
1853
1944
|
};
|
|
1854
1945
|
};
|
|
1855
1946
|
|
|
1856
|
-
export { APP_TYPE_TOKEN, ActivityRestriction, ActivityType, AddressLinkType, AddressRestriction, AnswerLinkType, AnswerRestriction, AppType, AuthRegisterRestriction, BOT_PATH_TOKEN, BookingAddonRestriction, BookingAddonType, BookingRestriction, BookingStatusType, BugReportRestriction, BugReportStatusType, CommentLinkType, CommentRestriction, CommonConfigService, DependencyInjectionContainer, DrivingRouteRestriction, InvoiceRestriction, InvoiceStatusType, LogService, MembershipBillingCycleType, MembershipRestriction, MembershipStatus, MembershipType, MouseButton, NetworkState, OrderDirectionType, PermissionRestriction, PermissionType, PetRestriction, PetSexType, PetStatusType, PetType, QuestionForType, QuestionRestriction, QuestionType, SITE_CONFIG_TOKEN, SearchableColumnType, StripeRestriction, TempLinkType, UnavailabilityRestriction, UploadLinkType, UploadRestriction, UploadType, UserAccountFlagType, UserRestriction, UserType, activityShortCode, addDays, addMinutes, addMonths, addSeconds, addSpacesForEnum, addToParallelTasks, anyObject, apiRoute, apiRouteParam, arrayContains, arrayOfNLength, capitalizeFirstLetter, changeMonth, colourPalette, commonEmailLinks, convertToDate, convertToFullDateSelection, createToken, cyrb53, dateDiffInDays, debounceLeading, defaultSiteColour, emailValid, fakePromise, formatDate, formatFileSize, formatForBookingDate, formatForDateDropdown, formatForDateLocal, formatForDateLocalDetailed, formatForDateOfBirth, formatForDateWithTime, getActiveUserMembership, getAgeInYears, getAllPetQuestionForType, getAppType, getArrFromEnum, getBotPath, getCalendarDropdownDisplayValue, getCalendarDropdownForDateOfBirthDisplayValue, getCommonConfig, getDayClassObject, getDayElements, getDayHeadingElements, getImageParams, getLog, getMimeTypeFromExtension, getPayloadFromJwt, getPerformanceTimer, getPetAvatarUrl, getQuestionGroups, getSiteColour, getSiteConfig, getUserAvatarUrl, getUsersName, getWeekNumber, hasRequiredPermissions, hubspotQuestionsExport, isBefore, isDateAfterStart, isDateBeforeEnd, isDateDisabledByDisabledDays, isDateEnabledByEnabledDays, isNumber, isSameDay, isWebApp, lowercaseFirstLetter, makeArrayOrDefault, maxDate, maxItems, maxLength, maxValue, mimeTypeLookup, minDate, minItems, minLength, minUrlLength, minValue, monthTranslationKeyOrder, multiValidation, nameof, nanasFonts, noValidation, notNull, onlyUnique, passwordValid, portalGlyphLength, promiseFromValue, randomIntFromRange, randomItemFromArray, rootContainer, rootDependencyInjectionSetup, searchColumns, selectedItemsExist, selectedOptionIsInEnum, separateValidation, setContainerToken, setContainerTokenLazy, setSiteConfig, shouldBeUrl, shouldBeYoutubeUrl, showSecondCalendar, socialLinks, timeout, tryParseNumber, uploadsThatNeedEncryption, urlRef, uuidv4, validUuidChars, validateForEach, webAppTypes, weekdayTranslationKeyOrder };
|
|
1947
|
+
export { APP_TYPE_TOKEN, ActivityRestriction, ActivityType, AddressLinkType, AddressRestriction, AnswerLinkType, AnswerRestriction, AppType, AuthRegisterRestriction, BOOKING_OVERVIEW_STATUSES, BOT_PATH_TOKEN, BookingAddonRestriction, BookingAddonType, BookingRestriction, BookingStatusType, BugReportRestriction, BugReportStatusType, CommentLinkType, CommentRestriction, CommonConfigService, DependencyInjectionContainer, DrivingRouteRestriction, InvoiceRestriction, InvoiceStatusType, LogService, MembershipBillingCycleType, MembershipRestriction, MembershipStatus, MembershipType, MouseButton, NANAS_PALLETTE, NetworkState, OrderDirectionType, PermissionRestriction, PermissionType, PetRestriction, PetSexType, PetStatusType, PetType, QuestionForType, QuestionRestriction, QuestionType, SITE_CONFIG_TOKEN, SearchableColumnType, StripeRestriction, SupportedLanguageArray, TempLinkType, UnavailabilityRestriction, UploadLinkType, UploadRestriction, UploadType, UserAccountFlagType, UserRestriction, UserType, activityShortCode, addDays, addMinutes, addMonths, addSeconds, addSpacesForEnum, addToParallelTasks, anyObject, apiRoute, apiRouteParam, arrayContains, arrayOfNLength, capitalizeFirstLetter, changeMonth, colourPalette, commonEmailLinks, computeBookingStatusCounts, convertToDate, convertToFullDateSelection, createToken, cyrb53, dateDiffInDays, debounceLeading, defaultSiteColour, emailValid, fakePromise, filterBookingsByOverviewStatus, formatBookingCalendarLabel, formatDate, formatFileSize, formatForBookingDate, formatForDateDropdown, formatForDateLocal, formatForDateLocalDetailed, formatForDateOfBirth, formatForDateWithTime, getActiveUserMembership, getAgeInYears, getAllPetQuestionForType, getAppType, getArrFromEnum, getBookingStatusLabelForAdmin, getBotPath, getCalendarDropdownDisplayValue, getCalendarDropdownForDateOfBirthDisplayValue, getCommonConfig, getDayClassObject, getDayElements, getDayHeadingElements, getImageParams, getLog, getMembershipTypeLabel, getMimeTypeFromExtension, getPayloadFromJwt, getPerformanceTimer, getPetAvatarUrl, getQuestionGroups, getSiteColour, getSiteConfig, getUserAvatarUrl, getUsersName, getWeekNumber, hasRequiredPermissions, hubspotQuestionsExport, isBefore, isDateAfterStart, isDateBeforeEnd, isDateDisabledByDisabledDays, isDateEnabledByEnabledDays, isNumber, isSameDay, isWebApp, lowercaseFirstLetter, makeArrayOrDefault, maxDate, maxItems, maxLength, maxValue, mimeTypeLookup, minDate, minItems, minLength, minUrlLength, minValue, monthTranslationKeyOrder, multiValidation, nameof, nanasFonts, noValidation, notNull, onlyUnique, passwordValid, portalGlyphLength, promiseFromValue, randomIntFromRange, randomItemFromArray, rootContainer, rootDependencyInjectionSetup, searchColumns, selectedItemsExist, selectedOptionIsInEnum, separateValidation, setContainerToken, setContainerTokenLazy, setSiteConfig, shouldBeUrl, shouldBeYoutubeUrl, showSecondCalendar, socialLinks, timeout, tryParseNumber, uploadsThatNeedEncryption, urlRef, userMustChangePassword, uuidv4, validUuidChars, validateForEach, webAppTypes, weekdayTranslationKeyOrder };
|