@wix/members 1.0.105 → 1.0.107

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.
@@ -1,8 +1,47 @@
1
+ type HostModule<T, H extends Host> = {
2
+ __type: 'host';
3
+ create(host: H): T;
4
+ };
5
+ type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
6
+ type Host<Environment = unknown> = {
7
+ channel: {
8
+ observeState(callback: (props: unknown, environment: Environment) => unknown): {
9
+ disconnect: () => void;
10
+ } | Promise<{
11
+ disconnect: () => void;
12
+ }>;
13
+ };
14
+ environment?: Environment;
15
+ /**
16
+ * Optional bast url to use for API requests, for example `www.wixapis.com`
17
+ */
18
+ apiBaseUrl?: string;
19
+ /**
20
+ * Possible data to be provided by every host, for cross cutting concerns
21
+ * like internationalization, billing, etc.
22
+ */
23
+ essentials?: {
24
+ /**
25
+ * The language of the currently viewed session
26
+ */
27
+ language?: string;
28
+ /**
29
+ * The locale of the currently viewed session
30
+ */
31
+ locale?: string;
32
+ /**
33
+ * Any headers that should be passed through to the API requests
34
+ */
35
+ passThroughHeaders?: Record<string, string>;
36
+ };
37
+ };
38
+
1
39
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
2
40
  interface HttpClient {
3
41
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
4
42
  fetchWithAuth: typeof fetch;
5
43
  wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
44
+ getActiveToken?: () => string | undefined;
6
45
  }
