@wix/himalaya-cli 0.1323.0 → 0.1324.0

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 (27) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/comments-v1/src/extensions.d.ts +79 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/groups/src/extensions.d.ts +221 -14
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/groups/src/index.d.ts +0 -2
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/social-feed/src/index.d.ts +38 -21
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-comments.mjs +80 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-groups.mjs +45 -17
  7. package/dist/cli.mjs +3 -2
  8. package/guides/release-notes.md +25 -0
  9. package/guides/sdk-reference.json +200 -31
  10. package/guides/wix-api-usage.md +5 -0
  11. package/package.json +2 -2
  12. package/templates/branded-lite/config.ts +0 -7
  13. package/templates/branded-lite/dev/index.ts +0 -116
  14. package/templates/branded-lite/himalaya.content.json +0 -3
  15. package/templates/community-club/config.ts +0 -7
  16. package/templates/community-club/dev/index.ts +0 -116
  17. package/templates/community-club/himalaya.content.json +0 -3
  18. package/templates/events-meetups/config.ts +0 -7
  19. package/templates/events-meetups/dev/index.ts +0 -116
  20. package/templates/events-meetups/himalaya.content.json +0 -3
  21. package/templates/nonprofit-cause/config.ts +0 -7
  22. package/templates/nonprofit-cause/dev/index.ts +0 -116
  23. package/templates/nonprofit-cause/himalaya.content.json +0 -3
  24. package/templates/branded-lite/tier5-src/wix-spaces-create-group/index.ts +0 -29
  25. package/templates/community-club/tier5-src/wix-spaces-create-group/index.ts +0 -29
  26. package/templates/events-meetups/tier5-src/wix-spaces-create-group/index.ts +0 -29
  27. package/templates/nonprofit-cause/tier5-src/wix-spaces-create-group/index.ts +0 -29
@@ -8,6 +8,15 @@ export type WixBlogCommentRow = {
8
8
  /** [rico] #3372 — the comment's Ricos document (`content.richContent`) as the API returned it, for a
9
9
  * RichContent row; undefined when the comment has none. */
10
10
  richContent?: unknown;
11
+ /** Set only on a reply row `listGroupPostComments` flattens in from `commentReplies` —
12
+ * absent on a top-level comment. */
13
+ parentCommentId?: string;
14
+ /** Set only on a TOP-LEVEL comment row, true when its reply thread had more replies than
15
+ * `repliesLimit` returned. There is no confirmed endpoint in this SDK to fetch the rest —
16
+ * `WixRepliesListResponse`'s own `pagingMetadata` carries a cursor, but nothing in the
17
+ * ingested spec calls it by itself — so this is a signal to show "N more replies" rather
18
+ * than silently truncating, not something a caller can page past yet. */
19
+ hasMoreReplies?: boolean;
11
20
  };
