@replyke/core 7.0.0-beta.46 → 7.0.0-beta.48

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.
Files changed (37) hide show
  1. package/dist/cjs/hooks/user/index.d.ts +1 -0
  2. package/dist/cjs/hooks/user/useUserActions.js +19 -2
  3. package/dist/cjs/hooks/user/useUserActions.js.map +1 -1
  4. package/dist/cjs/hooks/users/index.d.ts +0 -1
  5. package/dist/cjs/hooks/users/index.js +1 -3
  6. package/dist/cjs/hooks/users/index.js.map +1 -1
  7. package/dist/cjs/index.d.ts +2 -2
  8. package/dist/cjs/index.js +2 -3
  9. package/dist/cjs/index.js.map +1 -1
  10. package/dist/cjs/interfaces/models/User.d.ts +1 -1
  11. package/dist/cjs/store/api/userApi.d.ts +9 -1
  12. package/dist/cjs/store/api/userApi.js +61 -10
  13. package/dist/cjs/store/api/userApi.js.map +1 -1
  14. package/dist/cjs/store/slices/entityListsSlice.d.ts +168 -168
  15. package/dist/cjs/store/slices/userSlice.d.ts +696 -0
  16. package/dist/esm/hooks/user/index.d.ts +1 -0
  17. package/dist/esm/hooks/user/useUserActions.js +19 -2
  18. package/dist/esm/hooks/user/useUserActions.js.map +1 -1
  19. package/dist/esm/hooks/users/index.d.ts +0 -1
  20. package/dist/esm/hooks/users/index.js +0 -1
  21. package/dist/esm/hooks/users/index.js.map +1 -1
  22. package/dist/esm/index.d.ts +2 -2
  23. package/dist/esm/index.js +1 -1
  24. package/dist/esm/index.js.map +1 -1
  25. package/dist/esm/interfaces/models/User.d.ts +1 -1
  26. package/dist/esm/store/api/userApi.d.ts +9 -1
  27. package/dist/esm/store/api/userApi.js +61 -10
  28. package/dist/esm/store/api/userApi.js.map +1 -1
  29. package/dist/esm/store/slices/entityListsSlice.d.ts +168 -168
  30. package/dist/esm/store/slices/userSlice.d.ts +696 -0
  31. package/package.json +1 -1
  32. package/dist/cjs/hooks/users/useUpdateUser.d.ts +0 -26
  33. package/dist/cjs/hooks/users/useUpdateUser.js +0 -121
  34. package/dist/cjs/hooks/users/useUpdateUser.js.map +0 -1
  35. package/dist/esm/hooks/users/useUpdateUser.d.ts +0 -26
  36. package/dist/esm/hooks/users/useUpdateUser.js +0 -116
  37. package/dist/esm/hooks/users/useUpdateUser.js.map +0 -1
@@ -1,2 +1,3 @@
1
1
  export { useUserActions } from "./useUserActions";
2
2
  export { default as useUser, type UseUserProps, type UseUserValues, } from "./useUser";
3
+ export { type UpdateUserParams } from "../../store/api/userApi";
@@ -67,7 +67,7 @@ function useUserActions() {
67
67
  }, [dispatch]);
68
68
  // Update user with optimistic updates for instant UI feedback