7
46
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
8
47
  type HttpResponse<T = any> = {
@@ -24,16 +63,65 @@ type APIMetadata = {
24
63
  packageName?: string;
25
64
  };
26
65
  type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
27
- type EventDefinition<Payload = unknown, Type extends string = string> = {
66
+ type EventDefinition$2<Payload = unknown, Type extends string = string> = {
28
67
  __type: 'event-definition';
29
68
  type: Type;
30
69
  isDomainEvent?: boolean;
31
70
  transformations?: (envelope: unknown) => Payload;
32
71
  __payload: Payload;
33
72
  };
34
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
35
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
36
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
73
+ declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
74
+ type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
75
+ type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
76
+
77
+ type ServicePluginMethodInput = {
78
+ request: any;
79
+ metadata: any;
80
+ };
81
+ type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
82
+ type ServicePluginMethodMetadata = {
83
+ name: string;
84
+ primaryHttpMappingPath: string;
85
+ transformations: {
86
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput;
87
+ toREST: (...args: unknown[]) => unknown;
88
+ };
89
+ };
90
+ type ServicePluginDefinition<Contract extends ServicePluginContract> = {
91
+ __type: 'service-plugin-definition';
92
+ componentType: string;
93
+ methods: ServicePluginMethodMetadata[];
94
+ __contract: Contract;
95
+ };
96
+ declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
97
+ type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
98
+ declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
99
+
100
+ type RequestContext = {
101
+ isSSR: boolean;
102
+ host: string;
103
+ protocol?: string;
104
+ };
105
+ type ResponseTransformer = (data: any, headers?: any) => any;
106
+ /**
107
+ * Ambassador request options types are copied mostly from AxiosRequestConfig.
108
+ * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
109
+ * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
110
+ */
111
+ type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
112
+ type AmbassadorRequestOptions<T = any> = {
113
+ _?: T;
114
+ url?: string;
115
+ method?: Method;
116
+ params?: any;
117
+ data?: any;
118
+ transformResponse?: ResponseTransformer | ResponseTransformer[];
119
+ };
120
+ type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
121
+ __isAmbassador: boolean;
122
+ };
123
+ type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
124
+ type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
37
125
 
38
126
  declare global {
39
127
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -42,6 +130,284 @@ declare global {
42
130
  }
43
131
  }
44
132
 
133
+ declare const emptyObjectSymbol: unique symbol;
134
+
135
+ /**
136
+ Represents a strictly empty plain object, the `{}` value.
137
+
138
+ When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
139
+
140
+ @example
141
+ ```
142
+ import type {EmptyObject} from 'type-fest';
143
+
144
+ // The following illustrates the problem with `{}`.
145
+ const foo1: {} = {}; // Pass
146
+ const foo2: {} = []; // Pass
147
+ const foo3: {} = 42; // Pass
148
+ const foo4: {} = {a: 1}; // Pass
149
+
150
+ // With `EmptyObject` only the first case is valid.
151
+ const bar1: EmptyObject = {}; // Pass
152
+ const bar2: EmptyObject = 42; // Fail
153
+ const bar3: EmptyObject = []; // Fail
154
+ const bar4: EmptyObject = {a: 1}; // Fail
155
+ ```
156
+
157
+ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
158
+
159
+ @category Object
160
+ */
161
+ type EmptyObject = {[emptyObjectSymbol]?: never};
162
+
163
+ /**
164
+ Returns a boolean for whether the two given types are equal.
165
+
166
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
167
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
168
+
169
+ Use-cases:
170
+ - If you want to make a conditional branch based on the result of a comparison of two types.
171
+
172
+ @example
173
+ ```
174
+ import type {IsEqual} from 'type-fest';
175
+
176
+ // This type returns a boolean for whether the given array includes the given item.
177
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
178
+ type Includes<Value extends readonly any[], Item> =
179
+ Value extends readonly [Value[0], ...infer rest]
180
+ ? IsEqual<Value[0], Item> extends true
181
+ ? true
182
+ : Includes<rest, Item>
183
+ : false;
184
+ ```
185
+
186
+ @category Type Guard
187
+ @category Utilities
188
+ */
189
+ type IsEqual<A, B> =
190
+ (<G>() => G extends A ? 1 : 2) extends
191
+ (<G>() => G extends B ? 1 : 2)
192
+ ? true
193
+ : false;
194
+
195
+ /**
196
+ Filter out keys from an object.
197
+
198
+ Returns `never` if `Exclude` is strictly equal to `Key`.
199
+ Returns `never` if `Key` extends `Exclude`.
200
+ Returns `Key` otherwise.
201
+
202
+ @example
203
+ ```
204
+ type Filtered = Filter<'foo', 'foo'>;
205
+ //=> never
206
+ ```
207
+
208
+ @example
209
+ ```
210
+ type Filtered = Filter<'bar', string>;
211
+ //=> never
212
+ ```
213
+
214
+ @example
215
+ ```
216
+ type Filtered = Filter<'bar', 'foo'>;
217
+ //=> 'bar'
218
+ ```
219
+
220
+ @see {Except}
221
+ */
222
+ type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
223
+
224
+ type ExceptOptions = {
225
+ /**
226
+ Disallow assigning non-specified properties.
227
+
228
+ Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
229
+
230
+ @default false
231
+ */
232
+ requireExactProps?: boolean;
233
+ };
234
+
235
+ /**
236
+ Create a type from an object type without certain keys.
237
+
238
+ We recommend setting the `requireExactProps` option to `true`.
239
+
240
+ This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
241
+
242
+ This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
243
+
244
+ @example
245
+ ```
246
+ import type {Except} from 'type-fest';
247
+
248
+ type Foo = {
249
+ a: number;
250
+ b: string;
251
+ };
252
+
253
+ type FooWithoutA = Except<Foo, 'a'>;
254
+ //=> {b: string}
255
+
256
+ const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
257
+ //=> errors: 'a' does not exist in type '{ b: string; }'
258
+
259
+ type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
260
+ //=> {a: number} & Partial<Record<"b", never>>
261
+
262
+ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
263
+ //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
264
+ ```
265
+
266
+ @category Object
267
+ */
268
+ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
269
+ [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
270
+ } & (Options['requireExactProps'] extends true
271
+ ? Partial<Record<KeysType, never>>
272
+ : {});
273
+
274
+ /**
275
+ Extract the keys from a type where the value type of the key extends the given `Condition`.
276
+
277
+ Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
278
+
279
+ @example
280
+ ```
281
+ import type {ConditionalKeys} from 'type-fest';
282
+
283
+ interface Example {
284
+ a: string;
285
+ b: string | number;
286
+ c?: string;
287
+ d: {};
288
+ }
289
+
290
+ type StringKeysOnly = ConditionalKeys<Example, string>;
291
+ //=> 'a'
292
+ ```
293
+
294
+ To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
295
+
296
+ @example
297
+ ```
298
+ import type {ConditionalKeys} from 'type-fest';
299
+
300
+ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
301
+ //=> 'a' | 'c'
302
+ ```
303
+
304
+ @category Object
305
+ */
306
+ type ConditionalKeys<Base, Condition> = NonNullable<
307
+ // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
308
+ {
309
+ // Map through all the keys of the given base type.
310
+ [Key in keyof Base]:
311
+ // Pick only keys with types extending the given `Condition` type.
312
+ Base[Key] extends Condition
313
+ // Retain this key since the condition passes.
314
+ ? Key
315
+ // Discard this key since the condition fails.
316
+ : never;
317
+
318
+ // Convert the produced object into a union type of the keys which passed the conditional test.
319
+ }[keyof Base]
320
+ >;
321
+
322
+ /**
323
+ Exclude keys from a shape that matches the given `Condition`.
324
+
325
+ This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
326
+
327
+ @example
328
+ ```
329
+ import type {Primitive, ConditionalExcept} from 'type-fest';
330
+
331
+ class Awesome {
332
+ name: string;
333
+ successes: number;
334
+ failures: bigint;
335
+
336
+ run() {}
337
+ }
338
+
339
+ type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
340
+ //=> {run: () => void}
341
+ ```
342
+
343
+ @example
344
+ ```
345
+ import type {ConditionalExcept} from 'type-fest';
346
+
347
+ interface Example {
348
+ a: string;
349
+ b: string | number;
350
+ c: () => void;
351
+ d: {};
352
+ }
353
+
354
+ type NonStringKeysOnly = ConditionalExcept<Example, string>;
355
+ //=> {b: string | number; c: () => void; d: {}}
356
+ ```
357
+
358
+ @category Object
359
+ */
360
+ type ConditionalExcept<Base, Condition> = Except<
361
+ Base,
362
+ ConditionalKeys<Base, Condition>
363
+ >;
364
+
365
+ /**
366
+ * Descriptors are objects that describe the API of a module, and the module
367
+ * can either be a REST module or a host module.
368
+ * This type is recursive, so it can describe nested modules.
369
+ */
370
+ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$2<any> | ServicePluginDefinition<any> | {
371
+ [key: string]: Descriptors | PublicMetadata | any;
372
+ };
373
+ /**
374
+ * This type takes in a descriptors object of a certain Host (including an `unknown` host)
375
+ * and returns an object with the same structure, but with all descriptors replaced with their API.
376
+ * Any non-descriptor properties are removed from the returned object, including descriptors that
377
+ * do not match the given host (as they will not work with the given host).
378
+ */
379
+ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
380
+ done: T;
381
+ recurse: T extends {
382
+ __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
383
+ } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$2<any> ? BuildEventDefinition$2<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
384
+ [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
385
+ -1,
386
+ 0,
387
+ 1,
388
+ 2,
389
+ 3,
390
+ 4,
391
+ 5
392
+ ][Depth]> : never;
393
+ }, EmptyObject>;
394
+ }[Depth extends -1 ? 'done' : 'recurse'];
395
+ type PublicMetadata = {
396
+ PACKAGE_NAME?: string;
397
+ };
398
+
399
+ declare global {
400
+ interface ContextualClient {
401
+ }
402
+ }
403
+ /**
404
+ * A type used to create concerete types from SDK descriptors in
405
+ * case a contextual client is available.
406
+ */
407
+ type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
408
+ host: Host;
409
+ } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
410
+
45
411
  interface Badge {
46
412
  /**
47
413
  * Badge ID.
@@ -759,25 +1125,43 @@ interface UpdateBadgesDisplayOrderSignature {
759
1125
  */
760
1126
  (badgeIds: string[]): Promise<UpdateBadgesDisplayOrderResponse & UpdateBadgesDisplayOrderResponseNonNullableFields>;
761
1127
  }
