@wix/groups 1.0.102 → 1.0.104

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.
@@ -12,6 +12,10 @@ type Host<Environment = unknown> = {
12
12
  }>;
13
13
  };
14
14
  environment?: Environment;
15
+ /**
16
+ * Optional name of the environment, use for logging
17
+ */
18
+ name?: string;
15
19
  /**
16
20
  * Optional bast url to use for API requests, for example `www.wixapis.com`
17
21
  */
@@ -63,16 +67,16 @@ type APIMetadata = {
63
67
  packageName?: string;
64
68
  };
65
69
  type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
66
- type EventDefinition$8<Payload = unknown, Type extends string = string> = {
70
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
67
71
  __type: 'event-definition';
68
72
  type: Type;
69
73
  isDomainEvent?: boolean;
70
74
  transformations?: (envelope: unknown) => Payload;
71
75
  __payload: Payload;
72
76
  };
73
- declare function EventDefinition$8<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$8<Payload, Type>;
74
- type EventHandler$8<T extends EventDefinition$8> = (payload: T['__payload']) => void | Promise<void>;
75
- type BuildEventDefinition$8<T extends EventDefinition$8<any, string>> = (handler: EventHandler$8<T>) => void;
77
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
78
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
79
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
76
80
 
77
81
  type ServicePluginMethodInput = {
78
82
  request: any;
@@ -271,6 +275,72 @@ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends Excep
271
275
  ? Partial<Record<KeysType, never>>
272
276
  : {});
273
277
 
278
+ /**
279
+ Returns a boolean for whether the given type is `never`.
280
+
281
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
282
+ @link https://stackoverflow.com/a/53984913/10292952
283
+ @link https://www.zhenghao.io/posts/ts-never
284
+
285
+ Useful in type utilities, such as checking if something does not occur.
286
+
287
+ @example
288
+ ```
289
+ import type {IsNever, And} from 'type-fest';
290
+
291
+ // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
292
+ type AreStringsEqual<A extends string, B extends string> =
293
+ And<
294
+ IsNever<Exclude<A, B>> extends true ? true : false,
295
+ IsNever<Exclude<B, A>> extends true ? true : false
296
+ >;
297
+
298
+ type EndIfEqual<I extends string, O extends string> =
299
+ AreStringsEqual<I, O> extends true
300
+ ? never
301
+ : void;
302
+
303
+ function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
304
+ if (input === output) {
305
+ process.exit(0);
306
+ }
307
+ }
308
+
309
+ endIfEqual('abc', 'abc');
310
+ //=> never
311
+
312
+ endIfEqual('abc', '123');
313
+ //=> void
314
+ ```
315
+
316
+ @category Type Guard
317
+ @category Utilities
318
+ */
319
+ type IsNever<T> = [T] extends [never] ? true : false;
320
+
321
+ /**
322
+ An if-else-like type that resolves depending on whether the given type is `never`.
323
+
324
+ @see {@link IsNever}
325
+
326
+ @example
327
+ ```
328
+ import type {IfNever} from 'type-fest';
329
+
330
+ type ShouldBeTrue = IfNever<never>;
331
+ //=> true
332
+
333
+ type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
334
+ //=> 'bar'
335
+ ```
336
+
337
+ @category Type Guard
338
+ @category Utilities
339
+ */
340
+ type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
341
+ IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
342
+ );
343
+
274
344
  /**
275
345
  Extract the keys from a type where the value type of the key extends the given `Condition`.
276
346
 
@@ -303,21 +373,19 @@ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
303
373
 
304
374
  @category Object
305
375
  */
306
- type ConditionalKeys<Base, Condition> = NonNullable<
307
- // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
376
+ type ConditionalKeys<Base, Condition> =
308
377
  {
309
378
  // Map through all the keys of the given base type.
310
- [Key in keyof Base]:
379
+ [Key in keyof Base]-?:
311
380
  // Pick only keys with types extending the given `Condition` type.
312
381
  Base[Key] extends Condition
313
- // Retain this key since the condition passes.
314
- ? Key
382
+ // Retain this key
383
+ // If the value for the key extends never, only include it if `Condition` also extends never
384
+ ? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
315
385
  // Discard this key since the condition fails.
316
386
  : never;
317
-
318
387
  // Convert the produced object into a union type of the keys which passed the conditional test.
319
- }[keyof Base]
320
- >;
388
+ }[keyof Base];
321
389
 
322
390
  /**
323
391
  Exclude keys from a shape that matches the given `Condition`.
@@ -367,7 +435,7 @@ ConditionalKeys<Base, Condition>
367
435
  * can either be a REST module or a host module.
368
436
  * This type is recursive, so it can describe nested modules.
369
437
  */
370
- type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$8<any> | ServicePluginDefinition<any> | {
438
+ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
371
439
  [key: string]: Descriptors | PublicMetadata | any;
372
440
  };
