@nanas-home/hub-common 0.11.295 → 0.12.299

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.
@@ -76,6 +76,11 @@ var hasRequiredPermissions = (props) => {
76
76
  // src/helpers/commonHelper.ts
77
77
  var getUsersName = (details) => `${details?.firstName} ${details?.lastName}`;
78
78
 
79
+ // src/helpers/promiseHelper.ts
80
+ var promiseFromValue = (value) => {
81
+ return new Promise((resolve) => resolve(value));
82
+ };
83
+
79
84
  // src/helpers/mimeHelper.ts
80
85
  var mimeTypeLookup = {
81
86
  txt: "text/plain",
@@ -161,19 +166,19 @@ var getWeekNumber = (d) => {
161
166
 
162
167
  // src/assets/meta.json
163
168
  var meta_default = {
164
- packageVersion: "0.11.0",
165
- date: "2025-08-31",
166
- gitCommitHash: "2e4e0ec3cc603d9540250a7fd4721fcaec6ba608"
169
+ packageVersion: "0.12.0",
170
+ date: "2025-09-09",
171
+ gitCommitHash: "832a08fcdc07dd2aab395af01b66b2b355c4baa1"
167
172
  };
168
173
 
169
174
  // src/assets/packagesUsed.json
170
175
  var packagesUsed_default = {
171
- generatedDate: "2025-08-31T19:05:39.039Z",
172
- generatedDateFormat: "2025-08-31",
176
+ generatedDate: "2025-09-09T15:28:23.978Z",
177
+ generatedDateFormat: "2025-09-09",
173
178
  list: [
174
179
  {
175
180
  name: "@chromatic-com/storybook",
176
- version: "4.1.0",
181
+ version: "4.1.1",
177
182
  licenseType: "MIT",
178
183
  repoUrl: "https://github.com/chromaui/addon-visual-tests.git",
179
184
  licenceUrl: "https://github.com/chromaui/addon-visual-tests/blob/master/LICENSE"
@@ -187,37 +192,37 @@ var packagesUsed_default = {
187
192
  },
188
193
  {
189
194
  name: "@storybook/addon-a11y",
190
- version: "9.1.2",
195
+ version: "9.1.5",
191
196
  licenseType: "MIT",
192
197
  repoUrl: "https://github.com/storybookjs/storybook.git"
193
198
  },
194
199
  {
195
200
  name: "@storybook/addon-docs",
196
- version: "9.1.2",
201
+ version: "9.1.5",
197
202
  licenseType: "MIT",
198
203
  repoUrl: "https://github.com/storybookjs/storybook.git"
199
204
  },
200
205
  {
201
206
  name: "@storybook/addon-links",
202
- version: "9.1.2",
207
+ version: "9.1.5",
203
208
  licenseType: "MIT",
204
209
  repoUrl: "https://github.com/storybookjs/storybook.git"
205
210
  },
206
211
  {
207
212
  name: "@storybook/addon-onboarding",
208
- version: "9.1.2",
213
+ version: "9.1.5",
209
214
  licenseType: "MIT",
210
215
  repoUrl: "https://github.com/storybookjs/storybook.git"
211
216
  },
212
217
  {
213
218
  name: "@storybook/addon-vitest",
214
- version: "9.1.2",
219
+ version: "9.1.5",
215
220
  licenseType: "MIT",
216
221
  repoUrl: "https://github.com/storybookjs/storybook.git"
217
222
  },
218
223
  {
219
224
  name: "@types/node",
220
- version: "24.2.1",
225
+ version: "24.3.1",
221
226
  licenseType: "MIT",
222
227
  repoUrl: "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
223
228
  licenceUrl: "https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/LICENSE"
@@ -251,14 +256,14 @@ var packagesUsed_default = {
251
256
  },
252
257
  {
253
258
  name: "sass",
254
- version: "1.90.0",
259
+ version: "1.92.1",
255
260
  licenseType: "MIT",
256
261
  repoUrl: "https://github.com/sass/dart-sass",
257
262
  licenceUrl: "https://github.com/sass/dart-sass/blob/master/LICENSE"
258
263
  },
259
264
  {
260
265
  name: "storybook",
261
- version: "9.1.2",
266
+ version: "9.1.5",
262
267
  licenseType: "MIT",
263
268
  repoUrl: "https://github.com/storybookjs/storybook.git"
264
269
  },
@@ -284,7 +289,7 @@ var packagesUsed_default = {
284
289
  },
285
290
  {
286
291
  name: "vite",
287
- version: "7.1.2",
292
+ version: "7.1.5",
288
293
  licenseType: "MIT",
289
294
  repoUrl: "https://github.com/vitejs/vite.git"
290
295
  },
@@ -393,7 +398,8 @@ var CommonConfigService = class {
393
398
 
394
399
  // src/services/internal/log/logService.ts
395
400
  var LogService = class {
396
- constructor(config, _numDaysToKeep = 100) {
401
+ constructor(config, _onLogMessage, _numDaysToKeep = 100) {
402
+ this._onLogMessage = _onLogMessage;
397
403
  this._numDaysToKeep = _numDaysToKeep;
398
404
  this._logLevels = config.getConsoleLogLevels();
399
405
  this._latestLogDate = addDays(/* @__PURE__ */ new Date(), -this._numDaysToKeep);
@@ -429,6 +435,7 @@ ${(log.optionalParams ?? []).join("\n\r")}`;
429
435
  const dateString = formatForDateLocalDetailed(/* @__PURE__ */ new Date());
430
436
  const logFunc = console[log.type];
431
437
  logFunc(`${dateString}: ${messageString}`, logStyle);
438
+ this._onLogMessage?.(log);
432
439
  };
433
440
  _track = (type, groups) => (message, ...optionalParams) => {
434
441
  const log = {
@@ -443,6 +450,9 @@ ${(log.optionalParams ?? []).join("\n\r")}`;
443
450
  if (this._logLevels.includes(log.type) === false) return;
444
451
  else this._logMessageToConsole(log);
445
452
  };
453
+ clearLogs = () => {
454
+ this.logs = [];
455
+ };
446
456
  getLogger = (...groups) => ({
447
457
  d: this._track("debug", groups),
448
458
  i: this._track("info", groups),
@@ -455,7 +465,7 @@ var dependencyInjectionSetup = (props) => {
455
465
  if (props.botPath != null) setContainerToken(BOT_PATH, props.botPath);
456
466
  if (props.siteConfig != null) setContainerToken(SITE_CONFIG, props.siteConfig);
457
467
  const configService = new CommonConfigService();
458
- const logService = new LogService(configService);
468
+ const logService = new LogService(configService, props.onLogMessage, props.numDaysToKeepLogs);
459
469
  setContainerToken(CommonConfigService, configService);
460
470
  setContainerToken(LogService, logService);
461
471
  return {
@@ -752,6 +762,11 @@ var apiRoute = {
752
762
  prefix: "/upload",
753
763
  image: "/image",
754
764
  swagger: { name: "Uploads", description: "Endpoints for managing Uploads" }
765
+ },
766
+ userMembership: {
767
+ prefix: "/user-membership",
768
+ bookingDays: "/booking-days",
769
+ swagger: { name: "UserMembership", description: "Endpoints for User to get info about their Memberships" }
755
770
  }
756
771
  }
757
772
  };
@@ -1085,12 +1100,12 @@ var AddressRestriction = {
1085
1100
 
1086
1101
  // src/contracts/generated/searchColumns.ts
1087
1102
  var searchColumns = {
1088
- pet: [{ "property": "type", "type": 1 }, { "property": "sex", "type": 2 }, { "property": "breed", "type": 2 }, { "property": "neutered", "type": 2 }, { "property": "name", "type": 2 }, { "property": "notes", "type": 2 }, { "property": "dateOfBirth", "type": 5 }],
1089
1103
  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 }],
1104
+ booking: [{ "property": "startDate", "type": 5 }, { "property": "endDate", "type": 5 }, { "property": "status", "type": 2 }, { "property": "notes", "type": 2 }],
1105
+ pet: [{ "property": "type", "type": 1 }, { "property": "sex", "type": 2 }, { "property": "breed", "type": 2 }, { "property": "neutered", "type": 2 }, { "property": "name", "type": 2 }, { "property": "notes", "type": 2 }, { "property": "dateOfBirth", "type": 5 }],
1090
1106
  address: [{ "property": "name", "type": 2 }, { "property": "street", "type": 2 }, { "property": "city", "type": 2 }, { "property": "postalCode", "type": 2 }, { "property": "country", "type": 2 }],
1091
1107
  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 }],
1092
- question: [{ "property": "forTypes", "type": 1 }, { "property": "transKey", "type": 2 }, { "property": "fallback", "type": 2 }, { "property": "type", "type": 0 }, { "property": "sortOrder", "type": 3 }, { "property": "visible", "type": 4 }, { "property": "notes", "type": 2 }],
1093
- booking: [{ "property": "startDate", "type": 5 }, { "property": "endDate", "type": 5 }, { "property": "status", "type": 2 }, { "property": "notes", "type": 2 }]
1108
+ question: [{ "property": "forTypes", "type": 1 }, { "property": "transKey", "type": 2 }, { "property": "fallback", "type": 2 }, { "property": "type", "type": 0 }, { "property": "sortOrder", "type": 3 }, { "property": "visible", "type": 4 }, { "property": "notes", "type": 2 }]
1094
1109
  };
1095
1110
 
1096
1111
  // src/contracts/generated/enum/petSexType.ts
@@ -1270,4 +1285,4 @@ var AddressLinkType = /* @__PURE__ */ ((AddressLinkType2) => {
1270
1285
  return AddressLinkType2;
1271
1286
  })(AddressLinkType || {});
1272
1287
 
1273
- export { APP_TYPE, ActivityRestriction, ActivityType, AddressLinkType, AddressRestriction, AnswerLinkType, AnswerRestriction, AppType, BOT_PATH, BookingAddonRestriction, BookingAddonType, BookingRestriction, BookingStatusType, CommentLinkType, CommentRestriction, CommonConfigService, DrivingRouteRestriction, LocalStorageKeys, LogService, MembershipStatus, MembershipType, NetworkState, OrderDirectionType, PermissionRestriction, PermissionType, PetRestriction, PetSexType, PetStatusType, PetType, QuestionForType, QuestionRestriction, QuestionType, SITE_CONFIG, SearchableColumnType, UnavailabilityRestriction, UploadLinkType, UploadRestriction, UploadType, UserAccountFlagType, UserRestriction, UserType, addDays, addMinutes, addMonths, addSeconds, addSpacesForEnum, addToParallelTasks, anyObject, apiParams, apiRoute, arrayContains, arrayOfNLength, capitalizeFirstLetter, cyrb53, dateDiffInDays, debounceLeading, dependencyInjectionSetup, fakePromise, formatDate, formatFileSize, formatForBookingDate, formatForDateDropdown, formatForDateLocal, formatForDateLocalDetailed, formatForDateOfBirth, formatForDateWithTime, getAgeInYears, getAppType, getArrFromEnum, getBotPath, getCommonConfig, getImageParams, getLog, getMeta, getMimeTypeFromExtension, getPackagesUsed, getPayloadFromJwt, getPerformanceTimer, getPetAvatarUrl, getSiteConfig, getUserAvatarUrl, getUsersName, getWeekNumber, hasRequiredPermissions, isBefore, isNumber, isSameDay, isWebApp, lowercaseFirstLetter, makeArrayOrDefault, maxDate, maxItems, maxLength, mimeTypeLookup, minDate, minItems, minLength, minUrlLength, multiValidation, nameof, noValidation, notNull, onTargetChecked, onTargetFiles, onTargetValue, onlyUnique, portalGlyphLength, preventDefault, randomIntFromRange, randomItemFromArray, searchColumns, selectedItemsExist, selectedOptionIsInEnum, separateValidation, setContainerToken, setSiteConfig, shouldBeUrl, shouldBeYoutubeUrl, stopPropagation, timeout, uploadsThatNeedEncryption, urlRef, uuidv4, validUuidChars, validateForEach, webAppTypes };
1288
+ export { APP_TYPE, ActivityRestriction, ActivityType, AddressLinkType, AddressRestriction, AnswerLinkType, AnswerRestriction, AppType, BOT_PATH, BookingAddonRestriction, BookingAddonType, BookingRestriction, BookingStatusType, CommentLinkType, CommentRestriction, CommonConfigService, DrivingRouteRestriction, LocalStorageKeys, LogService, MembershipStatus, MembershipType, NetworkState, OrderDirectionType, PermissionRestriction, PermissionType, PetRestriction, PetSexType, PetStatusType, PetType, QuestionForType, QuestionRestriction, QuestionType, SITE_CONFIG, SearchableColumnType, UnavailabilityRestriction, UploadLinkType, UploadRestriction, UploadType, UserAccountFlagType, UserRestriction, UserType, addDays, addMinutes, addMonths, addSeconds, addSpacesForEnum, addToParallelTasks, anyObject, apiParams, apiRoute, arrayContains, arrayOfNLength, capitalizeFirstLetter, cyrb53, dateDiffInDays, debounceLeading, dependencyInjectionSetup, fakePromise, formatDate, formatFileSize, formatForBookingDate, formatForDateDropdown, formatForDateLocal, formatForDateLocalDetailed, formatForDateOfBirth, formatForDateWithTime, getAgeInYears, getAppType, getArrFromEnum, getBotPath, getCommonConfig, getImageParams, getLog, getMeta, getMimeTypeFromExtension, getPackagesUsed, getPayloadFromJwt, getPerformanceTimer, getPetAvatarUrl, getSiteConfig, getUserAvatarUrl, getUsersName, getWeekNumber, hasRequiredPermissions, isBefore, isNumber, isSameDay, isWebApp, lowercaseFirstLetter, makeArrayOrDefault, maxDate, maxItems, maxLength, mimeTypeLookup, minDate, minItems, minLength, minUrlLength, multiValidation, nameof, noValidation, notNull, onTargetChecked, onTargetFiles, onTargetValue, onlyUnique, portalGlyphLength, preventDefault, promiseFromValue, randomIntFromRange, randomItemFromArray, searchColumns, selectedItemsExist, selectedOptionIsInEnum, separateValidation, setContainerToken, setSiteConfig, shouldBeUrl, shouldBeYoutubeUrl, stopPropagation, timeout, uploadsThatNeedEncryption, urlRef, uuidv4, validUuidChars, validateForEach, webAppTypes };