762
- declare const onBadgeCreated$1: EventDefinition<BadgeCreatedEnvelope, "wix.badges.v3.badge_created">;
763
- declare const onBadgeUpdated$1: EventDefinition<BadgeUpdatedEnvelope, "wix.badges.v3.badge_updated">;
764
- declare const onBadgeDeleted$1: EventDefinition<BadgeDeletedEnvelope, "wix.badges.v3.badge_deleted">;
765
- declare const onBadgeAssigned$1: EventDefinition<BadgeAssignedEnvelope, "wix.badges.v3.badge_badge_assigned">;
766
- declare const onBadgeUnassigned$1: EventDefinition<BadgeUnassignedEnvelope, "wix.badges.v3.badge_badge_unassigned">;
1128
+ declare const onBadgeCreated$1: EventDefinition$2<BadgeCreatedEnvelope, "wix.badges.v3.badge_created">;
1129
+ declare const onBadgeUpdated$1: EventDefinition$2<BadgeUpdatedEnvelope, "wix.badges.v3.badge_updated">;
1130
+ declare const onBadgeDeleted$1: EventDefinition$2<BadgeDeletedEnvelope, "wix.badges.v3.badge_deleted">;
1131
+ declare const onBadgeAssigned$1: EventDefinition$2<BadgeAssignedEnvelope, "wix.badges.v3.badge_badge_assigned">;
1132
+ declare const onBadgeUnassigned$1: EventDefinition$2<BadgeUnassignedEnvelope, "wix.badges.v3.badge_badge_unassigned">;
767
1133
 
768
- declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1134
+ type EventDefinition$1<Payload = unknown, Type extends string = string> = {
1135
+ __type: 'event-definition';
1136
+ type: Type;
1137
+ isDomainEvent?: boolean;
1138
+ transformations?: (envelope: unknown) => Payload;
1139
+ __payload: Payload;
1140
+ };
1141
+ declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
1142
+ type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
1143
+ type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
1144
+
1145
+ declare global {
1146
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1147
+ interface SymbolConstructor {
1148
+ readonly observable: symbol;
1149
+ }
1150
+ }
1151
+
1152
+ declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
769
1153
 
