@rocapine/community-core 0.8.0 → 0.8.1

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/lib/hooks.js CHANGED
@@ -245,6 +245,7 @@ function useUpdateProfile() {
245
245
  hasBio: !!input.bio,
246
246
  hasAvatar: !!input.avatarUrl,
247
247
  handleChanged: !!input.handle,
248
+ usernameChanged: !!input.username,
248
249
  });
249
250
  },
250
251
  });
package/lib/service.d.ts CHANGED
@@ -124,19 +124,22 @@ export declare function deleteOwnComment(cfg: ResolvedCommunityConfig, commentId
124
124
  * signature and translated to the Edge Function's expected `avatarPath` body
125
125
  * key at the call site below.
126
126
  */
127
+ /** `username` is the display name shown on posts; `handle` the @handle. All fields are moderated server-side. */
127
128
  export type UpdateProfileInput = {
129
+ username?: string;
128
130
  handle?: string;
129
131
  bio?: string;
130
132
  avatarUrl?: string;
131
133
  };
132
134
  export type UpdateProfileResult = {
133
135
  status: "ok";
136
+ username: string | null;
134
137
  handle: string | null;
135
138
  bio: string | null;
136
139
  avatarUrl: string | null;
137
140
  } | {
138
141
  status: "rejected";
139
- field: "handle" | "bio" | "avatar";
142
+ field: "username" | "handle" | "bio" | "avatar";
140
143
  reason?: string;
141
144
  } | {
142
145
  status: "error";
package/lib/service.js CHANGED
@@ -472,9 +472,9 @@ async function deleteOwnComment(cfg, commentId) {
472
472
  */
473
473
  async function updateProfile(cfg, input) {
474
474
  const client = cfg.requireClient();
475
- const { handle, bio, avatarUrl } = input;
475
+ const { username, handle, bio, avatarUrl } = input;
476
476
  const { data, error } = await client.functions.invoke("update-profile", {
477
- body: { handle, bio, avatarPath: avatarUrl },
477
+ body: { username, handle, bio, avatarPath: avatarUrl },
478
478
  });
479
479
  if (!error)
480
480
  return data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rocapine/community-core",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Headless Supabase-backed community backend: identity, feed/thread/moderation services, and React Query hooks.",
5
5
  "license": "MIT",
6
6
  "repository": {