@wix/groups 1.0.91 → 1.0.92

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.
@@ -83,6 +83,15 @@ interface Group$2 {
83
83
  */
84
84
  lastActivityDate?: Date;
85
85
  }
86
+ declare enum Type$2 {
87
+ UNKNOWN = "UNKNOWN",
88
+ ADMIN_APPROVAL = "ADMIN_APPROVAL",
89
+ PAID_PLANS = "PAID_PLANS",
90
+ EVENTS = "EVENTS"
91
+ }
92
+ interface Events$2 {
93
+ eventIds?: string[];
94
+ }
86
95
  interface Logo$2 {
87
96
  /** Logo image ID (for internal use). */
88
97
  mediaId?: string | null;
@@ -91,6 +100,12 @@ interface Logo$2 {
91
100
  /** Logo image height. */
92
101
  height?: number | null;
93
102
  }
103
+ interface GroupDetailsPosition$2 {
104
+ /** horizontal coordinate */
105
+ x?: number;
106
+ /** vertical coordinate */
107
+ y?: number;
108
+ }
94
109
  interface Image$2 {
95
110
  /** Image ID (for internal use). */
96
111
  mediaId?: string | null;
@@ -105,6 +120,22 @@ interface Position$2 {
105
120
  /** vertical coordinate */
106
121
  y?: number;
107
122
  }
123
+ declare enum AllowPolicy$2 {
124
+ UNKNOWN = "UNKNOWN",
125
+ OWNER_AND_ADMINS = "OWNER_AND_ADMINS",
126
+ OWNER = "OWNER",
127
+ ALL_MEMBERS = "ALL_MEMBERS"
128
+ }
129
+ interface OnboardingStepSettings$2 {
130
+ stepKey?: StepKey$2;
131
+ visible?: boolean;
132
+ }
133
+ declare enum StepKey$2 {
134
+ UNKNOWN = "UNKNOWN",
135
+ CREATE_POST = "CREATE_POST",
136
+ REACT_TO_POST = "REACT_TO_POST",
137
+ INVITE_MEMBERS = "INVITE_MEMBERS"
138
+ }
108
139
  declare enum PrivacyStatus$2 {
109
140
  UNKNOWN = "UNKNOWN",
110
141
  /** Anyone can see the group in the group list and view its content. Anyone can join. */
@@ -114,6 +145,14 @@ declare enum PrivacyStatus$2 {
114
145
  /** Only group members and admins can see the group in the group list. New group members can only be added by existing group members. */
115
146
  SECRET = "SECRET"
116
147
  }
148
+ interface AccessRestriction$2 extends AccessRestrictionDataOneOf$2 {
149
+ events?: Events$2;
150
+ type?: Type$2;
151
+ }
152
+ /** @oneof */
153
+ interface AccessRestrictionDataOneOf$2 {
154
+ events?: Events$2;
155
+ }
117
156
  interface GroupDetails$2 {
118
157
  /** Group logo. You cannot upload your own logo. */
119
158
  logo?: Logo$2;
@@ -165,11 +204,33 @@ declare enum IdentityType$2 {
165
204
  USER = "USER",
166
205
  MEMBER = "MEMBER"
167
206
  }
207
+ interface CreateGroupRequest {
208
+ /** Group to create. */
209
+ group: Group$2;
210
+ /** ID of the member who created the group. This member will automatically become an admin. */
211
+ creatorId?: string | null;
212
+ /** Content Type */
213
+ contentType?: ContentType;
214
+ }
168
215
  declare enum ContentType {
169
216
  PLAIN_TEXT = "PLAIN_TEXT",
170
217
  DRAFTJS = "DRAFTJS",
171
218
  RICH_CONTENT = "RICH_CONTENT"
172
219
  }
220
+ interface CreateGroupResponse {
221
+ /** Created group. */
222
+ group?: Group$2;
223
+ }
224
+ interface UpdateGroupRequest {
225
+ /** Group to update. */
226
+ group: Group$2;
227
+ /** Content Type */
228
+ contentType?: ContentType;
229
+ }
230
+ interface UpdateGroupResponse {
231
+ /** Updated group. */
232
+ group?: Group$2;
233
+ }
173
234
  interface GroupCoverChanged {
174
235
  oldUrl?: string | null;
175
236
  newUrl?: string | null;
@@ -178,14 +239,43 @@ interface GroupDescriptionChanged {
178
239
  oldDescription?: string | null;
179
240
  newDescription?: string | null;
180
241
  }
242
+ interface DeleteGroupRequest {
243
+ /** ID of the group to delete. */
244
+ groupId: string;
245
+ }
181
246
  interface DeleteGroupResponse {
182
247
  /** Deleted group. */
183
248
  group?: Group$2;
184
249
  }
250
+ interface GetGroupRequest {
251
+ /** ID of the group to retrieve. */
252
+ groupId: string;
253
+ /** Content type (PLAIN_TEXT returns content as it is) */
254
+ contentType?: ContentType;
255
+ }
256
+ interface GetGroupResponse {
257
+ /** Retrieved group. */
258
+ group?: Group$2;
259
+ }
260
+ interface GetGroupBySlugRequest {
261
+ /** Unique part of the group's URL, for example `group-1` in `https:/example.com/groups/group-1`. Pass only the slug. Case-sensitive. */
262
+ slug: string;
263
+ autoInviteId?: string | null;
264
+ /** Content type (PLAIN_TEXT returns content as it is) */
265
+ contentType?: ContentType;
266
+ }
185
267
  interface GetGroupBySlugResponse {
186
268
  /** Retrieved group. */
187
269
  group?: Group$2;
188
270
  }
271
+ interface ListGroupsRequest {
272
+ /** Number of items to load. Maximum `100`. */
273
+ limit?: number | null;
274
+ /** Number of items to skip in the current sort order. */
275
+ offset?: number | null;
276
+ /** Content type (PLAIN_TEXT returns content as it is) */
277
+ contentType?: ContentType;
278
+ }
189
279
  interface ListGroupsResponse {
190
280
  /** Retrieved Groups. */
191
281
  groups?: Group$2[];
@@ -201,6 +291,201 @@ interface PagingMetadata$6 {
201
291
  /** Flag that indicates the server failed to calculate the `total` field. */
202
292
  tooManyToCount?: boolean | null;
203
293
  }
294
+ interface ListGroupsByUserIdRequest {
295
+ /** Content type (PLAIN_TEXT returns content as it is) */
296
+ contentType?: ContentType;
297
+ }
298
+ interface ListGroupsByUserIdResponse {
299
+ groups?: GroupWithMsId[];
300
+ }
301
+ /** Retrieved Groups by metasite id */
302
+ interface GroupWithMsId {
303
+ metaSiteId?: string;
304
+ groups?: Group$2[];
305
+ }
306
+ interface QueryGroupsRequest {
307
+ query?: Query$5;
308
+ /** Content type (PLAIN_TEXT returns content as it is) */
309
+ contentType?: ContentType;
310
+ }
311
+ interface Query$5 {
312
+ /**
313
+ * Filter object in the following format:
314
+ * `"filter" : {
315
+ * "fieldName1": "value1",
316
+ * "fieldName2":{"$operator":"value2"}
317
+ * }`
318
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
319
+ */
320
+ filter?: any;
321
+ /**
322
+ * Sort object in the following format:
323
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
324
+ */
325
+ sort?: Sorting$5[];
326
+ /** Paging options to limit and skip the number of items. */
327
+ paging?: Paging$6;
328
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
329
+ fields?: string[];
330
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
331
+ fieldsets?: string[];
332
+ }
333
+ interface Sorting$5 {
334
+ /** Name of the field to sort by. */
335
+ fieldName?: string;
336
+ /** Sort order. */
337
+ order?: SortOrder$5;
338
+ }
339
+ declare enum SortOrder$5 {
340
+ ASC = "ASC",
341
+ DESC = "DESC"
342
+ }
343
+ interface Paging$6 {
344
+ /** Number of items to load. */
345
+ limit?: number | null;
346
+ /** Number of items to skip in the current sort order. */
347
+ offset?: number | null;
348
+ }
349
+ interface QueryGroupsResponse {
350
+ /** Retrieved groups. */
351
+ groups?: Group$2[];
352
+ metadata?: PagingMetadata$6;
353
+ }
354
+ interface QueryJoinedGroupsRequest {
355
+ query?: Query$5;
356
+ /** Content type (PLAIN_TEXT returns content as it is) */
357
+ contentType?: ContentType;
358
+ }
359
+ interface QueryJoinedGroupsResponse {
360
+ /** Retrieved groups. */
361
+ groups?: Group$2[];
362
+ metadata?: PagingMetadata$6;
363
+ }
364
+ interface QueryGroupsByMembershipRequest {
365
+ query?: Query$5;
366
+ membershipStatus?: MembershipStatus$1;
367
+ /** Filter groups by permissions. */
368
+ permissionsFilter?: GroupPermissions;
369
+ /** Content type (PLAIN_TEXT returns content as it is) */
370
+ contentType?: ContentType;
371
+ }
372
+ declare enum MembershipStatus$1 {
373
+ NONE = "NONE",
374
+ JOINED = "JOINED",
375
+ PENDING = "PENDING"
376
+ }
377
+ interface GroupPermissions {
378
+ canCreatePosts?: boolean | null;
379
+ }
380
+ interface QueryGroupsByMembershipResponse {
381
+ /** Retrieved groups. */
382
+ groups?: Group$2[];
383
+ metadata?: PagingMetadata$6;
384
+ }
385
+ interface ListGroupIntegrationsDataRequest {
386
+ groupIds?: string[];
387
+ }
388
+ interface ListGroupIntegrationsDataResponse {
389
+ groupsIntegrationsData?: GroupIntegrationsData[];
390
+ }
391
+ interface GroupIntegrationsData {
392
+ groupId?: string;
393
+ feedItemsCount?: number;
394
+ topicIds?: string[];
395
+ eventIds?: string[];
396
+ connectedPricingPlanIds?: string[];
397
+ onlineProgramIds?: string[];
398
+ }
399
+ interface GetGroupMembersGroupIdsRequest {
400
+ /** ID of the group to retrieve members group ids. */
401
+ groupId?: string;
402
+ }
403
+ interface GetGroupMembersGroupIdsResponse {
404
+ /** All members group id */
405
+ allMembersGroupId?: string;
406
+ /** Admins members group id */
407
+ adminMembersGroupId?: string;
408
+ }
409
+ interface DomainEvent$7 extends DomainEventBodyOneOf$7 {
410
+ createdEvent?: EntityCreatedEvent$7;
411
+ updatedEvent?: EntityUpdatedEvent$7;
412
+ deletedEvent?: EntityDeletedEvent$7;
413
+ actionEvent?: ActionEvent$7;
414
+ /**
415
+ * Unique event ID.
416
+ * Allows clients to ignore duplicate webhooks.
417
+ */
418
+ _id?: string;
419
+ /**
420
+ * Assumes actions are also always typed to an entity_type
421
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
422
+ */
423
+ entityFqdn?: string;
424
+ /**
425
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
426
+ * This is although the created/updated/deleted notion is duplication of the oneof types
427
+ * Example: created/updated/deleted/started/completed/email_opened
428
+ */
429
+ slug?: string;
430
+ /** ID of the entity associated with the event. */
431
+ entityId?: string;
432
+ /** Event timestamp. */
433
+ eventTime?: Date;
434
+ /**
435
+ * Whether the event was triggered as a result of a privacy regulation application
436
+ * (for example, GDPR).
437
+ */
438
+ triggeredByAnonymizeRequest?: boolean | null;
439
+ /** If present, indicates the action that triggered the event. */
440
+ originatedFrom?: string | null;
441
+ /**
442
+ * A sequence number defining the order of updates to the underlying entity.
443
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
444
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
445
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
446
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
447
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
448
+ */
449
+ entityEventSequence?: string | null;
450
+ }
451
+ /** @oneof */
452
+ interface DomainEventBodyOneOf$7 {
453
+ createdEvent?: EntityCreatedEvent$7;
454
+ updatedEvent?: EntityUpdatedEvent$7;
455
+ deletedEvent?: EntityDeletedEvent$7;
456
+ actionEvent?: ActionEvent$7;
457
+ }
458
+ interface EntityCreatedEvent$7 {
459
+ entity?: string;
460
+ }
461
+ interface RestoreInfo$7 {
462
+ deletedDate?: Date;
463
+ }
464
+ interface EntityUpdatedEvent$7 {
465
+ /**
466
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
467
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
468
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
469
+ */
470
+ currentEntity?: string;
471
+ }
472
+ interface EntityDeletedEvent$7 {
473
+ /** Entity that was deleted */
474
+ deletedEntity?: string | null;
475
+ }
476
+ interface ActionEvent$7 {
477
+ body?: string;
478
+ }
479
+ interface MessageEnvelope$7 {
480
+ /** App instance ID. */
481
+ instanceId?: string | null;
482
+ /** Event type. */
483
+ eventType?: string;
484
+ /** The identification type and identity data. */
485
+ identity?: IdentificationData$7;
486
+ /** Stringify payload. */
487
+ data?: string;
488
+ }
204
489
  interface IdentificationData$7 extends IdentificationDataIdOneOf$7 {
205
490
  /** ID of a site visitor that has not logged in to the site. */
206
491
  anonymousVisitorId?: string;
@@ -231,62 +516,73 @@ declare enum WebhookIdentityType$7 {
231
516
  WIX_USER = "WIX_USER",
232
517
  APP = "APP"
233
518
  }
519
+ interface EventsNonNullableFields$2 {
520
+ eventIds: string[];
521
+ }
522
+ interface AccessRestrictionNonNullableFields$2 {
523
+ events?: EventsNonNullableFields$2;
524
+ type: Type$2;
525
+ }
526
+ interface GroupDetailsPositionNonNullableFields$2 {
527
+ x: number;
528
+ y: number;
529
+ }
530
+ interface GroupDetailsNonNullableFields$2 {
531
+ logoPosition?: GroupDetailsPositionNonNullableFields$2;
532
+ mobileLogoPosition?: GroupDetailsPositionNonNullableFields$2;
533
+ }
534
+ interface PositionNonNullableFields$2 {
535
+ x: number;
536
+ y: number;
537
+ }
538
+ interface CoverImageNonNullableFields$2 {
539
+ position?: PositionNonNullableFields$2;
540
+ mobilePosition?: PositionNonNullableFields$2;
541
+ }
542
+ interface OnboardingStepSettingsNonNullableFields$2 {
543
+ stepKey: StepKey$2;
544
+ visible: boolean;
545
+ }
546
+ interface GroupSettingsNonNullableFields$2 {
547
+ allowedToInviteMembers: AllowPolicy$2;
548
+ allowedToApproveJoinRequests: AllowPolicy$2;
549
+ allowedToAddMembers: AllowPolicy$2;
550
+ allowedToCreatePosts: AllowPolicy$2;
551
+ allowedToCommentPosts: AllowPolicy$2;
552
+ onboardingStepsSettings: OnboardingStepSettingsNonNullableFields$2[];
553
+ }
554
+ interface IdentityNonNullableFields$2 {
555
+ identityType: IdentityType$2;
556
+ }
557
+ interface GroupNonNullableFields$2 {
558
+ privacyLevel: PrivacyStatus$2;
559
+ privacyStatus: PrivacyStatus$2;
560
+ accessRestriction?: AccessRestrictionNonNullableFields$2;
561
+ details?: GroupDetailsNonNullableFields$2;
562
+ coverImage?: CoverImageNonNullableFields$2;
563
+ settings?: GroupSettingsNonNullableFields$2;
564
+ createdBy?: IdentityNonNullableFields$2;
565
+ }
566
+ interface CreateGroupResponseNonNullableFields {
567
+ group?: GroupNonNullableFields$2;
568
+ }
569
+ interface UpdateGroupResponseNonNullableFields {
570
+ group?: GroupNonNullableFields$2;
571
+ }
234
572
  interface DeleteGroupResponseNonNullableFields {
235
- group?: {
236
- privacyLevel: PrivacyStatus$2;
237
- privacyStatus: PrivacyStatus$2;
238
- coverImage?: {
239
- position?: {
240
- x: number;
241
- y: number;
242
- };
243
- mobilePosition?: {
244
- x: number;
245
- y: number;
246
- };
247
- };
248
- createdBy?: {
249
- identityType: IdentityType$2;
250
- };
251
- };
573
+ group?: GroupNonNullableFields$2;
574
+ }
575
+ interface GetGroupResponseNonNullableFields {
576
+ group?: GroupNonNullableFields$2;
252
577
  }
253
578
  interface GetGroupBySlugResponseNonNullableFields {
254
- group?: {
255
- privacyLevel: PrivacyStatus$2;
256
- privacyStatus: PrivacyStatus$2;
257
- coverImage?: {
258
- position?: {
259
- x: number;
260
- y: number;
261
- };
262
- mobilePosition?: {
263
- x: number;
264
- y: number;
265
- };
266
- };
267
- createdBy?: {
268
- identityType: IdentityType$2;
269
- };
270
- };
579
+ group?: GroupNonNullableFields$2;
271
580
  }
272
581
  interface ListGroupsResponseNonNullableFields {
273
- groups: {
274
- privacyLevel: PrivacyStatus$2;
275
- privacyStatus: PrivacyStatus$2;
276
- coverImage?: {
277
- position?: {
278
- x: number;
279
- y: number;
280
- };
281
- mobilePosition?: {
282
- x: number;
283
- y: number;
284
- };
285
- };
286
- createdBy?: {
287
- identityType: IdentityType$2;
288
- };
289
- }[];
582
+ groups: GroupNonNullableFields$2[];
583
+ }
584
+ interface QueryGroupsResponseNonNullableFields {
585
+ groups: GroupNonNullableFields$2[];
290
586
  }
291
587
  interface BaseEventMetadata$7 {
292
588
  /** App instance ID. */
@@ -509,41 +805,42 @@ interface GroupsQueryBuilder {
509
805
  find: () => Promise<GroupsQueryResult>;
510
806
  }
511
807
 
512
- type RESTFunctionDescriptor$8<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$8) => T;
513
- interface HttpClient$8 {
514
- request<TResponse, TData = any>(req: RequestOptionsFactory$8<TResponse, TData>): Promise<HttpResponse$8<TResponse>>;
515
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
808
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
809
+ interface HttpClient {
810
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
811
+ fetchWithAuth: typeof fetch;
812
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
516
813
  }
517
- type RequestOptionsFactory$8<TResponse = any, TData = any> = (context: any) => RequestOptions$8<TResponse, TData>;
518
- type HttpResponse$8<T = any> = {
814
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
815
+ type HttpResponse<T = any> = {
519
816
  data: T;
520
817
  status: number;
521
818
  statusText: string;
522
819
  headers: any;
523
820
  request?: any;
524
821
  };
525
- type RequestOptions$8<_TResponse = any, Data = any> = {
822
+ type RequestOptions<_TResponse = any, Data = any> = {
526
823
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
527
824
  url: string;
528
825
  data?: Data;
529
826
  params?: URLSearchParams;
530
- } & APIMetadata$8;
531
- type APIMetadata$8 = {
827
+ } & APIMetadata;
828
+ type APIMetadata = {
532
829
  methodFqn?: string;
533
830
  entityFqdn?: string;
534
831
  packageName?: string;
535
832
  };
536
- type BuildRESTFunction$8<T extends RESTFunctionDescriptor$8> = T extends RESTFunctionDescriptor$8<infer U> ? U : never;
537
- type EventDefinition$7<Payload = unknown, Type extends string = string> = {
833
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
834
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
538
835
  __type: 'event-definition';
539
836
  type: Type;
540
837
  isDomainEvent?: boolean;
541
838
  transformations?: (envelope: unknown) => Payload;
542
839
  __payload: Payload;
543
840
  };
544
- declare function EventDefinition$7<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$7<Payload, Type>;
545
- type EventHandler$7<T extends EventDefinition$7> = (payload: T['__payload']) => void | Promise<void>;
546
- type BuildEventDefinition$7<T extends EventDefinition$7<any, string>> = (handler: EventHandler$7<T>) => void;
841
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
842
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
843
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
547
844
 
548
845
  declare global {
549
846
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -552,80 +849,75 @@ declare global {
552
849
  }
553
850
  }
554
851
 
555
- declare function createGroup$1(httpClient: HttpClient$8): (group: Group$2, options?: CreateGroupOptions) => Promise<Group$2 & {
556
- privacyLevel: PrivacyStatus$2;
557
- privacyStatus: PrivacyStatus$2;
558
- coverImage?: {
559
- position?: {
560
- x: number;
561
- y: number;
562
- } | undefined;
563
- mobilePosition?: {
564
- x: number;
565
- y: number;
566
- } | undefined;
567
- } | undefined;
568
- createdBy?: {
569
- identityType: IdentityType$2;
570
- } | undefined;
571
- }>;
572
- declare function updateGroup$1(httpClient: HttpClient$8): (_id: string | null, group: UpdateGroup, options?: UpdateGroupOptions) => Promise<Group$2 & {
573
- privacyLevel: PrivacyStatus$2;
574
- privacyStatus: PrivacyStatus$2;
575
- coverImage?: {
576
- position?: {
577
- x: number;
578
- y: number;
579
- } | undefined;
580
- mobilePosition?: {
581
- x: number;
582
- y: number;
583
- } | undefined;
584
- } | undefined;
585
- createdBy?: {
586
- identityType: IdentityType$2;
587
- } | undefined;
588
- }>;
589
- declare function deleteGroup$1(httpClient: HttpClient$8): (groupId: string) => Promise<DeleteGroupResponse & DeleteGroupResponseNonNullableFields>;
590
- declare function getGroup$1(httpClient: HttpClient$8): (groupId: string, options?: GetGroupOptions) => Promise<Group$2 & {
591
- privacyLevel: PrivacyStatus$2;
592
- privacyStatus: PrivacyStatus$2;
593
- coverImage?: {
594
- position?: {
595
- x: number;
596
- y: number;
597
- } | undefined;
598
- mobilePosition?: {
599
- x: number;
600
- y: number;
601
- } | undefined;
602
- } | undefined;
603
- createdBy?: {
604
- identityType: IdentityType$2;
605
- } | undefined;
606
- }>;
607
- declare function getGroupBySlug$1(httpClient: HttpClient$8): (slug: string, options?: GetGroupBySlugOptions) => Promise<GetGroupBySlugResponse & GetGroupBySlugResponseNonNullableFields>;
608
- declare function listGroups$1(httpClient: HttpClient$8): (options?: ListGroupsOptions) => Promise<ListGroupsResponse & ListGroupsResponseNonNullableFields>;
609
- declare function queryGroups$1(httpClient: HttpClient$8): (options?: QueryGroupsOptions) => GroupsQueryBuilder;
610
- declare const onGroupCreated$1: EventDefinition$7<GroupCreatedEnvelope, "wix.social_groups.v2.group_created">;
611
- declare const onGroupUpdated$1: EventDefinition$7<GroupUpdatedEnvelope, "wix.social_groups.v2.group_updated">;
612
- declare const onGroupCoverChanged$1: EventDefinition$7<GroupCoverChangedEnvelope, "wix.social_groups.v2.group_group_cover_changed">;
613
- declare const onGroupDescriptionChanged$1: EventDefinition$7<GroupDescriptionChangedEnvelope, "wix.social_groups.v2.group_group_description_changed">;
614
- declare const onGroupDeleted$1: EventDefinition$7<GroupDeletedEnvelope, "wix.social_groups.v2.group_deleted">;
852
+ declare function createRESTModule$8<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
853
+
854
+ declare function createEventModule$7<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
615
855
 
616
- declare const createGroup: BuildRESTFunction$8<typeof createGroup$1>;
617
- declare const updateGroup: BuildRESTFunction$8<typeof updateGroup$1>;
618
- declare const deleteGroup: BuildRESTFunction$8<typeof deleteGroup$1>;
619
- declare const getGroup: BuildRESTFunction$8<typeof getGroup$1>;
620
- declare const getGroupBySlug: BuildRESTFunction$8<typeof getGroupBySlug$1>;
621
- declare const listGroups: BuildRESTFunction$8<typeof listGroups$1>;
622
- declare const queryGroups: BuildRESTFunction$8<typeof queryGroups$1>;
623
- declare const onGroupCreated: BuildEventDefinition$7<typeof onGroupCreated$1>;
624
- declare const onGroupUpdated: BuildEventDefinition$7<typeof onGroupUpdated$1>;
625
- declare const onGroupCoverChanged: BuildEventDefinition$7<typeof onGroupCoverChanged$1>;
626
- declare const onGroupDescriptionChanged: BuildEventDefinition$7<typeof onGroupDescriptionChanged$1>;
627
- declare const onGroupDeleted: BuildEventDefinition$7<typeof onGroupDeleted$1>;
856
+ declare const createGroup: ReturnType<typeof createRESTModule$8<typeof publicCreateGroup>>;
857
+ declare const updateGroup: ReturnType<typeof createRESTModule$8<typeof publicUpdateGroup>>;
858
+ declare const deleteGroup: ReturnType<typeof createRESTModule$8<typeof publicDeleteGroup>>;
859
+ declare const getGroup: ReturnType<typeof createRESTModule$8<typeof publicGetGroup>>;
860
+ declare const getGroupBySlug: ReturnType<typeof createRESTModule$8<typeof publicGetGroupBySlug>>;
861
+ declare const listGroups: ReturnType<typeof createRESTModule$8<typeof publicListGroups>>;
862
+ declare const queryGroups: ReturnType<typeof createRESTModule$8<typeof publicQueryGroups>>;
863
+ declare const onGroupCreated: ReturnType<typeof createEventModule$7<typeof publicOnGroupCreated>>;
864
+ declare const onGroupUpdated: ReturnType<typeof createEventModule$7<typeof publicOnGroupUpdated>>;
865
+ declare const onGroupCoverChanged: ReturnType<typeof createEventModule$7<typeof publicOnGroupCoverChanged>>;
866
+ declare const onGroupDescriptionChanged: ReturnType<typeof createEventModule$7<typeof publicOnGroupDescriptionChanged>>;
867
+ declare const onGroupDeleted: ReturnType<typeof createEventModule$7<typeof publicOnGroupDeleted>>;
628
868
 
869
+ type context$8_ContentType = ContentType;
870
+ declare const context$8_ContentType: typeof ContentType;
871
+ type context$8_CreateGroupOptions = CreateGroupOptions;
872
+ type context$8_CreateGroupRequest = CreateGroupRequest;
873
+ type context$8_CreateGroupResponse = CreateGroupResponse;
874
+ type context$8_CreateGroupResponseNonNullableFields = CreateGroupResponseNonNullableFields;
875
+ type context$8_DeleteGroupRequest = DeleteGroupRequest;
876
+ type context$8_DeleteGroupResponse = DeleteGroupResponse;
877
+ type context$8_DeleteGroupResponseNonNullableFields = DeleteGroupResponseNonNullableFields;
878
+ type context$8_GetGroupBySlugOptions = GetGroupBySlugOptions;
879
+ type context$8_GetGroupBySlugRequest = GetGroupBySlugRequest;
880
+ type context$8_GetGroupBySlugResponse = GetGroupBySlugResponse;
881
+ type context$8_GetGroupBySlugResponseNonNullableFields = GetGroupBySlugResponseNonNullableFields;
882
+ type context$8_GetGroupMembersGroupIdsRequest = GetGroupMembersGroupIdsRequest;
883
+ type context$8_GetGroupMembersGroupIdsResponse = GetGroupMembersGroupIdsResponse;
884
+ type context$8_GetGroupOptions = GetGroupOptions;
885
+ type context$8_GetGroupRequest = GetGroupRequest;
886
+ type context$8_GetGroupResponse = GetGroupResponse;
887
+ type context$8_GetGroupResponseNonNullableFields = GetGroupResponseNonNullableFields;
888
+ type context$8_GroupCoverChanged = GroupCoverChanged;
889
+ type context$8_GroupCoverChangedEnvelope = GroupCoverChangedEnvelope;
890
+ type context$8_GroupCreatedEnvelope = GroupCreatedEnvelope;
891
+ type context$8_GroupDeletedEnvelope = GroupDeletedEnvelope;
892
+ type context$8_GroupDescriptionChanged = GroupDescriptionChanged;
893
+ type context$8_GroupDescriptionChangedEnvelope = GroupDescriptionChangedEnvelope;
894
+ type context$8_GroupIntegrationsData = GroupIntegrationsData;
895
+ type context$8_GroupPermissions = GroupPermissions;
896
+ type context$8_GroupUpdatedEnvelope = GroupUpdatedEnvelope;
897
+ type context$8_GroupWithMsId = GroupWithMsId;
898
+ type context$8_GroupsQueryBuilder = GroupsQueryBuilder;
899
+ type context$8_GroupsQueryResult = GroupsQueryResult;
900
+ type context$8_ListGroupIntegrationsDataRequest = ListGroupIntegrationsDataRequest;
901
+ type context$8_ListGroupIntegrationsDataResponse = ListGroupIntegrationsDataResponse;
902
+ type context$8_ListGroupsByUserIdRequest = ListGroupsByUserIdRequest;
903
+ type context$8_ListGroupsByUserIdResponse = ListGroupsByUserIdResponse;
904
+ type context$8_ListGroupsOptions = ListGroupsOptions;
905
+ type context$8_ListGroupsRequest = ListGroupsRequest;
906
+ type context$8_ListGroupsResponse = ListGroupsResponse;
907
+ type context$8_ListGroupsResponseNonNullableFields = ListGroupsResponseNonNullableFields;
908
+ type context$8_QueryGroupsByMembershipRequest = QueryGroupsByMembershipRequest;
909
+ type context$8_QueryGroupsByMembershipResponse = QueryGroupsByMembershipResponse;
910
+ type context$8_QueryGroupsOptions = QueryGroupsOptions;
911
+ type context$8_QueryGroupsRequest = QueryGroupsRequest;
912
+ type context$8_QueryGroupsResponse = QueryGroupsResponse;
913
+ type context$8_QueryGroupsResponseNonNullableFields = QueryGroupsResponseNonNullableFields;
914
+ type context$8_QueryJoinedGroupsRequest = QueryJoinedGroupsRequest;
915
+ type context$8_QueryJoinedGroupsResponse = QueryJoinedGroupsResponse;
916
+ type context$8_UpdateGroup = UpdateGroup;
917
+ type context$8_UpdateGroupOptions = UpdateGroupOptions;
918
+ type context$8_UpdateGroupRequest = UpdateGroupRequest;
919
+ type context$8_UpdateGroupResponse = UpdateGroupResponse;
920
+ type context$8_UpdateGroupResponseNonNullableFields = UpdateGroupResponseNonNullableFields;
629
921
  declare const context$8_createGroup: typeof createGroup;
630
922
  declare const context$8_deleteGroup: typeof deleteGroup;
631
923
  declare const context$8_getGroup: typeof getGroup;
@@ -639,7 +931,7 @@ declare const context$8_onGroupUpdated: typeof onGroupUpdated;
639
931
  declare const context$8_queryGroups: typeof queryGroups;
640
932
  declare const context$8_updateGroup: typeof updateGroup;
641
933
  declare namespace context$8 {
642
- export { context$8_createGroup as createGroup, context$8_deleteGroup as deleteGroup, context$8_getGroup as getGroup, context$8_getGroupBySlug as getGroupBySlug, context$8_listGroups as listGroups, context$8_onGroupCoverChanged as onGroupCoverChanged, context$8_onGroupCreated as onGroupCreated, context$8_onGroupDeleted as onGroupDeleted, context$8_onGroupDescriptionChanged as onGroupDescriptionChanged, context$8_onGroupUpdated as onGroupUpdated, context$8_queryGroups as queryGroups, context$8_updateGroup as updateGroup };
934
+ export { type AccessRestriction$2 as AccessRestriction, type AccessRestrictionDataOneOf$2 as AccessRestrictionDataOneOf, type ActionEvent$7 as ActionEvent, AllowPolicy$2 as AllowPolicy, type BaseEventMetadata$7 as BaseEventMetadata, context$8_ContentType as ContentType, type CoverImage$2 as CoverImage, type context$8_CreateGroupOptions as CreateGroupOptions, type context$8_CreateGroupRequest as CreateGroupRequest, type context$8_CreateGroupResponse as CreateGroupResponse, type context$8_CreateGroupResponseNonNullableFields as CreateGroupResponseNonNullableFields, type context$8_DeleteGroupRequest as DeleteGroupRequest, type context$8_DeleteGroupResponse as DeleteGroupResponse, type context$8_DeleteGroupResponseNonNullableFields as DeleteGroupResponseNonNullableFields, type DomainEvent$7 as DomainEvent, type DomainEventBodyOneOf$7 as DomainEventBodyOneOf, type EntityCreatedEvent$7 as EntityCreatedEvent, type EntityDeletedEvent$7 as EntityDeletedEvent, type EntityUpdatedEvent$7 as EntityUpdatedEvent, type EventMetadata$7 as EventMetadata, type Events$2 as Events, type context$8_GetGroupBySlugOptions as GetGroupBySlugOptions, type context$8_GetGroupBySlugRequest as GetGroupBySlugRequest, type context$8_GetGroupBySlugResponse as GetGroupBySlugResponse, type context$8_GetGroupBySlugResponseNonNullableFields as GetGroupBySlugResponseNonNullableFields, type context$8_GetGroupMembersGroupIdsRequest as GetGroupMembersGroupIdsRequest, type context$8_GetGroupMembersGroupIdsResponse as GetGroupMembersGroupIdsResponse, type context$8_GetGroupOptions as GetGroupOptions, type context$8_GetGroupRequest as GetGroupRequest, type context$8_GetGroupResponse as GetGroupResponse, type context$8_GetGroupResponseNonNullableFields as GetGroupResponseNonNullableFields, type Group$2 as Group, type context$8_GroupCoverChanged as GroupCoverChanged, type context$8_GroupCoverChangedEnvelope as GroupCoverChangedEnvelope, type context$8_GroupCreatedEnvelope as GroupCreatedEnvelope, type context$8_GroupDeletedEnvelope as GroupDeletedEnvelope, type context$8_GroupDescriptionChanged as GroupDescriptionChanged, type context$8_GroupDescriptionChangedEnvelope as GroupDescriptionChangedEnvelope, type GroupDetails$2 as GroupDetails, type GroupDetailsPosition$2 as GroupDetailsPosition, type context$8_GroupIntegrationsData as GroupIntegrationsData, type GroupNonNullableFields$2 as GroupNonNullableFields, type context$8_GroupPermissions as GroupPermissions, type GroupSettings$2 as GroupSettings, type context$8_GroupUpdatedEnvelope as GroupUpdatedEnvelope, type context$8_GroupWithMsId as GroupWithMsId, type context$8_GroupsQueryBuilder as GroupsQueryBuilder, type context$8_GroupsQueryResult as GroupsQueryResult, type IdentificationData$7 as IdentificationData, type IdentificationDataIdOneOf$7 as IdentificationDataIdOneOf, type Identity$2 as Identity, IdentityType$2 as IdentityType, type Image$2 as Image, type context$8_ListGroupIntegrationsDataRequest as ListGroupIntegrationsDataRequest, type context$8_ListGroupIntegrationsDataResponse as ListGroupIntegrationsDataResponse, type context$8_ListGroupsByUserIdRequest as ListGroupsByUserIdRequest, type context$8_ListGroupsByUserIdResponse as ListGroupsByUserIdResponse, type context$8_ListGroupsOptions as ListGroupsOptions, type context$8_ListGroupsRequest as ListGroupsRequest, type context$8_ListGroupsResponse as ListGroupsResponse, type context$8_ListGroupsResponseNonNullableFields as ListGroupsResponseNonNullableFields, type Logo$2 as Logo, MembershipStatus$1 as MembershipStatus, type MessageEnvelope$7 as MessageEnvelope, type OnboardingStepSettings$2 as OnboardingStepSettings, type Paging$6 as Paging, type PagingMetadata$6 as PagingMetadata, type Position$2 as Position, PrivacyStatus$2 as PrivacyStatus, type Query$5 as Query, type context$8_QueryGroupsByMembershipRequest as QueryGroupsByMembershipRequest, type context$8_QueryGroupsByMembershipResponse as QueryGroupsByMembershipResponse, type context$8_QueryGroupsOptions as QueryGroupsOptions, type context$8_QueryGroupsRequest as QueryGroupsRequest, type context$8_QueryGroupsResponse as QueryGroupsResponse, type context$8_QueryGroupsResponseNonNullableFields as QueryGroupsResponseNonNullableFields, type context$8_QueryJoinedGroupsRequest as QueryJoinedGroupsRequest, type context$8_QueryJoinedGroupsResponse as QueryJoinedGroupsResponse, type RestoreInfo$7 as RestoreInfo, SortOrder$5 as SortOrder, type Sorting$5 as Sorting, StepKey$2 as StepKey, Type$2 as Type, type context$8_UpdateGroup as UpdateGroup, type context$8_UpdateGroupOptions as UpdateGroupOptions, type context$8_UpdateGroupRequest as UpdateGroupRequest, type context$8_UpdateGroupResponse as UpdateGroupResponse, type context$8_UpdateGroupResponseNonNullableFields as UpdateGroupResponseNonNullableFields, WebhookIdentityType$7 as WebhookIdentityType, context$8_createGroup as createGroup, context$8_deleteGroup as deleteGroup, context$8_getGroup as getGroup, context$8_getGroupBySlug as getGroupBySlug, context$8_listGroups as listGroups, context$8_onGroupCoverChanged as onGroupCoverChanged, context$8_onGroupCreated as onGroupCreated, context$8_onGroupDeleted as onGroupDeleted, context$8_onGroupDescriptionChanged as onGroupDescriptionChanged, context$8_onGroupUpdated as onGroupUpdated, context$8_queryGroups as queryGroups, context$8_updateGroup as updateGroup };
643
935
  }
644
936
 
645
937
  interface GroupMember$1 {
@@ -682,6 +974,101 @@ declare enum Role$1 {
682
974
  /** Group administrator. */
683
975
  ADMIN = "ADMIN"
684
976
  }
977
+ interface SocialGroupsEvent$1 extends SocialGroupsEventPayloadOneOf$1 {
978
+ memberJoined?: MemberJoinedGroup$1;
979
+ membersAdded?: MembersAddedToGroup$1;
980
+ joinRequestsApproved?: JoinRequestsApproved$1;
981
+ membersInvited?: MembersInvitedToGroup$1;
982
+ }
983
+ /** @oneof */
984
+ interface SocialGroupsEventPayloadOneOf$1 {
985
+ memberJoined?: MemberJoinedGroup$1;
986
+ membersAdded?: MembersAddedToGroup$1;
987
+ joinRequestsApproved?: JoinRequestsApproved$1;
988
+ membersInvited?: MembersInvitedToGroup$1;
989
+ }
990
+ interface MemberJoinedGroup$1 {
991
+ groupId?: string;
992
+ groupsInstanceId?: string;
993
+ siteMemberId?: string;
994
+ }
995
+ interface MembersAddedToGroup$1 {
996
+ groupId?: string;
997
+ groupsInstanceId?: string;
998
+ whoAddedId?: string | null;
999
+ siteMemberIds?: string[];
1000
+ /** Used for Apes sticky experiment */
1001
+ operationId?: string;
1002
+ }
1003
+ interface JoinRequestsApproved$1 {
1004
+ groupId?: string;
1005
+ groupsInstanceId?: string;
1006
+ siteMemberIds?: string[];
1007
+ /** Used for Apes sticky experiment */
1008
+ operationId?: string;
1009
+ }
1010
+ interface MembersInvitedToGroup$1 {
1011
+ groupId?: string;
1012
+ groupsInstanceId?: string;
1013
+ siteMemberIds?: string[];
1014
+ }
1015
+ /** ID of the group to join. */
1016
+ interface JoinRequest$1 {
1017
+ groupId?: string;
1018
+ /** Answers to membership questions. A Join Request will fail, if the answer to a required question is omitted. */
1019
+ membershipQuestionAnswers?: MembershipQuestionAnswer$3[];
1020
+ autoInviteId?: string | null;
1021
+ }
1022
+ /** Answer to a membership question. */
1023
+ interface MembershipQuestionAnswer$3 {
1024
+ /** Question ID. */
1025
+ _id?: string;
1026
+ /** Answer text. */
1027
+ text?: string | null;
1028
+ }
1029
+ interface JoinResponse {
1030
+ /** New member. */
1031
+ member?: GroupMember$1;
1032
+ }
1033
+ interface MemberJoined {
1034
+ /** Group ID that member has joined. */
1035
+ groupId?: string;
1036
+ /** Joined group member. */
1037
+ groupMember?: GroupMember$1;
1038
+ }
1039
+ declare enum JoinBy {
1040
+ MANUALLY = "MANUALLY",
1041
+ PERSONAL_INVITE_LINK = "PERSONAL_INVITE_LINK",
1042
+ PUBLIC_INVITE_LINK = "PUBLIC_INVITE_LINK"
1043
+ }
1044
+ interface LeaveRequest {
1045
+ /** ID of the Group to leave. */
1046
+ groupId?: string;
1047
+ }
1048
+ interface LeaveResponse {
1049
+ }
1050
+ interface MemberLeft {
1051
+ /** Group ID that member has left. */
1052
+ groupId?: string;
1053
+ /** Group member that left. */
1054
+ groupMember?: GroupMember$1;
1055
+ }
1056
+ interface AddGroupMembersRequest {
1057
+ /** Group ID. */
1058
+ groupId: string;
1059
+ /**
1060
+ * @internal
1061
+ * @internal
1062
+ * @deprecated
1063
+ */
1064
+ siteMemberIds?: string[];
1065
+ /**
1066
+ * IDs of the site members to add to the group.
1067
+ *
1068
+ *
1069
+ */
1070
+ memberIds?: string[];
1071
+ }
685
1072
  interface AddGroupMembersResponse {
686
1073
  /** New members. */
687
1074
  members?: GroupMember$1[];
@@ -692,11 +1079,33 @@ interface MemberAdded {
692
1079
  /** Added group member. */
693
1080
  groupMember?: GroupMember$1;
694
1081
  }
695
- interface MemberRemoved {
696
- /** Group ID that member was removed from. */
697
- groupId?: string;
698
- /** Removed group member. */
699
- groupMember?: GroupMember$1;
1082
+ interface RemoveGroupMembersRequest {
1083
+ /** Group ID. */
1084
+ groupId: string;
1085
+ /**
1086
+ * @internal
1087
+ * @internal
1088
+ * @deprecated
1089
+ */
1090
+ siteMemberIds?: string[];
1091
+ /** IDs of the site members to remove from the group. */
1092
+ memberIds?: string[];
1093
+ }
1094
+ interface RemoveGroupMembersResponse {
1095
+ }
1096
+ interface MemberRemoved {
1097
+ /** Group ID that member was removed from. */
1098
+ groupId?: string;
1099
+ /** Removed group member. */
1100
+ groupMember?: GroupMember$1;
1101
+ }
1102
+ interface ListGroupMembersRequest {
1103
+ /** Group ID. */
1104
+ groupId: string;
1105
+ /** Number of items to load. Maximum `100.` */
1106
+ limit?: number | null;
1107
+ /** Number of group members to skip in the list. */
1108
+ offset?: number | null;
700
1109
  }
701
1110
  interface ListGroupMembersResponse {
702
1111
  /** Retrieved members. */
@@ -714,7 +1123,12 @@ interface PagingMetadata$5 {
714
1123
  /** Flag that indicates the server failed to calculate the `total` field. */
715
1124
  tooManyToCount?: boolean | null;
716
1125
  }
717
- interface Query$2 {
1126
+ interface QueryGroupMembersRequest {
1127
+ /** Group ID. */
1128
+ groupId: string;
1129
+ query?: Query$4;
1130
+ }
1131
+ interface Query$4 {
718
1132
  /**
719
1133
  * Filter object in the following format:
720
1134
  * `"filter" : {
@@ -728,30 +1142,53 @@ interface Query$2 {
728
1142
  * Sort object in the following format:
729
1143
  * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
730
1144
  */
731
- sort?: Sorting$2[];
1145
+ sort?: Sorting$4[];
732
1146
  /** Paging options to limit and skip the number of items. */
733
- paging?: Paging$3;
1147
+ paging?: Paging$5;
734
1148
  /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
735
1149
  fields?: string[];
736
1150
  /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
737
1151
  fieldsets?: string[];
738
1152
  }
739
- interface Sorting$2 {
1153
+ interface Sorting$4 {
740
1154
  /** Name of the field to sort by. */
741
1155
  fieldName?: string;
742
1156
  /** Sort order. */
743
- order?: SortOrder$2;
1157
+ order?: SortOrder$4;
744
1158
  }
745
- declare enum SortOrder$2 {
1159
+ declare enum SortOrder$4 {
746
1160
  ASC = "ASC",
747
1161
  DESC = "DESC"
748
1162
  }
749
- interface Paging$3 {
1163
+ interface Paging$5 {
750
1164
  /** Number of items to load. */
751
1165
  limit?: number | null;
752
1166
  /** Number of items to skip in the current sort order. */
753
1167
  offset?: number | null;
754
1168
  }
1169
+ interface QueryGroupMembersResponse {
1170
+ /** Group members. */
1171
+ members?: GroupMember$1[];
1172
+ /** Paging information. */
1173
+ metadata?: PagingMetadata$5;
1174
+ }
1175
+ interface QueryNonGroupMembersRequest {
1176
+ /** Group ID. */
1177
+ groupId?: string;
1178
+ query?: Query$4;
1179
+ }
1180
+ interface QueryNonGroupMembersResponse {
1181
+ /** Retrieved members. */
1182
+ members?: GroupMember$1[];
1183
+ }
1184
+ interface ListMembershipsRequest {
1185
+ /** Site member ID. */
1186
+ memberId: string | null;
1187
+ /** Number of items to load. */
1188
+ limit?: number | null;
1189
+ /** Number of memberships to skip in the list. */
1190
+ offset?: number | null;
1191
+ }
755
1192
  interface ListMembershipsResponse {
756
1193
  /** Site member's memberships. */
757
1194
  memberships?: Membership[];
@@ -780,12 +1217,103 @@ declare enum MembershipStatus {
780
1217
  /** Site member has join group request with `PENDING` status for this group. */
781
1218
  PENDING = "PENDING"
782
1219
  }
1220
+ interface QueryMembershipsRequest {
1221
+ /**
1222
+ * @internal
1223
+ * @internal
1224
+ * @deprecated
1225
+ */
1226
+ siteMemberId?: string | null;
1227
+ /** Site member ID. */
1228
+ memberId: string | null;
1229
+ query?: Query$4;
1230
+ }
783
1231
  interface QueryMembershipsResponse {
784
1232
  /** Site member's memberships. */
785
1233
  memberships?: Membership[];
786
1234
  /** Paging information. */
787
1235
  metadata?: PagingMetadata$5;
788
1236
  }
1237
+ interface DomainEvent$6 extends DomainEventBodyOneOf$6 {
1238
+ createdEvent?: EntityCreatedEvent$6;
1239
+ updatedEvent?: EntityUpdatedEvent$6;
1240
+ deletedEvent?: EntityDeletedEvent$6;
1241
+ actionEvent?: ActionEvent$6;
1242
+ /**
1243
+ * Unique event ID.
1244
+ * Allows clients to ignore duplicate webhooks.
1245
+ */
1246
+ _id?: string;
1247
+ /**
1248
+ * Assumes actions are also always typed to an entity_type
1249
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
1250
+ */
1251
+ entityFqdn?: string;
1252
+ /**
1253
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
1254
+ * This is although the created/updated/deleted notion is duplication of the oneof types
1255
+ * Example: created/updated/deleted/started/completed/email_opened
1256
+ */
1257
+ slug?: string;
1258
+ /** ID of the entity associated with the event. */
1259
+ entityId?: string;
1260
+ /** Event timestamp. */
1261
+ eventTime?: Date;
1262
+ /**
1263
+ * Whether the event was triggered as a result of a privacy regulation application
1264
+ * (for example, GDPR).
1265
+ */
1266
+ triggeredByAnonymizeRequest?: boolean | null;
1267
+ /** If present, indicates the action that triggered the event. */
1268
+ originatedFrom?: string | null;
1269
+ /**
1270
+ * A sequence number defining the order of updates to the underlying entity.
1271
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
1272
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
1273
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
1274
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
1275
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
1276
+ */
1277
+ entityEventSequence?: string | null;
1278
+ }
1279
+ /** @oneof */
1280
+ interface DomainEventBodyOneOf$6 {
1281
+ createdEvent?: EntityCreatedEvent$6;
1282
+ updatedEvent?: EntityUpdatedEvent$6;
1283
+ deletedEvent?: EntityDeletedEvent$6;
1284
+ actionEvent?: ActionEvent$6;
1285
+ }
1286
+ interface EntityCreatedEvent$6 {
1287
+ entity?: string;
1288
+ }
1289
+ interface RestoreInfo$6 {
1290
+ deletedDate?: Date;
1291
+ }
1292
+ interface EntityUpdatedEvent$6 {
1293
+ /**
1294
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
1295
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
1296
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
1297
+ */
1298
+ currentEntity?: string;
1299
+ }
1300
+ interface EntityDeletedEvent$6 {
1301
+ /** Entity that was deleted */
1302
+ deletedEntity?: string | null;
1303
+ }
1304
+ interface ActionEvent$6 {
1305
+ body?: string;
1306
+ }
1307
+ interface MessageEnvelope$6 {
1308
+ /** App instance ID. */
1309
+ instanceId?: string | null;
1310
+ /** Event type. */
1311
+ eventType?: string;
1312
+ /** The identification type and identity data. */
1313
+ identity?: IdentificationData$6;
1314
+ /** Stringify payload. */
1315
+ data?: string;
1316
+ }
789
1317
  interface IdentificationData$6 extends IdentificationDataIdOneOf$6 {
790
1318
  /** ID of a site visitor that has not logged in to the site. */
791
1319
  anonymousVisitorId?: string;
@@ -816,41 +1344,33 @@ declare enum WebhookIdentityType$6 {
816
1344
  WIX_USER = "WIX_USER",
817
1345
  APP = "APP"
818
1346
  }
1347
+ interface GroupRoleNonNullableFields$1 {
1348
+ value: Role$1;
1349
+ }
1350
+ interface GroupMemberNonNullableFields {
1351
+ siteMemberId: string;
1352
+ memberId: string;
1353
+ role?: GroupRoleNonNullableFields$1;
1354
+ }
819
1355
  interface AddGroupMembersResponseNonNullableFields {
820
- members: {
821
- siteMemberId: string;
822
- memberId: string;
823
- role?: {
824
- value: Role$1;
825
- };
826
- }[];
1356
+ members: GroupMemberNonNullableFields[];
827
1357
  }
828
1358
  interface ListGroupMembersResponseNonNullableFields {
829
- members: {
830
- siteMemberId: string;
831
- memberId: string;
832
- role?: {
833
- value: Role$1;
834
- };
835
- }[];
1359
+ members: GroupMemberNonNullableFields[];
1360
+ }
1361
+ interface QueryGroupMembersResponseNonNullableFields {
1362
+ members: GroupMemberNonNullableFields[];
1363
+ }
1364
+ interface MembershipNonNullableFields {
1365
+ groupId: string;
1366
+ status: MembershipStatus;
1367
+ role?: GroupRoleNonNullableFields$1;
836
1368
  }
837
1369
  interface ListMembershipsResponseNonNullableFields {
838
- memberships: {
839
- groupId: string;
840
- status: MembershipStatus;
841
- role?: {
842
- value: Role$1;
843
- };
844
- }[];
1370
+ memberships: MembershipNonNullableFields[];
845
1371
  }
846
1372
  interface QueryMembershipsResponseNonNullableFields {
847
- memberships: {
848
- groupId: string;
849
- status: MembershipStatus;
850
- role?: {
851
- value: Role$1;
852
- };
853
- }[];
1373
+ memberships: MembershipNonNullableFields[];
854
1374
  }
855
1375
  interface BaseEventMetadata$6 {
856
1376
  /** App instance ID. */
@@ -981,70 +1501,62 @@ interface QueryMembershipsOptions {
981
1501
  * @deprecated
982
1502
  */
983
1503
  siteMemberId?: string | null;
984
- query?: Query$2;
985
- }
986
-
987
- type RESTFunctionDescriptor$7<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$7) => T;
988
- interface HttpClient$7 {
989
- request<TResponse, TData = any>(req: RequestOptionsFactory$7<TResponse, TData>): Promise<HttpResponse$7<TResponse>>;
990
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
1504
+ query?: Query$4;
991
1505
  }
992
- type RequestOptionsFactory$7<TResponse = any, TData = any> = (context: any) => RequestOptions$7<TResponse, TData>;
993
- type HttpResponse$7<T = any> = {
994
- data: T;
995
- status: number;
996
- statusText: string;
997
- headers: any;
998
- request?: any;
999
- };
1000
- type RequestOptions$7<_TResponse = any, Data = any> = {
1001
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
1002
- url: string;
1003
- data?: Data;
1004
- params?: URLSearchParams;
1005
- } & APIMetadata$7;
1006
- type APIMetadata$7 = {
1007
- methodFqn?: string;
1008
- entityFqdn?: string;
1009
- packageName?: string;
1010
- };
1011
- type BuildRESTFunction$7<T extends RESTFunctionDescriptor$7> = T extends RESTFunctionDescriptor$7<infer U> ? U : never;
1012
- type EventDefinition$6<Payload = unknown, Type extends string = string> = {
1013
- __type: 'event-definition';
1014
- type: Type;
1015
- isDomainEvent?: boolean;
1016
- transformations?: (envelope: unknown) => Payload;
1017
- __payload: Payload;
1018
- };
1019
- declare function EventDefinition$6<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$6<Payload, Type>;
1020
- type EventHandler$6<T extends EventDefinition$6> = (payload: T['__payload']) => void | Promise<void>;
1021
- type BuildEventDefinition$6<T extends EventDefinition$6<any, string>> = (handler: EventHandler$6<T>) => void;
1022
1506
 
1023
- declare global {
1024
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1025
- interface SymbolConstructor {
1026
- readonly observable: symbol;
1027
- }
1028
- }
1507
+ declare function createRESTModule$7<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
1029
1508
 
1030
- declare function addGroupMembers$1(httpClient: HttpClient$7): (groupId: string, memberIds: string[], options?: AddGroupMembersOptions) => Promise<AddGroupMembersResponse & AddGroupMembersResponseNonNullableFields>;
1031
- declare function removeGroupMembers$1(httpClient: HttpClient$7): (groupId: string, memberIds: string[], options?: RemoveGroupMembersOptions) => Promise<void>;
1032
- declare function listGroupMembers$1(httpClient: HttpClient$7): (groupId: string, options?: ListGroupMembersOptions) => Promise<ListGroupMembersResponse & ListGroupMembersResponseNonNullableFields>;
1033
- declare function queryGroupMembers$1(httpClient: HttpClient$7): (groupId: string) => MembersQueryBuilder;
1034
- declare function listMemberships$1(httpClient: HttpClient$7): (memberId: string | null, options?: ListMembershipsOptions) => Promise<ListMembershipsResponse & ListMembershipsResponseNonNullableFields>;
1035
- declare function queryMemberships$1(httpClient: HttpClient$7): (memberId: string | null, options?: QueryMembershipsOptions) => Promise<QueryMembershipsResponse & QueryMembershipsResponseNonNullableFields>;
1036
- declare const onGroupMemberAdded$1: EventDefinition$6<GroupMemberAddedEnvelope, "wix.social_groups.v2.group_member_added">;
1037
- declare const onGroupMemberRemoved$1: EventDefinition$6<GroupMemberRemovedEnvelope, "wix.social_groups.v2.group_member_removed">;
1509
+ declare function createEventModule$6<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1038
1510
 
1039
- declare const addGroupMembers: BuildRESTFunction$7<typeof addGroupMembers$1>;
1040
- declare const removeGroupMembers: BuildRESTFunction$7<typeof removeGroupMembers$1>;
1041
- declare const listGroupMembers: BuildRESTFunction$7<typeof listGroupMembers$1>;
1042
- declare const queryGroupMembers: BuildRESTFunction$7<typeof queryGroupMembers$1>;
1043
- declare const listMemberships: BuildRESTFunction$7<typeof listMemberships$1>;
1044
- declare const queryMemberships: BuildRESTFunction$7<typeof queryMemberships$1>;
1045
- declare const onGroupMemberAdded: BuildEventDefinition$6<typeof onGroupMemberAdded$1>;
1046
- declare const onGroupMemberRemoved: BuildEventDefinition$6<typeof onGroupMemberRemoved$1>;
1511
+ declare const addGroupMembers: ReturnType<typeof createRESTModule$7<typeof publicAddGroupMembers>>;
1512
+ declare const removeGroupMembers: ReturnType<typeof createRESTModule$7<typeof publicRemoveGroupMembers>>;
1513
+ declare const listGroupMembers: ReturnType<typeof createRESTModule$7<typeof publicListGroupMembers>>;
1514
+ declare const queryGroupMembers: ReturnType<typeof createRESTModule$7<typeof publicQueryGroupMembers>>;
1515
+ declare const listMemberships: ReturnType<typeof createRESTModule$7<typeof publicListMemberships>>;
1516
+ declare const queryMemberships: ReturnType<typeof createRESTModule$7<typeof publicQueryMemberships>>;
1517
+ declare const onGroupMemberAdded: ReturnType<typeof createEventModule$6<typeof publicOnGroupMemberAdded>>;
1518
+ declare const onGroupMemberRemoved: ReturnType<typeof createEventModule$6<typeof publicOnGroupMemberRemoved>>;
1047
1519
 
1520
+ type context$7_AddGroupMembersOptions = AddGroupMembersOptions;
1521
+ type context$7_AddGroupMembersRequest = AddGroupMembersRequest;
1522
+ type context$7_AddGroupMembersResponse = AddGroupMembersResponse;
1523
+ type context$7_AddGroupMembersResponseNonNullableFields = AddGroupMembersResponseNonNullableFields;
1524
+ type context$7_GroupMemberAddedEnvelope = GroupMemberAddedEnvelope;
1525
+ type context$7_GroupMemberRemovedEnvelope = GroupMemberRemovedEnvelope;
1526
+ type context$7_JoinBy = JoinBy;
1527
+ declare const context$7_JoinBy: typeof JoinBy;
1528
+ type context$7_JoinResponse = JoinResponse;
1529
+ type context$7_LeaveRequest = LeaveRequest;
1530
+ type context$7_LeaveResponse = LeaveResponse;
1531
+ type context$7_ListGroupMembersOptions = ListGroupMembersOptions;
1532
+ type context$7_ListGroupMembersRequest = ListGroupMembersRequest;
1533
+ type context$7_ListGroupMembersResponse = ListGroupMembersResponse;
1534
+ type context$7_ListGroupMembersResponseNonNullableFields = ListGroupMembersResponseNonNullableFields;
1535
+ type context$7_ListMembershipsOptions = ListMembershipsOptions;
1536
+ type context$7_ListMembershipsRequest = ListMembershipsRequest;
1537
+ type context$7_ListMembershipsResponse = ListMembershipsResponse;
1538
+ type context$7_ListMembershipsResponseNonNullableFields = ListMembershipsResponseNonNullableFields;
1539
+ type context$7_MemberAdded = MemberAdded;
1540
+ type context$7_MemberJoined = MemberJoined;
1541
+ type context$7_MemberLeft = MemberLeft;
1542
+ type context$7_MemberRemoved = MemberRemoved;
1543
+ type context$7_MembersQueryBuilder = MembersQueryBuilder;
1544
+ type context$7_MembersQueryResult = MembersQueryResult;
1545
+ type context$7_Membership = Membership;
1546
+ type context$7_MembershipStatus = MembershipStatus;
1547
+ declare const context$7_MembershipStatus: typeof MembershipStatus;
1548
+ type context$7_QueryGroupMembersRequest = QueryGroupMembersRequest;
1549
+ type context$7_QueryGroupMembersResponse = QueryGroupMembersResponse;
1550
+ type context$7_QueryGroupMembersResponseNonNullableFields = QueryGroupMembersResponseNonNullableFields;
1551
+ type context$7_QueryMembershipsOptions = QueryMembershipsOptions;
1552
+ type context$7_QueryMembershipsRequest = QueryMembershipsRequest;
1553
+ type context$7_QueryMembershipsResponse = QueryMembershipsResponse;
1554
+ type context$7_QueryMembershipsResponseNonNullableFields = QueryMembershipsResponseNonNullableFields;
1555
+ type context$7_QueryNonGroupMembersRequest = QueryNonGroupMembersRequest;
1556
+ type context$7_QueryNonGroupMembersResponse = QueryNonGroupMembersResponse;
1557
+ type context$7_RemoveGroupMembersOptions = RemoveGroupMembersOptions;
1558
+ type context$7_RemoveGroupMembersRequest = RemoveGroupMembersRequest;
1559
+ type context$7_RemoveGroupMembersResponse = RemoveGroupMembersResponse;
1048
1560
  declare const context$7_addGroupMembers: typeof addGroupMembers;
1049
1561
  declare const context$7_listGroupMembers: typeof listGroupMembers;
1050
1562
  declare const context$7_listMemberships: typeof listMemberships;
@@ -1054,7 +1566,7 @@ declare const context$7_queryGroupMembers: typeof queryGroupMembers;
1054
1566
  declare const context$7_queryMemberships: typeof queryMemberships;
1055
1567
  declare const context$7_removeGroupMembers: typeof removeGroupMembers;
1056
1568
  declare namespace context$7 {
1057
- export { context$7_addGroupMembers as addGroupMembers, context$7_listGroupMembers as listGroupMembers, context$7_listMemberships as listMemberships, context$7_onGroupMemberAdded as onGroupMemberAdded, context$7_onGroupMemberRemoved as onGroupMemberRemoved, context$7_queryGroupMembers as queryGroupMembers, context$7_queryMemberships as queryMemberships, context$7_removeGroupMembers as removeGroupMembers };
1569
+ export { type ActionEvent$6 as ActionEvent, type context$7_AddGroupMembersOptions as AddGroupMembersOptions, type context$7_AddGroupMembersRequest as AddGroupMembersRequest, type context$7_AddGroupMembersResponse as AddGroupMembersResponse, type context$7_AddGroupMembersResponseNonNullableFields as AddGroupMembersResponseNonNullableFields, type BaseEventMetadata$6 as BaseEventMetadata, type DomainEvent$6 as DomainEvent, type DomainEventBodyOneOf$6 as DomainEventBodyOneOf, type EntityCreatedEvent$6 as EntityCreatedEvent, type EntityDeletedEvent$6 as EntityDeletedEvent, type EntityUpdatedEvent$6 as EntityUpdatedEvent, type EventMetadata$6 as EventMetadata, type GroupMember$1 as GroupMember, type context$7_GroupMemberAddedEnvelope as GroupMemberAddedEnvelope, type context$7_GroupMemberRemovedEnvelope as GroupMemberRemovedEnvelope, type GroupRole$1 as GroupRole, type IdentificationData$6 as IdentificationData, type IdentificationDataIdOneOf$6 as IdentificationDataIdOneOf, context$7_JoinBy as JoinBy, type JoinRequest$1 as JoinRequest, type JoinRequestsApproved$1 as JoinRequestsApproved, type context$7_JoinResponse as JoinResponse, type context$7_LeaveRequest as LeaveRequest, type context$7_LeaveResponse as LeaveResponse, type context$7_ListGroupMembersOptions as ListGroupMembersOptions, type context$7_ListGroupMembersRequest as ListGroupMembersRequest, type context$7_ListGroupMembersResponse as ListGroupMembersResponse, type context$7_ListGroupMembersResponseNonNullableFields as ListGroupMembersResponseNonNullableFields, type context$7_ListMembershipsOptions as ListMembershipsOptions, type context$7_ListMembershipsRequest as ListMembershipsRequest, type context$7_ListMembershipsResponse as ListMembershipsResponse, type context$7_ListMembershipsResponseNonNullableFields as ListMembershipsResponseNonNullableFields, type context$7_MemberAdded as MemberAdded, type context$7_MemberJoined as MemberJoined, type MemberJoinedGroup$1 as MemberJoinedGroup, type context$7_MemberLeft as MemberLeft, type context$7_MemberRemoved as MemberRemoved, type MembersAddedToGroup$1 as MembersAddedToGroup, type MembersInvitedToGroup$1 as MembersInvitedToGroup, type context$7_MembersQueryBuilder as MembersQueryBuilder, type context$7_MembersQueryResult as MembersQueryResult, type context$7_Membership as Membership, type MembershipQuestionAnswer$3 as MembershipQuestionAnswer, context$7_MembershipStatus as MembershipStatus, type MessageEnvelope$6 as MessageEnvelope, type Paging$5 as Paging, type PagingMetadata$5 as PagingMetadata, type Query$4 as Query, type context$7_QueryGroupMembersRequest as QueryGroupMembersRequest, type context$7_QueryGroupMembersResponse as QueryGroupMembersResponse, type context$7_QueryGroupMembersResponseNonNullableFields as QueryGroupMembersResponseNonNullableFields, type context$7_QueryMembershipsOptions as QueryMembershipsOptions, type context$7_QueryMembershipsRequest as QueryMembershipsRequest, type context$7_QueryMembershipsResponse as QueryMembershipsResponse, type context$7_QueryMembershipsResponseNonNullableFields as QueryMembershipsResponseNonNullableFields, type context$7_QueryNonGroupMembersRequest as QueryNonGroupMembersRequest, type context$7_QueryNonGroupMembersResponse as QueryNonGroupMembersResponse, type context$7_RemoveGroupMembersOptions as RemoveGroupMembersOptions, type context$7_RemoveGroupMembersRequest as RemoveGroupMembersRequest, type context$7_RemoveGroupMembersResponse as RemoveGroupMembersResponse, type RestoreInfo$6 as RestoreInfo, Role$1 as Role, type SocialGroupsEvent$1 as SocialGroupsEvent, type SocialGroupsEventPayloadOneOf$1 as SocialGroupsEventPayloadOneOf, SortOrder$4 as SortOrder, type Sorting$4 as Sorting, WebhookIdentityType$6 as WebhookIdentityType, context$7_addGroupMembers as addGroupMembers, context$7_listGroupMembers as listGroupMembers, context$7_listMemberships as listMemberships, context$7_onGroupMemberAdded as onGroupMemberAdded, context$7_onGroupMemberRemoved as onGroupMemberRemoved, context$7_queryGroupMembers as queryGroupMembers, context$7_queryMemberships as queryMemberships, context$7_removeGroupMembers as removeGroupMembers };
1058
1570
  }
1059
1571
 
1060
1572
  /**
@@ -1182,6 +1694,15 @@ interface Group$1 {
1182
1694
  */
1183
1695
  lastActivityDate?: Date;
1184
1696
  }
1697
+ declare enum Type$1 {
1698
+ UNKNOWN = "UNKNOWN",
1699
+ ADMIN_APPROVAL = "ADMIN_APPROVAL",
1700
+ PAID_PLANS = "PAID_PLANS",
1701
+ EVENTS = "EVENTS"
1702
+ }
1703
+ interface Events$1 {
1704
+ eventIds?: string[];
1705
+ }
1185
1706
  interface Logo$1 {
1186
1707
  /** Logo image ID (for internal use). */
1187
1708
  mediaId?: string | null;
@@ -1190,6 +1711,12 @@ interface Logo$1 {
1190
1711
  /** Logo image height. */
1191
1712
  height?: number | null;
1192
1713
  }
1714
+ interface GroupDetailsPosition$1 {
1715
+ /** horizontal coordinate */
1716
+ x?: number;
1717
+ /** vertical coordinate */
1718
+ y?: number;
1719
+ }
1193
1720
  interface Image$1 {
1194
1721
  /** Image ID (for internal use). */
1195
1722
  mediaId?: string | null;
@@ -1204,6 +1731,22 @@ interface Position$1 {
1204
1731
  /** vertical coordinate */
1205
1732
  y?: number;
1206
1733
  }
1734
+ declare enum AllowPolicy$1 {
1735
+ UNKNOWN = "UNKNOWN",
1736
+ OWNER_AND_ADMINS = "OWNER_AND_ADMINS",
1737
+ OWNER = "OWNER",
1738
+ ALL_MEMBERS = "ALL_MEMBERS"
1739
+ }
1740
+ interface OnboardingStepSettings$1 {
1741
+ stepKey?: StepKey$1;
1742
+ visible?: boolean;
1743
+ }
1744
+ declare enum StepKey$1 {
1745
+ UNKNOWN = "UNKNOWN",
1746
+ CREATE_POST = "CREATE_POST",
1747
+ REACT_TO_POST = "REACT_TO_POST",
1748
+ INVITE_MEMBERS = "INVITE_MEMBERS"
1749
+ }
1207
1750
  declare enum PrivacyStatus$1 {
1208
1751
  UNKNOWN = "UNKNOWN",
1209
1752
  /** Anyone can see the group in the group list and view its content. Anyone can join. */
@@ -1213,6 +1756,14 @@ declare enum PrivacyStatus$1 {
1213
1756
  /** Only group members and admins can see the group in the group list. New group members can only be added by existing group members. */
1214
1757
  SECRET = "SECRET"
1215
1758
  }
1759
+ interface AccessRestriction$1 extends AccessRestrictionDataOneOf$1 {
1760
+ events?: Events$1;
1761
+ type?: Type$1;
1762
+ }
1763
+ /** @oneof */
1764
+ interface AccessRestrictionDataOneOf$1 {
1765
+ events?: Events$1;
1766
+ }
1216
1767
  interface GroupDetails$1 {
1217
1768
  /** Group logo. You cannot upload your own logo. */
1218
1769
  logo?: Logo$1;
@@ -1293,6 +1844,28 @@ interface RequestDetails$3 {
1293
1844
  /** Reason the request to create a group is rejected. */
1294
1845
  rejectionReason?: string | null;
1295
1846
  }
1847
+ interface SubmitGroupRequestRequest {
1848
+ /** Group submitted for creation. */
1849
+ group?: Group$1;
1850
+ }
1851
+ interface SubmitGroupRequestResponse {
1852
+ /** Submitted Group Request. */
1853
+ groupRequest?: GroupRequest;
1854
+ }
1855
+ interface ApproveGroupRequestsRequest {
1856
+ /**
1857
+ * IDs of the requests create groups to approve.
1858
+ *
1859
+ * Max: 100 create group request IDs
1860
+ */
1861
+ groupRequestIds?: string[];
1862
+ }
1863
+ declare enum ItemsToUpdate$3 {
1864
+ /** Take into account only items which are listed in request. */
1865
+ BY_ID = "BY_ID",
1866
+ /** Update all items. */
1867
+ ALL_ITEMS = "ALL_ITEMS"
1868
+ }
1296
1869
  interface ApproveGroupRequestsResponse {
1297
1870
  /** Approved request to create a group. */
1298
1871
  groupRequest?: GroupRequest[];
@@ -1301,6 +1874,10 @@ interface GroupRequestApproved {
1301
1874
  /** Approved group request. */
1302
1875
  groupRequest?: GroupRequest;
1303
1876
  }
1877
+ interface RejectGroupRequestsRequest {
1878
+ /** Rejection data. */
1879
+ rejections?: Rejection$3[];
1880
+ }
1304
1881
  interface Rejection$3 {
1305
1882
  /**
1306
1883
  * ID of the requests to create groups to reject.
@@ -1322,6 +1899,26 @@ interface GroupRequestRejected {
1322
1899
  /** Rejected group request. */
1323
1900
  groupRequest?: GroupRequest;
1324
1901
  }
1902
+ interface CancelGroupRequestRequest {
1903
+ /** ID of the Group Request to cancel. */
1904
+ groupRequestId?: string;
1905
+ }
1906
+ interface CancelGroupRequestResponse {
1907
+ /** Canceled Group Request. */
1908
+ groupRequest?: GroupRequest;
1909
+ }
1910
+ interface ListGroupRequestsRequest {
1911
+ /** Number of items to load. Maximum `100`. */
1912
+ limit?: number | null;
1913
+ /** Number of items to skip in the current sort order. */
1914
+ offset?: number | null;
1915
+ }
1916
+ declare enum OwnershipFilter$3 {
1917
+ /** All items. */
1918
+ ALL = "ALL",
1919
+ /** Items for current site member. */
1920
+ CURRENT_MEMBER = "CURRENT_MEMBER"
1921
+ }
1325
1922
  interface ListGroupRequestsResponse {
1326
1923
  /** List of requests to create a group. */
1327
1924
  groupRequests?: GroupRequest[];
@@ -1338,111 +1935,64 @@ interface PagingMetadata$4 {
1338
1935
  /** Flag that indicates the server failed to calculate the `total` field. */
1339
1936
  tooManyToCount?: boolean | null;
1340
1937
  }
1341
- interface IdentificationData$5 extends IdentificationDataIdOneOf$5 {
1342
- /** ID of a site visitor that has not logged in to the site. */
1343
- anonymousVisitorId?: string;
1344
- /** ID of a site visitor that has logged in to the site. */
1345
- memberId?: string;
1346
- /** ID of a Wix user (site owner, contributor, etc.). */
1347
- wixUserId?: string;
1348
- /** ID of an app. */
1349
- appId?: string;
1350
- /** @readonly */
1351
- identityType?: WebhookIdentityType$5;
1352
- }
1353
- /** @oneof */
1354
- interface IdentificationDataIdOneOf$5 {
1355
- /** ID of a site visitor that has not logged in to the site. */
1356
- anonymousVisitorId?: string;
1357
- /** ID of a site visitor that has logged in to the site. */
1358
- memberId?: string;
1359
- /** ID of a Wix user (site owner, contributor, etc.). */
1360
- wixUserId?: string;
1361
- /** ID of an app. */
1362
- appId?: string;
1938
+ interface QueryGroupRequestsRequest {
1939
+ query?: Query$3;
1363
1940
  }
1364
- declare enum WebhookIdentityType$5 {
1365
- UNKNOWN = "UNKNOWN",
1366
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1367
- MEMBER = "MEMBER",
1368
- WIX_USER = "WIX_USER",
1369
- APP = "APP"
1941
+ interface Query$3 {
1942
+ /**
1943
+ * Filter object in the following format:
1944
+ * `"filter" : {
1945
+ * "fieldName1": "value1",
1946
+ * "fieldName2":{"$operator":"value2"}
1947
+ * }`
1948
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
1949
+ */
1950
+ filter?: any;
1951
+ /**
1952
+ * Sort object in the following format:
1953
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
1954
+ */
1955
+ sort?: Sorting$3[];
1956
+ /** Paging options to limit and skip the number of items. */
1957
+ paging?: Paging$4;
1958
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
1959
+ fields?: string[];
1960
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
1961
+ fieldsets?: string[];
1370
1962
  }
1371
- interface ApproveGroupRequestsResponseNonNullableFields {
1372
- groupRequest: {
1373
- group?: {
1374
- privacyLevel: PrivacyStatus$1;
1375
- privacyStatus: PrivacyStatus$1;
1376
- coverImage?: {
1377
- position?: {
1378
- x: number;
1379
- y: number;
1380
- };
1381
- mobilePosition?: {
1382
- x: number;
1383
- y: number;
1384
- };
1385
- };
1386
- createdBy?: {
1387
- identityType: IdentityType$1;
1388
- };
1389
- };
1390
- status: RequestStatus$3;
1391
- }[];
1963
+ interface Sorting$3 {
1964
+ /** Name of the field to sort by. */
1965
+ fieldName?: string;
1966
+ /** Sort order. */
1967
+ order?: SortOrder$3;
1392
1968
  }
1393
- interface RejectGroupRequestsResponseNonNullableFields {
1394
- groupRequest: {
1395
- group?: {
1396
- privacyLevel: PrivacyStatus$1;
1397
- privacyStatus: PrivacyStatus$1;
1398
- coverImage?: {
1399
- position?: {
1400
- x: number;
1401
- y: number;
1402
- };
1403
- mobilePosition?: {
1404
- x: number;
1405
- y: number;
1406
- };
1407
- };
1408
- createdBy?: {
1409
- identityType: IdentityType$1;
1410
- };
1411
- };
1412
- status: RequestStatus$3;
1413
- }[];
1969
+ declare enum SortOrder$3 {
1970
+ ASC = "ASC",
1971
+ DESC = "DESC"
1414
1972
  }
1415
- interface ListGroupRequestsResponseNonNullableFields {
1416
- groupRequests: {
1417
- group?: {
1418
- privacyLevel: PrivacyStatus$1;
1419
- privacyStatus: PrivacyStatus$1;
1420
- coverImage?: {
1421
- position?: {
1422
- x: number;
1423
- y: number;
1424
- };
1425
- mobilePosition?: {
1426
- x: number;
1427
- y: number;
1428
- };
1429
- };
1430
- createdBy?: {
1431
- identityType: IdentityType$1;
1432
- };
1433
- };
1434
- status: RequestStatus$3;
1435
- }[];
1973
+ interface Paging$4 {
1974
+ /**
1975
+ * Number of items to load.
1976
+ *
1977
+ * Max: `100`
1978
+ */
1979
+ limit?: number | null;
1980
+ /**
1981
+ * Number of items to skip in the current sort order.
1982
+ *
1983
+ */
1984
+ offset?: number | null;
1436
1985
  }
1437
- interface BaseEventMetadata$5 {
1438
- /** App instance ID. */
1439
- instanceId?: string | null;
1440
- /** Event type. */
1441
- eventType?: string;
1442
- /** The identification type and identity data. */
1443
- identity?: IdentificationData$5;
1986
+ interface QueryGroupRequestsResponse {
1987
+ /** Retrieved Group Requests. */
1988
+ groupRequests?: GroupRequest[];
1989
+ metadata?: PagingMetadata$4;
1444
1990
  }
1445
- interface EventMetadata$5 extends BaseEventMetadata$5 {
1991
+ interface DomainEvent$5 extends DomainEventBodyOneOf$5 {
1992
+ createdEvent?: EntityCreatedEvent$5;
1993
+ updatedEvent?: EntityUpdatedEvent$5;
1994
+ deletedEvent?: EntityDeletedEvent$5;
1995
+ actionEvent?: ActionEvent$5;
1446
1996
  /**
1447
1997
  * Unique event ID.
1448
1998
  * Allows clients to ignore duplicate webhooks.
@@ -1480,9 +2030,186 @@ interface EventMetadata$5 extends BaseEventMetadata$5 {
1480
2030
  */
1481
2031
  entityEventSequence?: string | null;
1482
2032
  }
1483
- interface GroupRequestCreatedEnvelope {
1484
- entity: GroupRequest;
1485
- metadata: EventMetadata$5;
2033
+ /** @oneof */
2034
+ interface DomainEventBodyOneOf$5 {
2035
+ createdEvent?: EntityCreatedEvent$5;
2036
+ updatedEvent?: EntityUpdatedEvent$5;
2037
+ deletedEvent?: EntityDeletedEvent$5;
2038
+ actionEvent?: ActionEvent$5;
2039
+ }
2040
+ interface EntityCreatedEvent$5 {
2041
+ entity?: string;
2042
+ }
2043
+ interface RestoreInfo$5 {
2044
+ deletedDate?: Date;
2045
+ }
2046
+ interface EntityUpdatedEvent$5 {
2047
+ /**
2048
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
2049
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
2050
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
2051
+ */
2052
+ currentEntity?: string;
2053
+ }
2054
+ interface EntityDeletedEvent$5 {
2055
+ /** Entity that was deleted */
2056
+ deletedEntity?: string | null;
2057
+ }
2058
+ interface ActionEvent$5 {
2059
+ body?: string;
2060
+ }
2061
+ interface MessageEnvelope$5 {
2062
+ /** App instance ID. */
2063
+ instanceId?: string | null;
2064
+ /** Event type. */
2065
+ eventType?: string;
2066
+ /** The identification type and identity data. */
2067
+ identity?: IdentificationData$5;
2068
+ /** Stringify payload. */
2069
+ data?: string;
2070
+ }
2071
+ interface IdentificationData$5 extends IdentificationDataIdOneOf$5 {
2072
+ /** ID of a site visitor that has not logged in to the site. */
2073
+ anonymousVisitorId?: string;
2074
+ /** ID of a site visitor that has logged in to the site. */
2075
+ memberId?: string;
2076
+ /** ID of a Wix user (site owner, contributor, etc.). */
2077
+ wixUserId?: string;
2078
+ /** ID of an app. */
2079
+ appId?: string;
2080
+ /** @readonly */
2081
+ identityType?: WebhookIdentityType$5;
2082
+ }
2083
+ /** @oneof */
2084
+ interface IdentificationDataIdOneOf$5 {
2085
+ /** ID of a site visitor that has not logged in to the site. */
2086
+ anonymousVisitorId?: string;
2087
+ /** ID of a site visitor that has logged in to the site. */
2088
+ memberId?: string;
2089
+ /** ID of a Wix user (site owner, contributor, etc.). */
2090
+ wixUserId?: string;
2091
+ /** ID of an app. */
2092
+ appId?: string;
2093
+ }
2094
+ declare enum WebhookIdentityType$5 {
2095
+ UNKNOWN = "UNKNOWN",
2096
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
2097
+ MEMBER = "MEMBER",
2098
+ WIX_USER = "WIX_USER",
2099
+ APP = "APP"
2100
+ }
2101
+ interface EventsNonNullableFields$1 {
2102
+ eventIds: string[];
2103
+ }
2104
+ interface AccessRestrictionNonNullableFields$1 {
2105
+ events?: EventsNonNullableFields$1;
2106
+ type: Type$1;
2107
+ }
2108
+ interface GroupDetailsPositionNonNullableFields$1 {
2109
+ x: number;
2110
+ y: number;
2111
+ }
2112
+ interface GroupDetailsNonNullableFields$1 {
2113
+ logoPosition?: GroupDetailsPositionNonNullableFields$1;
2114
+ mobileLogoPosition?: GroupDetailsPositionNonNullableFields$1;
2115
+ }
2116
+ interface PositionNonNullableFields$1 {
2117
+ x: number;
2118
+ y: number;
2119
+ }
2120
+ interface CoverImageNonNullableFields$1 {
2121
+ position?: PositionNonNullableFields$1;
2122
+ mobilePosition?: PositionNonNullableFields$1;
2123
+ }
2124
+ interface OnboardingStepSettingsNonNullableFields$1 {
2125
+ stepKey: StepKey$1;
2126
+ visible: boolean;
2127
+ }
2128
+ interface GroupSettingsNonNullableFields$1 {
2129
+ allowedToInviteMembers: AllowPolicy$1;
2130
+ allowedToApproveJoinRequests: AllowPolicy$1;
2131
+ allowedToAddMembers: AllowPolicy$1;
2132
+ allowedToCreatePosts: AllowPolicy$1;
2133
+ allowedToCommentPosts: AllowPolicy$1;
2134
+ onboardingStepsSettings: OnboardingStepSettingsNonNullableFields$1[];
2135
+ }
2136
+ interface IdentityNonNullableFields$1 {
2137
+ identityType: IdentityType$1;
2138
+ }
2139
+ interface GroupNonNullableFields$1 {
2140
+ privacyLevel: PrivacyStatus$1;
2141
+ privacyStatus: PrivacyStatus$1;
2142
+ accessRestriction?: AccessRestrictionNonNullableFields$1;
2143
+ details?: GroupDetailsNonNullableFields$1;
2144
+ coverImage?: CoverImageNonNullableFields$1;
2145
+ settings?: GroupSettingsNonNullableFields$1;
2146
+ createdBy?: IdentityNonNullableFields$1;
2147
+ }
2148
+ interface GroupRequestNonNullableFields {
2149
+ group?: GroupNonNullableFields$1;
2150
+ status: RequestStatus$3;
2151
+ }
2152
+ interface ApproveGroupRequestsResponseNonNullableFields {
2153
+ groupRequest: GroupRequestNonNullableFields[];
2154
+ }
2155
+ interface RejectGroupRequestsResponseNonNullableFields {
2156
+ groupRequest: GroupRequestNonNullableFields[];
2157
+ }
2158
+ interface ListGroupRequestsResponseNonNullableFields {
2159
+ groupRequests: GroupRequestNonNullableFields[];
2160
+ }
2161
+ interface QueryGroupRequestsResponseNonNullableFields {
2162
+ groupRequests: GroupRequestNonNullableFields[];
2163
+ }
2164
+ interface BaseEventMetadata$5 {
2165
+ /** App instance ID. */
2166
+ instanceId?: string | null;
2167
+ /** Event type. */
2168
+ eventType?: string;
2169
+ /** The identification type and identity data. */
2170
+ identity?: IdentificationData$5;
2171
+ }
2172
+ interface EventMetadata$5 extends BaseEventMetadata$5 {
2173
+ /**
2174
+ * Unique event ID.
2175
+ * Allows clients to ignore duplicate webhooks.
2176
+ */
2177
+ _id?: string;
2178
+ /**
2179
+ * Assumes actions are also always typed to an entity_type
2180
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2181
+ */
2182
+ entityFqdn?: string;
2183
+ /**
2184
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2185
+ * This is although the created/updated/deleted notion is duplication of the oneof types
2186
+ * Example: created/updated/deleted/started/completed/email_opened
2187
+ */
2188
+ slug?: string;
2189
+ /** ID of the entity associated with the event. */
2190
+ entityId?: string;
2191
+ /** Event timestamp. */
2192
+ eventTime?: Date;
2193
+ /**
2194
+ * Whether the event was triggered as a result of a privacy regulation application
2195
+ * (for example, GDPR).
2196
+ */
2197
+ triggeredByAnonymizeRequest?: boolean | null;
2198
+ /** If present, indicates the action that triggered the event. */
2199
+ originatedFrom?: string | null;
2200
+ /**
2201
+ * A sequence number defining the order of updates to the underlying entity.
2202
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
2203
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2204
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2205
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
2206
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2207
+ */
2208
+ entityEventSequence?: string | null;
2209
+ }
2210
+ interface GroupRequestCreatedEnvelope {
2211
+ entity: GroupRequest;
2212
+ metadata: EventMetadata$5;
1486
2213
  }
1487
2214
  interface GroupRequestApprovedEnvelope {
1488
2215
  data: GroupRequestApproved;
@@ -1552,65 +2279,44 @@ interface GroupRequestsQueryBuilder {
1552
2279
  find: () => Promise<GroupRequestsQueryResult>;
1553
2280
  }
1554
2281
 
1555
- type RESTFunctionDescriptor$6<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$6) => T;
1556
- interface HttpClient$6 {
1557
- request<TResponse, TData = any>(req: RequestOptionsFactory$6<TResponse, TData>): Promise<HttpResponse$6<TResponse>>;
1558
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
1559
- }
1560
- type RequestOptionsFactory$6<TResponse = any, TData = any> = (context: any) => RequestOptions$6<TResponse, TData>;
1561
- type HttpResponse$6<T = any> = {
1562
- data: T;
1563
- status: number;
1564
- statusText: string;
1565
- headers: any;
1566
- request?: any;
1567
- };
1568
- type RequestOptions$6<_TResponse = any, Data = any> = {
1569
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
1570
- url: string;
1571
- data?: Data;
1572
- params?: URLSearchParams;
1573
- } & APIMetadata$6;
1574
- type APIMetadata$6 = {
1575
- methodFqn?: string;
1576
- entityFqdn?: string;
1577
- packageName?: string;
1578
- };
1579
- type BuildRESTFunction$6<T extends RESTFunctionDescriptor$6> = T extends RESTFunctionDescriptor$6<infer U> ? U : never;
1580
- type EventDefinition$5<Payload = unknown, Type extends string = string> = {
1581
- __type: 'event-definition';
1582
- type: Type;
1583
- isDomainEvent?: boolean;
1584
- transformations?: (envelope: unknown) => Payload;
1585
- __payload: Payload;
1586
- };
1587
- declare function EventDefinition$5<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$5<Payload, Type>;
1588
- type EventHandler$5<T extends EventDefinition$5> = (payload: T['__payload']) => void | Promise<void>;
1589
- type BuildEventDefinition$5<T extends EventDefinition$5<any, string>> = (handler: EventHandler$5<T>) => void;
1590
-
1591
- declare global {
1592
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1593
- interface SymbolConstructor {
1594
- readonly observable: symbol;
1595
- }
1596
- }
2282
+ declare function createRESTModule$6<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
1597
2283
 
1598
- declare function approveGroupRequests$1(httpClient: HttpClient$6): (groupRequestIds: string[]) => Promise<ApproveGroupRequestsResponse & ApproveGroupRequestsResponseNonNullableFields>;
1599
- declare function rejectGroupRequests$1(httpClient: HttpClient$6): (rejections: Rejection$3[]) => Promise<RejectGroupRequestsResponse & RejectGroupRequestsResponseNonNullableFields>;
1600
- declare function listGroupRequests$1(httpClient: HttpClient$6): (options?: ListGroupRequestsOptions) => Promise<ListGroupRequestsResponse & ListGroupRequestsResponseNonNullableFields>;
1601
- declare function queryGroupRequests$1(httpClient: HttpClient$6): (options?: QueryGroupRequestsOptions) => GroupRequestsQueryBuilder;
1602
- declare const onGroupRequestCreated$1: EventDefinition$5<GroupRequestCreatedEnvelope, "wix.social_groups.v2.group_request_created">;
1603
- declare const onGroupRequestApproved$1: EventDefinition$5<GroupRequestApprovedEnvelope, "wix.social_groups.v2.group_request_approved">;
1604
- declare const onGroupRequestRejected$1: EventDefinition$5<GroupRequestRejectedEnvelope, "wix.social_groups.v2.group_request_rejected">;
2284
+ declare function createEventModule$5<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1605
2285
 
1606
- declare const approveGroupRequests: BuildRESTFunction$6<typeof approveGroupRequests$1>;
1607
- declare const rejectGroupRequests: BuildRESTFunction$6<typeof rejectGroupRequests$1>;
1608
- declare const listGroupRequests: BuildRESTFunction$6<typeof listGroupRequests$1>;
1609
- declare const queryGroupRequests: BuildRESTFunction$6<typeof queryGroupRequests$1>;
1610
- declare const onGroupRequestCreated: BuildEventDefinition$5<typeof onGroupRequestCreated$1>;
1611
- declare const onGroupRequestApproved: BuildEventDefinition$5<typeof onGroupRequestApproved$1>;
1612
- declare const onGroupRequestRejected: BuildEventDefinition$5<typeof onGroupRequestRejected$1>;
2286
+ declare const approveGroupRequests: ReturnType<typeof createRESTModule$6<typeof publicApproveGroupRequests>>;
2287
+ declare const rejectGroupRequests: ReturnType<typeof createRESTModule$6<typeof publicRejectGroupRequests>>;
2288
+ declare const listGroupRequests: ReturnType<typeof createRESTModule$6<typeof publicListGroupRequests>>;
2289
+ declare const queryGroupRequests: ReturnType<typeof createRESTModule$6<typeof publicQueryGroupRequests>>;
2290
+ declare const onGroupRequestCreated: ReturnType<typeof createEventModule$5<typeof publicOnGroupRequestCreated>>;
2291
+ declare const onGroupRequestApproved: ReturnType<typeof createEventModule$5<typeof publicOnGroupRequestApproved>>;
2292
+ declare const onGroupRequestRejected: ReturnType<typeof createEventModule$5<typeof publicOnGroupRequestRejected>>;
1613
2293
 
2294
+ type context$6_ApproveGroupRequestsRequest = ApproveGroupRequestsRequest;
2295
+ type context$6_ApproveGroupRequestsResponse = ApproveGroupRequestsResponse;
2296
+ type context$6_ApproveGroupRequestsResponseNonNullableFields = ApproveGroupRequestsResponseNonNullableFields;
2297
+ type context$6_CancelGroupRequestRequest = CancelGroupRequestRequest;
2298
+ type context$6_CancelGroupRequestResponse = CancelGroupRequestResponse;
2299
+ type context$6_GroupRequest = GroupRequest;
2300
+ type context$6_GroupRequestApproved = GroupRequestApproved;
2301
+ type context$6_GroupRequestApprovedEnvelope = GroupRequestApprovedEnvelope;
2302
+ type context$6_GroupRequestCreatedEnvelope = GroupRequestCreatedEnvelope;
2303
+ type context$6_GroupRequestRejected = GroupRequestRejected;
2304
+ type context$6_GroupRequestRejectedEnvelope = GroupRequestRejectedEnvelope;
2305
+ type context$6_GroupRequestsQueryBuilder = GroupRequestsQueryBuilder;
2306
+ type context$6_GroupRequestsQueryResult = GroupRequestsQueryResult;
2307
+ type context$6_ListGroupRequestsOptions = ListGroupRequestsOptions;
2308
+ type context$6_ListGroupRequestsRequest = ListGroupRequestsRequest;
2309
+ type context$6_ListGroupRequestsResponse = ListGroupRequestsResponse;
2310
+ type context$6_ListGroupRequestsResponseNonNullableFields = ListGroupRequestsResponseNonNullableFields;
2311
+ type context$6_QueryGroupRequestsOptions = QueryGroupRequestsOptions;
2312
+ type context$6_QueryGroupRequestsRequest = QueryGroupRequestsRequest;
2313
+ type context$6_QueryGroupRequestsResponse = QueryGroupRequestsResponse;
2314
+ type context$6_QueryGroupRequestsResponseNonNullableFields = QueryGroupRequestsResponseNonNullableFields;
2315
+ type context$6_RejectGroupRequestsRequest = RejectGroupRequestsRequest;
2316
+ type context$6_RejectGroupRequestsResponse = RejectGroupRequestsResponse;
2317
+ type context$6_RejectGroupRequestsResponseNonNullableFields = RejectGroupRequestsResponseNonNullableFields;
2318
+ type context$6_SubmitGroupRequestRequest = SubmitGroupRequestRequest;
2319
+ type context$6_SubmitGroupRequestResponse = SubmitGroupRequestResponse;
1614
2320
  declare const context$6_approveGroupRequests: typeof approveGroupRequests;
1615
2321
  declare const context$6_listGroupRequests: typeof listGroupRequests;
1616
2322
  declare const context$6_onGroupRequestApproved: typeof onGroupRequestApproved;
@@ -1619,7 +2325,7 @@ declare const context$6_onGroupRequestRejected: typeof onGroupRequestRejected;
1619
2325
  declare const context$6_queryGroupRequests: typeof queryGroupRequests;
1620
2326
  declare const context$6_rejectGroupRequests: typeof rejectGroupRequests;
1621
2327
  declare namespace context$6 {
1622
- export { context$6_approveGroupRequests as approveGroupRequests, context$6_listGroupRequests as listGroupRequests, context$6_onGroupRequestApproved as onGroupRequestApproved, context$6_onGroupRequestCreated as onGroupRequestCreated, context$6_onGroupRequestRejected as onGroupRequestRejected, context$6_queryGroupRequests as queryGroupRequests, context$6_rejectGroupRequests as rejectGroupRequests };
2328
+ export { type AccessRestriction$1 as AccessRestriction, type AccessRestrictionDataOneOf$1 as AccessRestrictionDataOneOf, type ActionEvent$5 as ActionEvent, AllowPolicy$1 as AllowPolicy, type context$6_ApproveGroupRequestsRequest as ApproveGroupRequestsRequest, type context$6_ApproveGroupRequestsResponse as ApproveGroupRequestsResponse, type context$6_ApproveGroupRequestsResponseNonNullableFields as ApproveGroupRequestsResponseNonNullableFields, type BaseEventMetadata$5 as BaseEventMetadata, type context$6_CancelGroupRequestRequest as CancelGroupRequestRequest, type context$6_CancelGroupRequestResponse as CancelGroupRequestResponse, type CoverImage$1 as CoverImage, type DomainEvent$5 as DomainEvent, type DomainEventBodyOneOf$5 as DomainEventBodyOneOf, type EntityCreatedEvent$5 as EntityCreatedEvent, type EntityDeletedEvent$5 as EntityDeletedEvent, type EntityUpdatedEvent$5 as EntityUpdatedEvent, type EventMetadata$5 as EventMetadata, type Events$1 as Events, type Group$1 as Group, type GroupDetails$1 as GroupDetails, type GroupDetailsPosition$1 as GroupDetailsPosition, type context$6_GroupRequest as GroupRequest, type context$6_GroupRequestApproved as GroupRequestApproved, type context$6_GroupRequestApprovedEnvelope as GroupRequestApprovedEnvelope, type context$6_GroupRequestCreatedEnvelope as GroupRequestCreatedEnvelope, type context$6_GroupRequestRejected as GroupRequestRejected, type context$6_GroupRequestRejectedEnvelope as GroupRequestRejectedEnvelope, type context$6_GroupRequestsQueryBuilder as GroupRequestsQueryBuilder, type context$6_GroupRequestsQueryResult as GroupRequestsQueryResult, type GroupSettings$1 as GroupSettings, type IdentificationData$5 as IdentificationData, type IdentificationDataIdOneOf$5 as IdentificationDataIdOneOf, type Identity$1 as Identity, IdentityType$1 as IdentityType, type Image$1 as Image, ItemsToUpdate$3 as ItemsToUpdate, type context$6_ListGroupRequestsOptions as ListGroupRequestsOptions, type context$6_ListGroupRequestsRequest as ListGroupRequestsRequest, type context$6_ListGroupRequestsResponse as ListGroupRequestsResponse, type context$6_ListGroupRequestsResponseNonNullableFields as ListGroupRequestsResponseNonNullableFields, type Logo$1 as Logo, type MessageEnvelope$5 as MessageEnvelope, type OnboardingStepSettings$1 as OnboardingStepSettings, OwnershipFilter$3 as OwnershipFilter, type Paging$4 as Paging, type PagingMetadata$4 as PagingMetadata, type Position$1 as Position, PrivacyStatus$1 as PrivacyStatus, type Query$3 as Query, type context$6_QueryGroupRequestsOptions as QueryGroupRequestsOptions, type context$6_QueryGroupRequestsRequest as QueryGroupRequestsRequest, type context$6_QueryGroupRequestsResponse as QueryGroupRequestsResponse, type context$6_QueryGroupRequestsResponseNonNullableFields as QueryGroupRequestsResponseNonNullableFields, type context$6_RejectGroupRequestsRequest as RejectGroupRequestsRequest, type context$6_RejectGroupRequestsResponse as RejectGroupRequestsResponse, type context$6_RejectGroupRequestsResponseNonNullableFields as RejectGroupRequestsResponseNonNullableFields, type Rejection$3 as Rejection, type RequestDetails$3 as RequestDetails, RequestStatus$3 as RequestStatus, type RestoreInfo$5 as RestoreInfo, SortOrder$3 as SortOrder, type Sorting$3 as Sorting, StepKey$1 as StepKey, type context$6_SubmitGroupRequestRequest as SubmitGroupRequestRequest, type context$6_SubmitGroupRequestResponse as SubmitGroupRequestResponse, Type$1 as Type, WebhookIdentityType$5 as WebhookIdentityType, context$6_approveGroupRequests as approveGroupRequests, context$6_listGroupRequests as listGroupRequests, context$6_onGroupRequestApproved as onGroupRequestApproved, context$6_onGroupRequestCreated as onGroupRequestCreated, context$6_onGroupRequestRejected as onGroupRequestRejected, context$6_queryGroupRequests as queryGroupRequests, context$6_rejectGroupRequests as rejectGroupRequests };
1623
2329
  }
1624
2330
 
1625
2331
  /**
@@ -1641,6 +2347,24 @@ declare enum Role {
1641
2347
  /** Group administrator. */
1642
2348
  ADMIN = "ADMIN"
1643
2349
  }
2350
+ interface AssignRoleRequest {
2351
+ /** Group ID. */
2352
+ groupId: string;
2353
+ /**
2354
+ * @internal
2355
+ * @internal
2356
+ * @deprecated
2357
+ */
2358
+ siteMemberIds?: string[];
2359
+ /**
2360
+ * Member IDs.
2361
+ *
2362
+ * Max: 100 member IDs
2363
+ */
2364
+ memberIds?: string[];
2365
+ /** Role to assign. */
2366
+ role?: GroupRole;
2367
+ }
1644
2368
  interface AssignRoleResponse {
1645
2369
  /** Group ID. */
1646
2370
  groupId?: string;
@@ -1686,6 +2410,24 @@ interface GroupMember {
1686
2410
  */
1687
2411
  joinedDate?: Date;
1688
2412
  }
2413
+ interface UnassignRoleRequest {
2414
+ /** Group ID. */
2415
+ groupId: string;
2416
+ /**
2417
+ * @internal
2418
+ * @internal
2419
+ * @deprecated
2420
+ */
2421
+ siteMemberIds?: string[];
2422
+ /**
2423
+ * Member IDs.
2424
+ *
2425
+ * Max: 100 member IDs
2426
+ */
2427
+ memberIds?: string[];
2428
+ /** Role to unassign. */
2429
+ role?: GroupRole;
2430
+ }
1689
2431
  interface UnassignRoleResponse {
1690
2432
  /** Group ID. */
1691
2433
  groupId?: string;
@@ -1710,6 +2452,86 @@ interface RoleUnassignedFromGroupMember {
1710
2452
  /** ID of site member who unassigned the role. It can be empty if the role was assigned by a third-party application. */
1711
2453
  unassignedById?: string | null;
1712
2454
  }
2455
+ interface DomainEvent$4 extends DomainEventBodyOneOf$4 {
2456
+ createdEvent?: EntityCreatedEvent$4;
2457
+ updatedEvent?: EntityUpdatedEvent$4;
2458
+ deletedEvent?: EntityDeletedEvent$4;
2459
+ actionEvent?: ActionEvent$4;
2460
+ /**
2461
+ * Unique event ID.
2462
+ * Allows clients to ignore duplicate webhooks.
2463
+ */
2464
+ _id?: string;
2465
+ /**
2466
+ * Assumes actions are also always typed to an entity_type
2467
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2468
+ */
2469
+ entityFqdn?: string;
2470
+ /**
2471
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2472
+ * This is although the created/updated/deleted notion is duplication of the oneof types
2473
+ * Example: created/updated/deleted/started/completed/email_opened
2474
+ */
2475
+ slug?: string;
2476
+ /** ID of the entity associated with the event. */
2477
+ entityId?: string;
2478
+ /** Event timestamp. */
2479
+ eventTime?: Date;
2480
+ /**
2481
+ * Whether the event was triggered as a result of a privacy regulation application
2482
+ * (for example, GDPR).
2483
+ */
2484
+ triggeredByAnonymizeRequest?: boolean | null;
2485
+ /** If present, indicates the action that triggered the event. */
2486
+ originatedFrom?: string | null;
2487
+ /**
2488
+ * A sequence number defining the order of updates to the underlying entity.
2489
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
2490
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2491
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2492
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
2493
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2494
+ */
2495
+ entityEventSequence?: string | null;
2496
+ }
2497
+ /** @oneof */
2498
+ interface DomainEventBodyOneOf$4 {
2499
+ createdEvent?: EntityCreatedEvent$4;
2500
+ updatedEvent?: EntityUpdatedEvent$4;
2501
+ deletedEvent?: EntityDeletedEvent$4;
2502
+ actionEvent?: ActionEvent$4;
2503
+ }
2504
+ interface EntityCreatedEvent$4 {
2505
+ entity?: string;
2506
+ }
2507
+ interface RestoreInfo$4 {
2508
+ deletedDate?: Date;
2509
+ }
2510
+ interface EntityUpdatedEvent$4 {
2511
+ /**
2512
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
2513
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
2514
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
2515
+ */
2516
+ currentEntity?: string;
2517
+ }
2518
+ interface EntityDeletedEvent$4 {
2519
+ /** Entity that was deleted */
2520
+ deletedEntity?: string | null;
2521
+ }
2522
+ interface ActionEvent$4 {
2523
+ body?: string;
2524
+ }
2525
+ interface MessageEnvelope$4 {
2526
+ /** App instance ID. */
2527
+ instanceId?: string | null;
2528
+ /** Event type. */
2529
+ eventType?: string;
2530
+ /** The identification type and identity data. */
2531
+ identity?: IdentificationData$4;
2532
+ /** Stringify payload. */
2533
+ data?: string;
2534
+ }
1713
2535
  interface IdentificationData$4 extends IdentificationDataIdOneOf$4 {
1714
2536
  /** ID of a site visitor that has not logged in to the site. */
1715
2537
  anonymousVisitorId?: string;
@@ -1740,21 +2562,20 @@ declare enum WebhookIdentityType$4 {
1740
2562
  WIX_USER = "WIX_USER",
1741
2563
  APP = "APP"
1742
2564
  }
2565
+ interface GroupRoleNonNullableFields {
2566
+ value: Role;
2567
+ }
1743
2568
  interface AssignRoleResponseNonNullableFields {
1744
2569
  groupId: string;
1745
2570
  siteMemberIds: string[];
1746
2571
  memberIds: string[];
1747
- role?: {
1748
- value: Role;
1749
- };
2572
+ role?: GroupRoleNonNullableFields;
1750
2573
  }
1751
2574
  interface UnassignRoleResponseNonNullableFields {
1752
2575
  groupId: string;
1753
2576
  siteMemberIds: string[];
1754
2577
  memberIds: string[];
1755
- role?: {
1756
- value: Role;
1757
- };
2578
+ role?: GroupRoleNonNullableFields;
1758
2579
  }
1759
2580
  interface BaseEventMetadata$4 {
1760
2581
  /** App instance ID. */
@@ -1825,65 +2646,37 @@ interface UnassignRoleOptions {
1825
2646
  siteMemberIds?: string[];
1826
2647
  }
1827
2648
 
1828
- type RESTFunctionDescriptor$5<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$5) => T;
1829
- interface HttpClient$5 {
1830
- request<TResponse, TData = any>(req: RequestOptionsFactory$5<TResponse, TData>): Promise<HttpResponse$5<TResponse>>;
1831
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
1832
- }
1833
- type RequestOptionsFactory$5<TResponse = any, TData = any> = (context: any) => RequestOptions$5<TResponse, TData>;
1834
- type HttpResponse$5<T = any> = {
1835
- data: T;
1836
- status: number;
1837
- statusText: string;
1838
- headers: any;
1839
- request?: any;
1840
- };
1841
- type RequestOptions$5<_TResponse = any, Data = any> = {
1842
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
1843
- url: string;
1844
- data?: Data;
1845
- params?: URLSearchParams;
1846
- } & APIMetadata$5;
1847
- type APIMetadata$5 = {
1848
- methodFqn?: string;
1849
- entityFqdn?: string;
1850
- packageName?: string;
1851
- };
1852
- type BuildRESTFunction$5<T extends RESTFunctionDescriptor$5> = T extends RESTFunctionDescriptor$5<infer U> ? U : never;
1853
- type EventDefinition$4<Payload = unknown, Type extends string = string> = {
1854
- __type: 'event-definition';
1855
- type: Type;
1856
- isDomainEvent?: boolean;
1857
- transformations?: (envelope: unknown) => Payload;
1858
- __payload: Payload;
1859
- };
1860
- declare function EventDefinition$4<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$4<Payload, Type>;
1861
- type EventHandler$4<T extends EventDefinition$4> = (payload: T['__payload']) => void | Promise<void>;
1862
- type BuildEventDefinition$4<T extends EventDefinition$4<any, string>> = (handler: EventHandler$4<T>) => void;
1863
-
1864
- declare global {
1865
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1866
- interface SymbolConstructor {
1867
- readonly observable: symbol;
1868
- }
1869
- }
2649
+ declare function createRESTModule$5<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
1870
2650
 
1871
- declare function assignRole$1(httpClient: HttpClient$5): (groupId: string, memberIds: string[], role: GroupRole, options?: AssignRoleOptions) => Promise<AssignRoleResponse & AssignRoleResponseNonNullableFields>;
1872
- declare function unassignRole$1(httpClient: HttpClient$5): (groupId: string, memberIds: string[], role: GroupRole, options?: UnassignRoleOptions) => Promise<UnassignRoleResponse & UnassignRoleResponseNonNullableFields>;
1873
- declare const onGroupRoleAssigned$1: EventDefinition$4<GroupRoleAssignedEnvelope, "wix.social_groups.v2.group_role_assigned">;
1874
- declare const onGroupRoleUnassigned$1: EventDefinition$4<GroupRoleUnassignedEnvelope, "wix.social_groups.v2.group_role_unassigned">;
2651
+ declare function createEventModule$4<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1875
2652
 
1876
- declare const assignRole: BuildRESTFunction$5<typeof assignRole$1>;
1877
- declare const unassignRole: BuildRESTFunction$5<typeof unassignRole$1>;
1878
- declare const onGroupRoleAssigned: BuildEventDefinition$4<typeof onGroupRoleAssigned$1>;
1879
- declare const onGroupRoleUnassigned: BuildEventDefinition$4<typeof onGroupRoleUnassigned$1>;
2653
+ declare const assignRole: ReturnType<typeof createRESTModule$5<typeof publicAssignRole>>;
2654
+ declare const unassignRole: ReturnType<typeof createRESTModule$5<typeof publicUnassignRole>>;
2655
+ declare const onGroupRoleAssigned: ReturnType<typeof createEventModule$4<typeof publicOnGroupRoleAssigned>>;
2656
+ declare const onGroupRoleUnassigned: ReturnType<typeof createEventModule$4<typeof publicOnGroupRoleUnassigned>>;
1880
2657
 
2658
+ type context$5_AssignRoleOptions = AssignRoleOptions;
2659
+ type context$5_AssignRoleRequest = AssignRoleRequest;
2660
+ type context$5_AssignRoleResponse = AssignRoleResponse;
2661
+ type context$5_AssignRoleResponseNonNullableFields = AssignRoleResponseNonNullableFields;
2662
+ type context$5_GroupMember = GroupMember;
2663
+ type context$5_GroupRole = GroupRole;
2664
+ type context$5_GroupRoleAssignedEnvelope = GroupRoleAssignedEnvelope;
2665
+ type context$5_GroupRoleUnassignedEnvelope = GroupRoleUnassignedEnvelope;
2666
+ type context$5_Role = Role;
2667
+ declare const context$5_Role: typeof Role;
2668
+ type context$5_RoleAssignedToGroupMember = RoleAssignedToGroupMember;
2669
+ type context$5_RoleUnassignedFromGroupMember = RoleUnassignedFromGroupMember;
2670
+ type context$5_UnassignRoleOptions = UnassignRoleOptions;
2671
+ type context$5_UnassignRoleRequest = UnassignRoleRequest;
2672
+ type context$5_UnassignRoleResponse = UnassignRoleResponse;
2673
+ type context$5_UnassignRoleResponseNonNullableFields = UnassignRoleResponseNonNullableFields;
1881
2674
  declare const context$5_assignRole: typeof assignRole;
1882
2675
  declare const context$5_onGroupRoleAssigned: typeof onGroupRoleAssigned;
1883
2676
  declare const context$5_onGroupRoleUnassigned: typeof onGroupRoleUnassigned;
1884
2677
  declare const context$5_unassignRole: typeof unassignRole;
1885
2678
  declare namespace context$5 {
1886
- export { context$5_assignRole as assignRole, context$5_onGroupRoleAssigned as onGroupRoleAssigned, context$5_onGroupRoleUnassigned as onGroupRoleUnassigned, context$5_unassignRole as unassignRole };
2679
+ export { type ActionEvent$4 as ActionEvent, type context$5_AssignRoleOptions as AssignRoleOptions, type context$5_AssignRoleRequest as AssignRoleRequest, type context$5_AssignRoleResponse as AssignRoleResponse, type context$5_AssignRoleResponseNonNullableFields as AssignRoleResponseNonNullableFields, type BaseEventMetadata$4 as BaseEventMetadata, type DomainEvent$4 as DomainEvent, type DomainEventBodyOneOf$4 as DomainEventBodyOneOf, type EntityCreatedEvent$4 as EntityCreatedEvent, type EntityDeletedEvent$4 as EntityDeletedEvent, type EntityUpdatedEvent$4 as EntityUpdatedEvent, type EventMetadata$4 as EventMetadata, type context$5_GroupMember as GroupMember, type context$5_GroupRole as GroupRole, type context$5_GroupRoleAssignedEnvelope as GroupRoleAssignedEnvelope, type context$5_GroupRoleUnassignedEnvelope as GroupRoleUnassignedEnvelope, type IdentificationData$4 as IdentificationData, type IdentificationDataIdOneOf$4 as IdentificationDataIdOneOf, type MessageEnvelope$4 as MessageEnvelope, type RestoreInfo$4 as RestoreInfo, context$5_Role as Role, type context$5_RoleAssignedToGroupMember as RoleAssignedToGroupMember, type context$5_RoleUnassignedFromGroupMember as RoleUnassignedFromGroupMember, type context$5_UnassignRoleOptions as UnassignRoleOptions, type context$5_UnassignRoleRequest as UnassignRoleRequest, type context$5_UnassignRoleResponse as UnassignRoleResponse, type context$5_UnassignRoleResponseNonNullableFields as UnassignRoleResponseNonNullableFields, WebhookIdentityType$4 as WebhookIdentityType, context$5_assignRole as assignRole, context$5_onGroupRoleAssigned as onGroupRoleAssigned, context$5_onGroupRoleUnassigned as onGroupRoleUnassigned, context$5_unassignRole as unassignRole };
1887
2680
  }
1888
2681
 
1889
2682
  /**
@@ -1900,16 +2693,112 @@ interface GroupRule {
1900
2693
  /** Rule description. */
1901
2694
  description?: string;
1902
2695
  }
2696
+ interface ListRulesRequest {
2697
+ /** Group ID. */
2698
+ groupId: string;
2699
+ }
1903
2700
  interface ListRulesResponse {
1904
2701
  /** Retrieved rules. */
1905
2702
  rules?: GroupRule[];
1906
2703
  }
2704
+ interface CreateOrReplaceAllRulesRequest {
2705
+ /** Group ID. */
2706
+ groupId: string;
2707
+ /** New rules. */
2708
+ rules?: GroupRule[];
2709
+ }
1907
2710
  interface CreateOrReplaceAllRulesResponse {
1908
2711
  /** Group ID. */
1909
2712
  groupId?: string;
1910
2713
  /** Rules. */
1911
2714
  rules?: GroupRule[];
1912
2715
  }
2716
+ interface Empty {
2717
+ }
2718
+ interface ListTemplatesResponse {
2719
+ /** Retrieved rule templates. */
2720
+ rules?: GroupRule[];
2721
+ }
2722
+ interface DomainEvent$3 extends DomainEventBodyOneOf$3 {
2723
+ createdEvent?: EntityCreatedEvent$3;
2724
+ updatedEvent?: EntityUpdatedEvent$3;
2725
+ deletedEvent?: EntityDeletedEvent$3;
2726
+ actionEvent?: ActionEvent$3;
2727
+ /**
2728
+ * Unique event ID.
2729
+ * Allows clients to ignore duplicate webhooks.
2730
+ */
2731
+ _id?: string;
2732
+ /**
2733
+ * Assumes actions are also always typed to an entity_type
2734
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2735
+ */
2736
+ entityFqdn?: string;
2737
+ /**
2738
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2739
+ * This is although the created/updated/deleted notion is duplication of the oneof types
2740
+ * Example: created/updated/deleted/started/completed/email_opened
2741
+ */
2742
+ slug?: string;
2743
+ /** ID of the entity associated with the event. */
2744
+ entityId?: string;
2745
+ /** Event timestamp. */
2746
+ eventTime?: Date;
2747
+ /**
2748
+ * Whether the event was triggered as a result of a privacy regulation application
2749
+ * (for example, GDPR).
2750
+ */
2751
+ triggeredByAnonymizeRequest?: boolean | null;
2752
+ /** If present, indicates the action that triggered the event. */
2753
+ originatedFrom?: string | null;
2754
+ /**
2755
+ * A sequence number defining the order of updates to the underlying entity.
2756
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
2757
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2758
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2759
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
2760
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2761
+ */
2762
+ entityEventSequence?: string | null;
2763
+ }
2764
+ /** @oneof */
2765
+ interface DomainEventBodyOneOf$3 {
2766
+ createdEvent?: EntityCreatedEvent$3;
2767
+ updatedEvent?: EntityUpdatedEvent$3;
2768
+ deletedEvent?: EntityDeletedEvent$3;
2769
+ actionEvent?: ActionEvent$3;
2770
+ }
2771
+ interface EntityCreatedEvent$3 {
2772
+ entity?: string;
2773
+ }
2774
+ interface RestoreInfo$3 {
2775
+ deletedDate?: Date;
2776
+ }
2777
+ interface EntityUpdatedEvent$3 {
2778
+ /**
2779
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
2780
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
2781
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
2782
+ */
2783
+ currentEntity?: string;
2784
+ }
2785
+ interface EntityDeletedEvent$3 {
2786
+ /** Entity that was deleted */
2787
+ deletedEntity?: string | null;
2788
+ }
2789
+ interface ActionEvent$3 {
2790
+ body?: string;
2791
+ }
2792
+ interface MessageEnvelope$3 {
2793
+ /** App instance ID. */
2794
+ instanceId?: string | null;
2795
+ /** Event type. */
2796
+ eventType?: string;
2797
+ /** The identification type and identity data. */
2798
+ identity?: IdentificationData$3;
2799
+ /** Stringify payload. */
2800
+ data?: string;
2801
+ }
1913
2802
  interface IdentificationData$3 extends IdentificationDataIdOneOf$3 {
1914
2803
  /** ID of a site visitor that has not logged in to the site. */
1915
2804
  anonymousVisitorId?: string;
@@ -1940,18 +2829,16 @@ declare enum WebhookIdentityType$3 {
1940
2829
  WIX_USER = "WIX_USER",
1941
2830
  APP = "APP"
1942
2831
  }
2832
+ interface GroupRuleNonNullableFields {
2833
+ title: string;
2834
+ description: string;
2835
+ }
1943
2836
  interface ListRulesResponseNonNullableFields {
1944
- rules: {
1945
- title: string;
1946
- description: string;
1947
- }[];
2837
+ rules: GroupRuleNonNullableFields[];
1948
2838
  }
1949
2839
  interface CreateOrReplaceAllRulesResponseNonNullableFields {
1950
2840
  groupId: string;
1951
- rules: {
1952
- title: string;
1953
- description: string;
1954
- }[];
2841
+ rules: GroupRuleNonNullableFields[];
1955
2842
  }
1956
2843
  interface BaseEventMetadata$3 {
1957
2844
  /** App instance ID. */
@@ -1995,75 +2882,44 @@ interface EventMetadata$3 extends BaseEventMetadata$3 {
1995
2882
  * it is guaranteed that the sequence number of the second update is strictly higher than the first.
1996
2883
  * As the consumer, you can use this value to ensure that you handle messages in the correct order.
1997
2884
  * To do so, you will need to persist this number on your end, and compare the sequence number from the
1998
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
1999
- */
2000
- entityEventSequence?: string | null;
2001
- }
2002
- interface GroupRulesUpdatedEnvelope {
2003
- entity: GroupRules;
2004
- metadata: EventMetadata$3;
2005
- }
2006
- interface CreateOrReplaceAllRulesOptions {
2007
- /** New rules. */
2008
- rules?: GroupRule[];
2009
- }
2010
-
2011
- type RESTFunctionDescriptor$4<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$4) => T;
2012
- interface HttpClient$4 {
2013
- request<TResponse, TData = any>(req: RequestOptionsFactory$4<TResponse, TData>): Promise<HttpResponse$4<TResponse>>;
2014
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
2015
- }
2016
- type RequestOptionsFactory$4<TResponse = any, TData = any> = (context: any) => RequestOptions$4<TResponse, TData>;
2017
- type HttpResponse$4<T = any> = {
2018
- data: T;
2019
- status: number;
2020
- statusText: string;
2021
- headers: any;
2022
- request?: any;
2023
- };
2024
- type RequestOptions$4<_TResponse = any, Data = any> = {
2025
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
2026
- url: string;
2027
- data?: Data;
2028
- params?: URLSearchParams;
2029
- } & APIMetadata$4;
2030
- type APIMetadata$4 = {
2031
- methodFqn?: string;
2032
- entityFqdn?: string;
2033
- packageName?: string;
2034
- };
2035
- type BuildRESTFunction$4<T extends RESTFunctionDescriptor$4> = T extends RESTFunctionDescriptor$4<infer U> ? U : never;
2036
- type EventDefinition$3<Payload = unknown, Type extends string = string> = {
2037
- __type: 'event-definition';
2038
- type: Type;
2039
- isDomainEvent?: boolean;
2040
- transformations?: (envelope: unknown) => Payload;
2041
- __payload: Payload;
2042
- };
2043
- declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
2044
- type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
2045
- type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
2046
-
2047
- declare global {
2048
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2049
- interface SymbolConstructor {
2050
- readonly observable: symbol;
2051
- }
2885
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2886
+ */
2887
+ entityEventSequence?: string | null;
2888
+ }
2889
+ interface GroupRulesUpdatedEnvelope {
2890
+ entity: GroupRules;
2891
+ metadata: EventMetadata$3;
2892
+ }
2893
+ interface CreateOrReplaceAllRulesOptions {
2894
+ /** New rules. */
2895
+ rules?: GroupRule[];
2052
2896
  }
2053
2897
 
2054
- declare function listRules$1(httpClient: HttpClient$4): (groupId: string) => Promise<ListRulesResponse & ListRulesResponseNonNullableFields>;
2055
- declare function createOrReplaceAllRules$1(httpClient: HttpClient$4): (groupId: string, options?: CreateOrReplaceAllRulesOptions) => Promise<CreateOrReplaceAllRulesResponse & CreateOrReplaceAllRulesResponseNonNullableFields>;
2056
- declare const onGroupRulesUpdated$1: EventDefinition$3<GroupRulesUpdatedEnvelope, "wix.social_groups.v2.group_rules_updated">;
2898
+ declare function createRESTModule$4<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
2899
+
2900
+ declare function createEventModule$3<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
2057
2901
 
2058
- declare const listRules: BuildRESTFunction$4<typeof listRules$1>;
2059
- declare const createOrReplaceAllRules: BuildRESTFunction$4<typeof createOrReplaceAllRules$1>;
2060
- declare const onGroupRulesUpdated: BuildEventDefinition$3<typeof onGroupRulesUpdated$1>;
2902
+ declare const listRules: ReturnType<typeof createRESTModule$4<typeof publicListRules>>;
2903
+ declare const createOrReplaceAllRules: ReturnType<typeof createRESTModule$4<typeof publicCreateOrReplaceAllRules>>;
2904
+ declare const onGroupRulesUpdated: ReturnType<typeof createEventModule$3<typeof publicOnGroupRulesUpdated>>;
2061
2905
 
2906
+ type context$4_CreateOrReplaceAllRulesOptions = CreateOrReplaceAllRulesOptions;
2907
+ type context$4_CreateOrReplaceAllRulesRequest = CreateOrReplaceAllRulesRequest;
2908
+ type context$4_CreateOrReplaceAllRulesResponse = CreateOrReplaceAllRulesResponse;
2909
+ type context$4_CreateOrReplaceAllRulesResponseNonNullableFields = CreateOrReplaceAllRulesResponseNonNullableFields;
2910
+ type context$4_Empty = Empty;
2911
+ type context$4_GroupRule = GroupRule;
2912
+ type context$4_GroupRules = GroupRules;
2913
+ type context$4_GroupRulesUpdatedEnvelope = GroupRulesUpdatedEnvelope;
2914
+ type context$4_ListRulesRequest = ListRulesRequest;
2915
+ type context$4_ListRulesResponse = ListRulesResponse;
2916
+ type context$4_ListRulesResponseNonNullableFields = ListRulesResponseNonNullableFields;
2917
+ type context$4_ListTemplatesResponse = ListTemplatesResponse;
2062
2918
  declare const context$4_createOrReplaceAllRules: typeof createOrReplaceAllRules;
2063
2919
  declare const context$4_listRules: typeof listRules;
2064
2920
  declare const context$4_onGroupRulesUpdated: typeof onGroupRulesUpdated;
2065
2921
  declare namespace context$4 {
2066
- export { context$4_createOrReplaceAllRules as createOrReplaceAllRules, context$4_listRules as listRules, context$4_onGroupRulesUpdated as onGroupRulesUpdated };
2922
+ export { type ActionEvent$3 as ActionEvent, type BaseEventMetadata$3 as BaseEventMetadata, type context$4_CreateOrReplaceAllRulesOptions as CreateOrReplaceAllRulesOptions, type context$4_CreateOrReplaceAllRulesRequest as CreateOrReplaceAllRulesRequest, type context$4_CreateOrReplaceAllRulesResponse as CreateOrReplaceAllRulesResponse, type context$4_CreateOrReplaceAllRulesResponseNonNullableFields as CreateOrReplaceAllRulesResponseNonNullableFields, type DomainEvent$3 as DomainEvent, type DomainEventBodyOneOf$3 as DomainEventBodyOneOf, type context$4_Empty as Empty, type EntityCreatedEvent$3 as EntityCreatedEvent, type EntityDeletedEvent$3 as EntityDeletedEvent, type EntityUpdatedEvent$3 as EntityUpdatedEvent, type EventMetadata$3 as EventMetadata, type context$4_GroupRule as GroupRule, type context$4_GroupRules as GroupRules, type context$4_GroupRulesUpdatedEnvelope as GroupRulesUpdatedEnvelope, type IdentificationData$3 as IdentificationData, type IdentificationDataIdOneOf$3 as IdentificationDataIdOneOf, type context$4_ListRulesRequest as ListRulesRequest, type context$4_ListRulesResponse as ListRulesResponse, type context$4_ListRulesResponseNonNullableFields as ListRulesResponseNonNullableFields, type context$4_ListTemplatesResponse as ListTemplatesResponse, type MessageEnvelope$3 as MessageEnvelope, type RestoreInfo$3 as RestoreInfo, WebhookIdentityType$3 as WebhookIdentityType, context$4_createOrReplaceAllRules as createOrReplaceAllRules, context$4_listRules as listRules, context$4_onGroupRulesUpdated as onGroupRulesUpdated };
2067
2923
  }
2068
2924
 
2069
2925
  /**
@@ -2107,6 +2963,144 @@ interface RequestDetails$2 {
2107
2963
  /** Reason the request to join a group was rejected. */
2108
2964
  rejectionReason?: string | null;
2109
2965
  }
2966
+ interface SocialGroupsEvent extends SocialGroupsEventPayloadOneOf {
2967
+ memberJoined?: MemberJoinedGroup;
2968
+ membersAdded?: MembersAddedToGroup;
2969
+ joinRequestsApproved?: JoinRequestsApproved;
2970
+ membersInvited?: MembersInvitedToGroup;
2971
+ }
2972
+ /** @oneof */
2973
+ interface SocialGroupsEventPayloadOneOf {
2974
+ memberJoined?: MemberJoinedGroup;
2975
+ membersAdded?: MembersAddedToGroup;
2976
+ joinRequestsApproved?: JoinRequestsApproved;
2977
+ membersInvited?: MembersInvitedToGroup;
2978
+ }
2979
+ interface MemberJoinedGroup {
2980
+ groupId?: string;
2981
+ groupsInstanceId?: string;
2982
+ siteMemberId?: string;
2983
+ }
2984
+ interface MembersAddedToGroup {
2985
+ groupId?: string;
2986
+ groupsInstanceId?: string;
2987
+ whoAddedId?: string | null;
2988
+ siteMemberIds?: string[];
2989
+ /** Used for Apes sticky experiment */
2990
+ operationId?: string;
2991
+ }
2992
+ interface JoinRequestsApproved {
2993
+ groupId?: string;
2994
+ groupsInstanceId?: string;
2995
+ siteMemberIds?: string[];
2996
+ /** Used for Apes sticky experiment */
2997
+ operationId?: string;
2998
+ }
2999
+ interface MembersInvitedToGroup {
3000
+ groupId?: string;
3001
+ groupsInstanceId?: string;
3002
+ siteMemberIds?: string[];
3003
+ }
3004
+ interface GetJoinRequirementsRequest {
3005
+ /** ID of the group requested to join. */
3006
+ groupId?: string;
3007
+ /** Answers to membership questions. They can be empty, but submit join group request will fail if an answer to a required question is omitted. */
3008
+ membershipQuestionAnswers?: MembershipQuestionAnswer$2[];
3009
+ autoInviteId?: string | null;
3010
+ }
3011
+ /** Answer to a membership question. */
3012
+ interface MembershipQuestionAnswer$2 {
3013
+ /** Question ID. */
3014
+ _id?: string;
3015
+ /** Answer text. */
3016
+ text?: string | null;
3017
+ }
3018
+ interface GetJoinRequirementsResponse {
3019
+ violation?: Violation;
3020
+ }
3021
+ interface PaidPlan {
3022
+ planId?: string;
3023
+ name?: string;
3024
+ startsAt?: Date;
3025
+ }
3026
+ declare enum ViolationType {
3027
+ NONE = "NONE",
3028
+ NOT_LOGGED_IN = "NOT_LOGGED_IN",
3029
+ ALREADY_JOINED = "ALREADY_JOINED",
3030
+ SECRET_GROUP = "SECRET_GROUP",
3031
+ EVENTS = "EVENTS",
3032
+ PRICING_PlANS = "PRICING_PlANS",
3033
+ MEMBERSHIP_QUESTIONS = "MEMBERSHIP_QUESTIONS",
3034
+ ADMIN_APPROVAL = "ADMIN_APPROVAL"
3035
+ }
3036
+ interface EventsViolationOptions {
3037
+ /** Events which allow user to join the group. */
3038
+ eventIds?: string[];
3039
+ }
3040
+ interface PricingPlanViolationOptions {
3041
+ installed?: boolean;
3042
+ /** Plan ids which allow user to join the group. */
3043
+ requiredPlans?: PaidPlan[];
3044
+ /** Plan ids which user have, but they don't allow to join group right now, because they start some time in the future. */
3045
+ futurePlans?: PaidPlan[];
3046
+ }
3047
+ interface MembershipQuestionViolationOptions {
3048
+ requiredQuestionIds?: string[];
3049
+ }
3050
+ interface Violation extends ViolationViolationOptionsOneOf {
3051
+ eventsOptions?: EventsViolationOptions;
3052
+ pricingPlansOptions?: PricingPlanViolationOptions;
3053
+ membershipQuestionsOptions?: MembershipQuestionViolationOptions;
3054
+ violationType?: ViolationType;
3055
+ }
3056
+ /** @oneof */
3057
+ interface ViolationViolationOptionsOneOf {
3058
+ eventsOptions?: EventsViolationOptions;
3059
+ pricingPlansOptions?: PricingPlanViolationOptions;
3060
+ membershipQuestionsOptions?: MembershipQuestionViolationOptions;
3061
+ }
3062
+ interface SubmitJoinGroupRequestRequest {
3063
+ /** ID of the group requested to join. */
3064
+ groupId?: string;
3065
+ /** Answers to membership questions. They can be empty, but submit join group request will fail if an answer to a required question is omitted. */
3066
+ membershipQuestionAnswers?: MembershipQuestionAnswer$2[];
3067
+ }
3068
+ interface SubmitJoinGroupRequestResponse {
3069
+ /** Submitted join group request. */
3070
+ joinGroupRequest?: JoinGroupRequest;
3071
+ }
3072
+ interface CancelJoinGroupRequestRequest {
3073
+ /** ID of the group requested to join. */
3074
+ groupId?: string;
3075
+ }
3076
+ interface CancelJoinGroupRequestResponse {
3077
+ /** Cancelled join group request. */
3078
+ joinGroupRequest?: JoinGroupRequest;
3079
+ }
3080
+ interface JoinGroupRequestCancelled {
3081
+ /** Group ID for which join request was cancelled. */
3082
+ groupId?: string;
3083
+ /** Cancelled join group request. */
3084
+ joinGroupRequest?: JoinGroupRequest;
3085
+ }
3086
+ interface ApproveJoinGroupRequestsRequest {
3087
+ /** ID of the group requested to join. */
3088
+ groupId: string;
3089
+ /**
3090
+ * @Internal
3091
+ * @Internal
3092
+ * @deprecated
3093
+ */
3094
+ siteMemberIds?: string[];
3095
+ /** IDs of the site members to approve. */
3096
+ memberIds?: string[];
3097
+ }
3098
+ declare enum ItemsToUpdate$2 {
3099
+ /** Take into account only items which are listed in request. */
3100
+ BY_ID = "BY_ID",
3101
+ /** Update all items. */
3102
+ ALL_ITEMS = "ALL_ITEMS"
3103
+ }
2110
3104
  interface ApproveJoinGroupRequestsResponse {
2111
3105
  /** Approved join group requests. */
2112
3106
  joinGroupRequests?: JoinGroupRequest[];
@@ -2117,6 +3111,12 @@ interface JoinGroupRequestApproved {
2117
3111
  /** Approved join group request. */
2118
3112
  joinGroupRequest?: JoinGroupRequest;
2119
3113
  }
3114
+ interface RejectJoinGroupRequestsRequest {
3115
+ /** ID of the group requested to join. */
3116
+ groupId: string;
3117
+ /** Rejection data. */
3118
+ rejections?: Rejection$2[];
3119
+ }
2120
3120
  interface Rejection$2 {
2121
3121
  /** Member ID to reject. */
2122
3122
  memberId?: string;
@@ -2133,6 +3133,18 @@ interface JoinGroupRequestRejected {
2133
3133
  /** Rejected join group request. */
2134
3134
  joinGroupRequest?: JoinGroupRequest;
2135
3135
  }
3136
+ interface ListJoinGroupRequestsRequest {
3137
+ /** ID of the group requested to join. */
3138
+ groupId: string;
3139
+ limit?: number | null;
3140
+ offset?: number | null;
3141
+ }
3142
+ declare enum OwnershipFilter$2 {
3143
+ /** All items. */
3144
+ ALL = "ALL",
3145
+ /** Items for current site member. */
3146
+ CURRENT_MEMBER = "CURRENT_MEMBER"
3147
+ }
2136
3148
  interface ListJoinGroupRequestsResponse {
2137
3149
  /** Join group requests. */
2138
3150
  joinGroupRequests?: JoinGroupRequest[];
@@ -2148,6 +3160,154 @@ interface PagingMetadata$3 {
2148
3160
  /** Flag that indicates the server failed to calculate the `total` field. */
2149
3161
  tooManyToCount?: boolean | null;
2150
3162
  }
3163
+ interface QueryJoinGroupRequestsRequest {
3164
+ /** ID of the group requested to join. */
3165
+ groupId: string;
3166
+ query?: Query$2;
3167
+ }
3168
+ interface Query$2 {
3169
+ /**
3170
+ * Filter object in the following format:
3171
+ * `"filter" : {
3172
+ * "fieldName1": "value1",
3173
+ * "fieldName2":{"$operator":"value2"}
3174
+ * }`
3175
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
3176
+ */
3177
+ filter?: any;
3178
+ /**
3179
+ * Sort object in the following format:
3180
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
3181
+ */
3182
+ sort?: Sorting$2[];
3183
+ /** Paging options to limit and skip the number of items. */
3184
+ paging?: Paging$3;
3185
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
3186
+ fields?: string[];
3187
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
3188
+ fieldsets?: string[];
3189
+ }
3190
+ interface Sorting$2 {
3191
+ /** Name of the field to sort by. */
3192
+ fieldName?: string;
3193
+ /** Sort order. */
3194
+ order?: SortOrder$2;
3195
+ }
3196
+ declare enum SortOrder$2 {
3197
+ ASC = "ASC",
3198
+ DESC = "DESC"
3199
+ }
3200
+ interface Paging$3 {
3201
+ /** Number of items to load. */
3202
+ limit?: number | null;
3203
+ /** Number of items to skip in the current sort order. */
3204
+ offset?: number | null;
3205
+ }
3206
+ interface QueryJoinGroupRequestsResponse {
3207
+ /** Requests to join a group. */
3208
+ joinGroupRequests?: JoinGroupRequest[];
3209
+ metadata?: PagingMetadata$3;
3210
+ }
3211
+ interface RejectAllJoinGroupRequestsRequest {
3212
+ }
3213
+ interface RejectAllJoinGroupRequestsResponse {
3214
+ /** Rejected join group requests. */
3215
+ joinGroupRequests?: JoinGroupRequest[];
3216
+ }
3217
+ interface ApproveAllJoinGroupRequestsRequest {
3218
+ }
3219
+ interface ApproveAllJoinGroupRequestsResponse {
3220
+ /** Rejected join group requests. */
3221
+ joinGroupRequests?: JoinGroupRequest[];
3222
+ }
3223
+ interface ListAllJoinGroupRequestsRequest {
3224
+ query?: Query$2;
3225
+ }
3226
+ interface ListAllJoinGroupRequestsResponse {
3227
+ /** Join group requests. */
3228
+ joinGroupRequests?: JoinGroupRequest[];
3229
+ metadata?: PagingMetadata$3;
3230
+ }
3231
+ interface DomainEvent$2 extends DomainEventBodyOneOf$2 {
3232
+ createdEvent?: EntityCreatedEvent$2;
3233
+ updatedEvent?: EntityUpdatedEvent$2;
3234
+ deletedEvent?: EntityDeletedEvent$2;
3235
+ actionEvent?: ActionEvent$2;
3236
+ /**
3237
+ * Unique event ID.
3238
+ * Allows clients to ignore duplicate webhooks.
3239
+ */
3240
+ _id?: string;
3241
+ /**
3242
+ * Assumes actions are also always typed to an entity_type
3243
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
3244
+ */
3245
+ entityFqdn?: string;
3246
+ /**
3247
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
3248
+ * This is although the created/updated/deleted notion is duplication of the oneof types
3249
+ * Example: created/updated/deleted/started/completed/email_opened
3250
+ */
3251
+ slug?: string;
3252
+ /** ID of the entity associated with the event. */
3253
+ entityId?: string;
3254
+ /** Event timestamp. */
3255
+ eventTime?: Date;
3256
+ /**
3257
+ * Whether the event was triggered as a result of a privacy regulation application
3258
+ * (for example, GDPR).
3259
+ */
3260
+ triggeredByAnonymizeRequest?: boolean | null;
3261
+ /** If present, indicates the action that triggered the event. */
3262
+ originatedFrom?: string | null;
3263
+ /**
3264
+ * A sequence number defining the order of updates to the underlying entity.
3265
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
3266
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
3267
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
3268
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
3269
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
3270
+ */
3271
+ entityEventSequence?: string | null;
3272
+ }
3273
+ /** @oneof */
3274
+ interface DomainEventBodyOneOf$2 {
3275
+ createdEvent?: EntityCreatedEvent$2;
3276
+ updatedEvent?: EntityUpdatedEvent$2;
3277
+ deletedEvent?: EntityDeletedEvent$2;
3278
+ actionEvent?: ActionEvent$2;
3279
+ }
3280
+ interface EntityCreatedEvent$2 {
3281
+ entity?: string;
3282
+ }
3283
+ interface RestoreInfo$2 {
3284
+ deletedDate?: Date;
3285
+ }
3286
+ interface EntityUpdatedEvent$2 {
3287
+ /**
3288
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
3289
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
3290
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
3291
+ */
3292
+ currentEntity?: string;
3293
+ }
3294
+ interface EntityDeletedEvent$2 {
3295
+ /** Entity that was deleted */
3296
+ deletedEntity?: string | null;
3297
+ }
3298
+ interface ActionEvent$2 {
3299
+ body?: string;
3300
+ }
3301
+ interface MessageEnvelope$2 {
3302
+ /** App instance ID. */
3303
+ instanceId?: string | null;
3304
+ /** Event type. */
3305
+ eventType?: string;
3306
+ /** The identification type and identity data. */
3307
+ identity?: IdentificationData$2;
3308
+ /** Stringify payload. */
3309
+ data?: string;
3310
+ }
2151
3311
  interface IdentificationData$2 extends IdentificationDataIdOneOf$2 {
2152
3312
  /** ID of a site visitor that has not logged in to the site. */
2153
3313
  anonymousVisitorId?: string;
@@ -2178,26 +3338,22 @@ declare enum WebhookIdentityType$2 {
2178
3338
  WIX_USER = "WIX_USER",
2179
3339
  APP = "APP"
2180
3340
  }
3341
+ interface JoinGroupRequestNonNullableFields {
3342
+ siteMemberId: string;
3343
+ contactId: string;
3344
+ status: RequestStatus$2;
3345
+ }
2181
3346
  interface ApproveJoinGroupRequestsResponseNonNullableFields {
2182
- joinGroupRequests: {
2183
- siteMemberId: string;
2184
- contactId: string;
2185
- status: RequestStatus$2;
2186
- }[];
3347
+ joinGroupRequests: JoinGroupRequestNonNullableFields[];
2187
3348
  }
2188
3349
  interface RejectJoinGroupRequestsResponseNonNullableFields {
2189
- joinGroupRequests: {
2190
- siteMemberId: string;
2191
- contactId: string;
2192
- status: RequestStatus$2;
2193
- }[];
3350
+ joinGroupRequests: JoinGroupRequestNonNullableFields[];
2194
3351
  }
2195
3352
  interface ListJoinGroupRequestsResponseNonNullableFields {
2196
- joinGroupRequests: {
2197
- siteMemberId: string;
2198
- contactId: string;
2199
- status: RequestStatus$2;
2200
- }[];
3353
+ joinGroupRequests: JoinGroupRequestNonNullableFields[];
3354
+ }
3355
+ interface QueryJoinGroupRequestsResponseNonNullableFields {
3356
+ joinGroupRequests: JoinGroupRequestNonNullableFields[];
2201
3357
  }
2202
3358
  interface BaseEventMetadata$2 {
2203
3359
  /** App instance ID. */
@@ -2308,65 +3464,68 @@ interface JoinGroupRequestsQueryBuilder {
2308
3464
  find: () => Promise<JoinGroupRequestsQueryResult>;
2309
3465
  }
2310
3466
 
2311
- type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
2312
- interface HttpClient$3 {
2313
- request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
2314
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
2315
- }
2316
- type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
2317
- type HttpResponse$3<T = any> = {
2318
- data: T;
2319
- status: number;
2320
- statusText: string;
2321
- headers: any;
2322
- request?: any;
2323
- };
2324
- type RequestOptions$3<_TResponse = any, Data = any> = {
2325
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
2326
- url: string;
2327
- data?: Data;
2328
- params?: URLSearchParams;
2329
- } & APIMetadata$3;
2330
- type APIMetadata$3 = {
2331
- methodFqn?: string;
2332
- entityFqdn?: string;
2333
- packageName?: string;
2334
- };
2335
- type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
2336
- type EventDefinition$2<Payload = unknown, Type extends string = string> = {
2337
- __type: 'event-definition';
2338
- type: Type;
2339
- isDomainEvent?: boolean;
2340
- transformations?: (envelope: unknown) => Payload;
2341
- __payload: Payload;
2342
- };
2343
- declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
2344
- type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
2345
- type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
2346
-
2347
- declare global {
2348
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2349
- interface SymbolConstructor {
2350
- readonly observable: symbol;
2351
- }
2352
- }
3467
+ declare function createRESTModule$3<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
2353
3468
 
2354
- declare function approveJoinGroupRequests$1(httpClient: HttpClient$3): (groupId: string, memberIds: string[], options?: ApproveJoinGroupRequestsOptions) => Promise<ApproveJoinGroupRequestsResponse & ApproveJoinGroupRequestsResponseNonNullableFields>;
2355
- declare function rejectJoinGroupRequests$1(httpClient: HttpClient$3): (groupId: string, rejections: Rejection$2[]) => Promise<RejectJoinGroupRequestsResponse & RejectJoinGroupRequestsResponseNonNullableFields>;
2356
- declare function listJoinGroupRequests$1(httpClient: HttpClient$3): (groupId: string, options?: ListJoinGroupRequestsOptions) => Promise<ListJoinGroupRequestsResponse & ListJoinGroupRequestsResponseNonNullableFields>;
2357
- declare function queryJoinGroupRequests$1(httpClient: HttpClient$3): (groupId: string, options?: QueryJoinGroupRequestsOptions) => JoinGroupRequestsQueryBuilder;
2358
- declare const onJoinGroupRequestCreated$1: EventDefinition$2<JoinGroupRequestCreatedEnvelope, "wix.social_groups.v2.join_group_request_created">;
2359
- declare const onJoinGroupRequestApproved$1: EventDefinition$2<JoinGroupRequestApprovedEnvelope, "wix.social_groups.v2.join_group_request_approved">;
2360
- declare const onJoinGroupRequestRejected$1: EventDefinition$2<JoinGroupRequestRejectedEnvelope, "wix.social_groups.v2.join_group_request_rejected">;
3469
+ declare function createEventModule$2<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
2361
3470
 
2362
- declare const approveJoinGroupRequests: BuildRESTFunction$3<typeof approveJoinGroupRequests$1>;
2363
- declare const rejectJoinGroupRequests: BuildRESTFunction$3<typeof rejectJoinGroupRequests$1>;
2364
- declare const listJoinGroupRequests: BuildRESTFunction$3<typeof listJoinGroupRequests$1>;
2365
- declare const queryJoinGroupRequests: BuildRESTFunction$3<typeof queryJoinGroupRequests$1>;
2366
- declare const onJoinGroupRequestCreated: BuildEventDefinition$2<typeof onJoinGroupRequestCreated$1>;
2367
- declare const onJoinGroupRequestApproved: BuildEventDefinition$2<typeof onJoinGroupRequestApproved$1>;
2368
- declare const onJoinGroupRequestRejected: BuildEventDefinition$2<typeof onJoinGroupRequestRejected$1>;
3471
+ declare const approveJoinGroupRequests: ReturnType<typeof createRESTModule$3<typeof publicApproveJoinGroupRequests>>;
3472
+ declare const rejectJoinGroupRequests: ReturnType<typeof createRESTModule$3<typeof publicRejectJoinGroupRequests>>;
3473
+ declare const listJoinGroupRequests: ReturnType<typeof createRESTModule$3<typeof publicListJoinGroupRequests>>;
3474
+ declare const queryJoinGroupRequests: ReturnType<typeof createRESTModule$3<typeof publicQueryJoinGroupRequests>>;
3475
+ declare const onJoinGroupRequestCreated: ReturnType<typeof createEventModule$2<typeof publicOnJoinGroupRequestCreated>>;
3476
+ declare const onJoinGroupRequestApproved: ReturnType<typeof createEventModule$2<typeof publicOnJoinGroupRequestApproved>>;
3477
+ declare const onJoinGroupRequestRejected: ReturnType<typeof createEventModule$2<typeof publicOnJoinGroupRequestRejected>>;
2369
3478
 
3479
+ type context$3_ApproveAllJoinGroupRequestsRequest = ApproveAllJoinGroupRequestsRequest;
3480
+ type context$3_ApproveAllJoinGroupRequestsResponse = ApproveAllJoinGroupRequestsResponse;
3481
+ type context$3_ApproveJoinGroupRequestsOptions = ApproveJoinGroupRequestsOptions;
3482
+ type context$3_ApproveJoinGroupRequestsRequest = ApproveJoinGroupRequestsRequest;
3483
+ type context$3_ApproveJoinGroupRequestsResponse = ApproveJoinGroupRequestsResponse;
3484
+ type context$3_ApproveJoinGroupRequestsResponseNonNullableFields = ApproveJoinGroupRequestsResponseNonNullableFields;
3485
+ type context$3_CancelJoinGroupRequestRequest = CancelJoinGroupRequestRequest;
3486
+ type context$3_CancelJoinGroupRequestResponse = CancelJoinGroupRequestResponse;
3487
+ type context$3_EventsViolationOptions = EventsViolationOptions;
3488
+ type context$3_GetJoinRequirementsRequest = GetJoinRequirementsRequest;
3489
+ type context$3_GetJoinRequirementsResponse = GetJoinRequirementsResponse;
3490
+ type context$3_JoinGroupRequest = JoinGroupRequest;
3491
+ type context$3_JoinGroupRequestApproved = JoinGroupRequestApproved;
3492
+ type context$3_JoinGroupRequestApprovedEnvelope = JoinGroupRequestApprovedEnvelope;
3493
+ type context$3_JoinGroupRequestCancelled = JoinGroupRequestCancelled;
3494
+ type context$3_JoinGroupRequestCreatedEnvelope = JoinGroupRequestCreatedEnvelope;
3495
+ type context$3_JoinGroupRequestRejected = JoinGroupRequestRejected;
3496
+ type context$3_JoinGroupRequestRejectedEnvelope = JoinGroupRequestRejectedEnvelope;
3497
+ type context$3_JoinGroupRequestsQueryBuilder = JoinGroupRequestsQueryBuilder;
3498
+ type context$3_JoinGroupRequestsQueryResult = JoinGroupRequestsQueryResult;
3499
+ type context$3_JoinRequestsApproved = JoinRequestsApproved;
3500
+ type context$3_ListAllJoinGroupRequestsRequest = ListAllJoinGroupRequestsRequest;
3501
+ type context$3_ListAllJoinGroupRequestsResponse = ListAllJoinGroupRequestsResponse;
3502
+ type context$3_ListJoinGroupRequestsOptions = ListJoinGroupRequestsOptions;
3503
+ type context$3_ListJoinGroupRequestsRequest = ListJoinGroupRequestsRequest;
3504
+ type context$3_ListJoinGroupRequestsResponse = ListJoinGroupRequestsResponse;
3505
+ type context$3_ListJoinGroupRequestsResponseNonNullableFields = ListJoinGroupRequestsResponseNonNullableFields;
3506
+ type context$3_MemberJoinedGroup = MemberJoinedGroup;
3507
+ type context$3_MembersAddedToGroup = MembersAddedToGroup;
3508
+ type context$3_MembersInvitedToGroup = MembersInvitedToGroup;
3509
+ type context$3_MembershipQuestionViolationOptions = MembershipQuestionViolationOptions;
3510
+ type context$3_PaidPlan = PaidPlan;
3511
+ type context$3_PricingPlanViolationOptions = PricingPlanViolationOptions;
3512
+ type context$3_QueryJoinGroupRequestsOptions = QueryJoinGroupRequestsOptions;
3513
+ type context$3_QueryJoinGroupRequestsRequest = QueryJoinGroupRequestsRequest;
3514
+ type context$3_QueryJoinGroupRequestsResponse = QueryJoinGroupRequestsResponse;
3515
+ type context$3_QueryJoinGroupRequestsResponseNonNullableFields = QueryJoinGroupRequestsResponseNonNullableFields;
3516
+ type context$3_RejectAllJoinGroupRequestsRequest = RejectAllJoinGroupRequestsRequest;
3517
+ type context$3_RejectAllJoinGroupRequestsResponse = RejectAllJoinGroupRequestsResponse;
3518
+ type context$3_RejectJoinGroupRequestsRequest = RejectJoinGroupRequestsRequest;
3519
+ type context$3_RejectJoinGroupRequestsResponse = RejectJoinGroupRequestsResponse;
3520
+ type context$3_RejectJoinGroupRequestsResponseNonNullableFields = RejectJoinGroupRequestsResponseNonNullableFields;
3521
+ type context$3_SocialGroupsEvent = SocialGroupsEvent;
3522
+ type context$3_SocialGroupsEventPayloadOneOf = SocialGroupsEventPayloadOneOf;
3523
+ type context$3_SubmitJoinGroupRequestRequest = SubmitJoinGroupRequestRequest;
3524
+ type context$3_SubmitJoinGroupRequestResponse = SubmitJoinGroupRequestResponse;
3525
+ type context$3_Violation = Violation;
3526
+ type context$3_ViolationType = ViolationType;
3527
+ declare const context$3_ViolationType: typeof ViolationType;
3528
+ type context$3_ViolationViolationOptionsOneOf = ViolationViolationOptionsOneOf;
2370
3529
  declare const context$3_approveJoinGroupRequests: typeof approveJoinGroupRequests;
2371
3530
  declare const context$3_listJoinGroupRequests: typeof listJoinGroupRequests;
2372
3531
  declare const context$3_onJoinGroupRequestApproved: typeof onJoinGroupRequestApproved;
@@ -2375,7 +3534,7 @@ declare const context$3_onJoinGroupRequestRejected: typeof onJoinGroupRequestRej
2375
3534
  declare const context$3_queryJoinGroupRequests: typeof queryJoinGroupRequests;
2376
3535
  declare const context$3_rejectJoinGroupRequests: typeof rejectJoinGroupRequests;
2377
3536
  declare namespace context$3 {
2378
- export { context$3_approveJoinGroupRequests as approveJoinGroupRequests, context$3_listJoinGroupRequests as listJoinGroupRequests, context$3_onJoinGroupRequestApproved as onJoinGroupRequestApproved, context$3_onJoinGroupRequestCreated as onJoinGroupRequestCreated, context$3_onJoinGroupRequestRejected as onJoinGroupRequestRejected, context$3_queryJoinGroupRequests as queryJoinGroupRequests, context$3_rejectJoinGroupRequests as rejectJoinGroupRequests };
3537
+ export { type ActionEvent$2 as ActionEvent, type context$3_ApproveAllJoinGroupRequestsRequest as ApproveAllJoinGroupRequestsRequest, type context$3_ApproveAllJoinGroupRequestsResponse as ApproveAllJoinGroupRequestsResponse, type context$3_ApproveJoinGroupRequestsOptions as ApproveJoinGroupRequestsOptions, type context$3_ApproveJoinGroupRequestsRequest as ApproveJoinGroupRequestsRequest, type context$3_ApproveJoinGroupRequestsResponse as ApproveJoinGroupRequestsResponse, type context$3_ApproveJoinGroupRequestsResponseNonNullableFields as ApproveJoinGroupRequestsResponseNonNullableFields, type BaseEventMetadata$2 as BaseEventMetadata, type context$3_CancelJoinGroupRequestRequest as CancelJoinGroupRequestRequest, type context$3_CancelJoinGroupRequestResponse as CancelJoinGroupRequestResponse, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventMetadata$2 as EventMetadata, type context$3_EventsViolationOptions as EventsViolationOptions, type context$3_GetJoinRequirementsRequest as GetJoinRequirementsRequest, type context$3_GetJoinRequirementsResponse as GetJoinRequirementsResponse, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, ItemsToUpdate$2 as ItemsToUpdate, type context$3_JoinGroupRequest as JoinGroupRequest, type context$3_JoinGroupRequestApproved as JoinGroupRequestApproved, type context$3_JoinGroupRequestApprovedEnvelope as JoinGroupRequestApprovedEnvelope, type context$3_JoinGroupRequestCancelled as JoinGroupRequestCancelled, type context$3_JoinGroupRequestCreatedEnvelope as JoinGroupRequestCreatedEnvelope, type context$3_JoinGroupRequestRejected as JoinGroupRequestRejected, type context$3_JoinGroupRequestRejectedEnvelope as JoinGroupRequestRejectedEnvelope, type context$3_JoinGroupRequestsQueryBuilder as JoinGroupRequestsQueryBuilder, type context$3_JoinGroupRequestsQueryResult as JoinGroupRequestsQueryResult, type context$3_JoinRequestsApproved as JoinRequestsApproved, type context$3_ListAllJoinGroupRequestsRequest as ListAllJoinGroupRequestsRequest, type context$3_ListAllJoinGroupRequestsResponse as ListAllJoinGroupRequestsResponse, type context$3_ListJoinGroupRequestsOptions as ListJoinGroupRequestsOptions, type context$3_ListJoinGroupRequestsRequest as ListJoinGroupRequestsRequest, type context$3_ListJoinGroupRequestsResponse as ListJoinGroupRequestsResponse, type context$3_ListJoinGroupRequestsResponseNonNullableFields as ListJoinGroupRequestsResponseNonNullableFields, type context$3_MemberJoinedGroup as MemberJoinedGroup, type context$3_MembersAddedToGroup as MembersAddedToGroup, type context$3_MembersInvitedToGroup as MembersInvitedToGroup, type MembershipQuestionAnswer$2 as MembershipQuestionAnswer, type context$3_MembershipQuestionViolationOptions as MembershipQuestionViolationOptions, type MessageEnvelope$2 as MessageEnvelope, OwnershipFilter$2 as OwnershipFilter, type Paging$3 as Paging, type PagingMetadata$3 as PagingMetadata, type context$3_PaidPlan as PaidPlan, type context$3_PricingPlanViolationOptions as PricingPlanViolationOptions, type Query$2 as Query, type context$3_QueryJoinGroupRequestsOptions as QueryJoinGroupRequestsOptions, type context$3_QueryJoinGroupRequestsRequest as QueryJoinGroupRequestsRequest, type context$3_QueryJoinGroupRequestsResponse as QueryJoinGroupRequestsResponse, type context$3_QueryJoinGroupRequestsResponseNonNullableFields as QueryJoinGroupRequestsResponseNonNullableFields, type context$3_RejectAllJoinGroupRequestsRequest as RejectAllJoinGroupRequestsRequest, type context$3_RejectAllJoinGroupRequestsResponse as RejectAllJoinGroupRequestsResponse, type context$3_RejectJoinGroupRequestsRequest as RejectJoinGroupRequestsRequest, type context$3_RejectJoinGroupRequestsResponse as RejectJoinGroupRequestsResponse, type context$3_RejectJoinGroupRequestsResponseNonNullableFields as RejectJoinGroupRequestsResponseNonNullableFields, type Rejection$2 as Rejection, type RequestDetails$2 as RequestDetails, RequestStatus$2 as RequestStatus, type RestoreInfo$2 as RestoreInfo, type context$3_SocialGroupsEvent as SocialGroupsEvent, type context$3_SocialGroupsEventPayloadOneOf as SocialGroupsEventPayloadOneOf, SortOrder$2 as SortOrder, type Sorting$2 as Sorting, type context$3_SubmitJoinGroupRequestRequest as SubmitJoinGroupRequestRequest, type context$3_SubmitJoinGroupRequestResponse as SubmitJoinGroupRequestResponse, type context$3_Violation as Violation, context$3_ViolationType as ViolationType, type context$3_ViolationViolationOptionsOneOf as ViolationViolationOptionsOneOf, WebhookIdentityType$2 as WebhookIdentityType, context$3_approveJoinGroupRequests as approveJoinGroupRequests, context$3_listJoinGroupRequests as listJoinGroupRequests, context$3_onJoinGroupRequestApproved as onJoinGroupRequestApproved, context$3_onJoinGroupRequestCreated as onJoinGroupRequestCreated, context$3_onJoinGroupRequestRejected as onJoinGroupRequestRejected, context$3_queryJoinGroupRequests as queryJoinGroupRequests, context$3_rejectJoinGroupRequests as rejectJoinGroupRequests };
2379
3538
  }
2380
3539
 
2381
3540
  /**
@@ -2393,14 +3552,31 @@ interface MembershipQuestion {
2393
3552
  /** Question text. */
2394
3553
  text?: string;
2395
3554
  }
3555
+ interface ListMembershipQuestionsRequest {
3556
+ /** Group ID. */
3557
+ groupId: string;
3558
+ }
2396
3559
  interface ListMembershipQuestionsResponse {
2397
3560
  /** Membership questions. */
2398
3561
  questions?: MembershipQuestion[];
2399
3562
  }
3563
+ interface CreateOrReplaceAllMembershipQuestionsRequest {
3564
+ /** Group ID. */
3565
+ groupId: string;
3566
+ /** New membership questions. */
3567
+ questions?: MembershipQuestion[];
3568
+ }
2400
3569
  interface CreateOrReplaceAllMembershipQuestionsResponse {
2401
3570
  /** Membership questions. */
2402
3571
  questions?: MembershipQuestion[];
2403
3572
  }
3573
+ interface ListAnswersRequest {
3574
+ /** Group ID. */
3575
+ groupId: string;
3576
+ /** Member IDs. If no member ID is provided, answers for all members will be returned. See [Members API](https://dev.wix.com/api/rest/members/members/about-wix-members) for more details. */
3577
+ memberIds?: string[];
3578
+ paging?: Paging$2;
3579
+ }
2404
3580
  interface Paging$2 {
2405
3581
  /** Number of items to load. */
2406
3582
  limit?: number | null;
@@ -2418,10 +3594,10 @@ interface MemberMembershipQuestionAnswers {
2418
3594
  /** Member ID. See [Members API](https://dev.wix.com/api/rest/members/members/about-wix-members) for more details. */
2419
3595
  memberId?: string;
2420
3596
  /** Answers to the membership question. */
2421
- answers?: MembershipQuestionAnswer[];
3597
+ answers?: MembershipQuestionAnswer$1[];
2422
3598
  }
2423
3599
  /** Answer to a membership question. */
2424
- interface MembershipQuestionAnswer {
3600
+ interface MembershipQuestionAnswer$1 {
2425
3601
  /** Question ID. */
2426
3602
  _id?: string;
2427
3603
  /** Answer text. */
@@ -2437,29 +3613,36 @@ interface PagingMetadata$2 {
2437
3613
  /** Flag that indicates the server failed to calculate the `total` field. */
2438
3614
  tooManyToCount?: boolean | null;
2439
3615
  }
3616
+ interface ListAnswerCountsRequest {
3617
+ memberIds?: string[];
3618
+ }
3619
+ interface ListAnswerCountsResponse {
3620
+ memberAnswerCounts?: MemberAnswerCount[];
3621
+ }
3622
+ interface MemberAnswerCount {
3623
+ memberId?: string;
3624
+ groupId?: string;
3625
+ count?: number;
3626
+ }
3627
+ interface MembershipQuestionNonNullableFields {
3628
+ required: boolean;
3629
+ text: string;
3630
+ }
2440
3631
  interface ListMembershipQuestionsResponseNonNullableFields {
2441
- questions: {
2442
- required: boolean;
2443
- text: string;
2444
- }[];
3632
+ questions: MembershipQuestionNonNullableFields[];
2445
3633
  }
2446
3634
  interface CreateOrReplaceAllMembershipQuestionsResponseNonNullableFields {
2447
- questions: {
2448
- required: boolean;
2449
- text: string;
2450
- }[];
3635
+ questions: MembershipQuestionNonNullableFields[];
3636
+ }
3637
+ interface MembershipQuestionAnswerNonNullableFields {
3638
+ _id: string;
3639
+ }
3640
+ interface MemberMembershipQuestionAnswersNonNullableFields {
3641
+ memberId: string;
3642
+ answers: MembershipQuestionAnswerNonNullableFields[];
2451
3643
  }
2452
3644
  interface ListAnswersResponseNonNullableFields {
2453
- memberAnswers: {
2454
- memberId: string;
2455
- answers: {
2456
- _id: string;
2457
- }[];
2458
- }[];
2459
- questions?: {
2460
- required: boolean;
2461
- text: string;
2462
- };
3645
+ memberAnswers: MemberMembershipQuestionAnswersNonNullableFields[];
2463
3646
  }
2464
3647
  interface CreateOrReplaceAllMembershipQuestionsOptions {
2465
3648
  /** New membership questions. */
@@ -2471,52 +3654,33 @@ interface ListAnswersOptions {
2471
3654
  paging?: Paging$2;
2472
3655
  }
2473
3656
 
2474
- type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
2475
- interface HttpClient$2 {
2476
- request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
2477
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
2478
- }
2479
- type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
2480
- type HttpResponse$2<T = any> = {
2481
- data: T;
2482
- status: number;
2483
- statusText: string;
2484
- headers: any;
2485
- request?: any;
2486
- };
2487
- type RequestOptions$2<_TResponse = any, Data = any> = {
2488
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
2489
- url: string;
2490
- data?: Data;
2491
- params?: URLSearchParams;
2492
- } & APIMetadata$2;
2493
- type APIMetadata$2 = {
2494
- methodFqn?: string;
2495
- entityFqdn?: string;
2496
- packageName?: string;
2497
- };
2498
- type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
2499
-
2500
- declare global {
2501
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2502
- interface SymbolConstructor {
2503
- readonly observable: symbol;
2504
- }
2505
- }
2506
-
2507
- declare function listMembershipQuestions$1(httpClient: HttpClient$2): (groupId: string) => Promise<ListMembershipQuestionsResponse & ListMembershipQuestionsResponseNonNullableFields>;
2508
- declare function createOrReplaceAllMembershipQuestions$1(httpClient: HttpClient$2): (groupId: string, options?: CreateOrReplaceAllMembershipQuestionsOptions) => Promise<CreateOrReplaceAllMembershipQuestionsResponse & CreateOrReplaceAllMembershipQuestionsResponseNonNullableFields>;
2509
- declare function listAnswers$1(httpClient: HttpClient$2): (groupId: string, options?: ListAnswersOptions) => Promise<ListAnswersResponse & ListAnswersResponseNonNullableFields>;
3657
+ declare function createRESTModule$2<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
2510
3658
 
2511
- declare const listMembershipQuestions: BuildRESTFunction$2<typeof listMembershipQuestions$1>;
2512
- declare const createOrReplaceAllMembershipQuestions: BuildRESTFunction$2<typeof createOrReplaceAllMembershipQuestions$1>;
2513
- declare const listAnswers: BuildRESTFunction$2<typeof listAnswers$1>;
3659
+ declare const listMembershipQuestions: ReturnType<typeof createRESTModule$2<typeof publicListMembershipQuestions>>;
3660
+ declare const createOrReplaceAllMembershipQuestions: ReturnType<typeof createRESTModule$2<typeof publicCreateOrReplaceAllMembershipQuestions>>;
3661
+ declare const listAnswers: ReturnType<typeof createRESTModule$2<typeof publicListAnswers>>;
2514
3662
 
3663
+ type context$2_CreateOrReplaceAllMembershipQuestionsOptions = CreateOrReplaceAllMembershipQuestionsOptions;
3664
+ type context$2_CreateOrReplaceAllMembershipQuestionsRequest = CreateOrReplaceAllMembershipQuestionsRequest;
3665
+ type context$2_CreateOrReplaceAllMembershipQuestionsResponse = CreateOrReplaceAllMembershipQuestionsResponse;
3666
+ type context$2_CreateOrReplaceAllMembershipQuestionsResponseNonNullableFields = CreateOrReplaceAllMembershipQuestionsResponseNonNullableFields;
3667
+ type context$2_ListAnswerCountsRequest = ListAnswerCountsRequest;
3668
+ type context$2_ListAnswerCountsResponse = ListAnswerCountsResponse;
3669
+ type context$2_ListAnswersOptions = ListAnswersOptions;
3670
+ type context$2_ListAnswersRequest = ListAnswersRequest;
3671
+ type context$2_ListAnswersResponse = ListAnswersResponse;
3672
+ type context$2_ListAnswersResponseNonNullableFields = ListAnswersResponseNonNullableFields;
3673
+ type context$2_ListMembershipQuestionsRequest = ListMembershipQuestionsRequest;
3674
+ type context$2_ListMembershipQuestionsResponse = ListMembershipQuestionsResponse;
3675
+ type context$2_ListMembershipQuestionsResponseNonNullableFields = ListMembershipQuestionsResponseNonNullableFields;
3676
+ type context$2_MemberAnswerCount = MemberAnswerCount;
3677
+ type context$2_MemberMembershipQuestionAnswers = MemberMembershipQuestionAnswers;
3678
+ type context$2_MembershipQuestion = MembershipQuestion;
2515
3679
  declare const context$2_createOrReplaceAllMembershipQuestions: typeof createOrReplaceAllMembershipQuestions;
2516
3680
  declare const context$2_listAnswers: typeof listAnswers;
2517
3681
  declare const context$2_listMembershipQuestions: typeof listMembershipQuestions;
2518
3682
  declare namespace context$2 {
2519
- export { context$2_createOrReplaceAllMembershipQuestions as createOrReplaceAllMembershipQuestions, context$2_listAnswers as listAnswers, context$2_listMembershipQuestions as listMembershipQuestions };
3683
+ export { type context$2_CreateOrReplaceAllMembershipQuestionsOptions as CreateOrReplaceAllMembershipQuestionsOptions, type context$2_CreateOrReplaceAllMembershipQuestionsRequest as CreateOrReplaceAllMembershipQuestionsRequest, type context$2_CreateOrReplaceAllMembershipQuestionsResponse as CreateOrReplaceAllMembershipQuestionsResponse, type context$2_CreateOrReplaceAllMembershipQuestionsResponseNonNullableFields as CreateOrReplaceAllMembershipQuestionsResponseNonNullableFields, type context$2_ListAnswerCountsRequest as ListAnswerCountsRequest, type context$2_ListAnswerCountsResponse as ListAnswerCountsResponse, type context$2_ListAnswersOptions as ListAnswersOptions, type context$2_ListAnswersRequest as ListAnswersRequest, type context$2_ListAnswersResponse as ListAnswersResponse, type context$2_ListAnswersResponseNonNullableFields as ListAnswersResponseNonNullableFields, type context$2_ListMembershipQuestionsRequest as ListMembershipQuestionsRequest, type context$2_ListMembershipQuestionsResponse as ListMembershipQuestionsResponse, type context$2_ListMembershipQuestionsResponseNonNullableFields as ListMembershipQuestionsResponseNonNullableFields, type context$2_MemberAnswerCount as MemberAnswerCount, type context$2_MemberMembershipQuestionAnswers as MemberMembershipQuestionAnswers, type context$2_MembershipQuestion as MembershipQuestion, type MembershipQuestionAnswer$1 as MembershipQuestionAnswer, type Paging$2 as Paging, type PagingMetadata$2 as PagingMetadata, context$2_createOrReplaceAllMembershipQuestions as createOrReplaceAllMembershipQuestions, context$2_listAnswers as listAnswers, context$2_listMembershipQuestions as listMembershipQuestions };
2520
3684
  }
2521
3685
 
2522
3686
  /**
@@ -2633,6 +3797,15 @@ interface Group {
2633
3797
  */
2634
3798
  lastActivityDate?: Date;
2635
3799
  }
3800
+ declare enum Type {
3801
+ UNKNOWN = "UNKNOWN",
3802
+ ADMIN_APPROVAL = "ADMIN_APPROVAL",
3803
+ PAID_PLANS = "PAID_PLANS",
3804
+ EVENTS = "EVENTS"
3805
+ }
3806
+ interface Events {
3807
+ eventIds?: string[];
3808
+ }
2636
3809
  interface Logo {
2637
3810
  /** Logo image ID (for internal use). */
2638
3811
  mediaId?: string | null;
@@ -2641,6 +3814,12 @@ interface Logo {
2641
3814
  /** Logo image height. */
2642
3815
  height?: number | null;
2643
3816
  }
3817
+ interface GroupDetailsPosition {
3818
+ /** horizontal coordinate */
3819
+ x?: number;
3820
+ /** vertical coordinate */
3821
+ y?: number;
3822
+ }
2644
3823
  interface Image {
2645
3824
  /** Image ID (for internal use). */
2646
3825
  mediaId?: string | null;
@@ -2655,6 +3834,22 @@ interface Position {
2655
3834
  /** vertical coordinate */
2656
3835
  y?: number;
2657
3836
  }
3837
+ declare enum AllowPolicy {
3838
+ UNKNOWN = "UNKNOWN",
3839
+ OWNER_AND_ADMINS = "OWNER_AND_ADMINS",
3840
+ OWNER = "OWNER",
3841
+ ALL_MEMBERS = "ALL_MEMBERS"
3842
+ }
3843
+ interface OnboardingStepSettings {
3844
+ stepKey?: StepKey;
3845
+ visible?: boolean;
3846
+ }
3847
+ declare enum StepKey {
3848
+ UNKNOWN = "UNKNOWN",
3849
+ CREATE_POST = "CREATE_POST",
3850
+ REACT_TO_POST = "REACT_TO_POST",
3851
+ INVITE_MEMBERS = "INVITE_MEMBERS"
3852
+ }
2658
3853
  declare enum PrivacyStatus {
2659
3854
  UNKNOWN = "UNKNOWN",
2660
3855
  /** Anyone can see the group in the group list and view its content. Anyone can join. */
@@ -2664,6 +3859,14 @@ declare enum PrivacyStatus {
2664
3859
  /** Only group members and admins can see the group in the group list. New group members can only be added by existing group members. */
2665
3860
  SECRET = "SECRET"
2666
3861
  }
3862
+ interface AccessRestriction extends AccessRestrictionDataOneOf {
3863
+ events?: Events;
3864
+ type?: Type;
3865
+ }
3866
+ /** @oneof */
3867
+ interface AccessRestrictionDataOneOf {
3868
+ events?: Events;
3869
+ }
2667
3870
  interface GroupDetails {
2668
3871
  /** Group logo. You cannot upload your own logo. */
2669
3872
  logo?: Logo;
@@ -2732,6 +3935,24 @@ interface RequestDetails$1 {
2732
3935
  /** Reason the request has been rejected. */
2733
3936
  rejectionReason?: string | null;
2734
3937
  }
3938
+ interface SubmitCreateRequestRequest {
3939
+ /** Group submitted for creation. */
3940
+ group?: Group;
3941
+ }
3942
+ interface SubmitCreateRequestResponse {
3943
+ /** Submitted Create Request. */
3944
+ createRequest?: CreateRequest;
3945
+ }
3946
+ interface ApproveCreateRequestsRequest {
3947
+ /** Create Request IDs to approve. Limited to `100`. */
3948
+ createRequestIds?: string[];
3949
+ }
3950
+ declare enum ItemsToUpdate$1 {
3951
+ /** Take into account only items which are listed in request. */
3952
+ BY_ID = "BY_ID",
3953
+ /** Update all items. */
3954
+ ALL_ITEMS = "ALL_ITEMS"
3955
+ }
2735
3956
  interface ApproveCreateRequestsResponse {
2736
3957
  /** Approved Create Requests. */
2737
3958
  createRequest?: CreateRequest[];
@@ -2740,6 +3961,10 @@ interface CreateRequestApproved {
2740
3961
  /** Approved create request. */
2741
3962
  createRequest?: CreateRequest;
2742
3963
  }
3964
+ interface RejectCreateRequestsRequest {
3965
+ /** Rejection data. */
3966
+ rejections?: Rejection$1[];
3967
+ }
2743
3968
  interface Rejection$1 {
2744
3969
  /** ID of the Create Request to reject. */
2745
3970
  createRequestId?: string;
@@ -2754,6 +3979,26 @@ interface CreateRequestRejected {
2754
3979
  /** Rejected create request. */
2755
3980
  createRequest?: CreateRequest;
2756
3981
  }
3982
+ interface CancelCreateRequestRequest {
3983
+ /** ID of the Create Request to cancel. */
3984
+ createRequestId?: string;
3985
+ }
3986
+ interface CancelCreateRequestResponse {
3987
+ /** Canceled Create Request. */
3988
+ createRequest?: CreateRequest;
3989
+ }
3990
+ interface ListCreateRequestsRequest {
3991
+ /** Number of items to load. Maximum `100`. */
3992
+ limit?: number | null;
3993
+ /** Number of items to skip in the current sort order. */
3994
+ offset?: number | null;
3995
+ }
3996
+ declare enum OwnershipFilter$1 {
3997
+ /** All items. */
3998
+ ALL = "ALL",
3999
+ /** Items for current site member. */
4000
+ CURRENT_MEMBER = "CURRENT_MEMBER"
4001
+ }
2757
4002
  interface ListCreateRequestsResponse {
2758
4003
  /** Create Requests. */
2759
4004
  createRequests?: CreateRequest[];
@@ -2769,6 +4014,9 @@ interface PagingMetadata$1 {
2769
4014
  /** Flag that indicates the server failed to calculate the `total` field. */
2770
4015
  tooManyToCount?: boolean | null;
2771
4016
  }
4017
+ interface QueryCreateRequestsRequest {
4018
+ query?: Query$1;
4019
+ }
2772
4020
  interface Query$1 {
2773
4021
  /**
2774
4022
  * Filter object in the following format:
@@ -2812,6 +4060,86 @@ interface QueryCreateRequestsResponse {
2812
4060
  createRequests?: CreateRequest[];
2813
4061
  metadata?: PagingMetadata$1;
2814
4062
  }
4063
+ interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
4064
+ createdEvent?: EntityCreatedEvent$1;
4065
+ updatedEvent?: EntityUpdatedEvent$1;
4066
+ deletedEvent?: EntityDeletedEvent$1;
4067
+ actionEvent?: ActionEvent$1;
4068
+ /**
4069
+ * Unique event ID.
4070
+ * Allows clients to ignore duplicate webhooks.
4071
+ */
4072
+ _id?: string;
4073
+ /**
4074
+ * Assumes actions are also always typed to an entity_type
4075
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
4076
+ */
4077
+ entityFqdn?: string;
4078
+ /**
4079
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
4080
+ * This is although the created/updated/deleted notion is duplication of the oneof types
4081
+ * Example: created/updated/deleted/started/completed/email_opened
4082
+ */
4083
+ slug?: string;
4084
+ /** ID of the entity associated with the event. */
4085
+ entityId?: string;
4086
+ /** Event timestamp. */
4087
+ eventTime?: Date;
4088
+ /**
4089
+ * Whether the event was triggered as a result of a privacy regulation application
4090
+ * (for example, GDPR).
4091
+ */
4092
+ triggeredByAnonymizeRequest?: boolean | null;
4093
+ /** If present, indicates the action that triggered the event. */
4094
+ originatedFrom?: string | null;
4095
+ /**
4096
+ * A sequence number defining the order of updates to the underlying entity.
4097
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
4098
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
4099
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
4100
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
4101
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
4102
+ */
4103
+ entityEventSequence?: string | null;
4104
+ }
4105
+ /** @oneof */
4106
+ interface DomainEventBodyOneOf$1 {
4107
+ createdEvent?: EntityCreatedEvent$1;
4108
+ updatedEvent?: EntityUpdatedEvent$1;
4109
+ deletedEvent?: EntityDeletedEvent$1;
4110
+ actionEvent?: ActionEvent$1;
4111
+ }
4112
+ interface EntityCreatedEvent$1 {
4113
+ entity?: string;
4114
+ }
4115
+ interface RestoreInfo$1 {
4116
+ deletedDate?: Date;
4117
+ }
4118
+ interface EntityUpdatedEvent$1 {
4119
+ /**
4120
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
4121
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
4122
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
4123
+ */
4124
+ currentEntity?: string;
4125
+ }
4126
+ interface EntityDeletedEvent$1 {
4127
+ /** Entity that was deleted */
4128
+ deletedEntity?: string | null;
4129
+ }
4130
+ interface ActionEvent$1 {
4131
+ body?: string;
4132
+ }
4133
+ interface MessageEnvelope$1 {
4134
+ /** App instance ID. */
4135
+ instanceId?: string | null;
4136
+ /** Event type. */
4137
+ eventType?: string;
4138
+ /** The identification type and identity data. */
4139
+ identity?: IdentificationData$1;
4140
+ /** Stringify payload. */
4141
+ data?: string;
4142
+ }
2815
4143
  interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
2816
4144
  /** ID of a site visitor that has not logged in to the site. */
2817
4145
  anonymousVisitorId?: string;
@@ -2842,93 +4170,68 @@ declare enum WebhookIdentityType$1 {
2842
4170
  WIX_USER = "WIX_USER",
2843
4171
  APP = "APP"
2844
4172
  }
4173
+ interface EventsNonNullableFields {
4174
+ eventIds: string[];
4175
+ }
4176
+ interface AccessRestrictionNonNullableFields {
4177
+ events?: EventsNonNullableFields;
4178
+ type: Type;
4179
+ }
4180
+ interface GroupDetailsPositionNonNullableFields {
4181
+ x: number;
4182
+ y: number;
4183
+ }
4184
+ interface GroupDetailsNonNullableFields {
4185
+ logoPosition?: GroupDetailsPositionNonNullableFields;
4186
+ mobileLogoPosition?: GroupDetailsPositionNonNullableFields;
4187
+ }
4188
+ interface PositionNonNullableFields {
4189
+ x: number;
4190
+ y: number;
4191
+ }
4192
+ interface CoverImageNonNullableFields {
4193
+ position?: PositionNonNullableFields;
4194
+ mobilePosition?: PositionNonNullableFields;
4195
+ }
4196
+ interface OnboardingStepSettingsNonNullableFields {
4197
+ stepKey: StepKey;
4198
+ visible: boolean;
4199
+ }
4200
+ interface GroupSettingsNonNullableFields {
4201
+ allowedToInviteMembers: AllowPolicy;
4202
+ allowedToApproveJoinRequests: AllowPolicy;
4203
+ allowedToAddMembers: AllowPolicy;
4204
+ allowedToCreatePosts: AllowPolicy;
4205
+ allowedToCommentPosts: AllowPolicy;
4206
+ onboardingStepsSettings: OnboardingStepSettingsNonNullableFields[];
4207
+ }
4208
+ interface IdentityNonNullableFields {
4209
+ identityType: IdentityType;
4210
+ }
4211
+ interface GroupNonNullableFields {
4212
+ privacyLevel: PrivacyStatus;
4213
+ privacyStatus: PrivacyStatus;
4214
+ accessRestriction?: AccessRestrictionNonNullableFields;
4215
+ details?: GroupDetailsNonNullableFields;
4216
+ coverImage?: CoverImageNonNullableFields;
4217
+ settings?: GroupSettingsNonNullableFields;
4218
+ createdBy?: IdentityNonNullableFields;
4219
+ }
4220
+ interface CreateRequestNonNullableFields {
4221
+ group?: GroupNonNullableFields;
4222
+ status: RequestStatus$1;
4223
+ }
2845
4224
  interface ApproveCreateRequestsResponseNonNullableFields {
2846
- createRequest: {
2847
- group?: {
2848
- privacyLevel: PrivacyStatus;
2849
- privacyStatus: PrivacyStatus;
2850
- coverImage?: {
2851
- position?: {
2852
- x: number;
2853
- y: number;
2854
- };
2855
- mobilePosition?: {
2856
- x: number;
2857
- y: number;
2858
- };
2859
- };
2860
- createdBy?: {
2861
- identityType: IdentityType;
2862
- };
2863
- };
2864
- status: RequestStatus$1;
2865
- }[];
4225
+ createRequest: CreateRequestNonNullableFields[];
2866
4226
  }
2867
4227
  interface RejectCreateRequestsResponseNonNullableFields {
2868
- createRequest: {
2869
- group?: {
2870
- privacyLevel: PrivacyStatus;
2871
- privacyStatus: PrivacyStatus;
2872
- coverImage?: {
2873
- position?: {
2874
- x: number;
2875
- y: number;
2876
- };
2877
- mobilePosition?: {
2878
- x: number;
2879
- y: number;
2880
- };
2881
- };
2882
- createdBy?: {
2883
- identityType: IdentityType;
2884
- };
2885
- };
2886
- status: RequestStatus$1;
2887
- }[];
4228
+ createRequest: CreateRequestNonNullableFields[];
2888
4229
  }
2889
4230
  interface ListCreateRequestsResponseNonNullableFields {
2890
- createRequests: {
2891
- group?: {
2892
- privacyLevel: PrivacyStatus;
2893
- privacyStatus: PrivacyStatus;
2894
- coverImage?: {
2895
- position?: {
2896
- x: number;
2897
- y: number;
2898
- };
2899
- mobilePosition?: {
2900
- x: number;
2901
- y: number;
2902
- };
2903
- };
2904
- createdBy?: {
2905
- identityType: IdentityType;
2906
- };
2907
- };
2908
- status: RequestStatus$1;
2909
- }[];
4231
+ createRequests: CreateRequestNonNullableFields[];
2910
4232
  }
2911
4233
  interface QueryCreateRequestsResponseNonNullableFields {
2912
- createRequests: {
2913
- group?: {
2914
- privacyLevel: PrivacyStatus;
2915
- privacyStatus: PrivacyStatus;
2916
- coverImage?: {
2917
- position?: {
2918
- x: number;
2919
- y: number;
2920
- };
2921
- mobilePosition?: {
2922
- x: number;
2923
- y: number;
2924
- };
2925
- };
2926
- createdBy?: {
2927
- identityType: IdentityType;
2928
- };
2929
- };
2930
- status: RequestStatus$1;
2931
- }[];
4234
+ createRequests: CreateRequestNonNullableFields[];
2932
4235
  }
2933
4236
  interface BaseEventMetadata$1 {
2934
4237
  /** App instance ID. */
@@ -3002,63 +4305,65 @@ interface QueryCreateRequestsOptions {
3002
4305
  query?: Query$1;
3003
4306
  }
3004
4307
 
3005
- type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
3006
- interface HttpClient$1 {
3007
- request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
3008
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
3009
- }
3010
- type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
3011
- type HttpResponse$1<T = any> = {
3012
- data: T;
3013
- status: number;
3014
- statusText: string;
3015
- headers: any;
3016
- request?: any;
3017
- };
3018
- type RequestOptions$1<_TResponse = any, Data = any> = {
3019
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
3020
- url: string;
3021
- data?: Data;
3022
- params?: URLSearchParams;
3023
- } & APIMetadata$1;
3024
- type APIMetadata$1 = {
3025
- methodFqn?: string;
3026
- entityFqdn?: string;
3027
- packageName?: string;
3028
- };
3029
- type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
3030
- type EventDefinition$1<Payload = unknown, Type extends string = string> = {
3031
- __type: 'event-definition';
3032
- type: Type;
3033
- isDomainEvent?: boolean;
3034
- transformations?: (envelope: unknown) => Payload;
3035
- __payload: Payload;
3036
- };
3037
- declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
3038
- type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
3039
- type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
3040
-
3041
- declare global {
3042
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
3043
- interface SymbolConstructor {
3044
- readonly observable: symbol;
3045
- }
3046
- }
4308
+ declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
3047
4309
 
3048
- declare function approveCreateRequests$1(httpClient: HttpClient$1): (options?: ApproveCreateRequestsOptions) => Promise<ApproveCreateRequestsResponse & ApproveCreateRequestsResponseNonNullableFields>;
3049
- declare function rejectCreateRequests$1(httpClient: HttpClient$1): (options?: RejectCreateRequestsOptions) => Promise<RejectCreateRequestsResponse & RejectCreateRequestsResponseNonNullableFields>;
3050
- declare function listCreateRequests$1(httpClient: HttpClient$1): (options?: ListCreateRequestsOptions) => Promise<ListCreateRequestsResponse & ListCreateRequestsResponseNonNullableFields>;
3051
- declare function queryCreateRequests$1(httpClient: HttpClient$1): (options?: QueryCreateRequestsOptions) => Promise<QueryCreateRequestsResponse & QueryCreateRequestsResponseNonNullableFields>;
3052
- declare const onCreateRequestApproved$1: EventDefinition$1<CreateRequestApprovedEnvelope, "wix.social_groups.v3.create_request_approved">;
3053
- declare const onCreateRequestRejected$1: EventDefinition$1<CreateRequestRejectedEnvelope, "wix.social_groups.v3.create_request_rejected">;
4310
+ declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
3054
4311
 
3055
- declare const approveCreateRequests: BuildRESTFunction$1<typeof approveCreateRequests$1>;
3056
- declare const rejectCreateRequests: BuildRESTFunction$1<typeof rejectCreateRequests$1>;
3057
- declare const listCreateRequests: BuildRESTFunction$1<typeof listCreateRequests$1>;
3058
- declare const queryCreateRequests: BuildRESTFunction$1<typeof queryCreateRequests$1>;
3059
- declare const onCreateRequestApproved: BuildEventDefinition$1<typeof onCreateRequestApproved$1>;
3060
- declare const onCreateRequestRejected: BuildEventDefinition$1<typeof onCreateRequestRejected$1>;
4312
+ declare const approveCreateRequests: ReturnType<typeof createRESTModule$1<typeof publicApproveCreateRequests>>;
4313
+ declare const rejectCreateRequests: ReturnType<typeof createRESTModule$1<typeof publicRejectCreateRequests>>;
4314
+ declare const listCreateRequests: ReturnType<typeof createRESTModule$1<typeof publicListCreateRequests>>;
4315
+ declare const queryCreateRequests: ReturnType<typeof createRESTModule$1<typeof publicQueryCreateRequests>>;
4316
+ declare const onCreateRequestApproved: ReturnType<typeof createEventModule$1<typeof publicOnCreateRequestApproved>>;
4317
+ declare const onCreateRequestRejected: ReturnType<typeof createEventModule$1<typeof publicOnCreateRequestRejected>>;
3061
4318
 
4319
+ type context$1_AccessRestriction = AccessRestriction;
4320
+ type context$1_AccessRestrictionDataOneOf = AccessRestrictionDataOneOf;
4321
+ type context$1_AllowPolicy = AllowPolicy;
4322
+ declare const context$1_AllowPolicy: typeof AllowPolicy;
4323
+ type context$1_ApproveCreateRequestsOptions = ApproveCreateRequestsOptions;
4324
+ type context$1_ApproveCreateRequestsRequest = ApproveCreateRequestsRequest;
4325
+ type context$1_ApproveCreateRequestsResponse = ApproveCreateRequestsResponse;
4326
+ type context$1_ApproveCreateRequestsResponseNonNullableFields = ApproveCreateRequestsResponseNonNullableFields;
4327
+ type context$1_CancelCreateRequestRequest = CancelCreateRequestRequest;
4328
+ type context$1_CancelCreateRequestResponse = CancelCreateRequestResponse;
4329
+ type context$1_CoverImage = CoverImage;
4330
+ type context$1_CreateRequest = CreateRequest;
4331
+ type context$1_CreateRequestApproved = CreateRequestApproved;
4332
+ type context$1_CreateRequestApprovedEnvelope = CreateRequestApprovedEnvelope;
4333
+ type context$1_CreateRequestRejected = CreateRequestRejected;
4334
+ type context$1_CreateRequestRejectedEnvelope = CreateRequestRejectedEnvelope;
4335
+ type context$1_Events = Events;
4336
+ type context$1_Group = Group;
4337
+ type context$1_GroupDetails = GroupDetails;
4338
+ type context$1_GroupDetailsPosition = GroupDetailsPosition;
4339
+ type context$1_GroupSettings = GroupSettings;
4340
+ type context$1_Identity = Identity;
4341
+ type context$1_IdentityType = IdentityType;
4342
+ declare const context$1_IdentityType: typeof IdentityType;
4343
+ type context$1_Image = Image;
4344
+ type context$1_ListCreateRequestsOptions = ListCreateRequestsOptions;
4345
+ type context$1_ListCreateRequestsRequest = ListCreateRequestsRequest;
4346
+ type context$1_ListCreateRequestsResponse = ListCreateRequestsResponse;
4347
+ type context$1_ListCreateRequestsResponseNonNullableFields = ListCreateRequestsResponseNonNullableFields;
4348
+ type context$1_Logo = Logo;
4349
+ type context$1_OnboardingStepSettings = OnboardingStepSettings;
4350
+ type context$1_Position = Position;
4351
+ type context$1_PrivacyStatus = PrivacyStatus;
4352
+ declare const context$1_PrivacyStatus: typeof PrivacyStatus;
4353
+ type context$1_QueryCreateRequestsOptions = QueryCreateRequestsOptions;
4354
+ type context$1_QueryCreateRequestsRequest = QueryCreateRequestsRequest;
4355
+ type context$1_QueryCreateRequestsResponse = QueryCreateRequestsResponse;
4356
+ type context$1_QueryCreateRequestsResponseNonNullableFields = QueryCreateRequestsResponseNonNullableFields;
4357
+ type context$1_RejectCreateRequestsOptions = RejectCreateRequestsOptions;
4358
+ type context$1_RejectCreateRequestsRequest = RejectCreateRequestsRequest;
4359
+ type context$1_RejectCreateRequestsResponse = RejectCreateRequestsResponse;
4360
+ type context$1_RejectCreateRequestsResponseNonNullableFields = RejectCreateRequestsResponseNonNullableFields;
4361
+ type context$1_StepKey = StepKey;
4362
+ declare const context$1_StepKey: typeof StepKey;
4363
+ type context$1_SubmitCreateRequestRequest = SubmitCreateRequestRequest;
4364
+ type context$1_SubmitCreateRequestResponse = SubmitCreateRequestResponse;
4365
+ type context$1_Type = Type;
4366
+ declare const context$1_Type: typeof Type;
3062
4367
  declare const context$1_approveCreateRequests: typeof approveCreateRequests;
3063
4368
  declare const context$1_listCreateRequests: typeof listCreateRequests;
3064
4369
  declare const context$1_onCreateRequestApproved: typeof onCreateRequestApproved;
@@ -3066,7 +4371,7 @@ declare const context$1_onCreateRequestRejected: typeof onCreateRequestRejected;
3066
4371
  declare const context$1_queryCreateRequests: typeof queryCreateRequests;
3067
4372
  declare const context$1_rejectCreateRequests: typeof rejectCreateRequests;
3068
4373
  declare namespace context$1 {
3069
- export { context$1_approveCreateRequests as approveCreateRequests, context$1_listCreateRequests as listCreateRequests, context$1_onCreateRequestApproved as onCreateRequestApproved, context$1_onCreateRequestRejected as onCreateRequestRejected, context$1_queryCreateRequests as queryCreateRequests, context$1_rejectCreateRequests as rejectCreateRequests };
4374
+ export { type context$1_AccessRestriction as AccessRestriction, type context$1_AccessRestrictionDataOneOf as AccessRestrictionDataOneOf, type ActionEvent$1 as ActionEvent, context$1_AllowPolicy as AllowPolicy, type context$1_ApproveCreateRequestsOptions as ApproveCreateRequestsOptions, type context$1_ApproveCreateRequestsRequest as ApproveCreateRequestsRequest, type context$1_ApproveCreateRequestsResponse as ApproveCreateRequestsResponse, type context$1_ApproveCreateRequestsResponseNonNullableFields as ApproveCreateRequestsResponseNonNullableFields, type BaseEventMetadata$1 as BaseEventMetadata, type context$1_CancelCreateRequestRequest as CancelCreateRequestRequest, type context$1_CancelCreateRequestResponse as CancelCreateRequestResponse, type context$1_CoverImage as CoverImage, type context$1_CreateRequest as CreateRequest, type context$1_CreateRequestApproved as CreateRequestApproved, type context$1_CreateRequestApprovedEnvelope as CreateRequestApprovedEnvelope, type context$1_CreateRequestRejected as CreateRequestRejected, type context$1_CreateRequestRejectedEnvelope as CreateRequestRejectedEnvelope, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type context$1_Events as Events, type context$1_Group as Group, type context$1_GroupDetails as GroupDetails, type context$1_GroupDetailsPosition as GroupDetailsPosition, type context$1_GroupSettings as GroupSettings, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type context$1_Identity as Identity, context$1_IdentityType as IdentityType, type context$1_Image as Image, ItemsToUpdate$1 as ItemsToUpdate, type context$1_ListCreateRequestsOptions as ListCreateRequestsOptions, type context$1_ListCreateRequestsRequest as ListCreateRequestsRequest, type context$1_ListCreateRequestsResponse as ListCreateRequestsResponse, type context$1_ListCreateRequestsResponseNonNullableFields as ListCreateRequestsResponseNonNullableFields, type context$1_Logo as Logo, type MessageEnvelope$1 as MessageEnvelope, type context$1_OnboardingStepSettings as OnboardingStepSettings, OwnershipFilter$1 as OwnershipFilter, type Paging$1 as Paging, type PagingMetadata$1 as PagingMetadata, type context$1_Position as Position, context$1_PrivacyStatus as PrivacyStatus, type Query$1 as Query, type context$1_QueryCreateRequestsOptions as QueryCreateRequestsOptions, type context$1_QueryCreateRequestsRequest as QueryCreateRequestsRequest, type context$1_QueryCreateRequestsResponse as QueryCreateRequestsResponse, type context$1_QueryCreateRequestsResponseNonNullableFields as QueryCreateRequestsResponseNonNullableFields, type context$1_RejectCreateRequestsOptions as RejectCreateRequestsOptions, type context$1_RejectCreateRequestsRequest as RejectCreateRequestsRequest, type context$1_RejectCreateRequestsResponse as RejectCreateRequestsResponse, type context$1_RejectCreateRequestsResponseNonNullableFields as RejectCreateRequestsResponseNonNullableFields, type Rejection$1 as Rejection, type RequestDetails$1 as RequestDetails, RequestStatus$1 as RequestStatus, type RestoreInfo$1 as RestoreInfo, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, context$1_StepKey as StepKey, type context$1_SubmitCreateRequestRequest as SubmitCreateRequestRequest, type context$1_SubmitCreateRequestResponse as SubmitCreateRequestResponse, context$1_Type as Type, WebhookIdentityType$1 as WebhookIdentityType, context$1_approveCreateRequests as approveCreateRequests, context$1_listCreateRequests as listCreateRequests, context$1_onCreateRequestApproved as onCreateRequestApproved, context$1_onCreateRequestRejected as onCreateRequestRejected, context$1_queryCreateRequests as queryCreateRequests, context$1_rejectCreateRequests as rejectCreateRequests };
3070
4375
  }
3071
4376
 
3072
4377
  /**
@@ -3107,6 +4412,49 @@ interface RequestDetails {
3107
4412
  /** Reason the request has been rejected. */
3108
4413
  rejectionReason?: string | null;
3109
4414
  }
4415
+ interface SubmitJoinRequestRequest {
4416
+ /** Relevant group. */
4417
+ groupId?: string;
4418
+ /** Answers to membership questions. They can be empty, but submit join group request will fail if an answer to a required question is omitted. */
4419
+ membershipQuestionAnswers?: MembershipQuestionAnswer[];
4420
+ }
4421
+ /** Answer to a membership question. */
4422
+ interface MembershipQuestionAnswer {
4423
+ /** Question ID. */
4424
+ _id?: string;
4425
+ /** Answer text. */
4426
+ text?: string | null;
4427
+ }
4428
+ interface SubmitJoinRequestResponse {
4429
+ /** Submitted join request. */
4430
+ joinRequest?: JoinRequest;
4431
+ }
4432
+ interface CancelJoinRequestRequest {
4433
+ /** Relevant group. */
4434
+ groupId?: string;
4435
+ }
4436
+ interface CancelJoinRequestResponse {
4437
+ /** Cancelled join request. */
4438
+ joinRequest?: JoinRequest;
4439
+ }
4440
+ interface JoinRequestCancelled {
4441
+ /** Group ID for which join request was cancelled. */
4442
+ groupId?: string;
4443
+ /** Cancelled join request. */
4444
+ joinRequest?: JoinRequest;
4445
+ }
4446
+ interface ApproveJoinRequestsRequest {
4447
+ /** Relevant group. */
4448
+ groupId: string;
4449
+ /** Member IDs to approve. */
4450
+ memberIds: string[];
4451
+ }
4452
+ declare enum ItemsToUpdate {
4453
+ /** Take into account only items which are listed in request. */
4454
+ BY_ID = "BY_ID",
4455
+ /** Update all items. */
4456
+ ALL_ITEMS = "ALL_ITEMS"
4457
+ }
3110
4458
  interface ApproveJoinRequestsResponse {
3111
4459
  /** Approved join requests. */
3112
4460
  joinRequests?: JoinRequest[];
@@ -3117,6 +4465,12 @@ interface JoinRequestApproved {
3117
4465
  /** Approved join request. */
3118
4466
  joinRequest?: JoinRequest;
3119
4467
  }
4468
+ interface RejectJoinRequestsRequest {
4469
+ /** Relevant group. */
4470
+ groupId: string;
4471
+ /** Rejection data. */
4472
+ rejections?: Rejection[];
4473
+ }
3120
4474
  interface Rejection {
3121
4475
  /** Member ID to reject. */
3122
4476
  memberId?: string;
@@ -3133,6 +4487,18 @@ interface JoinRequestRejected {
3133
4487
  /** Rejected join request. */
3134
4488
  joinRequest?: JoinRequest;
3135
4489
  }
4490
+ interface ListJoinRequestsRequest {
4491
+ /** Group ID. */
4492
+ groupId: string;
4493
+ limit?: number | null;
4494
+ offset?: number | null;
4495
+ }
4496
+ declare enum OwnershipFilter {
4497
+ /** All items. */
4498
+ ALL = "ALL",
4499
+ /** Items for current site member. */
4500
+ CURRENT_MEMBER = "CURRENT_MEMBER"
4501
+ }
3136
4502
  interface ListJoinRequestsResponse {
3137
4503
  /** Join requests. */
3138
4504
  joinRequests?: JoinRequest[];
@@ -3148,6 +4514,11 @@ interface PagingMetadata {
3148
4514
  /** Flag that indicates the server failed to calculate the `total` field. */
3149
4515
  tooManyToCount?: boolean | null;
3150
4516
  }
4517
+ interface QueryJoinRequestsRequest {
4518
+ /** Group ID. */
4519
+ groupId: string;
4520
+ query?: Query;
4521
+ }
3151
4522
  interface Query {
3152
4523
  /**
3153
4524
  * Filter object in the following format:
@@ -3191,6 +4562,86 @@ interface QueryJoinRequestsResponse {
3191
4562
  joinRequests?: JoinRequest[];
3192
4563
  metadata?: PagingMetadata;
3193
4564
  }
4565
+ interface DomainEvent extends DomainEventBodyOneOf {
4566
+ createdEvent?: EntityCreatedEvent;
4567
+ updatedEvent?: EntityUpdatedEvent;
4568
+ deletedEvent?: EntityDeletedEvent;
4569
+ actionEvent?: ActionEvent;
4570
+ /**
4571
+ * Unique event ID.
4572
+ * Allows clients to ignore duplicate webhooks.
4573
+ */
4574
+ _id?: string;
4575
+ /**
4576
+ * Assumes actions are also always typed to an entity_type
4577
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
4578
+ */
4579
+ entityFqdn?: string;
4580
+ /**
4581
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
4582
+ * This is although the created/updated/deleted notion is duplication of the oneof types
4583
+ * Example: created/updated/deleted/started/completed/email_opened
4584
+ */
4585
+ slug?: string;
4586
+ /** ID of the entity associated with the event. */
4587
+ entityId?: string;
4588
+ /** Event timestamp. */
4589
+ eventTime?: Date;
4590
+ /**
4591
+ * Whether the event was triggered as a result of a privacy regulation application
4592
+ * (for example, GDPR).
4593
+ */
4594
+ triggeredByAnonymizeRequest?: boolean | null;
4595
+ /** If present, indicates the action that triggered the event. */
4596
+ originatedFrom?: string | null;
4597
+ /**
4598
+ * A sequence number defining the order of updates to the underlying entity.
4599
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
4600
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
4601
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
4602
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
4603
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
4604
+ */
4605
+ entityEventSequence?: string | null;
4606
+ }
4607
+ /** @oneof */
4608
+ interface DomainEventBodyOneOf {
4609
+ createdEvent?: EntityCreatedEvent;
4610
+ updatedEvent?: EntityUpdatedEvent;
4611
+ deletedEvent?: EntityDeletedEvent;
4612
+ actionEvent?: ActionEvent;
4613
+ }
4614
+ interface EntityCreatedEvent {
4615
+ entity?: string;
4616
+ }
4617
+ interface RestoreInfo {
4618
+ deletedDate?: Date;
4619
+ }
4620
+ interface EntityUpdatedEvent {
4621
+ /**
4622
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
4623
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
4624
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
4625
+ */
4626
+ currentEntity?: string;
4627
+ }
4628
+ interface EntityDeletedEvent {
4629
+ /** Entity that was deleted */
4630
+ deletedEntity?: string | null;
4631
+ }
4632
+ interface ActionEvent {
4633
+ body?: string;
4634
+ }
4635
+ interface MessageEnvelope {
4636
+ /** App instance ID. */
4637
+ instanceId?: string | null;
4638
+ /** Event type. */
4639
+ eventType?: string;
4640
+ /** The identification type and identity data. */
4641
+ identity?: IdentificationData;
4642
+ /** Stringify payload. */
4643
+ data?: string;
4644
+ }
3194
4645
  interface IdentificationData extends IdentificationDataIdOneOf {
3195
4646
  /** ID of a site visitor that has not logged in to the site. */
3196
4647
  anonymousVisitorId?: string;
@@ -3221,29 +4672,21 @@ declare enum WebhookIdentityType {
3221
4672
  WIX_USER = "WIX_USER",
3222
4673
  APP = "APP"
3223
4674
  }
4675
+ interface JoinRequestNonNullableFields {
4676
+ memberId: string;
4677
+ status: RequestStatus;
4678
+ }
3224
4679
  interface ApproveJoinRequestsResponseNonNullableFields {
3225
- joinRequests: {
3226
- memberId: string;
3227
- status: RequestStatus;
3228
- }[];
4680
+ joinRequests: JoinRequestNonNullableFields[];
3229
4681
  }
3230
4682
  interface RejectJoinRequestsResponseNonNullableFields {
3231
- joinRequests: {
3232
- memberId: string;
3233
- status: RequestStatus;
3234
- }[];
4683
+ joinRequests: JoinRequestNonNullableFields[];
3235
4684
  }
3236
4685
  interface ListJoinRequestsResponseNonNullableFields {
3237
- joinRequests: {
3238
- memberId: string;
3239
- status: RequestStatus;
3240
- }[];
4686
+ joinRequests: JoinRequestNonNullableFields[];
3241
4687
  }
3242
4688
  interface QueryJoinRequestsResponseNonNullableFields {
3243
- joinRequests: {
3244
- memberId: string;
3245
- status: RequestStatus;
3246
- }[];
4689
+ joinRequests: JoinRequestNonNullableFields[];
3247
4690
  }
3248
4691
  interface BaseEventMetadata {
3249
4692
  /** App instance ID. */
@@ -3315,63 +4758,72 @@ interface QueryJoinRequestsOptions {
3315
4758
  query?: Query;
3316
4759
  }
3317
4760
 
3318
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
3319
- interface HttpClient {
3320
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
3321
- fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
3322
- }
3323
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
3324
- type HttpResponse<T = any> = {
3325
- data: T;
3326
- status: number;
3327
- statusText: string;
3328
- headers: any;
3329
- request?: any;
3330
- };
3331
- type RequestOptions<_TResponse = any, Data = any> = {
3332
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
3333
- url: string;
3334
- data?: Data;
3335
- params?: URLSearchParams;
3336
- } & APIMetadata;
3337
- type APIMetadata = {
3338
- methodFqn?: string;
3339
- entityFqdn?: string;
3340
- packageName?: string;
3341
- };
3342
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
3343
- type EventDefinition<Payload = unknown, Type extends string = string> = {
3344
- __type: 'event-definition';
3345
- type: Type;
3346
- isDomainEvent?: boolean;
3347
- transformations?: (envelope: unknown) => Payload;
3348
- __payload: Payload;
3349
- };
3350
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
3351
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
3352
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
3353
-
3354
- declare global {
3355
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
3356
- interface SymbolConstructor {
3357
- readonly observable: symbol;
3358
- }
3359
- }
4761
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
3360
4762
 
3361
- declare function approveJoinRequests$1(httpClient: HttpClient): (groupId: string, options: ApproveJoinRequestsOptions) => Promise<ApproveJoinRequestsResponse & ApproveJoinRequestsResponseNonNullableFields>;
3362
- declare function rejectJoinRequests$1(httpClient: HttpClient): (groupId: string, options?: RejectJoinRequestsOptions) => Promise<RejectJoinRequestsResponse & RejectJoinRequestsResponseNonNullableFields>;
3363
- declare function listJoinRequests$1(httpClient: HttpClient): (groupId: string, options?: ListJoinRequestsOptions) => Promise<ListJoinRequestsResponse & ListJoinRequestsResponseNonNullableFields>;
3364
- declare function queryJoinRequests$1(httpClient: HttpClient): (groupId: string, options?: QueryJoinRequestsOptions) => Promise<QueryJoinRequestsResponse & QueryJoinRequestsResponseNonNullableFields>;
3365
- declare const onJoinRequestApproved$1: EventDefinition<JoinRequestApprovedEnvelope, "wix.social_groups.v3.join_request_approved">;
3366
- declare const onJoinRequestRejected$1: EventDefinition<JoinRequestRejectedEnvelope, "wix.social_groups.v3.join_request_rejected">;
4763
+ declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
3367
4764
 
3368
- declare const approveJoinRequests: BuildRESTFunction<typeof approveJoinRequests$1>;
3369
- declare const rejectJoinRequests: BuildRESTFunction<typeof rejectJoinRequests$1>;
3370
- declare const listJoinRequests: BuildRESTFunction<typeof listJoinRequests$1>;
3371
- declare const queryJoinRequests: BuildRESTFunction<typeof queryJoinRequests$1>;
3372
- declare const onJoinRequestApproved: BuildEventDefinition<typeof onJoinRequestApproved$1>;
3373
- declare const onJoinRequestRejected: BuildEventDefinition<typeof onJoinRequestRejected$1>;
4765
+ declare const approveJoinRequests: ReturnType<typeof createRESTModule<typeof publicApproveJoinRequests>>;
4766
+ declare const rejectJoinRequests: ReturnType<typeof createRESTModule<typeof publicRejectJoinRequests>>;
4767
+ declare const listJoinRequests: ReturnType<typeof createRESTModule<typeof publicListJoinRequests>>;
4768
+ declare const queryJoinRequests: ReturnType<typeof createRESTModule<typeof publicQueryJoinRequests>>;
4769
+ declare const onJoinRequestApproved: ReturnType<typeof createEventModule<typeof publicOnJoinRequestApproved>>;
4770
+ declare const onJoinRequestRejected: ReturnType<typeof createEventModule<typeof publicOnJoinRequestRejected>>;
3374
4771
 
4772
+ type context_ActionEvent = ActionEvent;
4773
+ type context_ApproveJoinRequestsOptions = ApproveJoinRequestsOptions;
4774
+ type context_ApproveJoinRequestsRequest = ApproveJoinRequestsRequest;
4775
+ type context_ApproveJoinRequestsResponse = ApproveJoinRequestsResponse;
4776
+ type context_ApproveJoinRequestsResponseNonNullableFields = ApproveJoinRequestsResponseNonNullableFields;
4777
+ type context_BaseEventMetadata = BaseEventMetadata;
4778
+ type context_CancelJoinRequestRequest = CancelJoinRequestRequest;
4779
+ type context_CancelJoinRequestResponse = CancelJoinRequestResponse;
4780
+ type context_DomainEvent = DomainEvent;
4781
+ type context_DomainEventBodyOneOf = DomainEventBodyOneOf;
4782
+ type context_EntityCreatedEvent = EntityCreatedEvent;
4783
+ type context_EntityDeletedEvent = EntityDeletedEvent;
4784
+ type context_EntityUpdatedEvent = EntityUpdatedEvent;
4785
+ type context_EventMetadata = EventMetadata;
4786
+ type context_IdentificationData = IdentificationData;
4787
+ type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
4788
+ type context_ItemsToUpdate = ItemsToUpdate;
4789
+ declare const context_ItemsToUpdate: typeof ItemsToUpdate;
4790
+ type context_JoinRequest = JoinRequest;
4791
+ type context_JoinRequestApproved = JoinRequestApproved;
4792
+ type context_JoinRequestApprovedEnvelope = JoinRequestApprovedEnvelope;
4793
+ type context_JoinRequestCancelled = JoinRequestCancelled;
4794
+ type context_JoinRequestRejected = JoinRequestRejected;
4795
+ type context_JoinRequestRejectedEnvelope = JoinRequestRejectedEnvelope;
4796
+ type context_ListJoinRequestsOptions = ListJoinRequestsOptions;
4797
+ type context_ListJoinRequestsRequest = ListJoinRequestsRequest;
4798
+ type context_ListJoinRequestsResponse = ListJoinRequestsResponse;
4799
+ type context_ListJoinRequestsResponseNonNullableFields = ListJoinRequestsResponseNonNullableFields;
4800
+ type context_MembershipQuestionAnswer = MembershipQuestionAnswer;
4801
+ type context_MessageEnvelope = MessageEnvelope;
4802
+ type context_OwnershipFilter = OwnershipFilter;
4803
+ declare const context_OwnershipFilter: typeof OwnershipFilter;
4804
+ type context_Paging = Paging;
4805
+ type context_PagingMetadata = PagingMetadata;
4806
+ type context_Query = Query;
4807
+ type context_QueryJoinRequestsOptions = QueryJoinRequestsOptions;
4808
+ type context_QueryJoinRequestsRequest = QueryJoinRequestsRequest;
4809
+ type context_QueryJoinRequestsResponse = QueryJoinRequestsResponse;
4810
+ type context_QueryJoinRequestsResponseNonNullableFields = QueryJoinRequestsResponseNonNullableFields;
4811
+ type context_RejectJoinRequestsOptions = RejectJoinRequestsOptions;
4812
+ type context_RejectJoinRequestsRequest = RejectJoinRequestsRequest;
4813
+ type context_RejectJoinRequestsResponse = RejectJoinRequestsResponse;
4814
+ type context_RejectJoinRequestsResponseNonNullableFields = RejectJoinRequestsResponseNonNullableFields;
4815
+ type context_Rejection = Rejection;
4816
+ type context_RequestDetails = RequestDetails;
4817
+ type context_RequestStatus = RequestStatus;
4818
+ declare const context_RequestStatus: typeof RequestStatus;
4819
+ type context_RestoreInfo = RestoreInfo;
4820
+ type context_SortOrder = SortOrder;
4821
+ declare const context_SortOrder: typeof SortOrder;
4822
+ type context_Sorting = Sorting;
4823
+ type context_SubmitJoinRequestRequest = SubmitJoinRequestRequest;
4824
+ type context_SubmitJoinRequestResponse = SubmitJoinRequestResponse;
4825
+ type context_WebhookIdentityType = WebhookIdentityType;
4826
+ declare const context_WebhookIdentityType: typeof WebhookIdentityType;
3375
4827
  declare const context_approveJoinRequests: typeof approveJoinRequests;
3376
4828
  declare const context_listJoinRequests: typeof listJoinRequests;
3377
4829
  declare const context_onJoinRequestApproved: typeof onJoinRequestApproved;
@@ -3379,7 +4831,7 @@ declare const context_onJoinRequestRejected: typeof onJoinRequestRejected;
3379
4831
  declare const context_queryJoinRequests: typeof queryJoinRequests;
3380
4832
  declare const context_rejectJoinRequests: typeof rejectJoinRequests;
3381
4833
  declare namespace context {
3382
- export { context_approveJoinRequests as approveJoinRequests, context_listJoinRequests as listJoinRequests, context_onJoinRequestApproved as onJoinRequestApproved, context_onJoinRequestRejected as onJoinRequestRejected, context_queryJoinRequests as queryJoinRequests, context_rejectJoinRequests as rejectJoinRequests };
4834
+ export { type context_ActionEvent as ActionEvent, type context_ApproveJoinRequestsOptions as ApproveJoinRequestsOptions, type context_ApproveJoinRequestsRequest as ApproveJoinRequestsRequest, type context_ApproveJoinRequestsResponse as ApproveJoinRequestsResponse, type context_ApproveJoinRequestsResponseNonNullableFields as ApproveJoinRequestsResponseNonNullableFields, type context_BaseEventMetadata as BaseEventMetadata, type context_CancelJoinRequestRequest as CancelJoinRequestRequest, type context_CancelJoinRequestResponse as CancelJoinRequestResponse, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, context_ItemsToUpdate as ItemsToUpdate, type context_JoinRequest as JoinRequest, type context_JoinRequestApproved as JoinRequestApproved, type context_JoinRequestApprovedEnvelope as JoinRequestApprovedEnvelope, type context_JoinRequestCancelled as JoinRequestCancelled, type context_JoinRequestRejected as JoinRequestRejected, type context_JoinRequestRejectedEnvelope as JoinRequestRejectedEnvelope, type context_ListJoinRequestsOptions as ListJoinRequestsOptions, type context_ListJoinRequestsRequest as ListJoinRequestsRequest, type context_ListJoinRequestsResponse as ListJoinRequestsResponse, type context_ListJoinRequestsResponseNonNullableFields as ListJoinRequestsResponseNonNullableFields, type context_MembershipQuestionAnswer as MembershipQuestionAnswer, type context_MessageEnvelope as MessageEnvelope, context_OwnershipFilter as OwnershipFilter, type context_Paging as Paging, type context_PagingMetadata as PagingMetadata, type context_Query as Query, type context_QueryJoinRequestsOptions as QueryJoinRequestsOptions, type context_QueryJoinRequestsRequest as QueryJoinRequestsRequest, type context_QueryJoinRequestsResponse as QueryJoinRequestsResponse, type context_QueryJoinRequestsResponseNonNullableFields as QueryJoinRequestsResponseNonNullableFields, type context_RejectJoinRequestsOptions as RejectJoinRequestsOptions, type context_RejectJoinRequestsRequest as RejectJoinRequestsRequest, type context_RejectJoinRequestsResponse as RejectJoinRequestsResponse, type context_RejectJoinRequestsResponseNonNullableFields as RejectJoinRequestsResponseNonNullableFields, type context_Rejection as Rejection, type context_RequestDetails as RequestDetails, context_RequestStatus as RequestStatus, type context_RestoreInfo as RestoreInfo, context_SortOrder as SortOrder, type context_Sorting as Sorting, type context_SubmitJoinRequestRequest as SubmitJoinRequestRequest, type context_SubmitJoinRequestResponse as SubmitJoinRequestResponse, context_WebhookIdentityType as WebhookIdentityType, context_approveJoinRequests as approveJoinRequests, context_listJoinRequests as listJoinRequests, context_onJoinRequestApproved as onJoinRequestApproved, context_onJoinRequestRejected as onJoinRequestRejected, context_queryJoinRequests as queryJoinRequests, context_rejectJoinRequests as rejectJoinRequests };
3383
4835
  }
3384
4836
 
3385
4837
  export { context$1 as createRequests, context$6 as groupRequests, context$8 as groups, context$3 as joinGroupRequests, context as joinRequests, context$7 as members, context$2 as membershipQuestions, context$5 as roles, context$4 as rules };