770
- declare const createBadge: BuildRESTFunction<typeof createBadge$1> & typeof createBadge$1;
771
- declare const updateBadge: BuildRESTFunction<typeof updateBadge$1> & typeof updateBadge$1;
772
- declare const listBadges: BuildRESTFunction<typeof listBadges$1> & typeof listBadges$1;
773
- declare const getBadge: BuildRESTFunction<typeof getBadge$1> & typeof getBadge$1;
774
- declare const deleteBadge: BuildRESTFunction<typeof deleteBadge$1> & typeof deleteBadge$1;
775
- declare const assignBadge: BuildRESTFunction<typeof assignBadge$1> & typeof assignBadge$1;
776
- declare const unassignBadge: BuildRESTFunction<typeof unassignBadge$1> & typeof unassignBadge$1;
777
- declare const listMembersByBadge: BuildRESTFunction<typeof listMembersByBadge$1> & typeof listMembersByBadge$1;
778
- declare const listBadgesPerMember: BuildRESTFunction<typeof listBadgesPerMember$1> & typeof listBadgesPerMember$1;
779
- declare const getMemberCountsPerBadge: BuildRESTFunction<typeof getMemberCountsPerBadge$1> & typeof getMemberCountsPerBadge$1;
780
- declare const updateBadgesDisplayOrder: BuildRESTFunction<typeof updateBadgesDisplayOrder$1> & typeof updateBadgesDisplayOrder$1;
1154
+ declare const createBadge: MaybeContext<BuildRESTFunction<typeof createBadge$1> & typeof createBadge$1>;
1155
+ declare const updateBadge: MaybeContext<BuildRESTFunction<typeof updateBadge$1> & typeof updateBadge$1>;
1156
+ declare const listBadges: MaybeContext<BuildRESTFunction<typeof listBadges$1> & typeof listBadges$1>;
1157
+ declare const getBadge: MaybeContext<BuildRESTFunction<typeof getBadge$1> & typeof getBadge$1>;
1158
+ declare const deleteBadge: MaybeContext<BuildRESTFunction<typeof deleteBadge$1> & typeof deleteBadge$1>;
1159
+ declare const assignBadge: MaybeContext<BuildRESTFunction<typeof assignBadge$1> & typeof assignBadge$1>;
1160
+ declare const unassignBadge: MaybeContext<BuildRESTFunction<typeof unassignBadge$1> & typeof unassignBadge$1>;
1161
+ declare const listMembersByBadge: MaybeContext<BuildRESTFunction<typeof listMembersByBadge$1> & typeof listMembersByBadge$1>;
1162
+ declare const listBadgesPerMember: MaybeContext<BuildRESTFunction<typeof listBadgesPerMember$1> & typeof listBadgesPerMember$1>;
1163
+ declare const getMemberCountsPerBadge: MaybeContext<BuildRESTFunction<typeof getMemberCountsPerBadge$1> & typeof getMemberCountsPerBadge$1>;
1164
+ declare const updateBadgesDisplayOrder: MaybeContext<BuildRESTFunction<typeof updateBadgesDisplayOrder$1> & typeof updateBadgesDisplayOrder$1>;
781
1165
 
782
1166
  type _publicOnBadgeCreatedType = typeof onBadgeCreated$1;
783
1167
  /**
@@ -1740,12 +2124,12 @@ interface BlockSignature {
1740
2124
  (options?: BlockOptions | undefined): Promise<void>;
1741
2125
  }
1742
2126
 
1743
- declare const register: BuildRESTFunction<typeof register$1> & typeof register$1;
1744
- declare const login: BuildRESTFunction<typeof login$1> & typeof login$1;
1745
- declare const sendSetPasswordEmail: BuildRESTFunction<typeof sendSetPasswordEmail$1> & typeof sendSetPasswordEmail$1;
1746
- declare const changeLoginEmail: BuildRESTFunction<typeof changeLoginEmail$1> & typeof changeLoginEmail$1;
1747
- declare const approve: BuildRESTFunction<typeof approve$1> & typeof approve$1;
1748
- declare const block: BuildRESTFunction<typeof block$1> & typeof block$1;
2127
+ declare const register: MaybeContext<BuildRESTFunction<typeof register$1> & typeof register$1>;
2128
+ declare const login: MaybeContext<BuildRESTFunction<typeof login$1> & typeof login$1>;
2129
+ declare const sendSetPasswordEmail: MaybeContext<BuildRESTFunction<typeof sendSetPasswordEmail$1> & typeof sendSetPasswordEmail$1>;
2130
+ declare const changeLoginEmail: MaybeContext<BuildRESTFunction<typeof changeLoginEmail$1> & typeof changeLoginEmail$1>;
2131
+ declare const approve: MaybeContext<BuildRESTFunction<typeof approve$1> & typeof approve$1>;
2132
+ declare const block: MaybeContext<BuildRESTFunction<typeof block$1> & typeof block$1>;
1749
2133
 
1750
2134
  type context$7_AppleLogin = AppleLogin;
1751
2135
  type context$7_ApproveMemberRequestMemberIdentifierOneOf = ApproveMemberRequestMemberIdentifierOneOf;
@@ -2102,7 +2486,10 @@ interface MetaSiteSpecialEvent$3 extends MetaSiteSpecialEventPayloadOneOf$3 {
2102
2486
  version?: string;
2103
2487
  /** A timestamp of the event. */
2104
2488
  timestamp?: string;
