@nanas-home/hub-common 0.3.222 → 0.4.227
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/{DRSQPLTU.js → J6QSO2HN.js} +49 -14
- package/dist/index.css +1 -1
- package/dist/node-utils/index.d.ts +2 -2
- package/dist/node-utils/index.js +2 -2
- package/dist/{validation-C6hGMD9T.d.ts → validation-Dpye2Rqo.d.ts} +35 -1
- package/dist/web/index.d.ts +26 -20
- package/dist/web/index.js +127 -57
- package/dist/web/index.jsx +198 -100
- package/package.json +10 -9
|
@@ -992,6 +992,13 @@ var UserCreateDtoMeta = {
|
|
|
992
992
|
}
|
|
993
993
|
};
|
|
994
994
|
|
|
995
|
+
// src/contracts/meta/profileDto.meta.ts
|
|
996
|
+
var ProfileUpdateDtoMeta = {
|
|
997
|
+
firstName: UserDtoMeta.firstName,
|
|
998
|
+
lastName: UserDtoMeta.lastName,
|
|
999
|
+
email: UserDtoMeta.email
|
|
1000
|
+
};
|
|
1001
|
+
|
|
995
1002
|
// src/contracts/meta/authDto.meta.ts
|
|
996
1003
|
var AuthLoginDtoMeta = {
|
|
997
1004
|
email: {
|
|
@@ -1192,15 +1199,15 @@ var stopPropagation = (event) => {
|
|
|
1192
1199
|
|
|
1193
1200
|
// src/assets/meta.json
|
|
1194
1201
|
var meta_default = {
|
|
1195
|
-
packageVersion: "0.
|
|
1196
|
-
date: "2025-07-
|
|
1197
|
-
gitCommitHash: "
|
|
1202
|
+
packageVersion: "0.4.0",
|
|
1203
|
+
date: "2025-07-10",
|
|
1204
|
+
gitCommitHash: "1a3cbc9b6d4c7c623fa393163064d6db57025215"
|
|
1198
1205
|
};
|
|
1199
1206
|
|
|
1200
1207
|
// src/assets/packagesUsed.json
|
|
1201
1208
|
var packagesUsed_default = {
|
|
1202
|
-
generatedDate: "2025-07-
|
|
1203
|
-
generatedDateFormat: "2025-07-
|
|
1209
|
+
generatedDate: "2025-07-10T16:06:41.279Z",
|
|
1210
|
+
generatedDateFormat: "2025-07-10",
|
|
1204
1211
|
list: [
|
|
1205
1212
|
{
|
|
1206
1213
|
name: "@chromatic-com/storybook",
|
|
@@ -1218,42 +1225,42 @@ var packagesUsed_default = {
|
|
|
1218
1225
|
},
|
|
1219
1226
|
{
|
|
1220
1227
|
name: "@storybook/addon-a11y",
|
|
1221
|
-
version: "9.0.
|
|
1228
|
+
version: "9.0.16",
|
|
1222
1229
|
licenseType: "MIT",
|
|
1223
1230
|
repoUrl: "https://github.com/storybookjs/storybook.git",
|
|
1224
1231
|
licenceUrl: "https://github.com/storybookjs/storybook/blob/master/LICENSE.md"
|
|
1225
1232
|
},
|
|
1226
1233
|
{
|
|
1227
1234
|
name: "@storybook/addon-docs",
|
|
1228
|
-
version: "9.0.
|
|
1235
|
+
version: "9.0.16",
|
|
1229
1236
|
licenseType: "MIT",
|
|
1230
1237
|
repoUrl: "https://github.com/storybookjs/storybook.git",
|
|
1231
1238
|
licenceUrl: "https://github.com/storybookjs/storybook/blob/master/LICENSE.md"
|
|
1232
1239
|
},
|
|
1233
1240
|
{
|
|
1234
1241
|
name: "@storybook/addon-links",
|
|
1235
|
-
version: "9.0.
|
|
1242
|
+
version: "9.0.16",
|
|
1236
1243
|
licenseType: "MIT",
|
|
1237
1244
|
repoUrl: "https://github.com/storybookjs/storybook.git",
|
|
1238
1245
|
licenceUrl: "https://github.com/storybookjs/storybook/blob/master/LICENSE.md"
|
|
1239
1246
|
},
|
|
1240
1247
|
{
|
|
1241
1248
|
name: "@storybook/addon-onboarding",
|
|
1242
|
-
version: "9.0.
|
|
1249
|
+
version: "9.0.16",
|
|
1243
1250
|
licenseType: "MIT",
|
|
1244
1251
|
repoUrl: "https://github.com/storybookjs/storybook.git",
|
|
1245
1252
|
licenceUrl: "https://github.com/storybookjs/storybook/blob/master/LICENSE.md"
|
|
1246
1253
|
},
|
|
1247
1254
|
{
|
|
1248
1255
|
name: "@storybook/addon-vitest",
|
|
1249
|
-
version: "9.0.
|
|
1256
|
+
version: "9.0.16",
|
|
1250
1257
|
licenseType: "MIT",
|
|
1251
1258
|
repoUrl: "https://github.com/storybookjs/storybook.git",
|
|
1252
1259
|
licenceUrl: "https://github.com/storybookjs/storybook/blob/master/LICENSE.md"
|
|
1253
1260
|
},
|
|
1254
1261
|
{
|
|
1255
1262
|
name: "@types/node",
|
|
1256
|
-
version: "24.0.
|
|
1263
|
+
version: "24.0.12",
|
|
1257
1264
|
licenseType: "MIT",
|
|
1258
1265
|
repoUrl: "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
1259
1266
|
licenceUrl: "https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/LICENSE"
|
|
@@ -1293,7 +1300,7 @@ var packagesUsed_default = {
|
|
|
1293
1300
|
},
|
|
1294
1301
|
{
|
|
1295
1302
|
name: "storybook",
|
|
1296
|
-
version: "9.0.
|
|
1303
|
+
version: "9.0.16",
|
|
1297
1304
|
licenseType: "MIT",
|
|
1298
1305
|
repoUrl: "https://github.com/storybookjs/storybook.git",
|
|
1299
1306
|
licenceUrl: "https://github.com/storybookjs/storybook/blob/master/LICENSE.md"
|
|
@@ -1321,7 +1328,7 @@ var packagesUsed_default = {
|
|
|
1321
1328
|
},
|
|
1322
1329
|
{
|
|
1323
1330
|
name: "vite",
|
|
1324
|
-
version: "7.0.
|
|
1331
|
+
version: "7.0.4",
|
|
1325
1332
|
licenseType: "MIT",
|
|
1326
1333
|
repoUrl: "https://github.com/vitejs/vite.git",
|
|
1327
1334
|
licenceUrl: "https://github.com/vitejs/vite/blob/master/LICENSE.md"
|
|
@@ -1499,6 +1506,11 @@ var getPayloadFromJwt = (token) => {
|
|
|
1499
1506
|
|
|
1500
1507
|
// src/helpers/commonHelper.ts
|
|
1501
1508
|
var getUsersName = (details) => `${details?.firstName} ${details?.lastName}`;
|
|
1509
|
+
|
|
1510
|
+
// src/constants/localStorageKeys.ts
|
|
1511
|
+
var LocalStorageKeys = {
|
|
1512
|
+
nanaHubProfile: 10
|
|
1513
|
+
};
|
|
1502
1514
|
var LocalStorageService = class {
|
|
1503
1515
|
_logger;
|
|
1504
1516
|
constructor(log) {
|
|
@@ -1524,6 +1536,9 @@ var LocalStorageService = class {
|
|
|
1524
1536
|
}
|
|
1525
1537
|
};
|
|
1526
1538
|
removeAllTrackedKeys = (allKeys) => {
|
|
1539
|
+
for (const key in Object.keys(LocalStorageKeys)) {
|
|
1540
|
+
localStorage.removeItem(key);
|
|
1541
|
+
}
|
|
1527
1542
|
for (const key in localStorage) {
|
|
1528
1543
|
if (allKeys.includes(key)) {
|
|
1529
1544
|
localStorage.removeItem(key);
|
|
@@ -1691,6 +1706,20 @@ var BaseApiService = class {
|
|
|
1691
1706
|
value: resultValue
|
|
1692
1707
|
};
|
|
1693
1708
|
}
|
|
1709
|
+
async cachedRequest(props) {
|
|
1710
|
+
const now = /* @__PURE__ */ new Date();
|
|
1711
|
+
const cached = getLocalStorage().get(props.localKey);
|
|
1712
|
+
if (cached != null && cached.expire > now) {
|
|
1713
|
+
return { isSuccess: true, value: cached.value };
|
|
1714
|
+
}
|
|
1715
|
+
const response = await props.request();
|
|
1716
|
+
if (response.isSuccess) {
|
|
1717
|
+
const min = props.cachedTimeInMin ?? 10;
|
|
1718
|
+
const add = { value: response.value, expire: new Date(now.getTime() + min * 6e4) };
|
|
1719
|
+
getLocalStorage().set(props.localKey, add);
|
|
1720
|
+
}
|
|
1721
|
+
return response;
|
|
1722
|
+
}
|
|
1694
1723
|
async post(url, data, manipulateHeaders, customMapper) {
|
|
1695
1724
|
let options = anyObject();
|
|
1696
1725
|
if (manipulateHeaders != null) {
|
|
@@ -1888,6 +1917,12 @@ var ProfileApiService = class extends BaseApiService {
|
|
|
1888
1917
|
super(apiUrl, log.getLogger("ProfileApiService"));
|
|
1889
1918
|
}
|
|
1890
1919
|
load = () => this.get(`${this.prefix}${apiRoute.routes.user.profile.prefix}`, addAccessTokenToHeaders);
|
|
1920
|
+
// this.cachedRequest({
|
|
1921
|
+
// localKey: 'nanaHubProfile',
|
|
1922
|
+
// cachedTimeInMin: 10,
|
|
1923
|
+
// request: () => this.get(`${this.prefix}${apiRoute.routes.user.profile.prefix}`, addAccessTokenToHeaders),
|
|
1924
|
+
// });
|
|
1925
|
+
update = (profile) => this.post(`${this.prefix}${apiRoute.routes.user.profile.prefix}`, profile, addAccessTokenToHeaders);
|
|
1891
1926
|
getQuestionsAndAnswers = (payload) => async () => this.post(
|
|
1892
1927
|
`${this.prefix}${apiRoute.routes.user.profile.answers}`,
|
|
1893
1928
|
payload,
|
|
@@ -2013,4 +2048,4 @@ var validUuidChars = [
|
|
|
2013
2048
|
"F"
|
|
2014
2049
|
];
|
|
2015
2050
|
|
|
2016
|
-
export { APP_TYPE, ActivityRestriction, ActivityType, AddressCreateDtoMeta, AddressRestriction, AnswerRestriction, AppType, AuthApiService, AuthLoginDtoMeta, AuthSignupDtoMeta, BOT_PATH, BaseApiService, BaseCrudService, BookingAddonRestriction, BookingAddonType, BookingCreateDtoMeta, BookingRestriction, BookingStatusType, CaptchaService, CommentRestriction, CommonConfigService, CommonStateService, DocumentService, DrivingRouteRestriction, LocalStorageService, LogService, MembershipRestriction, MembershipStatus, NetworkState, OrderDirectionType, PermissionRestriction, PermissionType, PetCreateDtoMeta, PetRestriction, PetSexType, PetStatusType, PetType, ProfileApiService, QuestionCreateDtoMeta, QuestionForType, QuestionRestriction, QuestionType, SiteConfigService, UnavailabilityRestriction, UploadCreateDtoMeta, UploadLinkType, UploadRestriction, UploadType, UserAccountFlagType, UserApiService, UserCreateDtoMeta, UserDtoMeta, UserRestriction, UserType, __decorateClass, addAccessTokenToHeaders, addDays, addMinutes, addSeconds, addSpacesForEnum, addToParallelTasks, anyObject, apiParams, apiRoute, arrayContains, arrayOfNLength, capitalizeFirstLetter, cyrb53, dateDiffInDays, debounceLeading, fakePromise, formDataWithAccessTokenHeaders, formatDate, formatFileSize, formatForBookingDate, formatForDateDropdown, formatForDateLocal, formatForDateLocalDetailed, formatForDateOfBirth, formatForDateWithTime, getAgeInYears, getAppType, getArrFromEnum, getAuthApiService, getBotPath, getCaptchaService, getCommonConfig, getCommonStateService, getDefaultDtoMeta, getDocumentServ, getImageParams, getLocalStorage, getLog, getMeta, getMimeTypeFromExtension, getPackagesUsed, getPaginationQueryParams, getPayloadFromJwt, getPerformanceTimer, getProfileApiService, getSiteConfig, getUserApiService, getUsersName, getWeekNumber, isBefore, isNumber, isSameDay, isWebApp, lowercaseFirstLetter, makeArrayOrDefault, maxDate, maxItems, maxLength, mimeTypeLookup, minDate, minItems, minLength, minUrlLength, multiValidation, nameof, noValidation, notNull, onTargetFiles, onTargetValue, onlyUnique, portalGlyphLength, preventDefault, randomIntFromRange, randomItemFromArray, selectedItemsExist, separateValidation, setContainerToken, shouldBeUrl, shouldBeYoutubeUrl, stopPropagation, timeout, uploadsThatNeedEncryption, uuidv4, validUuidChars, validateForEach, webAppTypes };
|
|
2051
|
+
export { APP_TYPE, ActivityRestriction, ActivityType, AddressCreateDtoMeta, AddressRestriction, AnswerRestriction, AppType, AuthApiService, AuthLoginDtoMeta, AuthSignupDtoMeta, BOT_PATH, BaseApiService, BaseCrudService, BookingAddonRestriction, BookingAddonType, BookingCreateDtoMeta, BookingRestriction, BookingStatusType, CaptchaService, CommentRestriction, CommonConfigService, CommonStateService, DocumentService, DrivingRouteRestriction, LocalStorageKeys, LocalStorageService, LogService, MembershipRestriction, MembershipStatus, NetworkState, OrderDirectionType, PermissionRestriction, PermissionType, PetCreateDtoMeta, PetRestriction, PetSexType, PetStatusType, PetType, ProfileApiService, ProfileUpdateDtoMeta, QuestionCreateDtoMeta, QuestionForType, QuestionRestriction, QuestionType, SiteConfigService, UnavailabilityRestriction, UploadCreateDtoMeta, UploadLinkType, UploadRestriction, UploadType, UserAccountFlagType, UserApiService, UserCreateDtoMeta, UserDtoMeta, UserRestriction, UserType, __decorateClass, addAccessTokenToHeaders, addDays, addMinutes, addSeconds, addSpacesForEnum, addToParallelTasks, anyObject, apiParams, apiRoute, arrayContains, arrayOfNLength, capitalizeFirstLetter, cyrb53, dateDiffInDays, debounceLeading, fakePromise, formDataWithAccessTokenHeaders, formatDate, formatFileSize, formatForBookingDate, formatForDateDropdown, formatForDateLocal, formatForDateLocalDetailed, formatForDateOfBirth, formatForDateWithTime, getAgeInYears, getAppType, getArrFromEnum, getAuthApiService, getBotPath, getCaptchaService, getCommonConfig, getCommonStateService, getDefaultDtoMeta, getDocumentServ, getImageParams, getLocalStorage, getLog, getMeta, getMimeTypeFromExtension, getPackagesUsed, getPaginationQueryParams, getPayloadFromJwt, getPerformanceTimer, getProfileApiService, getSiteConfig, getUserApiService, getUsersName, getWeekNumber, isBefore, isNumber, isSameDay, isWebApp, lowercaseFirstLetter, makeArrayOrDefault, maxDate, maxItems, maxLength, mimeTypeLookup, minDate, minItems, minLength, minUrlLength, multiValidation, nameof, noValidation, notNull, onTargetFiles, onTargetValue, onlyUnique, portalGlyphLength, preventDefault, randomIntFromRange, randomItemFromArray, selectedItemsExist, separateValidation, setContainerToken, shouldBeUrl, shouldBeYoutubeUrl, stopPropagation, timeout, uploadsThatNeedEncryption, uuidv4, validUuidChars, validateForEach, webAppTypes };
|