373
441
  /**
@@ -380,7 +448,7 @@ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, De
380
448
  done: T;
381
449
  recurse: T extends {
382
450
  __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
383
- } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$8<any> ? BuildEventDefinition$8<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
451
+ } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
384
452
  [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
385
453
  -1,
386
454
  0,
@@ -474,24 +542,24 @@ interface Group$2 {
474
542
  * Group creation date and time.
475
543
  * @readonly
476
544
  */
477
- _createdDate?: Date;
545
+ _createdDate?: Date | null;
478
546
  /**
479
547
  * Date and time of the latest group update.
480
548
  * @readonly
481
549
  */
482
- _updatedDate?: Date;
550
+ _updatedDate?: Date | null;
483
551
  /**
484
552
  * @internal
485
553
  * @internal
486
554
  * @readonly
487
555
  * @deprecated
488
556
  */
489
- recentActivityDate?: Date;
557
+ recentActivityDate?: Date | null;
490
558
  /**
491
559
  * Date and time of the most recent group activity, for example a post or comment.
492
560
  * @readonly
493
561
  */
494
- lastActivityDate?: Date;
562
+ lastActivityDate?: Date | null;
495
563
  }
496
564
  declare enum Type$2 {
497
565
  UNKNOWN = "UNKNOWN",
@@ -856,7 +924,7 @@ interface DomainEvent$7 extends DomainEventBodyOneOf$7 {
856
924
  /** ID of the entity associated with the event. */
857
925
  entityId?: string;
858
926
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
859
- eventTime?: Date;
927
+ eventTime?: Date | null;
860
928
  /**
861
929
  * Whether the event was triggered as a result of a privacy regulation application
862
930
  * (for example, GDPR).
@@ -885,7 +953,7 @@ interface EntityCreatedEvent$7 {
885
953
  entity?: string;
886
954
  }
887
955
  interface RestoreInfo$7 {
888
- deletedDate?: Date;
956
+ deletedDate?: Date | null;
889
957
  }
890
958
  interface EntityUpdatedEvent$7 {
891
959
  /**
@@ -1038,7 +1106,7 @@ interface EventMetadata$7 extends BaseEventMetadata$7 {
1038
1106
  /** ID of the entity associated with the event. */
1039
1107
  entityId?: string;
1040
1108
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1041
- eventTime?: Date;
1109
+ eventTime?: Date | null;
1042
1110
  /**
1043
1111
  * Whether the event was triggered as a result of a privacy regulation application
1044
1112
  * (for example, GDPR).
@@ -1143,23 +1211,23 @@ interface UpdateGroup {
1143
1211
  * Group creation date and time.
1144
1212
  * @readonly
1145
1213
  */
1146
- _createdDate?: Date;
1214
+ _createdDate?: Date | null;
1147
1215
  /**
1148
1216
  * Date and time of the latest group update.
1149
1217
  * @readonly
1150
1218
  */
1151
- _updatedDate?: Date;
1219
+ _updatedDate?: Date | null;
1152
1220
  /**
1153
1221
  * @internal
1154
1222
  * @readonly
1155
1223
  * @deprecated
1156
1224
  */
1157
- recentActivityDate?: Date;
1225
+ recentActivityDate?: Date | null;
1158
1226
  /**
1159
1227
  * Date and time of the most recent group activity, for example a post or comment.
1160
1228
  * @readonly
1161
1229
  */
1162
- lastActivityDate?: Date;
1230
+ lastActivityDate?: Date | null;
1163
1231
  }
1164
1232
  interface UpdateGroupOptions {
1165
1233
  /** Content Type */
@@ -1331,31 +1399,13 @@ interface QueryGroupsSignature {
1331
1399
  */
1332
1400
  (options?: QueryGroupsOptions | undefined): GroupsQueryBuilder;
1333
1401
  }
1334
- declare const onGroupCreated$1: EventDefinition$8<GroupCreatedEnvelope, "wix.social_groups.v2.group_created">;
1335
- declare const onGroupUpdated$1: EventDefinition$8<GroupUpdatedEnvelope, "wix.social_groups.v2.group_updated">;
1336
- declare const onGroupCoverChanged$1: EventDefinition$8<GroupCoverChangedEnvelope, "wix.social_groups.v2.group_group_cover_changed">;
1337
- declare const onGroupDescriptionChanged$1: EventDefinition$8<GroupDescriptionChangedEnvelope, "wix.social_groups.v2.group_group_description_changed">;
1338
- declare const onGroupDeleted$1: EventDefinition$8<GroupDeletedEnvelope, "wix.social_groups.v2.group_deleted">;
1339
-
1340
- type EventDefinition$7<Payload = unknown, Type extends string = string> = {
1341
- __type: 'event-definition';
1342
- type: Type;
1343
- isDomainEvent?: boolean;
1344
- transformations?: (envelope: unknown) => Payload;
1345
- __payload: Payload;
1346
- };
1347
- declare function EventDefinition$7<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$7<Payload, Type>;
1348
- type EventHandler$7<T extends EventDefinition$7> = (payload: T['__payload']) => void | Promise<void>;
1349
- type BuildEventDefinition$7<T extends EventDefinition$7<any, string>> = (handler: EventHandler$7<T>) => void;
1350
-
1351
- declare global {
1352
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1353
- interface SymbolConstructor {
1354
- readonly observable: symbol;
1355
- }
1356
- }
1402
+ declare const onGroupCreated$1: EventDefinition<GroupCreatedEnvelope, "wix.social_groups.v2.group_created">;
1403
+ declare const onGroupUpdated$1: EventDefinition<GroupUpdatedEnvelope, "wix.social_groups.v2.group_updated">;
1404
+ declare const onGroupCoverChanged$1: EventDefinition<GroupCoverChangedEnvelope, "wix.social_groups.v2.group_group_cover_changed">;
1405
+ declare const onGroupDescriptionChanged$1: EventDefinition<GroupDescriptionChangedEnvelope, "wix.social_groups.v2.group_group_description_changed">;
1406
+ declare const onGroupDeleted$1: EventDefinition<GroupDeletedEnvelope, "wix.social_groups.v2.group_deleted">;
1357
1407
 
1358
- declare function createEventModule$7<T extends EventDefinition$7<any, string>>(eventDefinition: T): BuildEventDefinition$7<T> & T;
1408
+ declare function createEventModule$7<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1359
1409
 
1360
1410
  declare const createGroup: MaybeContext<BuildRESTFunction<typeof createGroup$1> & typeof createGroup$1>;
1361
1411
  declare const updateGroup: MaybeContext<BuildRESTFunction<typeof updateGroup$1> & typeof updateGroup$1>;
@@ -1492,7 +1542,7 @@ interface GroupMember$1 {
1492
1542
  * Date and time the group Member joined the group.
1493
1543
  * @readonly
1494
1544
  */
1495
- joinedDate?: Date;
1545
+ joinedDate?: Date | null;
1496
1546
  }
1497
1547
  /**
1498
1548
  * A group member may have multiple roles in a single group.
@@ -1806,7 +1856,7 @@ interface DomainEvent$6 extends DomainEventBodyOneOf$6 {
1806
1856
  /** ID of the entity associated with the event. */
1807
1857
  entityId?: string;
1808
1858
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1809
- eventTime?: Date;
1859
+ eventTime?: Date | null;
1810
1860
  /**
1811
1861
  * Whether the event was triggered as a result of a privacy regulation application
1812
1862
  * (for example, GDPR).
@@ -1835,7 +1885,7 @@ interface EntityCreatedEvent$6 {
1835
1885
  entity?: string;
1836
1886
  }
1837
1887
  interface RestoreInfo$6 {
1838
- deletedDate?: Date;
1888
+ deletedDate?: Date | null;
1839
1889
  }
1840
1890
  interface EntityUpdatedEvent$6 {
1841
1891
  /**
@@ -1948,7 +1998,7 @@ interface EventMetadata$6 extends BaseEventMetadata$6 {
1948
1998
  /** ID of the entity associated with the event. */
1949
1999
  entityId?: string;
1950
2000
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1951
- eventTime?: Date;
2001
+ eventTime?: Date | null;
1952
2002
  /**
1953
2003
  * Whether the event was triggered as a result of a privacy regulation application
1954
2004
  * (for example, GDPR).
@@ -2165,28 +2215,10 @@ interface QueryMembershipsSignature {
2165
2215
  */
2166
2216
  (memberId: string | null, options?: QueryMembershipsOptions | undefined): Promise<QueryMembershipsResponse & QueryMembershipsResponseNonNullableFields>;
2167
2217
  }
2168
- declare const onGroupMemberAdded$1: EventDefinition$8<GroupMemberAddedEnvelope, "wix.social_groups.v2.group_member_added">;
2169
- declare const onGroupMemberRemoved$1: EventDefinition$8<GroupMemberRemovedEnvelope, "wix.social_groups.v2.group_member_removed">;
2218
+ declare const onGroupMemberAdded$1: EventDefinition<GroupMemberAddedEnvelope, "wix.social_groups.v2.group_member_added">;
2219
+ declare const onGroupMemberRemoved$1: EventDefinition<GroupMemberRemovedEnvelope, "wix.social_groups.v2.group_member_removed">;
2170
2220
 
2171
- type EventDefinition$6<Payload = unknown, Type extends string = string> = {
2172
- __type: 'event-definition';
2173
- type: Type;
2174
- isDomainEvent?: boolean;
2175
- transformations?: (envelope: unknown) => Payload;
2176
- __payload: Payload;
2177
- };
2178
- declare function EventDefinition$6<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$6<Payload, Type>;
2179
- type EventHandler$6<T extends EventDefinition$6> = (payload: T['__payload']) => void | Promise<void>;
2180
- type BuildEventDefinition$6<T extends EventDefinition$6<any, string>> = (handler: EventHandler$6<T>) => void;
2181
-
2182
- declare global {
2183
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2184
- interface SymbolConstructor {
2185
- readonly observable: symbol;
2186
- }
2187
- }
2188
-
2189
- declare function createEventModule$6<T extends EventDefinition$6<any, string>>(eventDefinition: T): BuildEventDefinition$6<T> & T;
2221
+ declare function createEventModule$6<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
2190
2222
 
2191
2223
  declare const addGroupMembers: MaybeContext<BuildRESTFunction<typeof addGroupMembers$1> & typeof addGroupMembers$1>;
2192
2224
  declare const removeGroupMembers: MaybeContext<BuildRESTFunction<typeof removeGroupMembers$1> & typeof removeGroupMembers$1>;
@@ -2365,26 +2397,26 @@ interface Group$1 {
2365
2397
  * Date and time the group was created.
2366
2398
  * @readonly
2367
2399
  */
2368
- _createdDate?: Date;
2400
+ _createdDate?: Date | null;
2369
2401
  /**
2370
2402
  * Date and time the group was last updated.
2371
2403
  * @readonly
2372
2404
  */
2373
- _updatedDate?: Date;
2405
+ _updatedDate?: Date | null;
2374
2406
  /**
2375
2407
  * @internal
2376
2408
  * @internal
2377
2409
  * @readonly
2378
2410
  * @deprecated
2379
2411
  */
2380
- recentActivityDate?: Date;
2412
+ recentActivityDate?: Date | null;
2381
2413
  /**
2382
2414
  * Date and time the group was last active.
2383
2415
  *
2384
2416
  * For example, a post or comment made in the group.
2385
2417
  * @readonly
2386
2418
  */
2387
- lastActivityDate?: Date;
2419
+ lastActivityDate?: Date | null;
2388
2420
  }
2389
2421
  declare enum Type$1 {
2390
2422
  UNKNOWN = "UNKNOWN",
@@ -2704,7 +2736,7 @@ interface DomainEvent$5 extends DomainEventBodyOneOf$5 {
2704
2736
  /** ID of the entity associated with the event. */
2705
2737
  entityId?: string;
2706
2738
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
2707
- eventTime?: Date;
2739
+ eventTime?: Date | null;
2708
2740
  /**
2709
2741
  * Whether the event was triggered as a result of a privacy regulation application
2710
2742
  * (for example, GDPR).
@@ -2733,7 +2765,7 @@ interface EntityCreatedEvent$5 {
2733
2765
  entity?: string;
2734
2766
  }
2735
2767
  interface RestoreInfo$5 {
2736
- deletedDate?: Date;
2768
+ deletedDate?: Date | null;
2737
2769
  }
2738
2770
  interface EntityUpdatedEvent$5 {
2739
2771
  /**
@@ -2881,7 +2913,7 @@ interface EventMetadata$5 extends BaseEventMetadata$5 {
2881
2913
  /** ID of the entity associated with the event. */
2882
2914
  entityId?: string;
2883
2915
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
2884
- eventTime?: Date;
2916
+ eventTime?: Date | null;
2885
2917
  /**
2886
2918
  * Whether the event was triggered as a result of a privacy regulation application
2887
2919
  * (for example, GDPR).
@@ -3031,29 +3063,11 @@ interface QueryGroupRequestsSignature {
3031
3063
  */
3032
3064
  (options?: QueryGroupRequestsOptions | undefined): GroupRequestsQueryBuilder;
3033
3065
  }
3034
- declare const onGroupRequestCreated$1: EventDefinition$8<GroupRequestCreatedEnvelope, "wix.social_groups.v2.group_request_created">;
3035
- declare const onGroupRequestApproved$1: EventDefinition$8<GroupRequestApprovedEnvelope, "wix.social_groups.v2.group_request_approved">;
3036
- declare const onGroupRequestRejected$1: EventDefinition$8<GroupRequestRejectedEnvelope, "wix.social_groups.v2.group_request_rejected">;
3037
-
3038
- type EventDefinition$5<Payload = unknown, Type extends string = string> = {
3039
- __type: 'event-definition';
3040
- type: Type;
3041
- isDomainEvent?: boolean;
3042
- transformations?: (envelope: unknown) => Payload;
3043
- __payload: Payload;
3044
- };
3045
- declare function EventDefinition$5<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$5<Payload, Type>;
3046
- type EventHandler$5<T extends EventDefinition$5> = (payload: T['__payload']) => void | Promise<void>;
3047
- type BuildEventDefinition$5<T extends EventDefinition$5<any, string>> = (handler: EventHandler$5<T>) => void;
3048
-
3049
- declare global {
3050
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
3051
- interface SymbolConstructor {
3052
- readonly observable: symbol;
3053
- }
3054
- }
3066
+ declare const onGroupRequestCreated$1: EventDefinition<GroupRequestCreatedEnvelope, "wix.social_groups.v2.group_request_created">;
3067
+ declare const onGroupRequestApproved$1: EventDefinition<GroupRequestApprovedEnvelope, "wix.social_groups.v2.group_request_approved">;
3068
+ declare const onGroupRequestRejected$1: EventDefinition<GroupRequestRejectedEnvelope, "wix.social_groups.v2.group_request_rejected">;
3055
3069
 
3056
- declare function createEventModule$5<T extends EventDefinition$5<any, string>>(eventDefinition: T): BuildEventDefinition$5<T> & T;
3070
+ declare function createEventModule$5<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
3057
3071
 
3058
3072
  declare const approveGroupRequests: MaybeContext<BuildRESTFunction<typeof approveGroupRequests$1> & typeof approveGroupRequests$1>;
3059
3073
  declare const rejectGroupRequests: MaybeContext<BuildRESTFunction<typeof rejectGroupRequests$1> & typeof rejectGroupRequests$1>;
@@ -3196,7 +3210,7 @@ interface GroupMember {
3196
3210
  * Date and time the group Member joined the group.
3197
3211
  * @readonly
3198
3212
  */
3199
- joinedDate?: Date;
3213
+ joinedDate?: Date | null;
3200
3214
  }
3201
3215
  interface UnassignRoleRequest {
3202
3216
  /** Group ID. */
@@ -3264,7 +3278,7 @@ interface DomainEvent$4 extends DomainEventBodyOneOf$4 {
3264
3278
  /** ID of the entity associated with the event. */
3265
3279
  entityId?: string;
3266
3280
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
3267
- eventTime?: Date;
3281
+ eventTime?: Date | null;
3268
3282
  /**
3269
3283
  * Whether the event was triggered as a result of a privacy regulation application
3270
3284
  * (for example, GDPR).
@@ -3293,7 +3307,7 @@ interface EntityCreatedEvent$4 {
3293
3307
  entity?: string;
3294
3308
  }
3295
3309
  interface RestoreInfo$4 {
3296
- deletedDate?: Date;
3310
+ deletedDate?: Date | null;
3297
3311
  }
3298
3312
  interface EntityUpdatedEvent$4 {
3299
3313
  /**
@@ -3393,7 +3407,7 @@ interface EventMetadata$4 extends BaseEventMetadata$4 {
3393
3407
  /** ID of the entity associated with the event. */
3394
3408
  entityId?: string;
3395
3409
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
3396
- eventTime?: Date;
3410
+ eventTime?: Date | null;
3397
3411
  /**
3398
3412
  * Whether the event was triggered as a result of a privacy regulation application
3399
3413
  * (for example, GDPR).
@@ -3467,28 +3481,10 @@ interface UnassignRoleSignature {
3467
3481
  */
3468
3482
  (groupId: string, memberIds: string[], role: GroupRole, options?: UnassignRoleOptions | undefined): Promise<UnassignRoleResponse & UnassignRoleResponseNonNullableFields>;
3469
3483
  }
3470
- declare const onGroupRoleAssigned$1: EventDefinition$8<GroupRoleAssignedEnvelope, "wix.social_groups.v2.group_role_assigned">;
3471
- declare const onGroupRoleUnassigned$1: EventDefinition$8<GroupRoleUnassignedEnvelope, "wix.social_groups.v2.group_role_unassigned">;
3472
-
3473
- type EventDefinition$4<Payload = unknown, Type extends string = string> = {
3474
- __type: 'event-definition';
3475
- type: Type;
3476
- isDomainEvent?: boolean;
3477
- transformations?: (envelope: unknown) => Payload;
3478
- __payload: Payload;
3479
- };
3480
- declare function EventDefinition$4<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$4<Payload, Type>;
3481
- type EventHandler$4<T extends EventDefinition$4> = (payload: T['__payload']) => void | Promise<void>;
3482
- type BuildEventDefinition$4<T extends EventDefinition$4<any, string>> = (handler: EventHandler$4<T>) => void;
3483
-
3484
- declare global {
3485
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
3486
- interface SymbolConstructor {
3487
- readonly observable: symbol;
3488
- }
3489
- }
3484
+ declare const onGroupRoleAssigned$1: EventDefinition<GroupRoleAssignedEnvelope, "wix.social_groups.v2.group_role_assigned">;
3485
+ declare const onGroupRoleUnassigned$1: EventDefinition<GroupRoleUnassignedEnvelope, "wix.social_groups.v2.group_role_unassigned">;
3490
3486
 
3491
- declare function createEventModule$4<T extends EventDefinition$4<any, string>>(eventDefinition: T): BuildEventDefinition$4<T> & T;
3487
+ declare function createEventModule$4<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
3492
3488
 
3493
3489
  declare const assignRole: MaybeContext<BuildRESTFunction<typeof assignRole$1> & typeof assignRole$1>;
3494
3490
  declare const unassignRole: MaybeContext<BuildRESTFunction<typeof unassignRole$1> & typeof unassignRole$1>;
@@ -3595,7 +3591,7 @@ interface DomainEvent$3 extends DomainEventBodyOneOf$3 {
3595
3591
  /** ID of the entity associated with the event. */
3596
3592
  entityId?: string;
3597
3593
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
3598
- eventTime?: Date;
3594
+ eventTime?: Date | null;
3599
3595
  /**
3600
3596
  * Whether the event was triggered as a result of a privacy regulation application
3601
3597
  * (for example, GDPR).
@@ -3624,7 +3620,7 @@ interface EntityCreatedEvent$3 {
3624
3620
  entity?: string;
3625
3621
  }
3626
3622
  interface RestoreInfo$3 {
3627
- deletedDate?: Date;
3623
+ deletedDate?: Date | null;
3628
3624
  }
3629
3625
  interface EntityUpdatedEvent$3 {
3630
3626
  /**
@@ -3720,7 +3716,7 @@ interface EventMetadata$3 extends BaseEventMetadata$3 {
3720
3716
  /** ID of the entity associated with the event. */
3721
3717
  entityId?: string;
3722
3718
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
3723
- eventTime?: Date;
3719
+ eventTime?: Date | null;
3724
3720
  /**
3725
3721
  * Whether the event was triggered as a result of a privacy regulation application
3726
3722
  * (for example, GDPR).
@@ -3770,27 +3766,9 @@ interface CreateOrReplaceAllRulesSignature {
3770
3766
  */
3771
3767
  (groupId: string, options?: CreateOrReplaceAllRulesOptions | undefined): Promise<CreateOrReplaceAllRulesResponse & CreateOrReplaceAllRulesResponseNonNullableFields>;
3772
3768
  }
3773
- declare const onGroupRulesUpdated$1: EventDefinition$8<GroupRulesUpdatedEnvelope, "wix.social_groups.v2.group_rules_updated">;
3769
+ declare const onGroupRulesUpdated$1: EventDefinition<GroupRulesUpdatedEnvelope, "wix.social_groups.v2.group_rules_updated">;
3774
3770
 
3775
- type EventDefinition$3<Payload = unknown, Type extends string = string> = {
3776
- __type: 'event-definition';
3777
- type: Type;
3778
- isDomainEvent?: boolean;
3779
- transformations?: (envelope: unknown) => Payload;
3780
- __payload: Payload;
3781
- };
3782
- declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
3783
- type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
3784
- type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
3785
-
3786
- declare global {
3787
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
3788
- interface SymbolConstructor {
3789
- readonly observable: symbol;
3790
- }
3791
- }
3792
-
3793
- declare function createEventModule$3<T extends EventDefinition$3<any, string>>(eventDefinition: T): BuildEventDefinition$3<T> & T;
3771
+ declare function createEventModule$3<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
3794
3772
 
3795
3773
  declare const listRules: MaybeContext<BuildRESTFunction<typeof listRules$1> & typeof listRules$1>;
3796
3774
  declare const createOrReplaceAllRules: MaybeContext<BuildRESTFunction<typeof createOrReplaceAllRules$1> & typeof createOrReplaceAllRules$1>;
@@ -3920,7 +3898,7 @@ interface GetJoinRequirementsResponse {
3920
3898
  interface PaidPlan {
3921
3899
  planId?: string;
3922
3900
  name?: string;
3923
- startsAt?: Date;
3901
+ startsAt?: Date | null;
3924
3902
  }
3925
3903
  declare enum ViolationType {
3926
3904
  NONE = "NONE",
@@ -4151,7 +4129,7 @@ interface DomainEvent$2 extends DomainEventBodyOneOf$2 {
4151
4129
  /** ID of the entity associated with the event. */
4152
4130
  entityId?: string;
4153
4131
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
4154
- eventTime?: Date;
4132
+ eventTime?: Date | null;
4155
4133
  /**
4156
4134
  * Whether the event was triggered as a result of a privacy regulation application
4157
4135
  * (for example, GDPR).
@@ -4180,7 +4158,7 @@ interface EntityCreatedEvent$2 {
4180
4158
  entity?: string;
4181
4159
  }
4182
4160
  interface RestoreInfo$2 {
4183
- deletedDate?: Date;
4161
+ deletedDate?: Date | null;
4184
4162
  }
4185
4163
  interface EntityUpdatedEvent$2 {
4186
4164
  /**
@@ -4282,7 +4260,7 @@ interface EventMetadata$2 extends BaseEventMetadata$2 {
4282
4260
  /** ID of the entity associated with the event. */
4283
4261
  entityId?: string;
4284
4262
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
4285
- eventTime?: Date;
4263
+ eventTime?: Date | null;
4286
4264
  /**
4287
4265
  * Whether the event was triggered as a result of a privacy regulation application
4288
4266
  * (for example, GDPR).
@@ -4442,29 +4420,11 @@ interface QueryJoinGroupRequestsSignature {
4442
4420
  */
4443
4421
  (groupId: string, options?: QueryJoinGroupRequestsOptions | undefined): JoinGroupRequestsQueryBuilder;
4444
4422
  }
4445
- declare const onJoinGroupRequestCreated$1: EventDefinition$8<JoinGroupRequestCreatedEnvelope, "wix.social_groups.v2.join_group_request_created">;
4446
- declare const onJoinGroupRequestApproved$1: EventDefinition$8<JoinGroupRequestApprovedEnvelope, "wix.social_groups.v2.join_group_request_approved">;
4447
- declare const onJoinGroupRequestRejected$1: EventDefinition$8<JoinGroupRequestRejectedEnvelope, "wix.social_groups.v2.join_group_request_rejected">;
4448
-
4449
- type EventDefinition$2<Payload = unknown, Type extends string = string> = {
4450
- __type: 'event-definition';
4451
- type: Type;
4452
- isDomainEvent?: boolean;
4453
- transformations?: (envelope: unknown) => Payload;
4454
- __payload: Payload;
4455
- };
4456
- declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
4457
- type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
4458
- type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
4459
-
4460
- declare global {
4461
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
4462
- interface SymbolConstructor {
4463
- readonly observable: symbol;
4464
- }
4465
- }
4423
+ declare const onJoinGroupRequestCreated$1: EventDefinition<JoinGroupRequestCreatedEnvelope, "wix.social_groups.v2.join_group_request_created">;
4424
+ declare const onJoinGroupRequestApproved$1: EventDefinition<JoinGroupRequestApprovedEnvelope, "wix.social_groups.v2.join_group_request_approved">;
4425
+ declare const onJoinGroupRequestRejected$1: EventDefinition<JoinGroupRequestRejectedEnvelope, "wix.social_groups.v2.join_group_request_rejected">;
4466
4426
 
4467
- declare function createEventModule$2<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
4427
+ declare function createEventModule$2<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
4468
4428
 
4469
4429
  declare const approveJoinGroupRequests: MaybeContext<BuildRESTFunction<typeof approveJoinGroupRequests$1> & typeof approveJoinGroupRequests$1>;
4470
4430
  declare const rejectJoinGroupRequests: MaybeContext<BuildRESTFunction<typeof rejectJoinGroupRequests$1> & typeof rejectJoinGroupRequests$1>;
@@ -4827,24 +4787,24 @@ interface Group {
4827
4787
  * Group creation date and time.
4828
4788
  * @readonly
4829
4789
  */
4830
- _createdDate?: Date;
4790
+ _createdDate?: Date | null;
4831
4791
  /**
4832
4792
  * Date and time of the latest group update.
4833
4793
  * @readonly
4834
4794
  */
4835
- _updatedDate?: Date;
4795
+ _updatedDate?: Date | null;
4836
4796
  /**
4837
4797
  * __Deprecated.__ Use `lastActivityDate` instead.
4838
4798
  * This property will be removed on June 30, 2022.
4839
4799
  * @readonly
4840
4800
  * @deprecated
4841
4801
  */
4842
- recentActivityDate?: Date;
4802
+ recentActivityDate?: Date | null;
4843
4803
  /**
4844
4804
  * Date and time of the most recent group activity, for example a post or comment.
4845
4805
  * @readonly
4846
4806
  */
4847
- lastActivityDate?: Date;
4807
+ lastActivityDate?: Date | null;
4848
4808
  }
4849
4809
  declare enum Type {
4850
4810
  UNKNOWN = "UNKNOWN",
@@ -5133,7 +5093,7 @@ interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
5133
5093
  /** ID of the entity associated with the event. */
5134
5094
  entityId?: string;
5135
5095
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
5136
- eventTime?: Date;
5096
+ eventTime?: Date | null;
5137
5097
  /**
5138
5098
  * Whether the event was triggered as a result of a privacy regulation application
5139
5099
  * (for example, GDPR).
@@ -5162,7 +5122,7 @@ interface EntityCreatedEvent$1 {
5162
5122
  entity?: string;
5163
5123
  }
5164
5124
  interface RestoreInfo$1 {
5165
- deletedDate?: Date;
5125
+ deletedDate?: Date | null;
5166
5126
  }
5167
5127
  interface EntityUpdatedEvent$1 {
5168
5128
  /**
@@ -5310,7 +5270,7 @@ interface EventMetadata$1 extends BaseEventMetadata$1 {
5310
5270
  /** ID of the entity associated with the event. */
5311
5271
  entityId?: string;
5312
5272
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
5313
- eventTime?: Date;
5273
+ eventTime?: Date | null;
5314
5274
  /**
5315
5275
  * Whether the event was triggered as a result of a privacy regulation application
5316
5276
  * (for example, GDPR).
@@ -5390,28 +5350,10 @@ interface QueryCreateRequestsSignature {
5390
5350
  */
5391
5351
  (options?: QueryCreateRequestsOptions | undefined): Promise<QueryCreateRequestsResponse & QueryCreateRequestsResponseNonNullableFields>;
5392
5352
  }
5393
- declare const onCreateRequestApproved$1: EventDefinition$8<CreateRequestApprovedEnvelope, "wix.social_groups.v3.create_request_approved">;
5394
- declare const onCreateRequestRejected$1: EventDefinition$8<CreateRequestRejectedEnvelope, "wix.social_groups.v3.create_request_rejected">;
5395
-
5396
- type EventDefinition$1<Payload = unknown, Type extends string = string> = {
5397
- __type: 'event-definition';
5398
- type: Type;
5399
- isDomainEvent?: boolean;
5400
- transformations?: (envelope: unknown) => Payload;
5401
- __payload: Payload;
5402
- };
5403
- declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
5404
- type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
5405
- type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
5353
+ declare const onCreateRequestApproved$1: EventDefinition<CreateRequestApprovedEnvelope, "wix.social_groups.v3.create_request_approved">;
5354
+ declare const onCreateRequestRejected$1: EventDefinition<CreateRequestRejectedEnvelope, "wix.social_groups.v3.create_request_rejected">;
5406
5355
 
5407
- declare global {
5408
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
5409
- interface SymbolConstructor {
5410
- readonly observable: symbol;
5411
- }
5412
- }
5413
-
5414
- declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
5356
+ declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
5415
5357
 
5416
5358
  declare const approveCreateRequests: MaybeContext<BuildRESTFunction<typeof approveCreateRequests$1> & typeof approveCreateRequests$1>;
5417
5359
  declare const rejectCreateRequests: MaybeContext<BuildRESTFunction<typeof rejectCreateRequests$1> & typeof rejectCreateRequests$1>;
@@ -5702,7 +5644,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
5702
5644
  /** ID of the entity associated with the event. */
5703
5645
  entityId?: string;
5704
5646
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
5705
- eventTime?: Date;
5647
+ eventTime?: Date | null;
5706
5648
  /**
5707
5649
  * Whether the event was triggered as a result of a privacy regulation application
5708
5650
  * (for example, GDPR).
@@ -5731,7 +5673,7 @@ interface EntityCreatedEvent {
5731
5673
  entity?: string;
5732
5674
  }
5733
5675
  interface RestoreInfo {
5734
- deletedDate?: Date;
5676
+ deletedDate?: Date | null;
5735
5677
  }
5736
5678
  interface EntityUpdatedEvent {
5737
5679
  /**
@@ -5832,7 +5774,7 @@ interface EventMetadata extends BaseEventMetadata {
5832
5774
  /** ID of the entity associated with the event. */
5833
5775
  entityId?: string;
5834
5776
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
5835
- eventTime?: Date;
5777
+ eventTime?: Date | null;
5836
5778
  /**
5837
5779
  * Whether the event was triggered as a result of a privacy regulation application
5838
5780
  * (for example, GDPR).
@@ -5915,26 +5857,8 @@ interface QueryJoinRequestsSignature {
5915
5857
  */
5916
5858
  (groupId: string, options?: QueryJoinRequestsOptions | undefined): Promise<QueryJoinRequestsResponse & QueryJoinRequestsResponseNonNullableFields>;
5917
5859
  }
5918
- declare const onJoinRequestApproved$1: EventDefinition$8<JoinRequestApprovedEnvelope, "wix.social_groups.v3.join_request_approved">;
5919
- declare const onJoinRequestRejected$1: EventDefinition$8<JoinRequestRejectedEnvelope, "wix.social_groups.v3.join_request_rejected">;
5920
-
5921
- type EventDefinition<Payload = unknown, Type extends string = string> = {
5922
- __type: 'event-definition';
5923
- type: Type;
5924
- isDomainEvent?: boolean;
5925
- transformations?: (envelope: unknown) => Payload;
5926
- __payload: Payload;
5927
- };
5928
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
5929
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
5930
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
5931
-
5932
- declare global {
5933
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
5934
- interface SymbolConstructor {
5935
- readonly observable: symbol;
5936
- }
5937
- }
5860
+ declare const onJoinRequestApproved$1: EventDefinition<JoinRequestApprovedEnvelope, "wix.social_groups.v3.join_request_approved">;
5861
+ declare const onJoinRequestRejected$1: EventDefinition<JoinRequestRejectedEnvelope, "wix.social_groups.v3.join_request_rejected">;
5938
5862
 
5939
5863
  declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
5940
5864