2105
- /** A list of "assets" (applications). The same as MetaSiteContext. */
2489
+ /**
2490
+ * TODO(meta-site): Change validation once validations are disabled for consumers
2491
+ * More context: https://wix.slack.com/archives/C0UHEBPFT/p1720957844413149 and https://wix.slack.com/archives/CFWKX325T/p1728892152855659
2492
+ */
2106
2493
  assets?: Asset$3[];
2107
2494
  }
2108
2495
  /** @oneof */
@@ -2426,7 +2813,7 @@ interface QueryUserMembersSignature {
2426
2813
  (): UserMembersQueryBuilder;
2427
2814
  }
2428
2815
 
2429
- declare const queryUserMembers: BuildRESTFunction<typeof queryUserMembers$1> & typeof queryUserMembers$1;
2816
+ declare const queryUserMembers: MaybeContext<BuildRESTFunction<typeof queryUserMembers$1> & typeof queryUserMembers$1>;
2430
2817
 
2431
2818
  type context$6_CursorQuery = CursorQuery;
2432
2819
  type context$6_CursorQueryPagingMethodOneOf = CursorQueryPagingMethodOneOf;
@@ -3178,13 +3565,13 @@ interface UpdateCustomFieldsOrderSignature {
3178
3565
  (fieldIds: string[], options?: UpdateCustomFieldsOrderOptions | undefined): Promise<UpdateCustomFieldsOrderResponse & UpdateCustomFieldsOrderResponseNonNullableFields>;
3179
3566
  }
3180
3567
 
3181
- declare const createCustomField: BuildRESTFunction<typeof createCustomField$1> & typeof createCustomField$1;
3182
- declare const getCustomField: BuildRESTFunction<typeof getCustomField$1> & typeof getCustomField$1;
3183
- declare const listCustomFields: BuildRESTFunction<typeof listCustomFields$1> & typeof listCustomFields$1;
3184
- declare const updateCustomField: BuildRESTFunction<typeof updateCustomField$1> & typeof updateCustomField$1;
3185
- declare const deleteCustomField: BuildRESTFunction<typeof deleteCustomField$1> & typeof deleteCustomField$1;
3186
- declare const hideCustomField: BuildRESTFunction<typeof hideCustomField$1> & typeof hideCustomField$1;
3187
- declare const updateCustomFieldsOrder: BuildRESTFunction<typeof updateCustomFieldsOrder$1> & typeof updateCustomFieldsOrder$1;
3568
+ declare const createCustomField: MaybeContext<BuildRESTFunction<typeof createCustomField$1> & typeof createCustomField$1>;
3569
+ declare const getCustomField: MaybeContext<BuildRESTFunction<typeof getCustomField$1> & typeof getCustomField$1>;
3570
+ declare const listCustomFields: MaybeContext<BuildRESTFunction<typeof listCustomFields$1> & typeof listCustomFields$1>;
3571
+ declare const updateCustomField: MaybeContext<BuildRESTFunction<typeof updateCustomField$1> & typeof updateCustomField$1>;
3572
+ declare const deleteCustomField: MaybeContext<BuildRESTFunction<typeof deleteCustomField$1> & typeof deleteCustomField$1>;
3573
+ declare const hideCustomField: MaybeContext<BuildRESTFunction<typeof hideCustomField$1> & typeof hideCustomField$1>;
3574
+ declare const updateCustomFieldsOrder: MaybeContext<BuildRESTFunction<typeof updateCustomFieldsOrder$1> & typeof updateCustomFieldsOrder$1>;
3188
3575
 
3189
3576
  type context$5_AppliesTo = AppliesTo;
3190
3577
  declare const context$5_AppliesTo: typeof AppliesTo;
@@ -3365,8 +3752,8 @@ interface QueryCustomFieldSuggestionsSignature {
3365
3752
  (options?: QueryCustomFieldSuggestionsOptions | undefined): Promise<QueryCustomFieldSuggestionsResponse & QueryCustomFieldSuggestionsResponseNonNullableFields>;
3366
3753
  }
3367
3754
 
3368
- declare const listCustomFieldSuggestions: BuildRESTFunction<typeof listCustomFieldSuggestions$1> & typeof listCustomFieldSuggestions$1;
3369
- declare const queryCustomFieldSuggestions: BuildRESTFunction<typeof queryCustomFieldSuggestions$1> & typeof queryCustomFieldSuggestions$1;
3755
+ declare const listCustomFieldSuggestions: MaybeContext<BuildRESTFunction<typeof listCustomFieldSuggestions$1> & typeof listCustomFieldSuggestions$1>;
3756
+ declare const queryCustomFieldSuggestions: MaybeContext<BuildRESTFunction<typeof queryCustomFieldSuggestions$1> & typeof queryCustomFieldSuggestions$1>;
3370
3757
 
3371
3758
  type context$4_CustomFieldSuggestion = CustomFieldSuggestion;
3372
3759
  type context$4_ListCustomFieldSuggestionsOptions = ListCustomFieldSuggestionsOptions;
