@nanas-home/hub-common 0.50.1085 → 0.51.1149

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.
@@ -1,7 +1,5 @@
1
1
  import dayjs from 'dayjs';
2
2
  import { jwtDecode } from 'jwt-decode';
3
- import { FormatIcu } from '@tolgee/format-icu';
4
- import { Tolgee, DevTools, BackendFetch } from '@tolgee/web';
5
3
 
6
4
  // src/constants/appType.ts
7
5
  var AppType = /* @__PURE__ */ ((AppType2) => {
@@ -100,6 +98,13 @@ var validUuidChars = [
100
98
  // src/contracts/dependencyInjection.ts
101
99
  var createToken = (description) => ({ id: Symbol(description) });
102
100
 
101
+ // src/contracts/generated/activity.ts
102
+ var activityShortCode = {
103
+ startIdentifier: "{[|",
104
+ separator: "+",
105
+ endIdentifier: "|]}"
106
+ };
107
+
103
108
  // src/contracts/generated/apiRoute.ts
104
109
  var apiRouteParam = {
105
110
  userUuid: ":userUuid",
@@ -109,7 +114,6 @@ var apiRouteParam = {
109
114
  bookingAddonUuid: ":bookingAddonUuid",
110
115
  userMembershipUuid: ":userMembershipUuid",
111
116
  bugReportUuid: ":bugReportUuid",
112
- linkTypeUuid: ":linkTypeUuid",
113
117
  linkUuid: ":linkUuid",
114
118
  linkType: ":linkType",
115
119
  // Stripe
@@ -125,19 +129,15 @@ var apiRoute = {
125
129
  login: "/login",
126
130
  signup: "/signup",
127
131
  signupQuestions: "/signup-questions",
128
- confirmEmail: `/confirm-email/${apiRouteParam.linkTypeUuid}`,
132
+ confirmEmail: `/confirm-email/${apiRouteParam.linkUuid}`,
133
+ requestPasswordResetLink: `/password-reset`,
134
+ passwordResetFromTempLink: `/password-reset/${apiRouteParam.linkUuid}`,
129
135
  swagger: { name: "Auth", description: "Endpoints for login, sign up etc" },
130
136
  token: {
131
137
  prefix: "/token",
132
138
  swagger: { name: "AuthToken", description: "Endpoints for creating an API token" }
133
139
  }
134
140
  },
135
- bugReport: {
136
- prefix: "/bug-report",
137
- getAllForUser: "/user",
138
- submit: "/user",
139
- swagger: { name: "BugReports", description: "Endpoints for Users to submit BugReports" }
140
- },
141
141
  version: "/version"
142
142
  },
143
143
  admin: {
@@ -261,6 +261,12 @@ var apiRoute = {
261
261
  removeToBooking: `/${apiRouteParam.bookingAddonUuid}`,
262
262
  swagger: { name: "BookingAddons", description: "Endpoints for User to manage their Booking Addons" }
263
263
  },
264
+ bugReport: {
265
+ prefix: "/bug-report",
266
+ getAllForUser: "/user",
267
+ submit: "/user",
268
+ swagger: { name: "BugReports", description: "Endpoints for Users to submit BugReports" }
269
+ },
264
270
  membership: {
265
271
  prefix: "/membership",
266
272
  getAll: "",
@@ -706,8 +712,15 @@ var AnswerRestriction = {
706
712
  notes: { minLength: 0, maxLength: 1e3 }
707
713
  };
708
714
 
715
+ // src/contracts/generated/restrictions/authRestriction.ts
716
+ var AuthRegisterRestriction = {
717
+ pets: { minItems: 1, maxItems: 5 },
718
+ answers: { minItems: 3, maxItems: 50 }
719
+ };
720
+
709
721
  // src/contracts/generated/restrictions/bookingRestriction.ts
710
722
  var BookingRestriction = {
723
+ code: { min: 0, max: 99999 },
711
724
  notes: { maxLength: 250 }
712
725
  };
713
726
  var BookingAddonRestriction = {
@@ -821,7 +834,7 @@ var searchColumns = {
821
834
  userMembership: [{ "property": "status", "type": 0, "subType": "MembershipStatus" }, { "property": "billingCycle", "type": 0, "subType": "MembershipBillingCycleType" }, { "property": "stripeSubscriptionId", "type": 2 }, { "property": "startDate", "type": 5 }, { "property": "endDate", "type": 5 }],
822
835
  user: [{ "property": "types", "type": 1 }, { "property": "firstName", "type": 2 }, { "property": "lastName", "type": 2 }, { "property": "email", "type": 2 }, { "property": "hubspotId", "type": 2 }, { "property": "flags", "type": 1 }, { "property": "dateCreated", "type": 5 }],
823
836
  upload: [{ "property": "linkUuid", "type": 2 }, { "property": "linkType", "type": 2 }, { "property": "type", "type": 2 }, { "property": "fileName", "type": 2 }, { "property": "blobType", "type": 2 }, { "property": "sizeInKb", "type": 2 }, { "property": "dateCreated", "type": 5 }],
824
- booking: [{ "property": "startDate", "type": 5 }, { "property": "endDate", "type": 5 }, { "property": "status", "type": 2 }, { "property": "notes", "type": 2 }, { "property": "dateCreated", "type": 5 }],
837
+ booking: [{ "property": "code", "type": 2 }, { "property": "status", "type": 1 }, { "property": "startDate", "type": 5 }, { "property": "endDate", "type": 5 }, { "property": "notes", "type": 2 }, { "property": "dateCreated", "type": 5 }],
825
838
  bugReport: [{ "property": "status", "type": 0 }, { "property": "comment", "type": 2 }, { "property": "metadata", "type": 2 }, { "property": "logs", "type": 2 }],
826
839
  question: [{ "property": "forTypes", "type": 1 }, { "property": "transKey", "type": 2 }, { "property": "fallback", "type": 2 }, { "property": "category", "type": 2 }, { "property": "type", "type": 0 }, { "property": "sortOrder", "type": 3 }, { "property": "visible", "type": 4 }, { "property": "notes", "type": 2 }]
827
840
  };
@@ -1574,40 +1587,6 @@ var defaultSiteColour = {
1574
1587
  primary: "#97A571",
1575
1588
  secondary: "#97A571"
1576
1589
  };
1577
- var TranslationService = class {
1578
- constructor(log, _config) {
1579
- this._config = _config;
1580
- this._logger = log.getLogger("TranslationService");
1581
- }
1582
- _logger;
1583
- _tolgee;
1584
- initialize = async () => {
1585
- if (this._tolgee != null) return;
1586
- this._tolgee = Tolgee().use(DevTools()).use(FormatIcu()).use(
1587
- BackendFetch({
1588
- prefix: "/assets/i18n",
1589
- fallbackOnFail: true
1590
- })
1591
- ).init({
1592
- defaultLanguage: "en",
1593
- observerType: "text",
1594
- observerOptions: { inputPrefix: "{{", inputSuffix: "}}" },
1595
- // Dev mode only 👇
1596
- apiKey: this._config.getTolgeeApiKey(),
1597
- apiUrl: this._config.getTolgeeApiUrl(),
1598
- projectId: this._config.getTolgeeProjectId()
1599
- });
1600
- await this._tolgee.run();
1601
- this._logger.d("Tolgee initialised!");
1602
- };
1603
- instance = () => this._tolgee;
1604
- getLanguage = () => this._tolgee?.getLanguage?.();
1605
- changeLanguage = (locale) => this._tolgee?.changeLanguage?.(locale);
1606
- t = (key, defaultValue, options) => (
1607
- // this._tolgee.t(key, defaultValue, options);
1608
- this._tolgee?.t?.(key, defaultValue, options) ?? defaultValue ?? key
1609
- );
1610
- };
1611
1590
 
1612
1591
  // src/validation/arrayValidation.ts
1613
1592
  var minItems = (minLength2) => (values) => {
@@ -1874,4 +1853,4 @@ var shouldBeYoutubeUrl = (value) => {
1874
1853
  };
1875
1854
  };
1876
1855
 
1877
- export { APP_TYPE_TOKEN, ActivityRestriction, ActivityType, AddressLinkType, AddressRestriction, AnswerLinkType, AnswerRestriction, AppType, 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, TranslationService, UnavailabilityRestriction, UploadLinkType, UploadRestriction, UploadType, UserAccountFlagType, UserRestriction, UserType, 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 };
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 };