12
21
  type BlogCommentLike = {
13
22
  id?: string;
@@ -22,4 +31,74 @@ type BlogCommentLike = {
22
31
  export declare function blogCommentRow(comment: BlogCommentLike | undefined): WixBlogCommentRow;
23
32
  export declare function createBlogComment(postId: string, text: string): Promise<WixBlogCommentRow>;
24
33
  export declare function listBlogComments(postId: string): Promise<WixBlogCommentRow[]>;
34
+ /** The appId Wix Groups registers as its comments provider. Same value as
35
+ * GROUPS_APP_ID/GROUPS_APP_DEF_ID used elsewhere in this repo (social-feed's
36
+ * reactions/create-post calls) — Groups is one of the apps where the comments
37
+ * provider id and the app-def-id coincide. Source: comments-ng's own CONSUMERS.md. */
38
+ export declare const GROUPS_COMMENTS_APP_ID = "148c2287-c669-d849-d153-463c7486a694";
39
+ /**
40
+ * Posts a comment (or a reply, when `parentCommentId` is given) on a group feed post —
41
+ * POST /comments/v1/comments, body { comment: { appId, contextId: groupId, resourceId:
42
+ * feedItemId, content, parentComment? } }. Same underlying RPC as the generated
43
+ * `createComment`, scoped to a group feed item by the appId/contextId/resourceId
44
+ * convention in comments-ng's own CONSUMERS.md (source-verified; see the file header).
45
+ *
46
+ * verify-live: no round-trip against a real group post yet — the scoping comes from the
47
+ * comments-ng consumer table, not a live create+list.
48
+ *
49
+ * @scope member — requires a signed-in site member.
50
+ */
51
+ export declare function createGroupPostComment(groupId: string, feedItemId: string, text: string, parentCommentId?: string): Promise<WixBlogCommentRow>;
52
+ export interface WixListGroupPostCommentsResult {
53
+ comments: WixBlogCommentRow[];
54
+ /** `undefined` when the response carried none — a thread with more pages has one. */
55
+ pagingMetadata?: {
56
+ count?: number;
57
+ hasNext?: boolean;
58
+ cursors?: {
59
+ next?: string;
60
+ prev?: string;
61
+ };
62
+ };
63
+ }
64
+ export interface WixListGroupPostCommentsOptions {
65
+ /** From a prior call's `pagingMetadata.cursors.next` — fetches the next page. */
66
+ cursor?: string;
67
+ /** Top-level comments per page. Defaults to the server's own default (unset). */
68
+ limit?: number;
69
+ /** Replies to include inline PER parent comment. Defaults to 20 — unset, the
70
+ * server's documented default is to include none at all (see below). */
71
+ repliesLimit?: number;
72
+ }
73
+ /**
74
+ * Lists a group feed post's comment thread — GET /comments/v1/comments/list-by-resource,
75
+ * scoped by appId/contextId=groupId/resourceId=feedItemId (query string, never a GET
76
+ * body — see the comment above). Same underlying RPC as the generated
77
+ * `listCommentsByResource`.
78
+ *
79
+ * Replies ride the SAME response, under `commentReplies` — keyed by parent comment id —
80
+ * but ONLY when the request's `cursorPaging.repliesLimit` asks for them; the field exists
81
+ * precisely because the server does not include replies by default. This function sends
82
+ * `cursorPaging.repliesLimit=20` unless `opts.repliesLimit` overrides it, and forwards
83
+ * `opts.cursor`/`opts.limit` into `cursorPaging.cursor`/`cursorPaging.limit` so a caller
84
+ * can actually page past `pagingMetadata.hasNext` instead of being stuck on page one. The
85
+ * generator could not resolve a precise shape for the `commentReplies` map
86
+ * (`Record<string, unknown>`), so its value is read as `{ replies?, pagingMetadata? }` here —
87
+ * inferred from the already-typed, structurally identical `WixRepliesListResponse`, not
88
+ * live-verified against a real multi-reply thread. Each reply is flattened into the SAME
89
+ * row list, tagged with `parentCommentId`, directly after its parent, oldest reply first.
90
+ * Top-level comments keep the SERVER's order: the request sends no sort (none is confirmed
91
+ * for this provider), so re-sorting a page on the client would break chronology at a page
92
+ * boundary whenever the server pages newest-first. Kept as-is, consecutive pages append
93
+ * consistently, whatever order the server uses. A thread with more replies than `repliesLimit` sets its PARENT row's
94
+ * `hasMoreReplies: true` instead of silently dropping them — there is no confirmed endpoint
95
+ * in this SDK to page a single thread's replies, so this is a signal, not a cursor.
96
+ *
97
+ * verify-live: no round-trip against a real group post yet — the appId/contextId/resourceId
98
+ * shape comes from the comments-ng consumer table, not a live call.
99
+ *
100
+ * @scope member — a signed-in site member reading a group they can see; whether an
101
+ * anonymous visitor can read a PUBLIC group's comments is unconfirmed — needsLiveProbe.
102
+ */
103
+ export declare function listGroupPostComments(groupId: string, feedItemId: string, opts?: WixListGroupPostCommentsOptions): Promise<WixListGroupPostCommentsResult>;
25
104
  export {};
@@ -1,4 +1,21 @@
1
- import type { WixGroup } from "./index.js";
1
+ import type { WixGroup, WixGroupsQueryRequest, WixQueryGroupsResponse, WixCallOptions } from "./index.js";
2
+ /**
3
+ * List/search groups — POST /social-groups-proxy/groups/v2/groups/query.
4
+ *
5
+ * @scope visitor — browsing public groups needs no sign-in; this is an
6
+ * already-working consumer-app feature (group discovery). Whether a
7
+ * private/secret group's existence is visible to a non-member is unconfirmed
8
+ * — needsLiveProbe.
9
+ */
10
+ export declare function queryGroups(req?: WixGroupsQueryRequest, opts?: WixCallOptions): Promise<WixQueryGroupsResponse>;
11
+ /**
12
+ * Get a single group by id — GET /social-groups-proxy/groups/v2/groups/{id}.
13
+ *
14
+ * @scope visitor — same reasoning as `queryGroups`: reading a group's detail is
15
+ * an already-working consumer-app feature with no sign-in required for a
16
+ * public group.
17
+ */
18
+ export declare function getGroup(id: string, opts?: WixCallOptions): Promise<WixGroup>;
2
19
  export interface WixGroupCoverImage {
3
20
  /** A previously-uploaded Wix Media file id (from site-media generate-upload-url + PUT). */
4
21
  mediaId?: string;
@@ -9,8 +26,24 @@ export interface WixGroupAccessRestriction {
9
26
  /** UNKNOWN | ADMIN_APPROVAL | PAID_PLANS | EVENTS */
10
27
  type?: string;
11
28
  }
29
+ /** The real `GroupSettings` shape, ingested from `@wix/auto_sdk_groups_groups`
30
+ * (codegen/wix/auto/specs/groups_groups/types.d.ts) at its latest published version as of
31
+ * 2026-10-06 — re-ingestion confirmed no additional fields exist upstream. Do NOT add
32
+ * fields beyond this list without re-ingesting or a live probe first. */
33
+ export interface WixGroupSettings {
34
+ membersCanInvite?: boolean;
35
+ membersCanApprove?: boolean;
36
+ welcomeMemberPostEnabled?: boolean;
37
+ groupDetailsChangedPostEnabled?: boolean;
38
+ showMemberList?: boolean;
39
+ /** No enum is pinned anywhere in the ingested spec — needsLiveProbe. */
40
+ allowedToInviteMembers?: string;
41
+ /** No enum is pinned anywhere in the ingested spec — needsLiveProbe. */
42
+ allowedToApproveJoinRequests?: string;
43
+ aiSpamProtectionEnabled?: boolean;
44
+ }
12
45
  /** Writable group fields for create/update. */
13
- export interface WixGroupWrite {
46
+ export interface WixGroupWriteInput {
14
47
  /** Required on create. */
15
48
  name?: string;
16
49
  /** UNKNOWN | PUBLIC | PRIVATE | SECRET */
@@ -21,15 +54,16 @@ export interface WixGroupWrite {
21
54
  description?: string;
22
55
  coverImage?: WixGroupCoverImage | null;
23
56
  accessRestriction?: WixGroupAccessRestriction;
57
+ settings?: WixGroupSettings;
24
58
  }
25
59
  export interface WixCreateGroupRequest {
26
- group: WixGroupWrite;
60
+ group: WixGroupWriteInput;
27
61
  }
28
62
  export interface WixCreateGroupResponse {
29
63
  group: WixGroup;
30
64
  }
31
65
  export interface WixUpdateGroupRequest {
32
- group: WixGroupWrite & {
66
+ group: WixGroupWriteInput & {
33
67
  id: string;
34
68
  };
35
69
  }
@@ -38,11 +72,35 @@ export interface WixUpdateGroupResponse {
38
72
  }
39
73
  export interface WixDeleteGroupResponse {
40
74
  }
41
- /** Create a group — POST /social-groups-proxy/groups/v2/groups. `name` is required; the entity is wrapped as `{ group }`. */
42
- export declare function createGroup(group: WixGroupWrite): Promise<WixCreateGroupResponse>;
43
- /** Update a group — PATCH /social-groups-proxy/groups/v2/groups/{id} (field-mask style). Only the supplied fields change; the request carries `{ group: { id, ... } }`. */
44
- export declare function updateGroup(groupId: string, group: WixGroupWrite): Promise<WixUpdateGroupResponse>;
45
- /** Delete a group — DELETE /social-groups-proxy/groups/v2/groups/{id}. */
75
+ /**
76
+ * Create a group — POST /social-groups-proxy/groups/v2/groups. `name` is required;
77
+ * the entity is wrapped as `{ group }`.
78
+ *
79
+ * @scope owner — CONFIRMED: requires a true owner/admin-scoped API token. Returns
80
+ * HTTP 403 for every member session, including the site owner's own account signed
81
+ * in via a normal member-login flow. There is NO member-side workaround — do not
82
+ * wire this to a consumer-facing "create group" action. See the section note above
83
+ * for the reproduction.
84
+ */
85
+ export declare function createGroup(group: WixGroupWriteInput): Promise<WixCreateGroupResponse>;
86
+ /**
87
+ * Update a group — PATCH /social-groups-proxy/groups/v2/groups/{id} (field-mask style).
88
+ * Only the supplied fields change; the request carries `{ group: { id, ... } }`.
89
+ *
90
+ * @scope owner — VERY LIKELY the same owner/admin-scoped-token requirement as
91
+ * `createGroup` (same entity, same write-class, originally verified together via
92
+ * "the real Owner Create/Edit-Group flow") — but NOT independently re-tested
93
+ * against a member session this round. needsLiveProbe to confirm directly rather
94
+ * than by inference.
95
+ */
96
+ export declare function updateGroup(groupId: string, group: WixGroupWriteInput): Promise<WixUpdateGroupResponse>;
97
+ /**
98
+ * Delete a group — DELETE /social-groups-proxy/groups/v2/groups/{id}.
99
+ *
100
+ * @scope owner — VERY LIKELY the same owner/admin-scoped-token requirement as
101
+ * `createGroup` (same reasoning as `updateGroup` above) — not independently
102
+ * re-tested against a member session this round. needsLiveProbe.
103
+ */
46
104
  export declare function deleteGroup(groupId: string): Promise<WixDeleteGroupResponse>;
47
105
  export interface WixGroupJoinResponse {
48
106
  member?: {
@@ -53,9 +111,18 @@ export interface WixGroupJoinResponse {
53
111
  };
54
112
  };
55
113
  }
56
- /** Join a group as the signed-in member — POST /social-groups/v2/groups/{id}/join. */
114
+ /**
115
+ * Join a group as the signed-in member — POST /social-groups/v2/groups/{id}/join.
116
+ *
117
+ * @scope member — a self-service action any signed-in member session can reach
118
+ * (distinct REST base from group CRUD above, which is owner-only). Verified live.
119
+ */
57
120
  export declare function joinGroup(groupId: string): Promise<WixGroupJoinResponse>;
58
- /** Leave a group as the signed-in member — POST /social-groups/v2/groups/{id}/leave. */
121
+ /**
122
+ * Leave a group as the signed-in member — POST /social-groups/v2/groups/{id}/leave.
123
+ *
124
+ * @scope member — same reasoning as `joinGroup`. Verified live.
125
+ */
59
126
  export declare function leaveGroup(groupId: string): Promise<Record<string, never>>;
60
127
  export interface WixGroupMember {
61
128
  /** Site member id (resolve to name/photo via the Members API). */
@@ -74,7 +141,147 @@ export interface WixQueryGroupMembersResponse {
74
141
  total?: number;
75
142
  };
76
143
  }
77
- /** Query a group's members — POST /social-groups-proxy/members/v2/groups/{groupId}/members/query.
78
- * The members service lives behind the `members` proxy base (NOT `groups`);
79
- * live-verified 2026-06-19 (the `groups` base 404s, this base returns 200). */
144
+ /**
145
+ * Query a group's members — POST /social-groups-proxy/members/v2/groups/{groupId}/members/query.
146
+ * The members service lives behind the `members` proxy base (NOT `groups`);
147
+ * live-verified 2026-06-19 (the `groups` base 404s, this base returns 200).
148
+ *
149
+ * @scope member — reachable by a signed-in member session (listing a group's
150
+ * members is an already-working consumer-app feature); visitor/anonymous
151
+ * readability for a public group is unconfirmed — needsLiveProbe.
152
+ */
80
153
  export declare function queryMembers(groupId: string, limit?: number): Promise<WixQueryGroupMembersResponse>;
154
+ export interface WixJoinGroupRequest {
155
+ siteMemberId?: string;
156
+ contactId?: string;
157
+ /** No enum is pinned anywhere in the ingested spec — needsLiveProbe. */
158
+ status?: string;
159
+ requestDetails?: {
160
+ rejectionReason?: string;
161
+ };
162
+ }
163
+ export interface WixListJoinGroupRequestsResponse {
164
+ joinGroupRequests?: WixJoinGroupRequest[];
165
+ metadata?: {
166
+ count?: number;
167
+ offset?: number;
168
+ total?: number;
169
+ tooManyToCount?: boolean;
170
+ };
171
+ }
172
+ /**
173
+ * List a group's pending join requests — GET /social-groups-proxy/join/v2/groups/{groupId}/join-requests.
174
+ *
175
+ * verify-live: not yet called against a real group — path and shape come from the
176
+ * ingested Social Groups spec.
177
+ *
178
+ * @scope member — documented as reachable by a signed-in member whose in-group
179
+ * role is admin/manager (not an owner-scoped API token — see the section's "OPEN
180
+ * QUESTION" note); a regular member gets 403. Not independently live-probed.
181
+ */
182
+ export declare function listJoinGroupRequests(groupId: string, limit?: number, offset?: number): Promise<WixListJoinGroupRequestsResponse>;
183
+ export interface WixApproveJoinGroupRequestsResponse {
184
+ joinGroupRequests?: WixJoinGroupRequest[];
185
+ }
186
+ /**
187
+ * Approve pending join requests — POST /social-groups-proxy/join/v2/groups/{groupId}/join-requests/approve,
188
+ * body { groupId, memberIds }.
189
+ *
190
+ * verify-live: not yet called against a real group — path and shape come from the
191
+ * ingested Social Groups spec.
192
+ *
193
+ * @scope member — same documented-but-unverified basis as `listJoinGroupRequests`
194
+ * (see the section's "OPEN QUESTION" note) — a regular member gets 403.
195
+ */
196
+ export declare function approveJoinGroupRequests(groupId: string, memberIds: string[]): Promise<WixApproveJoinGroupRequestsResponse>;
197
+ export interface WixJoinGroupRequestRejection {
198
+ memberId: string;
199
+ reason?: string;
200
+ }
201
+ export interface WixRejectJoinGroupRequestsResponse {
202
+ joinGroupRequests?: WixJoinGroupRequest[];
203
+ }
204
+ /**
205
+ * Reject pending join requests — POST /social-groups-proxy/join/v2/groups/{groupId}/join-requests/reject,
206
+ * body { groupId, rejections }.
207
+ *
208
+ * verify-live: not yet called against a real group — path and shape come from the
209
+ * ingested Social Groups spec.
210
+ *
211
+ * @scope member — same documented-but-unverified basis as `listJoinGroupRequests`
212
+ * (see the section's "OPEN QUESTION" note) — a regular member gets 403.
213
+ */
214
+ export declare function rejectJoinGroupRequests(groupId: string, rejections: WixJoinGroupRequestRejection[]): Promise<WixRejectJoinGroupRequestsResponse>;
215
+ export interface WixGroupRole {
216
+ value?: string;
217
+ }
218
+ export interface WixAssignRoleResponse {
219
+ groupId?: string;
220
+ memberIds?: string[];
221
+ role?: WixGroupRole;
222
+ }
223
+ /**
224
+ * Assign a role to group members — POST /social-groups-proxy/roles/v2/groups/{groupId}/roles/assign,
225
+ * body { groupId, memberIds, role: { value } }. `role` is a loose string, not a union: no
226
+ * literal role value (e.g. "ADMIN"/"MEMBER") is pinned anywhere in the ingested spec —
227
+ * needsLiveProbe.
228
+ *
229
+ * verify-live: not yet called against a real group — path and shape come from the
230
+ * ingested Social Groups spec.
231
+ *
232
+ * @scope member — documented as reachable by a signed-in member whose in-group
233
+ * role is admin/manager, not an owner-scoped API token (see the join-request
234
+ * moderation section's "OPEN QUESTION" note above) — a regular member gets 403.
235
+ * Not independently live-probed.
236
+ */
237
+ export declare function assignRole(groupId: string, memberIds: string[], role: string): Promise<WixAssignRoleResponse>;
238
+ export interface WixUnassignRoleResponse {
239
+ groupId?: string;
240
+ siteMemberIds?: string[];
241
+ memberIds?: string[];
242
+ role?: WixGroupRole;
243
+ }
244
+ /**
245
+ * Remove a role from group members — POST /social-groups-proxy/roles/v2/groups/{groupId}/roles/unassign,
246
+ * body { groupId, memberIds, role: { value } }. Same unconfirmed-enum caveat as `assignRole`.
247
+ *
248
+ * verify-live: not yet called against a real group — path and shape come from the
249
+ * ingested Social Groups spec.
250
+ *
251
+ * @scope member — same documented-but-unverified basis as `assignRole` — a regular
252
+ * member gets 403.
253
+ */
254
+ export declare function unassignRole(groupId: string, memberIds: string[], role: string): Promise<WixUnassignRoleResponse>;
255
+ export interface WixRemoveGroupMembersResponse {
256
+ }
257
+ /**
258
+ * Remove members from a group — DELETE /social-groups-proxy/members/v2/groups/{groupId}/members,
259
+ * `memberIds` repeated in the QUERY STRING (`?memberIds=a&memberIds=b`), no body — every
260
+ * no-path-param DELETE this repo has confirmed against Wix's own generated clients sends its
261
+ * request that way (codegen/wix/tests/delete-query-string.test.ts); unlike a GET/HEAD body,
262
+ * which the gateway drops unconditionally, a DELETE body is NOT dropped — this is a convention
263
+ * match with Wix's own generated clients, not a gateway constraint. Same `members` proxy base
264
+ * `queryMembers` already live-verified (2026-06-19) uses; this specific verb+path combination
265
+ * is not yet live-probed.
266
+ *
267
+ * verify-live: not yet called against a real group — path and shape come from the
268
+ * ingested Social Groups spec.
269
+ *
270
+ * @scope member — same documented-but-unverified basis as `assignRole` — a regular
271
+ * member gets 403.
272
+ */
273
+ export declare function removeGroupMembers(groupId: string, memberIds: string[]): Promise<WixRemoveGroupMembersResponse>;
274
+ /**
275
+ * Update a group's settings — PATCH /social-groups-proxy/groups/v2/groups/{id} (field-mask),
276
+ * via the existing `updateGroup` RPC, body { group: { id, settings } }. No separate settings
277
+ * endpoint exists.
278
+ *
279
+ * verify-live: not yet called against a real group — path and shape come from the
280
+ * ingested Social Groups spec.
281
+ *
282
+ * @scope owner — rides the SAME `updateGroup` RPC that is very likely owner-token-only
283
+ * (see `updateGroup`'s own doc above) — reclassified from an earlier "group-admin
284
+ * member" assumption once `createGroup`'s owner-only finding showed group CRUD writes
285
+ * are gated by API-token tier, not in-group role. Not independently live-probed.
286
+ */
287
+ export declare function updateGroupSettings(groupId: string, settings: WixGroupSettings): Promise<WixUpdateGroupResponse>;
@@ -86,6 +86,4 @@ export interface WixUpdateGroupResponse {
86
86
  }
87
87
  export interface WixDeleteGroupResponse {
88
88
  }
89
- export declare function queryGroups(req?: WixGroupsQueryRequest, opts?: WixCallOptions): Promise<WixQueryGroupsResponse>;
90
- export declare function getGroup(id: string, opts?: WixCallOptions): Promise<WixGroup>;
91
89
  export * from "./extensions.js";
@@ -62,17 +62,26 @@ export interface WixListFeedItemsResponse {
62
62
  profiles?: WixFeedProfile[];
63
63
  nextPageCursor?: string;
64
64
  }
65
- /** List a group's activity feed — GET
66
- * https://social.wix.com/serverless/mobile/feed/v4/feedPosts (the ENRICHED read the
67
- * real mobile app uses). Each item carries content (Ricos blocks), commentsCount, and
68
- * reactionsList (count = length); the response's top-level `profiles[]` resolves each
69
- * item's author.id → userName + profileImage. Verified live (200). Replaces the lean
70
- * GET /api/v1/feed/items read, which omitted counts + author. */
65
+ /**
66
+ * List a group's activity feed — GET
67
+ * https://social.wix.com/serverless/mobile/feed/v4/feedPosts (the ENRICHED read the
68
+ * real mobile app uses). Each item carries content (Ricos blocks), commentsCount, and
69
+ * reactionsList (count = length); the response's top-level `profiles[]` resolves each
70
+ * item's author.id → userName + profileImage. Verified live (200). Replaces the lean
71
+ * GET /api/v1/feed/items read, which omitted counts + author.
72
+ *
73
+ * @scope member — verified live with a signed-in member session; visitor/anonymous
74
+ * readability of a public group's feed is unconfirmed.
75
+ */
71
76
  export declare function listFeedItems(groupId: string, limit?: number): Promise<WixListFeedItemsResponse>;
72
- /** Create a feed post in a group as the signed-in member — POST
73
- * https://social.wix.com/api/v1/feed/items. `content` is the post text (modern
74
- * posts are Ricos rich-content serialized to a string; plain text also works with
75
- * contentType PLAIN_TEXT). Verified live (returns the created FeedItem). */
77
+ /**
78
+ * Create a feed post in a group as the signed-in member — POST
79
+ * https://social.wix.com/api/v1/feed/items. `content` is the post text (modern
80
+ * posts are Ricos rich-content serialized to a string; plain text also works with
81
+ * contentType PLAIN_TEXT). Verified live (returns the created FeedItem).
82
+ *
83
+ * @scope member — requires a signed-in site member. Verified live.
84
+ */
76
85
  export declare function createFeedItem(groupId: string, content: string): Promise<WixFeedItem>;
77
86
  export interface WixReactionsSummary {
78
87
  total?: number;
@@ -81,16 +90,24 @@ export interface WixReactionsSummary {
81
90
  /** The default "like" reaction is the THUMBS_UP emoji — NOT the literal "LIKE".
82
91
  * The real client's DEFAULT_REACTION is ReactionCode.THUMBS_UP ('👍'). */
83
92
  export declare const DEFAULT_REACTION = "\uD83D\uDC4D";
84
- /** Like (react to) a feed item as the signed-in member. Verified live (200 →
85
- * { total, reactionCodeCounts }). The real mobile app posts to the Groups
86
- * mobile-serverless wrapper (NOT the raw /api/v1/reactions REST route, which
87
- * 404s for the member): POST /serverless/mobile/feed/v3/addReaction with
88
- * { containerId=groupId, appDefId(Groups), reactionCode(emoji), resourceId=feedItemId, mode }.
89
- * Auth is the signed instance (the wixApi bridge attaches it). `mode:"APPEND"`
90
- * adds without clearing other reactions. (RE'd from wix-one-app-feed
91
- * feed-api.reactionPress + groups-mobile-serverless addReaction.) */
93
+ /**
94
+ * Like (react to) a feed item as the signed-in member. Verified live (200 →
95
+ * { total, reactionCodeCounts }). The real mobile app posts to the Groups
96
+ * mobile-serverless wrapper (NOT the raw /api/v1/reactions REST route, which
97
+ * 404s for the member): POST /serverless/mobile/feed/v3/addReaction with
98
+ * { containerId=groupId, appDefId(Groups), reactionCode(emoji), resourceId=feedItemId, mode }.
99
+ * Auth is the signed instance (the wixApi bridge attaches it). `mode:"APPEND"`
100
+ * adds without clearing other reactions. (RE'd from wix-one-app-feed
101
+ * feed-api.reactionPress + groups-mobile-serverless addReaction.)
102
+ *
103
+ * @scope member — requires a signed-in site member. Verified live.
104
+ */
92
105
  export declare function reactToFeedItem(feedItemId: string, groupId: string, reactionCode?: string): Promise<WixReactionsSummary>;
93
- /** Remove the member's reaction from a feed item — POST
94
- * /serverless/mobile/feed/v2/removeReaction (same body minus `mode`).
95
- * Verified live (200 → total decremented). */
106
+ /**
107
+ * Remove the member's reaction from a feed item — POST
108
+ * /serverless/mobile/feed/v2/removeReaction (same body minus `mode`).
109
+ * Verified live (200 → total decremented).
110
+ *
111
+ * @scope member — requires a signed-in site member. Verified live.
112
+ */
96
113
  export declare function unreactFeedItem(feedItemId: string, groupId: string, reactionCode?: string): Promise<WixReactionsSummary>;
@@ -98,6 +98,83 @@ async function listBlogComments(postId) {
98
98
  return x === y ? 0 : x < y ? -1 : 1;
99
99
  });
100
100
  }
101
+ var GROUPS_COMMENTS_APP_ID = "148c2287-c669-d849-d153-463c7486a694";
102
+ async function createGroupPostComment(groupId, feedItemId, text, parentCommentId) {
103
+ const trimmed = text.trim();
104
+ if (!groupId) {
105
+ throw new Error("groupId is required");
106
+ }
107
+ if (!feedItemId) {
108
+ throw new Error("feedItemId is required");
109
+ }
110
+ if (!trimmed) {
111
+ throw new Error("comment text is required");
112
+ }
113
+ const request = {
114
+ comment: {
115
+ appId: GROUPS_COMMENTS_APP_ID,
116
+ contextId: groupId,
117
+ resourceId: feedItemId,
118
+ content: { richContent: ricosText(trimmed) },
119
+ ...parentCommentId ? { parentComment: { id: parentCommentId } } : {}
120
+ }
121
+ };
122
+ const response = await createComment(request);
123
+ const row = blogCommentRow(response.comment ?? response);
124
+ return parentCommentId ? { ...row, parentCommentId } : row;
125
+ }
126
+ async function listGroupPostComments(groupId, feedItemId, opts = {}) {
127
+ if (!groupId) {
128
+ throw new Error("groupId is required");
129
+ }
130
+ if (!feedItemId) {
131
+ throw new Error("feedItemId is required");
132
+ }
133
+ const params = [
134
+ ["appId", GROUPS_COMMENTS_APP_ID],
135
+ ["contextId", groupId],
136
+ ["resourceId", feedItemId],
137
+ ["cursorPaging.repliesLimit", String(opts.repliesLimit ?? 20)],
138
+ ...opts.cursor ? [["cursorPaging.cursor", opts.cursor]] : [],
139
+ ...opts.limit != null ? [["cursorPaging.limit", String(opts.limit)]] : []
140
+ ];
141
+ const query = params.map(([k, v]) => `${k}=${encodeURIComponent(v)}`).join("&");
142
+ const response = await wixCall(
143
+ "GET",
144
+ `/comments/v1/comments/list-by-resource?${query}`
145
+ );
146
+ const toRow = (comment, parentCommentId) => ({
147
+ id: comment.id ?? "comment",
148
+ authorName: commentAuthor(comment),
149
+ text: commentText(comment),
150
+ createdDate: comment.createdDate ?? "",
151
+ richContent: commentRichContent(comment),
152
+ ...parentCommentId ? { parentCommentId } : {}
153
+ });
154
+ const instantOf = (row) => {
155
+ if (!row.createdDate) return Number.POSITIVE_INFINITY;
156
+ const ms = Date.parse(row.createdDate);
157
+ return Number.isNaN(ms) ? Number.POSITIVE_INFINITY : ms;
158
+ };
159
+ const byInstant = (a, b) => {
160
+ const x = instantOf(a);
161
+ const y = instantOf(b);
162
+ return x === y ? 0 : x < y ? -1 : 1;
163
+ };
164
+ const topLevel = (response.comments ?? []).map((comment) => toRow(comment));
165
+ const repliesByParent = response.commentReplies ?? {};
166
+ const repliesOf = (parentCommentId) => (repliesByParent[parentCommentId]?.replies ?? []).map((reply) => toRow(reply, parentCommentId)).sort(byInstant);
167
+ const rows = [];
168
+ for (const parent of topLevel) {
169
+ if (repliesByParent[parent.id]?.pagingMetadata?.hasNext) parent.hasMoreReplies = true;
170
+ rows.push(parent, ...repliesOf(parent.id));
171
+ }
172
+ const shown = new Set(topLevel.map((row) => row.id));
173
+ for (const parentCommentId of Object.keys(repliesByParent)) {
174
+ if (!shown.has(parentCommentId)) rows.push(...repliesOf(parentCommentId));
175
+ }
176
+ return { comments: rows, pagingMetadata: response.pagingMetadata };
177
+ }
101
178
 
102
179
  // ../../stdlib/wix-sdk/comments-v1/src/index.ts
103
180
  function wixCallHeaders(opts) {
@@ -591,6 +668,7 @@ function updateCommentsWidget(req, opts) {
591
668
  }
592
669
  export {
593
670
  BLOG_COMMENTS_APP_ID,
671
+ GROUPS_COMMENTS_APP_ID,
594
672
  addCommentReaction,
595
673
  blogCommentRow,
596
674
  bulkDeleteComment,
@@ -606,12 +684,14 @@ export {
606
684
  countComments,
607
685
  createBlogComment,
608
686
  createComment,
687
+ createGroupPostComment,
609
688
  deleteComment,
610
689
  getComment,
611
690
  getCommentThread,
612
691
  hideComment,
613
692
  listBlogComments,
614
693
  listCommentsByResource,
694
+ listGroupPostComments,
615
695
  markComment,
616
696
  moderateDraftContent,
617
697
  publishComment,
@@ -1,4 +1,11 @@
1
1
  // ../../stdlib/wix-sdk/groups/src/extensions.ts
2
+ function queryGroups(req = {}, opts) {
3
+ return wixCall("POST", "/social-groups-proxy/groups/v2/groups/query", { query: req }, opts);
4
+ }
5
+ function getGroup(id, opts) {
6
+ if (!id) throw new Error("getGroup: id is required");
7
+ return wixCall("GET", `/social-groups-proxy/groups/v2/groups/${encodeURIComponent(id)}`, void 0, opts);
8
+ }
2
9
  function createGroup(group) {
3
10
  return wixCall("POST", "/social-groups-proxy/groups/v2/groups", { group });
4
11
  }
@@ -22,6 +29,37 @@ function queryMembers(groupId, limit = 30) {
22
29
  if (!groupId) throw new Error("queryMembers: groupId is required");
23
30
  return wixCall("POST", `/social-groups-proxy/members/v2/groups/${encodeURIComponent(groupId)}/members/query`, { query: { paging: { limit } } });
24
31
  }
32
+ function listJoinGroupRequests(groupId, limit = 30, offset = 0) {
33
+ if (!groupId) throw new Error("listJoinGroupRequests: groupId is required");
34
+ return wixCall("GET", `/social-groups-proxy/join/v2/groups/${encodeURIComponent(groupId)}/join-requests?limit=${limit}&offset=${offset}`);
35
+ }
36
+ function approveJoinGroupRequests(groupId, memberIds) {
37
+ if (!groupId) throw new Error("approveJoinGroupRequests: groupId is required");
38
+ return wixCall("POST", `/social-groups-proxy/join/v2/groups/${encodeURIComponent(groupId)}/join-requests/approve`, { groupId, memberIds });
39
+ }
40
+ function rejectJoinGroupRequests(groupId, rejections) {
41
+ if (!groupId) throw new Error("rejectJoinGroupRequests: groupId is required");
42
+ return wixCall("POST", `/social-groups-proxy/join/v2/groups/${encodeURIComponent(groupId)}/join-requests/reject`, { groupId, rejections });
43
+ }
44
+ function assignRole(groupId, memberIds, role) {
45
+ if (!groupId) throw new Error("assignRole: groupId is required");
46
+ return wixCall("POST", `/social-groups-proxy/roles/v2/groups/${encodeURIComponent(groupId)}/roles/assign`, { groupId, memberIds, role: { value: role } });
47
+ }
48
+ function unassignRole(groupId, memberIds, role) {
49
+ if (!groupId) throw new Error("unassignRole: groupId is required");
50
+ return wixCall("POST", `/social-groups-proxy/roles/v2/groups/${encodeURIComponent(groupId)}/roles/unassign`, { groupId, memberIds, role: { value: role } });
51
+ }
52
+ function removeGroupMembers(groupId, memberIds) {
53
+ if (!groupId) throw new Error("removeGroupMembers: groupId is required");
54
+ const qs = memberIds.map((id) => `memberIds=${encodeURIComponent(id)}`).join("&");
55
+ return wixCall(
56
+ "DELETE",
57
+ `/social-groups-proxy/members/v2/groups/${encodeURIComponent(groupId)}/members?${qs}`
58
+ );
59
+ }
60
+ function updateGroupSettings(groupId, settings) {
61
+ return updateGroup(groupId, { settings });
62
+ }
25
63
 
26
64
  // ../../stdlib/wix-sdk/groups/src/index.ts
27
65
  function wixCallHeaders(opts) {
@@ -41,32 +79,22 @@ function wixCall(method, path, body, opts) {
41
79
  wixCallHeaders(opts)
42
80
  );
43
81
  }
44
- function queryGroups(req = {}, opts) {
45
- return wixCall(
46
- "POST",
47
- "/social-groups-proxy/groups/v2/groups/query",
48
- { query: req },
49
- opts
50
- );
51
- }
52
- function getGroup(id, opts) {
53
- if (!id) throw new Error("getGroup: id is required");
54
- return wixCall(
55
- "GET",
56
- `/social-groups-proxy/groups/v2/groups/${encodeURIComponent(id)}`,
57
- void 0,
58
- opts
59
- );
60
- }
61
82
  export {
83
+ approveJoinGroupRequests,
84
+ assignRole,
62
85
  createGroup,
63
86
  deleteGroup,
64
87
  getGroup,
65
88
  joinGroup,
66
89
  leaveGroup,
90
+ listJoinGroupRequests,
67
91
  queryGroups,
68
92
  queryMembers,
93
+ rejectJoinGroupRequests,
94
+ removeGroupMembers,
95
+ unassignRole,
69
96
  updateGroup,
97
+ updateGroupSettings,
70
98
  wixCall
71
99
  };
72
100
  //# sourceMappingURL=wix-groups.mjs.map