@@ -3648,6 +4035,7 @@ interface InvalidateCache extends InvalidateCacheGetByOneOf {
3648
4035
  reason?: string | null;
3649
4036
  /** Is local DS */
3650
4037
  localDc?: boolean;
4038
+ hardPurge?: boolean;
3651
4039
  }
3652
4040
  /** @oneof */
3653
4041
  interface InvalidateCacheGetByOneOf {
@@ -4219,7 +4607,10 @@ interface MetaSiteSpecialEvent$1 extends MetaSiteSpecialEventPayloadOneOf$1 {
4219
4607
  version?: string;
4220
4608
  /** A timestamp of the event. */
4221
4609
  timestamp?: string;
4222
- /** A list of "assets" (applications). The same as MetaSiteContext. */
4610
+ /**
4611
+ * TODO(meta-site): Change validation once validations are disabled for consumers
4612
+ * More context: https://wix.slack.com/archives/C0UHEBPFT/p1720957844413149 and https://wix.slack.com/archives/CFWKX325T/p1728892152855659
4613
+ */
4223
4614
  assets?: Asset$1[];
4224
4615
  }
4225
4616
  /** @oneof */
@@ -5188,36 +5579,54 @@ interface DeleteMemberAddressesSignature {
5188
5579
  */
5189
5580
  (_id: string): Promise<DeleteMemberAddressesResponse & DeleteMemberAddressesResponseNonNullableFields>;
5190
5581
  }
5191
- declare const onMemberUpdated$1: EventDefinition<MemberUpdatedEnvelope, "wix.members.v1.member_updated">;
5192
- declare const onMemberDeleted$1: EventDefinition<MemberDeletedEnvelope, "wix.members.v1.member_deleted">;
5193
- declare const onMemberCreated$1: EventDefinition<MemberCreatedEnvelope, "wix.members.v1.member_created">;
5582
+ declare const onMemberUpdated$1: EventDefinition$2<MemberUpdatedEnvelope, "wix.members.v1.member_updated">;
5583
+ declare const onMemberDeleted$1: EventDefinition$2<MemberDeletedEnvelope, "wix.members.v1.member_deleted">;
5584
+ declare const onMemberCreated$1: EventDefinition$2<MemberCreatedEnvelope, "wix.members.v1.member_created">;
5585
+
5586
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
5587
+ __type: 'event-definition';
5588
+ type: Type;
5589
+ isDomainEvent?: boolean;
5590
+ transformations?: (envelope: unknown) => Payload;
5591
+ __payload: Payload;
5592
+ };
5593
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
5594
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
5595
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
5596
+
5597
+ declare global {
5598
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
5599
+ interface SymbolConstructor {
5600
+ readonly observable: symbol;
5601
+ }
5602
+ }
5194
5603
 
5195
5604
  declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
5196
5605
 