69
69
  var updateUser = (0, react_1.useCallback)(function (projectId, userId, update, currentUser) { return __awaiter(_this, void 0, void 0, function () {
70
- var originalUser, result, error_1, errorMessage;
70
+ var originalUser, optimisticUpdate, result, error_1, errorMessage;
71
71
  return __generator(this, function (_a) {
72
72
  switch (_a.label) {
73
73
  case 0:
@@ -77,8 +77,25 @@ function useUserActions() {
77
77
  dispatch((0, userSlice_1.setUpdating)(true));
78
78
  dispatch((0, userSlice_1.clearError)());
79
79
  originalUser = currentUser;
80
+ optimisticUpdate = {};
81
+ if (update.name !== undefined)
82
+ optimisticUpdate.name = update.name;
83
+ if (update.username !== undefined)
84
+ optimisticUpdate.username = update.username;
85
+ if (update.bio !== undefined)
86
+ optimisticUpdate.bio = update.bio;
87
+ if (update.birthdate !== undefined)
88
+ optimisticUpdate.birthdate = update.birthdate;
89
+ if (update.metadata !== undefined)
90
+ optimisticUpdate.metadata = update.metadata;
91
+ // Only apply avatar optimistically if it's a string URL (not a file upload)
92
+ if (typeof update.avatar === 'string' || update.avatar === null) {
93
+ optimisticUpdate.avatar = update.avatar;
94
+ }
80
95
  // OPTIMISTIC UPDATE: Apply changes immediately for instant UI feedback
81
- dispatch((0, userSlice_1.updateUserOptimistic)(update));
96
+ if (Object.keys(optimisticUpdate).length > 0) {
97
+ dispatch((0, userSlice_1.updateUserOptimistic)(optimisticUpdate));
98
+ }
82
99
  _a.label = 1;
83
100
  case 1:
84
101
  _a.trys.push([1, 3, 4, 5]);
@@ -1 +1 @@
1
- {"version":3,"file":"useUserActions.js","sourceRoot":"","sources":["../../../../src/hooks/user/useUserActions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,wCAuFC;AA5GD,+BAAoC;AACpC,2CAA0C;AAG1C,0DAOsC;AACtC,mDAGiC;AAEjC;;;GAGG;AACH,SAAgB,cAAc;IAA9B,iBAuFC;IAtFC,IAAM,QAAQ,GAAG,IAAA,yBAAW,GAAe,CAAC;IAE5C,uCAAuC;IAChC,IAAA,kBAAkB,GAAI,IAAA,+BAAqB,GAAE,GAA3B,CAA4B;IAErD,+BAA+B;IAC/B,IAAM,aAAa,GAAG,IAAA,mBAAW,EAAC,UAAC,IAAqB;QACtD,iEAAiE;QACjE,sEAAsE;QACtE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;YAC9E,OAAO;QACT,CAAC;QACD,QAAQ,CAAC,IAAA,mBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;QACxB,QAAQ,CAAC,IAAA,sBAAU,GAAE,CAAC,CAAC;IACzB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,IAAM,eAAe,GAAG,IAAA,mBAAW,EAAC;QAClC,QAAQ,CAAC,IAAA,qBAAS,GAAE,CAAC,CAAC;QACtB,QAAQ,CAAC,IAAA,sBAAU,GAAE,CAAC,CAAC;IACzB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,8DAA8D;IAC9D,IAAM,UAAU,GAAG,IAAA,mBAAW,EAC5B,UAAO,SAAiB,EAAE,MAAc,EAAE,MAAwB,EAAE,WAAiB;;;;;oBACnF,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM,EAAE,CAAC;wBAC1B,M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sernameAvailability } from "./useCheckUsernameAvailability";
5
5
  export { default as useFetchUserSuggestions } from "./useFetchUserSuggestions";
6
6
  export { default as useMentions } from "./useMentions";
7
- export { default as useUpdateUser } from "./useUpdateUser";
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.useUpdateUser = exports.useMentions = exports.useFetchUserSuggestions = exports.useCheckUsernameAvailability = exports.useFetchUserByUsername = exports.useFetchUserByForeignId = exports.useFetchUser = void 0;
6
+ exports.useMentions = exports.useFetchUserSuggestions = exports.useCheckUsernameAvailability = exports.useFetchUserByUsername = exports.useFetchUserByForeignId = exports.useFetchUser = void 0;
7
7
  var useFetchUser_1 = require("./useFetchUser");
8
8
  Object.defineProperty(exports, "useFetchUser", { enumerable: true, get: function () { return __importDefault(useFetchUser_1).default; } });
9
9
  var useFetchUserByForeignId_1 = require("./useFetchUserByForeignId");
@@ -16,6 +16,4 @@ var useFetchUserSuggestions_1 = require("./useFetchUserSuggestions");
16
16
  Object.defineProperty(exports, "useFetchUserSuggestions", { enumerable: true, get: function () { return __importDefault(useFetchUserSuggestions_1).default; } });
17
17
  var useMentions_1 = require("./useMentions");
18
18
  Object.defineProperty(exports, "useMentions", { enumerable: true, get: function () { return __importDefault(useMentions_1).default; } });
19
- var useUpdateUser_1 = require("./useUpdateUser");
20
- Object.defineProperty(exports, "useUpdateUser", { enumerable: true, get: function () { return __importDefault(useUpdateUser_1).default; } });
21
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/users/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,qEAA+E;AAAtE,mJAAA,OAAO,OAA2B;AAC3C,mEAA6E;AAApE,iJAAA,OAAO,OAA0B;AAC1C,+EAAyF;AAAhF,6JAAA,OAAO,OAAgC;AAChD,qEAA+E;AAAtE,mJAAA,OAAO,OAA2B;AAC3C,6CAAuD;AAA9C,2HAAA,OAAO,OAAe;AAC/B,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/users/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,qEAA+E;AAAtE,mJAAA,OAAO,OAA2B;AAC3C,mEAA6E;AAApE,iJAAA,OAAO,OAA0B;AAC1C,+EAAyF;AAAhF,6JAAA,OAAO,OAAgC;AAChD,qEAA+E;AAAtE,mJAAA,OAAO,OAA2B;AAC3C,6CAAuD;AAA9C,2HAAA,OAAO,OAAe"}
@@ -10,7 +10,7 @@ export { ReplykeProvider, EntityProvider, CommentSectionProvider, SpaceProvider,
10
10
  export { useProject, useProjectData } from "./hooks/projects";
11
11
  export { useSignTestingJwt } from "./hooks/crypto";
12
12
  export { useAuth, type UseAuthValues } from "./hooks/auth";
13
- export { useUser, useUserActions, type UseUserProps, type UseUserValues, } from "./hooks/user";
13
+ export { useUser, useUserActions, type UseUserProps, type UseUserValues, type UpdateUserParams, } from "./hooks/user";
14
14
  export { useAppNotifications, useAppNotificationsActions, type UseAppNotificationsProps, type UseAppNotificationsValues, } from "./hooks/app-notifications";
15
15
  export { useCollections, useCollectionsActions, useIsEntityInCollection, useCollectionEntitiesWrapper, type UseCollectionsProps, type UseCollectionsValues, type UseCollectionEntitiesWrapperProps, type UseCollectionEntitiesWrapperValues, } from "./hooks/collections";
16
16
  export { useEntity, useEntityData, useCreateEntity, useDeleteEntity, useFetchEntity, useFetchEntityByForeignId, useFetchEntityByShortId, useFetchManyEntities, useIncrementEntityViews, useFetchManyEntitiesWrapper, useUpdateEntity, type UseFetchManyEntitiesWrapperProps, type UseFetchManyEntitiesWrapperValues, } from "./hooks/entities";
@@ -19,7 +19,7 @@ export { useSpace, useSpaceData, useFetchSpace, useFetchSpaceByShortId, useFetch
19
19
  export { useSpaceList, useSpaceListActions, type UseSpaceListProps, type UseSpaceListValues, } from "./hooks/space-lists";
20
20
  export { useCommentSection, useCommentSectionData, useCreateComment, useFetchManyComments, useFetchComment, useFetchCommentByForeignId, useReplies, useUpdateComment, useDeleteComment, useEntityComments, useFetchManyCommentsWrapper, type UseFetchManyCommentsWrapperProps, type UseFetchManyCommentsWrapperValues, } from "./hooks/comments";
21
21
  export { useFetchEntityReactions, useFetchCommentReactions, useFetchEntityReactionsWrapper, useFetchCommentReactionsWrapper, useAddReaction, useRemoveReaction, useReactionToggle, type UseFetchEntityReactionsWrapperProps, type UseFetchEntityReactionsWrapperValues, type UseFetchCommentReactionsWrapperProps, type UseFetchCommentReactionsWrapperValues, type UseReactionToggleValues, } from "./hooks/reactions";
22
- export { useFetchUser, useFetchUserByForeignId, useFetchUserByUsername, useCheckUsernameAvailability, useFetchUserSuggestions, useMentions, useUpdateUser, } from "./hooks/users";
22
+ export { useFetchUser, useFetchUserByForeignId, useFetchUserByUsername, useCheckUsernameAvailability, useFetchUserSuggestions, useMentions, } from "./hooks/users";
23
23
  export { useFetchFollowStatus, useFetchFollowers, useFetchFollowersByUserId, useFetchFollowersCount, useFetchFollowersCountByUserId, useFetchFollowing, useFetchFollowingByUserId, useFetchFollowingCount, useFetchFollowingCountByUserId, useFollowManager, useFollowUser, useUnfollowByFollowId, useUnfollowUserByUserId, } from "./hooks/relationships/follows";
24
24
  export { useRequestConnection, useAcceptConnection, useDeclineConnection, useRemoveConnection, useFetchConnections, useFetchConnectionStatus, useRemoveConnectionByUserId, useFetchConnectionsCount, useFetchSentPendingConnections, useFetchReceivedPendingConnections, useFetchConnectionsByUserId, useFetchConnectionsCountByUserId, useConnectionManager, } from "./hooks/relationships/connections";
25
25
  export { useCreateReport } from "./hooks/reports";
package/dist/cjs/index.js CHANGED
@@ -37,8 +37,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.useUpdateSpace = exports.useCreateSpace = exports.useCheckSlugAvailability = exports.useFetchManySpaces = exports.useFetchSpaceChildren = exports.useFetchSpaceBreadcrumb = exports.useFetchSpaceBySlug = exports.useFetchSpaceByShortId = exports.useFetchSpace = exports.useSpaceData = exports.useSpace = exports.useEntityListActions = exports.useEntityList = exports.useUpdateEntity = exports.useFetchManyEntitiesWrapper = exports.useIncrementEntityViews = exports.useFetchManyEntities = exports.useFetchEntityByShortId = exports.useFetchEntityByForeignId = exports.useFetchEntity = exports.useDeleteEntity = exports.useCreateEntity = exports.useEntityData = exports.useEntity = exports.useCollectionEntitiesWrapper = exports.useIsEntityInCollection = exports.useCollectionsActions = exports.useCollections = exports.useAppNotificationsActions = exports.useAppNotifications = exports.useUserActions = exports.useUser = exports.useAuth = exports.useSignTestingJwt = exports.useProjectData = exports.useProject = exports.SpaceProvider = exports.CommentSectionProvider = exports.EntityProvider = exports.ReplykeProvider = exports.reportReasons = exports.getEnvVar = exports.getApiBaseUrl = exports.isProduction = exports.isDevelopment = exports.getPublicFileUrl = exports.getUserName = exports.safeMergeStyleProps = exports.keywordHelpers = exports.handleError = void 0;
40
- exports.useUnfollowUserByUserId = exports.useUnfollowByFollowId = exports.useFollowUser = exports.useFollowManager = exports.useFetchFollowingCountByUserId = exports.useFetchFollowingCount = exports.useFetchFollowingByUserId = exports.useFetchFollowing = exports.useFetchFollowersCountByUserId = exports.useFetchFollowersCount = exports.useFetchFollowersByUserId = exports.useFetchFollowers = exports.useFetchFollowStatus = exports.useUpdateUser = exports.useMentions = exports.useFetchUserSuggestions = exports.useCheckUsernameAvailability = exports.useFetchUserByUsername = exports.useFetchUserByForeignId = exports.useFetchUser = exports.useReactionToggle = exports.useRemoveReaction = exports.useAddReaction = exports.useFetchCommentReactionsWrapper = exports.useFetchEntityReactionsWrapper = exports.useFetchCommentReactions = exports.useFetchEntityReactions = exports.useFetchManyCommentsWrapper = exports.useEntityComments = exports.useDeleteComment = exports.useUpdateComment = exports.useReplies = exports.useFetchCommentByForeignId = exports.useFetchComment = exports.useFetchManyComments = exports.useCreateComment = exports.useCommentSectionData = exports.useCommentSection = exports.useSpaceListActions = exports.useSpaceList = exports.useSpacePermissions = exports.useRemoveMember = exports.useDeclineMember = exports.useApproveMember = exports.useUpdateMemberRole = exports.useFetchMySpaces = exports.useFetchSpaceMembers = exports.useLeaveSpace = exports.useJoinSpace = exports.useDeleteSpace = void 0;
41
- exports.validateSortType = exports.validateMetadataPropertyName = exports.validateSortBy = exports.AppNotification = exports.useUploadImage = exports.useUploadFile = exports.useGetMetadata = exports.useHandleSpaceCommentReport = exports.useHandleSpaceEntityReport = exports.useFetchSpaceReports = exports.useCreateReport = exports.useConnectionManager = exports.useFetchConnectionsCountByUserId = exports.useFetchConnectionsByUserId = exports.useFetchReceivedPendingConnections = exports.useFetchSentPendingConnections = exports.useFetchConnectionsCount = exports.useRemoveConnectionByUserId = exports.useFetchConnectionStatus = exports.useFetchConnections = exports.useRemoveConnection = exports.useDeclineConnection = exports.useAcceptConnection = exports.useRequestConnection = void 0;
40
+ exports.useRequestConnection = exports.useUnfollowUserByUserId = exports.useUnfollowByFollowId = exports.useFollowUser = exports.useFollowManager = exports.useFetchFollowingCountByUserId = exports.useFetchFollowingCount = exports.useFetchFollowingByUserId = exports.useFetchFollowing = exports.useFetchFollowersCountByUserId = exports.useFetchFollowersCount = exports.useFetchFollowersByUserId = exports.useFetchFollowers = exports.useFetchFollowStatus = exports.useMentions = exports.useFetchUserSuggestions = exports.useCheckUsernameAvailability = exports.useFetchUserByUsername = exports.useFetchUserByForeignId = exports.useFetchUser = exports.useReactionToggle = exports.useRemoveReaction = exports.useAddReaction = exports.useFetchCommentReactionsWrapper = exports.useFetchEntityReactionsWrapper = exports.useFetchCommentReactions = exports.useFetchEntityReactions = exports.useFetchManyCommentsWrapper = exports.useEntityComments = exports.useDeleteComment = exports.useUpdateComment = exports.useReplies = exports.useFetchCommentByForeignId = exports.useFetchComment = exports.useFetchManyComments = exports.useCreateComment = exports.useCommentSectionData = exports.useCommentSection = exports.useSpaceListActions = exports.useSpaceList = exports.useSpacePermissions = exports.useRemoveMember = exports.useDeclineMember = exports.useApproveMember = exports.useUpdateMemberRole = exports.useFetchMySpaces = exports.useFetchSpaceMembers = exports.useLeaveSpace = exports.useJoinSpace = exports.useDeleteSpace = void 0;
41
+ exports.validateSortType = exports.validateMetadataPropertyName = exports.validateSortBy = exports.AppNotification = exports.useUploadImage = exports.useUploadFile = exports.useGetMetadata = exports.useHandleSpaceCommentReport = exports.useHandleSpaceEntityReport = exports.useFetchSpaceReports = exports.useCreateReport = exports.useConnectionManager = exports.useFetchConnectionsCountByUserId = exports.useFetchConnectionsByUserId = exports.useFetchReceivedPendingConnections = exports.useFetchSentPendingConnections = exports.useFetchConnectionsCount = exports.useRemoveConnectionByUserId = exports.useFetchConnectionStatus = exports.useFetchConnections = exports.useRemoveConnection = exports.useDeclineConnection = exports.useAcceptConnection = void 0;
42
42
  // Helpers & Utilities
43
43
  var handleError_1 = require("./utils/handleError");
44
44
  Object.defineProperty(exports, "handleError", { enumerable: true, get: function () { return handleError_1.handleError; } });
@@ -162,7 +162,6 @@ Object.defineProperty(exports, "useFetchUserByUsername", { enumerable: true, get
162
162
  Object.defineProperty(exports, "useCheckUsernameAvailability", { enumerable: true, get: function () { return users_1.useCheckUsernameAvailability; } });
163
163
  Object.defineProperty(exports, "useFetchUserSuggestions", { enumerable: true, get: function () { return users_1.useFetchUserSuggestions; } });
164
164
  Object.defineProperty(exports, "useMentions", { enumerable: true, get: function () { return users_1.useMentions; } });
165
- Object.defineProperty(exports, "useUpdateUser", { enumerable: true, get: function () { return users_1.useUpdateUser; } });
166
165
  // -- follows
167
166
  var follows_1 = require("./hooks/relationships/follows");
168
167
  Object.defineProperty(exports, "useFetchFollowStatus", { enumerable: true, get: function () { return follows_1.useFetchFollowStatus; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","source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Aa,OAAA;AACb,gHAAA,qBAAqB,OAAA;AACrB,kHAAA,uBAAuB,OAAA;AAGzB,iBAAiB;AACjB,iEAc2C;AAbzC,mHAAA,oBAAoB,OAAA;AACpB,kHAAA,mBAAmB,OAAA;AACnB,mHAAA,oBAAoB,OAAA;AACpB,kHAAA,mBAAmB,OAAA;AACnB,kHAAA,mBAAmB,OAAA;AACnB,uHAAA,wBAAwB,OAAA;AACxB,0HAAA,2BAA2B,OAAA;AAC3B,uHAAA,wBAAwB,OAAA;AACxB,6HAAA,8BAA8B,OAAA;AAC9B,iIAAA,kCAAkC,OAAA;AAClC,0HAAA,2BAA2B,OAAA;AAC3B,+HAAA,gCAAgC,OAAA;AAChC,mHAAA,oBAAoB,OAAA;AAGtB,aAAa;AACb,2CAAkD;AAAzC,0GAAA,eAAe,OAAA;AACxB,2CAAuD;AAA9C,+GAAA,oBAAoB,OAAA;AAC7B,2CAA6D;AAApD,qHAAA,0BAA0B,OAAA;AACnC,2CAA8D;AAArD,sHAAA,2BAA2B,OAAA;AAEpC,aAAa;AACb,uCAA+C;AAAtC,uGAAA,cAAc,OAAA;AAEvB,aAAa;AACb,2CAAgE;AAAvD,wGAAA,aAAa,OAAA;AAAE,yGAAA,cAAc,OAAA;AAiBtC,uFAAuE;AA2DvE,gFAI8C;AAH5C,yHAAA,cAAc,OAAA;AACd,uIAAA,4BAA4B,OAAA;AAC5B,2HAAA,gBAAgB,OAAA"}
@@ -29,7 +29,7 @@ export type UserFull = {
29
29
  updatedAt: Date;
30
30
  deletedAt: Date | null;
31
31
  };
32
- export type AuthUser = Pick<UserFull, "id" | "projectId" | "foreignId" | "role" | "email" | "name" | "username" | "avatar" | "bio" | "birthdate" | "metadata" | "reputation" | "isVerified" | "isActive" | "lastActive" | "createdAt"> & {
32
+ export type AuthUser = Omit<UserFull, "secureMetadata" | "deletedAt"> & {
33
33
  suspensions: {
34
34
  reason: string | null;
35
35
  startDate: Date;
@@ -1,8 +1,12 @@
1
1
  import type { AuthUser } from '../../interfaces/models/User';
2
+ import type { UploadImageOptions } from '../../interfaces/models/Image';
2
3
  export interface UpdateUserParams {
3
4
  name?: string | null;
4
5
  username?: string | null;
5
- avatar?: string | null;
6
+ avatar?: string | null | {
7
+ file: File | Blob;
8
+ options: UploadImageOptions;
9
+ };
6
10
  bio?: string;
7
11
  birthdate?: Date | null;
8
12
  location?: {
@@ -11,6 +15,10 @@ export interface UpdateUserParams {
11
15
  } | null;
12
16
  metadata?: Record<string, any>;
13
17
  secureMetadata?: Record<string, any>;
18
+ banner?: {
19
+ file: File | Blob;
20
+ options: UploadImageOptions;
21
+ };
14
22
  }
15
23
  export interface UpdateUserRequest {
16
24
  projectId: string;
@@ -3,30 +3,81 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useUpdateUserMutation = exports.userApi = void 0;
4
4
  var baseApi_1 = require("./baseApi");
5
5
  // Removed FetchUserRequest and FetchUserByForeignIdRequest - these are for other users, not current user management
6
+ // Helper to build FormData for file uploads
7
+ function buildUserUpdateFormData(update) {
8
+ var formData = new FormData();
9
+ var avatarIsFile = update.avatar && typeof update.avatar === 'object' && 'file' in update.avatar;
10
+ // Append non-file fields
11
+ if (update.name !== undefined) {
12
+ formData.append("name", update.name === null ? "" : update.name);
13
+ }
14
+ if (update.username !== undefined) {
15
+ formData.append("username", update.username === null ? "" : update.username);
16
+ }
17
+ if (update.bio !== undefined) {
18
+ formData.append("bio", update.bio);
19
+ }
20
+ if (update.birthdate !== undefined) {
21
+ formData.append("birthdate", update.birthdate ? update.birthdate.toISOString() : "");
22
+ }
23
+ // URL-based avatar (legacy support)
24
+ if (update.avatar && typeof update.avatar === "string") {
25
+ formData.append("avatar", update.avatar);
26
+ }
27
+ // Object fields as JSON strings
28
+ if (update.location !== undefined) {
29
+ formData.append("location", update.location === null ? "null" : JSON.stringify(update.location));
30
+ }
31
+ if (update.metadata !== undefined) {
32
+ formData.append("metadata", JSON.stringify(update.metadata));
33
+ }
34
+ if (update.secureMetadata !== undefined) {
35
+ formData.append("secureMetadata", JSON.stringify(update.secureMetadata));
36
+ }
37
+ // Append avatar FILE and options
38
+ if (avatarIsFile && update.avatar && typeof update.avatar === 'object' && 'file' in update.avatar) {
39
+ formData.append("avatarFile", update.avatar.file);
40
+ formData.append("avatarFile.options", JSON.stringify(update.avatar.options));
41
+ }
42
+ // Append banner FILE and options
43
+ if (update.banner) {
44
+ formData.append("bannerFile", update.banner.file);
45
+ formData.append("bannerFile.options", JSON.stringify(update.banner.options));
46
+ }
47
+ return formData;
48
+ }
6
49
  // Inject user-specific endpoints into the base API
7
50
  exports.userApi = baseApi_1.baseApi.injectEndpoints({
8
51
  endpoints: function (builder) { return ({
9
- // Update current user (flat structure - matches space update pattern)
52
+ // Update current user (supports both JSON and FormData for file uploads)
10
53
  updateUser: builder.mutation({
11
54
  query: function (_a) {
12
55
  var projectId = _a.projectId, userId = _a.userId, update = _a.update;
13
- return ({
56
+ var avatarIsFile = update.avatar && typeof update.avatar === 'object' && 'file' in update.avatar;
57
+ var hasFiles = avatarIsFile || update.banner;
58
+ if (hasFiles) {
59
+ return {
60
+ url: "/".concat(projectId, "/users/").concat(userId),
61
+ method: 'PATCH',
62
+ body: buildUserUpdateFormData(update),
63
+ formData: true,
64
+ };
65
+ }
66
+ // Simple JSON request (no files)
67
+ return {
14
68
  url: "/".concat(projectId, "/users/").concat(userId),
15
69
  method: 'PATCH',
16
70
  body: update,
17
- });
71
+ };
18
72
  },
19
73
  // No complex optimistic updates needed - let useUserActions handle state updates
20
- invalidatesTags: function (result, error, _a) {
21
- var userId = _a.userId;
22
- return [
23
- { type: 'User', id: 'CURRENT' }, // Only current user now
24
- ];
25
- },
74
+ invalidatesTags: function () { return [
75
+ { type: 'User', id: 'CURRENT' },
76
+ ]; },
26
77
  }),
27
78
  // Removed other-user queries - these should use the existing legacy hooks:
28
79
  // - useFetchUser
29
- // - useFetchUserByForeignId
80
+ // - useFetchUserByForeignId
30
81
  // - useFetchUserFollowersCount
31
82
  // - useFetchUserFollowingCount
32
83
  // - useCheckUsernameAvailability
@@ -1 +1 @@
1
- {"version":3,"file":"userApi.js","sourceRoot":"","sources":["../../../../src/store/api/userApi.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAwBpC,oHAAoH;AAEpH,mDAAmD;AACtC,QAAA,OAAO,GAAG,iBAAO,CAAC,eAAe,CAAC;IAC7C,SAAS,EAAE,UAAC,OAAO,IAAK,OAAA,CAAC;QACvB,sEAAsE;QACtE,UAAU,EAAE,OAAO,CAAC,QAAQ,CAA8B;YACxD,KAAK,EAAE,UAAC,EAA6B;oBAA3B,SAAS,eAAA,EAAE,MAAM,YAAA,EAAE,MAAM,YAAA;gBAAO,OAAA,CAAC;oBACzC,GAAG,EAAE,WAAI,SAAS,oBAAU,MAAM,CAAE;oBACpC,MAAM,EAAE,OAAO;oBACf,IAAI,EAAE,MAAM;iBACb,CAAC;YAJwC,CAIxC;YACF,iFAAiF;YACjF,eAAe,EAAE,UAAC,MAAM,EAAE,KAAK,EAAE,EAAU;oBAAR,MAAM,YAAA;gBAAO,OAAA;oBAC9C,EAAE,IAAI,EAAE,MAAe,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,wBAAwB;iBACnE;YAF+C,CAE/C;SACF,CAAC;QAEF,2EAA2E;QAC3E,iBAAiB;QACjB,8BAA8B;QAC9B,+BAA+B;QAC/B,+BAA+B;QAC/B,iCAAiC;QACjC,4BAA4B;KAC7B,CAAC,EArBsB,CAqBtB;CACH,CAAC,CAAC;AAEH,wDAAwD;AAEtD,QAAA,qBAAqB,GACnB,eAAO,uBAAC"}
1
+ {"version":3,"file":"userApi.js","sourceRoot":"","sources":["../../../../src/store/api/userApi.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AA0BpC,oHAAoH;AAEpH,4CAA4C;AAC5C,SAAS,uBAAuB,CAAC,MAAwB;IACvD,IAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAChC,IAAM,YAAY,GAAG,MAAM,CAAC,MA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