5197
- declare const updateCurrentMemberSlug: BuildRESTFunction<typeof updateCurrentMemberSlug$1> & typeof updateCurrentMemberSlug$1;
5198
- declare const updateMemberSlug: BuildRESTFunction<typeof updateMemberSlug$1> & typeof updateMemberSlug$1;
5199
- declare const joinCommunity: BuildRESTFunction<typeof joinCommunity$1> & typeof joinCommunity$1;
5200
- declare const leaveCommunity: BuildRESTFunction<typeof leaveCommunity$1> & typeof leaveCommunity$1;
5201
- declare const getCurrentMember: BuildRESTFunction<typeof getCurrentMember$1> & typeof getCurrentMember$1;
5202
- declare const getMember: BuildRESTFunction<typeof getMember$1> & typeof getMember$1;
5203
- declare const listMembers: BuildRESTFunction<typeof listMembers$1> & typeof listMembers$1;
5204
- declare const queryMembers: BuildRESTFunction<typeof queryMembers$1> & typeof queryMembers$1;
5205
- declare const muteMember: BuildRESTFunction<typeof muteMember$1> & typeof muteMember$1;
5206
- declare const unmuteMember: BuildRESTFunction<typeof unmuteMember$1> & typeof unmuteMember$1;
5207
- declare const approveMember: BuildRESTFunction<typeof approveMember$1> & typeof approveMember$1;
5208
- declare const blockMember$2: BuildRESTFunction<typeof blockMember$3> & typeof blockMember$3;
5209
- declare const disconnectMember: BuildRESTFunction<typeof disconnectMember$1> & typeof disconnectMember$1;
5210
- declare const deleteMember: BuildRESTFunction<typeof deleteMember$1> & typeof deleteMember$1;
5211
- declare const deleteMyMember: BuildRESTFunction<typeof deleteMyMember$1> & typeof deleteMyMember$1;
5212
- declare const bulkDeleteMembers: BuildRESTFunction<typeof bulkDeleteMembers$1> & typeof bulkDeleteMembers$1;
5213
- declare const bulkDeleteMembersByFilter: BuildRESTFunction<typeof bulkDeleteMembersByFilter$1> & typeof bulkDeleteMembersByFilter$1;
5214
- declare const bulkApproveMembers: BuildRESTFunction<typeof bulkApproveMembers$1> & typeof bulkApproveMembers$1;
5215
- declare const bulkBlockMembers: BuildRESTFunction<typeof bulkBlockMembers$1> & typeof bulkBlockMembers$1;
5216
- declare const createMember: BuildRESTFunction<typeof createMember$1> & typeof createMember$1;
5217
- declare const updateMember: BuildRESTFunction<typeof updateMember$1> & typeof updateMember$1;
5218
- declare const deleteMemberPhones: BuildRESTFunction<typeof deleteMemberPhones$1> & typeof deleteMemberPhones$1;
5219
- declare const deleteMemberEmails: BuildRESTFunction<typeof deleteMemberEmails$1> & typeof deleteMemberEmails$1;
5220
- declare const deleteMemberAddresses: BuildRESTFunction<typeof deleteMemberAddresses$1> & typeof deleteMemberAddresses$1;
5606
+ declare const updateCurrentMemberSlug: MaybeContext<BuildRESTFunction<typeof updateCurrentMemberSlug$1> & typeof updateCurrentMemberSlug$1>;
5607
+ declare const updateMemberSlug: MaybeContext<BuildRESTFunction<typeof updateMemberSlug$1> & typeof updateMemberSlug$1>;
5608
+ declare const joinCommunity: MaybeContext<BuildRESTFunction<typeof joinCommunity$1> & typeof joinCommunity$1>;
5609
+ declare const leaveCommunity: MaybeContext<BuildRESTFunction<typeof leaveCommunity$1> & typeof leaveCommunity$1>;
5610
+ declare const getCurrentMember: MaybeContext<BuildRESTFunction<typeof getCurrentMember$1> & typeof getCurrentMember$1>;
5611
+ declare const getMember: MaybeContext<BuildRESTFunction<typeof getMember$1> & typeof getMember$1>;
5612
+ declare const listMembers: MaybeContext<BuildRESTFunction<typeof listMembers$1> & typeof listMembers$1>;
5613
+ declare const queryMembers: MaybeContext<BuildRESTFunction<typeof queryMembers$1> & typeof queryMembers$1>;
5614
+ declare const muteMember: MaybeContext<BuildRESTFunction<typeof muteMember$1> & typeof muteMember$1>;
5615
+ declare const unmuteMember: MaybeContext<BuildRESTFunction<typeof unmuteMember$1> & typeof unmuteMember$1>;
5616
+ declare const approveMember: MaybeContext<BuildRESTFunction<typeof approveMember$1> & typeof approveMember$1>;
5617
+ declare const blockMember$2: MaybeContext<BuildRESTFunction<typeof blockMember$3> & typeof blockMember$3>;
5618
+ declare const disconnectMember: MaybeContext<BuildRESTFunction<typeof disconnectMember$1> & typeof disconnectMember$1>;
5619
+ declare const deleteMember: MaybeContext<BuildRESTFunction<typeof deleteMember$1> & typeof deleteMember$1>;
5620
+ declare const deleteMyMember: MaybeContext<BuildRESTFunction<typeof deleteMyMember$1> & typeof deleteMyMember$1>;
5621
+ declare const bulkDeleteMembers: MaybeContext<BuildRESTFunction<typeof bulkDeleteMembers$1> & typeof bulkDeleteMembers$1>;
5622
+ declare const bulkDeleteMembersByFilter: MaybeContext<BuildRESTFunction<typeof bulkDeleteMembersByFilter$1> & typeof bulkDeleteMembersByFilter$1>;
5623
+ declare const bulkApproveMembers: MaybeContext<BuildRESTFunction<typeof bulkApproveMembers$1> & typeof bulkApproveMembers$1>;
5624
+ declare const bulkBlockMembers: MaybeContext<BuildRESTFunction<typeof bulkBlockMembers$1> & typeof bulkBlockMembers$1>;
5625
+ declare const createMember: MaybeContext<BuildRESTFunction<typeof createMember$1> & typeof createMember$1>;
5626
+ declare const updateMember: MaybeContext<BuildRESTFunction<typeof updateMember$1> & typeof updateMember$1>;
5627
+ declare const deleteMemberPhones: MaybeContext<BuildRESTFunction<typeof deleteMemberPhones$1> & typeof deleteMemberPhones$1>;
5628
+ declare const deleteMemberEmails: MaybeContext<BuildRESTFunction<typeof deleteMemberEmails$1> & typeof deleteMemberEmails$1>;
5629
+ declare const deleteMemberAddresses: MaybeContext<BuildRESTFunction<typeof deleteMemberAddresses$1> & typeof deleteMemberAddresses$1>;
5221
5630
 
5222
5631
  type _publicOnMemberUpdatedType = typeof onMemberUpdated$1;
5223
5632
  /** */
@@ -5788,11 +6197,11 @@ interface DeleteMemberRoleDefinitionSignature {
5788
6197
  (roleKey: string): Promise<void>;
5789
6198
  }
5790
6199
 
5791
- declare const createMemberRoleDefinition: BuildRESTFunction<typeof createMemberRoleDefinition$1> & typeof createMemberRoleDefinition$1;
5792
- declare const listMemberRoleDefinitions: BuildRESTFunction<typeof listMemberRoleDefinitions$1> & typeof listMemberRoleDefinitions$1;
5793
- declare const getMemberRoleDefinition: BuildRESTFunction<typeof getMemberRoleDefinition$1> & typeof getMemberRoleDefinition$1;
5794
- declare const updateMemberRoleDefinition: BuildRESTFunction<typeof updateMemberRoleDefinition$1> & typeof updateMemberRoleDefinition$1;
5795
- declare const deleteMemberRoleDefinition: BuildRESTFunction<typeof deleteMemberRoleDefinition$1> & typeof deleteMemberRoleDefinition$1;
6200
+ declare const createMemberRoleDefinition: MaybeContext<BuildRESTFunction<typeof createMemberRoleDefinition$1> & typeof createMemberRoleDefinition$1>;
6201
+ declare const listMemberRoleDefinitions: MaybeContext<BuildRESTFunction<typeof listMemberRoleDefinitions$1> & typeof listMemberRoleDefinitions$1>;
6202
+ declare const getMemberRoleDefinition: MaybeContext<BuildRESTFunction<typeof getMemberRoleDefinition$1> & typeof getMemberRoleDefinition$1>;
6203
+ declare const updateMemberRoleDefinition: MaybeContext<BuildRESTFunction<typeof updateMemberRoleDefinition$1> & typeof updateMemberRoleDefinition$1>;
6204
+ declare const deleteMemberRoleDefinition: MaybeContext<BuildRESTFunction<typeof deleteMemberRoleDefinition$1> & typeof deleteMemberRoleDefinition$1>;
5796
6205
 
5797
6206
  type context$2_Asset = Asset;
5798
6207
  type context$2_CreateMemberRoleDefinitionOptions = CreateMemberRoleDefinitionOptions;
@@ -6125,10 +6534,10 @@ interface ListMemberBlocksSignature {
6125
6534
  (memberId: string, options?: ListMemberBlocksOptions | undefined): Promise<ListMemberBlocksResponse & ListMemberBlocksResponseNonNullableFields>;
6126
6535
  }
6127
6536
 
6128
- declare const blockMember: BuildRESTFunction<typeof blockMember$1> & typeof blockMember$1;
6129
- declare const unblockMember: BuildRESTFunction<typeof unblockMember$1> & typeof unblockMember$1;
6130
- declare const listCurrentMemberBlocking: BuildRESTFunction<typeof listCurrentMemberBlocking$1> & typeof listCurrentMemberBlocking$1;
6131
- declare const listMemberBlocks: BuildRESTFunction<typeof listMemberBlocks$1> & typeof listMemberBlocks$1;
6537
+ declare const blockMember: MaybeContext<BuildRESTFunction<typeof blockMember$1> & typeof blockMember$1>;
6538
+ declare const unblockMember: MaybeContext<BuildRESTFunction<typeof unblockMember$1> & typeof unblockMember$1>;
6539
+ declare const listCurrentMemberBlocking: MaybeContext<BuildRESTFunction<typeof listCurrentMemberBlocking$1> & typeof listCurrentMemberBlocking$1>;
6540
+ declare const listMemberBlocks: MaybeContext<BuildRESTFunction<typeof listMemberBlocks$1> & typeof listMemberBlocks$1>;
6132
6541
 
6133
6542
  type context$1_ActionEvent = ActionEvent;
6134
6543
  type context$1_AdminBlockingForbiddenError = AdminBlockingForbiddenError;
@@ -6272,10 +6681,10 @@ interface QueryRolesSignature {
6272
6681
  (options?: QueryRolesOptions | undefined): Promise<QueryRolesResponse>;
6273
6682
  }
6274
6683
 
6275
- declare const assignRole: BuildRESTFunction<typeof assignRole$1> & typeof assignRole$1;
6276
- declare const unassignRole: BuildRESTFunction<typeof unassignRole$1> & typeof unassignRole$1;
6277
- declare const getRoles: BuildRESTFunction<typeof getRoles$1> & typeof getRoles$1;
6278
- declare const queryRoles: BuildRESTFunction<typeof queryRoles$1> & typeof queryRoles$1;
6684
+ declare const assignRole: MaybeContext<BuildRESTFunction<typeof assignRole$1> & typeof assignRole$1>;
6685
+ declare const unassignRole: MaybeContext<BuildRESTFunction<typeof unassignRole$1> & typeof unassignRole$1>;
6686
+ declare const getRoles: MaybeContext<BuildRESTFunction<typeof getRoles$1> & typeof getRoles$1>;
6687
+ declare const queryRoles: MaybeContext<BuildRESTFunction<typeof queryRoles$1> & typeof queryRoles$1>;
6279
6688
 
6280
6689
  type context_AssignRoleRequest = AssignRoleRequest;
6281
6690
  type context_AssignRoleResponse = AssignRoleResponse;