@wix/auth-management 1.0.40 → 1.0.42

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,1421 +0,0 @@
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 name of the environment, use for logging
17
- */
18
- name?: string;
19
- /**
20
- * Optional bast url to use for API requests, for example `www.wixapis.com`
21
- */
22
- apiBaseUrl?: string;
23
- /**
24
- * Possible data to be provided by every host, for cross cutting concerns
25
- * like internationalization, billing, etc.
26
- */
27
- essentials?: {
28
- /**
29
- * The language of the currently viewed session
30
- */
31
- language?: string;
32
- /**
33
- * The locale of the currently viewed session
34
- */
35
- locale?: string;
36
- /**
37
- * Any headers that should be passed through to the API requests
38
- */
39
- passThroughHeaders?: Record<string, string>;
40
- };
41
- };
42
-
43
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
44
- interface HttpClient {
45
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
46
- fetchWithAuth: typeof fetch;
47
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
48
- getActiveToken?: () => string | undefined;
49
- }
50
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
51
- type HttpResponse<T = any> = {
52
- data: T;
53
- status: number;
54
- statusText: string;
55
- headers: any;
56
- request?: any;
57
- };
58
- type RequestOptions<_TResponse = any, Data = any> = {
59
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
60
- url: string;
61
- data?: Data;
62
- params?: URLSearchParams;
63
- } & APIMetadata;
64
- type APIMetadata = {
65
- methodFqn?: string;
66
- entityFqdn?: string;
67
- packageName?: string;
68
- };
69
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
70
- type EventDefinition<Payload = unknown, Type extends string = string> = {
71
- __type: 'event-definition';
72
- type: Type;
73
- isDomainEvent?: boolean;
74
- transformations?: (envelope: unknown) => Payload;
75
- __payload: Payload;
76
- };
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;
80
-
81
- type ServicePluginMethodInput = {
82
- request: any;
83
- metadata: any;
84
- };
85
- type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
86
- type ServicePluginMethodMetadata = {
87
- name: string;
88
- primaryHttpMappingPath: string;
89
- transformations: {
90
- fromREST: (...args: unknown[]) => ServicePluginMethodInput;
91
- toREST: (...args: unknown[]) => unknown;
92
- };
93
- };
94
- type ServicePluginDefinition<Contract extends ServicePluginContract> = {
95
- __type: 'service-plugin-definition';
96
- componentType: string;
97
- methods: ServicePluginMethodMetadata[];
98
- __contract: Contract;
99
- };
100
- declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
101
- type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
102
- declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
103
-
104
- type RequestContext = {
105
- isSSR: boolean;
106
- host: string;
107
- protocol?: string;
108
- };
109
- type ResponseTransformer = (data: any, headers?: any) => any;
110
- /**
111
- * Ambassador request options types are copied mostly from AxiosRequestConfig.
112
- * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
113
- * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
114
- */
115
- type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
116
- type AmbassadorRequestOptions<T = any> = {
117
- _?: T;
118
- url?: string;
119
- method?: Method;
120
- params?: any;
121
- data?: any;
122
- transformResponse?: ResponseTransformer | ResponseTransformer[];
123
- };
124
- type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
125
- __isAmbassador: boolean;
126
- };
127
- type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
128
- type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
129
-
130
- declare global {
131
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
132
- interface SymbolConstructor {
133
- readonly observable: symbol;
134
- }
135
- }
136
-
137
- declare const emptyObjectSymbol: unique symbol;
138
-
139
- /**
140
- Represents a strictly empty plain object, the `{}` value.
141
-
142
- 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)).
143
-
144
- @example
145
- ```
146
- import type {EmptyObject} from 'type-fest';
147
-
148
- // The following illustrates the problem with `{}`.
149
- const foo1: {} = {}; // Pass
150
- const foo2: {} = []; // Pass
151
- const foo3: {} = 42; // Pass
152
- const foo4: {} = {a: 1}; // Pass
153
-
154
- // With `EmptyObject` only the first case is valid.
155
- const bar1: EmptyObject = {}; // Pass
156
- const bar2: EmptyObject = 42; // Fail
157
- const bar3: EmptyObject = []; // Fail
158
- const bar4: EmptyObject = {a: 1}; // Fail
159
- ```
160
-
161
- 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}.
162
-
163
- @category Object
164
- */
165
- type EmptyObject = {[emptyObjectSymbol]?: never};
166
-
167
- /**
168
- Returns a boolean for whether the two given types are equal.
169
-
170
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
171
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
172
-
173
- Use-cases:
174
- - If you want to make a conditional branch based on the result of a comparison of two types.
175
-
176
- @example
177
- ```
178
- import type {IsEqual} from 'type-fest';
179
-
180
- // This type returns a boolean for whether the given array includes the given item.
181
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
182
- type Includes<Value extends readonly any[], Item> =
183
- Value extends readonly [Value[0], ...infer rest]
184
- ? IsEqual<Value[0], Item> extends true
185
- ? true
186
- : Includes<rest, Item>
187
- : false;
188
- ```
189
-
190
- @category Type Guard
191
- @category Utilities
192
- */
193
- type IsEqual<A, B> =
194
- (<G>() => G extends A ? 1 : 2) extends
195
- (<G>() => G extends B ? 1 : 2)
196
- ? true
197
- : false;
198
-
199
- /**
200
- Filter out keys from an object.
201
-
202
- Returns `never` if `Exclude` is strictly equal to `Key`.
203
- Returns `never` if `Key` extends `Exclude`.
204
- Returns `Key` otherwise.
205
-
206
- @example
207
- ```
208
- type Filtered = Filter<'foo', 'foo'>;
209
- //=> never
210
- ```
211
-
212
- @example
213
- ```
214
- type Filtered = Filter<'bar', string>;
215
- //=> never
216
- ```
217
-
218
- @example
219
- ```
220
- type Filtered = Filter<'bar', 'foo'>;
221
- //=> 'bar'
222
- ```
223
-
224
- @see {Except}
225
- */
226
- type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
227
-
228
- type ExceptOptions = {
229
- /**
230
- Disallow assigning non-specified properties.
231
-
232
- Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
233
-
234
- @default false
235
- */
236
- requireExactProps?: boolean;
237
- };
238
-
239
- /**
240
- Create a type from an object type without certain keys.
241
-
242
- We recommend setting the `requireExactProps` option to `true`.
243
-
244
- 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.
245
-
246
- 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)).
247
-
248
- @example
249
- ```
250
- import type {Except} from 'type-fest';
251
-
252
- type Foo = {
253
- a: number;
254
- b: string;
255
- };
256
-
257
- type FooWithoutA = Except<Foo, 'a'>;
258
- //=> {b: string}
259
-
260
- const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
261
- //=> errors: 'a' does not exist in type '{ b: string; }'
262
-
263
- type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
264
- //=> {a: number} & Partial<Record<"b", never>>
265
-
266
- const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
267
- //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
268
- ```
269
-
270
- @category Object
271
- */
272
- type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
273
- [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
274
- } & (Options['requireExactProps'] extends true
275
- ? Partial<Record<KeysType, never>>
276
- : {});
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
-
344
- /**
345
- Extract the keys from a type where the value type of the key extends the given `Condition`.
346
-
347
- Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
348
-
349
- @example
350
- ```
351
- import type {ConditionalKeys} from 'type-fest';
352
-
353
- interface Example {
354
- a: string;
355
- b: string | number;
356
- c?: string;
357
- d: {};
358
- }
359
-
360
- type StringKeysOnly = ConditionalKeys<Example, string>;
361
- //=> 'a'
362
- ```
363
-
364
- To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
365
-
366
- @example
367
- ```
368
- import type {ConditionalKeys} from 'type-fest';
369
-
370
- type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
371
- //=> 'a' | 'c'
372
- ```
373
-
374
- @category Object
375
- */
376
- type ConditionalKeys<Base, Condition> =
377
- {
378
- // Map through all the keys of the given base type.
379
- [Key in keyof Base]-?:
380
- // Pick only keys with types extending the given `Condition` type.
381
- Base[Key] extends Condition
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>
385
- // Discard this key since the condition fails.
386
- : never;
387
- // Convert the produced object into a union type of the keys which passed the conditional test.
388
- }[keyof Base];
389
-
390
- /**
391
- Exclude keys from a shape that matches the given `Condition`.
392
-
393
- 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.
394
-
395
- @example
396
- ```
397
- import type {Primitive, ConditionalExcept} from 'type-fest';
398
-
399
- class Awesome {
400
- name: string;
401
- successes: number;
402
- failures: bigint;
403
-
404
- run() {}
405
- }
406
-
407
- type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
408
- //=> {run: () => void}
409
- ```
410
-
411
- @example
412
- ```
413
- import type {ConditionalExcept} from 'type-fest';
414
-
415
- interface Example {
416
- a: string;
417
- b: string | number;
418
- c: () => void;
419
- d: {};
420
- }
421
-
422
- type NonStringKeysOnly = ConditionalExcept<Example, string>;
423
- //=> {b: string | number; c: () => void; d: {}}
424
- ```
425
-
426
- @category Object
427
- */
428
- type ConditionalExcept<Base, Condition> = Except<
429
- Base,
430
- ConditionalKeys<Base, Condition>
431
- >;
432
-
433
- /**
434
- * Descriptors are objects that describe the API of a module, and the module
435
- * can either be a REST module or a host module.
436
- * This type is recursive, so it can describe nested modules.
437
- */
438
- type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
439
- [key: string]: Descriptors | PublicMetadata | any;
440
- };
441
- /**
442
- * This type takes in a descriptors object of a certain Host (including an `unknown` host)
443
- * and returns an object with the same structure, but with all descriptors replaced with their API.
444
- * Any non-descriptor properties are removed from the returned object, including descriptors that
445
- * do not match the given host (as they will not work with the given host).
446
- */
447
- type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
448
- done: T;
449
- recurse: T extends {
450
- __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
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<{
452
- [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
453
- -1,
454
- 0,
455
- 1,
456
- 2,
457
- 3,
458
- 4,
459
- 5
460
- ][Depth]> : never;
461
- }, EmptyObject>;
462
- }[Depth extends -1 ? 'done' : 'recurse'];
463
- type PublicMetadata = {
464
- PACKAGE_NAME?: string;
465
- };
466
-
467
- declare global {
468
- interface ContextualClient {
469
- }
470
- }
471
- /**
472
- * A type used to create concerete types from SDK descriptors in
473
- * case a contextual client is available.
474
- */
475
- type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
476
- host: Host;
477
- } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
478
-
479
- /** An intermediary application that authorizes and authenticates an external client to access data on a Wix project or site. */
480
- interface OAuthApp {
481
- /**
482
- * ID of the OAuth app.
483
- * @readonly
484
- */
485
- _id?: string | null;
486
- /**
487
- * Date and time the OAuth app was created, in ISO 8601 format.
488
- * @readonly
489
- */
490
- _createdDate?: Date | null;
491
- /** Display name of the OAuth app, as it appears in the dashboard. */
492
- name?: string | null;
493
- /** Description of the OAuth app, as it appears in the dashboard. */
494
- description?: string | null;
495
- /**
496
- * For internal use only.
497
- * @readonly
498
- * @deprecated
499
- */
500
- secret?: string | null;
501
- /** External login URL to which users are redirected automatically to authenticate. If no login URL is specified, the user is redirected to Wix to authenticate. */
502
- loginUrl?: string | null;
503
- /**
504
- * List of URIs to which redirection from Wix is allowed after authentication.
505
- *
506
- * When a client redirects a user to Wix for authentication, the client provides a URI to redirect the user back to after the user has been authenticated.
507
- * Wix only redirects the user if the exact URI is contained in this array.
508
- */
509
- allowedRedirectUris?: string[];
510
- /**
511
- * List of domains to which redirection from Wix is allowed after processes other than authentication.
512
- *
513
- * When a client redirects a user to a Wix page (for example, for checkout), the client provides a URL to redirect the user back to.
514
- * Wix only redirects the user if the URL is in one of the specified domains.
515
- */
516
- allowedRedirectDomains?: string[];
517
- /**
518
- * Whether a secret can be generated for this OAuth app.
519
- *
520
- * Default: `true` until a secret has been generated for the OAuth App.
521
- */
522
- allowSecretGeneration?: boolean | null;
523
- /** External logout URL to which we invoke when user logout at wix. If no logout URL is specified, the user is logged out only at Wix. */
524
- logoutUrl?: string | null;
525
- /** OAuth application type. */
526
- applicationType?: OAuthAppType;
527
- /** OAuth technology used by the oauth application. */
528
- technology?: OAuthTechnologies;
529
- }
530
- /** OAuth application type. */
531
- declare enum OAuthAppType {
532
- /** OAuth app type is not specified. */
533
- OAUTH_APP_TYPE_UNSPECIFIED = "OAUTH_APP_TYPE_UNSPECIFIED",
534
- /** OAuth app type is a web application. */
535
- WEB_APP = "WEB_APP",
536
- /** OAuth app type is a mobile application. */
537
- MOBILE = "MOBILE",
538
- /** OAuth app type is some other type of application. */
539
- OTHER = "OTHER"
540
- }
541
- /** OAuth technology used by the oauth application. */
542
- declare enum OAuthTechnologies {
543
- /** The OAuth technology is not specified. */
544
- OAUTH_TECHNOLOGY_UNSPECIFIED = "OAUTH_TECHNOLOGY_UNSPECIFIED",
545
- /** OAuth technology using JavaScript. */
546
- JAVASCRIPT = "JAVASCRIPT",
547
- /** OAuth technology using Angular. */
548
- ANGULAR = "ANGULAR",
549
- /** OAuth technology using Vue.js. */
550
- VUE = "VUE",
551
- /** OAuth technology using React. */
552
- REACT = "REACT",
553
- /** OAuth technology using React Native. */
554
- REACT_NATIVE = "REACT_NATIVE",
555
- /** OAuth technology using iOS. */
556
- IOS = "IOS",
557
- /** OAuth technology using Android. */
558
- ANDROID = "ANDROID",
559
- /** OAuth technology using some other kind of technology. */
560
- OTHER_TECHNOLOGY = "OTHER_TECHNOLOGY"
561
- }
562
- interface CreateOAuthAppRequest {
563
- /** OAuth app to create. */
564
- oAuthApp: OAuthApp;
565
- }
566
- interface CreateOAuthAppResponse {
567
- /** Created OAuth app info. */
568
- oAuthApp?: OAuthApp;
569
- }
570
- interface GetOAuthAppRequest {
571
- /** ID of the OAuth app to retrieve. */
572
- oAuthAppId: string;
573
- }
574
- interface GetOAuthAppResponse {
575
- /** Retrieved OAuth app info. */
576
- oAuthApp?: OAuthApp;
577
- }
578
- interface UpdateOAuthAppRequest {
579
- /** Updated OAuth app details. May include some or all fields. */
580
- oAuthApp: OAuthApp;
581
- }
582
- interface UpdateOAuthAppResponse {
583
- /** Updated OAuth app info. */
584
- oAuthApp?: OAuthApp;
585
- }
586
- interface DeleteOAuthAppRequest {
587
- /** ID of the OAuth app to delete. */
588
- oAuthAppId?: string;
589
- }
590
- interface DeleteOAuthAppResponse {
591
- }
592
- interface QueryOAuthAppsRequest {
593
- /** Query options. */
594
- query?: PlatformQuery;
595
- }
596
- interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
597
- /** Paging options to limit and skip the number of items. */
598
- paging?: Paging;
599
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
600
- cursorPaging?: CursorPaging;
601
- /**
602
- * Filter object in the following format:
603
- * `"filter" : {
604
- * "fieldName1": "value1",
605
- * "fieldName2":{"$operator":"value2"}
606
- * }`
607
- * Example of operators: `$eq`
608
- */
609
- filter?: Record<string, any> | null;
610
- /**
611
- * Sort object in the following format:
612
- * `[{"fieldName":"name","order":"ASC"},{"fieldName":"created_date","order":"DESC"}]`
613
- */
614
- sort?: Sorting[];
615
- }
616
- /** @oneof */
617
- interface PlatformQueryPagingMethodOneOf {
618
- /** Paging options to limit and skip the number of items. */
619
- paging?: Paging;
620
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
621
- cursorPaging?: CursorPaging;
622
- }
623
- interface Sorting {
624
- /** Name of the field to sort by. */
625
- fieldName?: string;
626
- /** Sort order. */
627
- order?: SortOrder;
628
- }
629
- declare enum SortOrder {
630
- ASC = "ASC",
631
- DESC = "DESC"
632
- }
633
- interface Paging {
634
- /** Number of items to load. */
635
- limit?: number | null;
636
- /** Number of items to skip in the current sort order. */
637
- offset?: number | null;
638
- }
639
- interface CursorPaging {
640
- /** Maximum number of items to return in the results. */
641
- limit?: number | null;
642
- /**
643
- * Pointer to the next or previous page in the list of results.
644
- *
645
- * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
646
- * Not relevant for the first request.
647
- */
648
- cursor?: string | null;
649
- }
650
- interface QueryOAuthAppsResponse {
651
- /** List of OAuth apps matching the query. */
652
- oAuthApps?: OAuthApp[];
653
- /** Paging metadata. */
654
- pagingMetadata?: PagingMetadataV2;
655
- }
656
- interface PagingMetadataV2 {
657
- /** Number of items returned in the response. */
658
- count?: number | null;
659
- /** Offset that was requested. */
660
- offset?: number | null;
661
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
662
- total?: number | null;
663
- /** Flag that indicates the server failed to calculate the `total` field. */
664
- tooManyToCount?: boolean | null;
665
- /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
666
- cursors?: Cursors;
667
- }
668
- interface Cursors {
669
- /** Cursor string pointing to the next page in the list of results. */
670
- next?: string | null;
671
- /** Cursor pointing to the previous page in the list of results. */
672
- prev?: string | null;
673
- }
674
- interface GenerateOAuthAppSecretRequest {
675
- /** ID of the OAuth app to generate a secret for. */
676
- oAuthAppId?: string;
677
- }
678
- interface GenerateOAuthAppSecretResponse {
679
- /** Secret generated. */
680
- oAuthAppSecret?: string;
681
- }
682
- interface MetaSiteSpecialEvent extends MetaSiteSpecialEventPayloadOneOf {
683
- /** Emitted on a meta site creation. */
684
- siteCreated?: SiteCreated;
685
- /** Emitted on a meta site transfer completion. */
686
- siteTransferred?: SiteTransferred;
687
- /** Emitted on a meta site deletion. */
688
- siteDeleted?: SiteDeleted;
689
- /** Emitted on a meta site restoration. */
690
- siteUndeleted?: SiteUndeleted;
691
- /** Emitted on the first* publish of the meta site (* switching from unpublished to published state). */
692
- sitePublished?: SitePublished;
693
- /** Emitted on a meta site unpublish. */
694
- siteUnpublished?: SiteUnpublished;
695
- /** Emitted when meta site is marked as template. */
696
- siteMarkedAsTemplate?: SiteMarkedAsTemplate;
697
- /** Emitted when meta site is marked as a WixSite. */
698
- siteMarkedAsWixSite?: SiteMarkedAsWixSite;
699
- /** Emitted when an application is provisioned (installed). */
700
- serviceProvisioned?: ServiceProvisioned;
701
- /** Emitted when an application is removed (uninstalled). */
702
- serviceRemoved?: ServiceRemoved;
703
- /** Emitted when meta site name (URL slug) is changed. */
704
- siteRenamedPayload?: SiteRenamed;
705
- /** Emitted when meta site was permanently deleted. */
706
- hardDeleted?: SiteHardDeleted;
707
- /** Emitted on a namespace change. */
708
- namespaceChanged?: NamespaceChanged;
709
- /** Emitted when Studio is attached. */
710
- studioAssigned?: StudioAssigned;
711
- /** Emitted when Studio is detached. */
712
- studioUnassigned?: StudioUnassigned;
713
- /** A meta site id. */
714
- metaSiteId?: string;
715
- /** A meta site version. Monotonically increasing. */
716
- version?: string;
717
- /** A timestamp of the event. */
718
- timestamp?: string;
719
- /**
720
- * TODO(meta-site): Change validation once validations are disabled for consumers
721
- * More context: https://wix.slack.com/archives/C0UHEBPFT/p1720957844413149 and https://wix.slack.com/archives/CFWKX325T/p1728892152855659
722
- */
723
- assets?: Asset[];
724
- }
725
- /** @oneof */
726
- interface MetaSiteSpecialEventPayloadOneOf {
727
- /** Emitted on a meta site creation. */
728
- siteCreated?: SiteCreated;
729
- /** Emitted on a meta site transfer completion. */
730
- siteTransferred?: SiteTransferred;
731
- /** Emitted on a meta site deletion. */
732
- siteDeleted?: SiteDeleted;
733
- /** Emitted on a meta site restoration. */
734
- siteUndeleted?: SiteUndeleted;
735
- /** Emitted on the first* publish of the meta site (* switching from unpublished to published state). */
736
- sitePublished?: SitePublished;
737
- /** Emitted on a meta site unpublish. */
738
- siteUnpublished?: SiteUnpublished;
739
- /** Emitted when meta site is marked as template. */
740
- siteMarkedAsTemplate?: SiteMarkedAsTemplate;
741
- /** Emitted when meta site is marked as a WixSite. */
742
- siteMarkedAsWixSite?: SiteMarkedAsWixSite;
743
- /** Emitted when an application is provisioned (installed). */
744
- serviceProvisioned?: ServiceProvisioned;
745
- /** Emitted when an application is removed (uninstalled). */
746
- serviceRemoved?: ServiceRemoved;
747
- /** Emitted when meta site name (URL slug) is changed. */
748
- siteRenamedPayload?: SiteRenamed;
749
- /** Emitted when meta site was permanently deleted. */
750
- hardDeleted?: SiteHardDeleted;
751
- /** Emitted on a namespace change. */
752
- namespaceChanged?: NamespaceChanged;
753
- /** Emitted when Studio is attached. */
754
- studioAssigned?: StudioAssigned;
755
- /** Emitted when Studio is detached. */
756
- studioUnassigned?: StudioUnassigned;
757
- }
758
- interface Asset {
759
- /** An application definition id (app_id in dev-center). For legacy reasons may be UUID or a string (from Java Enum). */
760
- appDefId?: string;
761
- /** An instance id. For legacy reasons may be UUID or a string. */
762
- instanceId?: string;
763
- /** An application state. */
764
- state?: State;
765
- }
766
- declare enum State {
767
- UNKNOWN = "UNKNOWN",
768
- ENABLED = "ENABLED",
769
- DISABLED = "DISABLED",
770
- PENDING = "PENDING",
771
- DEMO = "DEMO"
772
- }
773
- interface SiteCreated {
774
- /** A template identifier (empty if not created from a template). */
775
- originTemplateId?: string;
776
- /** An account id of the owner. */
777
- ownerId?: string;
778
- /** A context in which meta site was created. */
779
- context?: SiteCreatedContext;
780
- /**
781
- * A meta site id from which this site was created.
782
- *
783
- * In case of a creation from a template it's a template id.
784
- * In case of a site duplication ("Save As" in dashboard or duplicate in UM) it's an id of a source site.
785
- */
786
- originMetaSiteId?: string | null;
787
- /** A meta site name (URL slug). */
788
- siteName?: string;
789
- /** A namespace. */
790
- namespace?: Namespace;
791
- }
792
- declare enum SiteCreatedContext {
793
- /** A valid option, we don't expose all reasons why site might be created. */
794
- OTHER = "OTHER",
795
- /** A meta site was created from template. */
796
- FROM_TEMPLATE = "FROM_TEMPLATE",
797
- /** A meta site was created by copying of the transfferred meta site. */
798
- DUPLICATE_BY_SITE_TRANSFER = "DUPLICATE_BY_SITE_TRANSFER",
799
- /** A copy of existing meta site. */
800
- DUPLICATE = "DUPLICATE",
801
- /** A meta site was created as a transfferred site (copy of the original), old flow, should die soon. */
802
- OLD_SITE_TRANSFER = "OLD_SITE_TRANSFER",
803
- /** deprecated A meta site was created for Flash editor. */
804
- FLASH = "FLASH"
805
- }
806
- declare enum Namespace {
807
- UNKNOWN_NAMESPACE = "UNKNOWN_NAMESPACE",
808
- /** Default namespace for UGC sites. MetaSites with this namespace will be shown in a user's site list by default. */
809
- WIX = "WIX",
810
- /** ShoutOut stand alone product. These are siteless (no actual Wix site, no HtmlWeb). MetaSites with this namespace will *not* be shown in a user's site list by default. */
811
- SHOUT_OUT = "SHOUT_OUT",
812
- /** MetaSites created by the Albums product, they appear as part of the Albums app. MetaSites with this namespace will *not* be shown in a user's site list by default. */
813
- ALBUMS = "ALBUMS",
814
- /** Part of the WixStores migration flow, a user tries to migrate and gets this site to view and if the user likes it then stores removes this namespace and deletes the old site with the old stores. MetaSites with this namespace will *not* be shown in a user's site list by default. */
815
- WIX_STORES_TEST_DRIVE = "WIX_STORES_TEST_DRIVE",
816
- /** Hotels standalone (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
817
- HOTELS = "HOTELS",
818
- /** Clubs siteless MetaSites, a club without a wix website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
819
- CLUBS = "CLUBS",
820
- /** A partially created ADI website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
821
- ONBOARDING_DRAFT = "ONBOARDING_DRAFT",
822
- /** AppBuilder for AppStudio / shmite (c). MetaSites with this namespace will *not* be shown in a user's site list by default. */
823
- DEV_SITE = "DEV_SITE",
824
- /** LogoMaker websites offered to the user after logo purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
825
- LOGOS = "LOGOS",
826
- /** VideoMaker websites offered to the user after video purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
827
- VIDEO_MAKER = "VIDEO_MAKER",
828
- /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
829
- PARTNER_DASHBOARD = "PARTNER_DASHBOARD",
830
- /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
831
- DEV_CENTER_COMPANY = "DEV_CENTER_COMPANY",
832
- /**
833
- * A draft created by HTML editor on open. Upon "first save" it will be moved to be of WIX domain.
834
- *
835
- * Meta site with this namespace will *not* be shown in a user's site list by default.
836
- */
837
- HTML_DRAFT = "HTML_DRAFT",
838
- /**
839
- * the user-journey for Fitness users who want to start from managing their business instead of designing their website.
840
- * Will be accessible from Site List and will not have a website app.
841
- * Once the user attaches a site, the site will become a regular wixsite.
842
- */
843
- SITELESS_BUSINESS = "SITELESS_BUSINESS",
844
- /** Belongs to "strategic products" company. Supports new product in the creator's economy space. */
845
- CREATOR_ECONOMY = "CREATOR_ECONOMY",
846
- /** It is to be used in the Business First efforts. */
847
- DASHBOARD_FIRST = "DASHBOARD_FIRST",
848
- /** Bookings business flow with no site. */
849
- ANYWHERE = "ANYWHERE",
850
- /** Namespace for Headless Backoffice with no editor */
851
- HEADLESS = "HEADLESS",
852
- /**
853
- * Namespace for master site that will exist in parent account that will be referenced by subaccounts
854
- * The site will be used for account level CSM feature for enterprise
855
- */
856
- ACCOUNT_MASTER_CMS = "ACCOUNT_MASTER_CMS",
857
- /** Rise.ai Siteless account management for Gift Cards and Store Credit. */
858
- RISE = "RISE",
859
- /**
860
- * As part of the branded app new funnel, users now can create a meta site that will be branded app first.
861
- * There's a blank site behind the scene but it's blank).
862
- * The Mobile company will be the owner of this namespace.
863
- */
864
- BRANDED_FIRST = "BRANDED_FIRST",
865
- /** Nownia.com Siteless account management for Ai Scheduling Assistant. */
866
- NOWNIA = "NOWNIA",
867
- /**
868
- * UGC Templates are templates that are created by users for personal use and to sale to other users.
869
- * The Partners company owns this namespace.
870
- */
871
- UGC_TEMPLATE = "UGC_TEMPLATE",
872
- /** Codux Headless Sites */
873
- CODUX = "CODUX"
874
- }
875
- /** Site transferred to another user. */
876
- interface SiteTransferred {
877
- /** A previous owner id (user that transfers meta site). */
878
- oldOwnerId?: string;
879
- /** A new owner id (user that accepts meta site). */
880
- newOwnerId?: string;
881
- }
882
- /** Soft deletion of the meta site. Could be restored. */
883
- interface SiteDeleted {
884
- /** A deletion context. */
885
- deleteContext?: DeleteContext;
886
- }
887
- interface DeleteContext {
888
- /** When the meta site was deleted. */
889
- dateDeleted?: Date | null;
890
- /** A status. */
891
- deleteStatus?: DeleteStatus;
892
- /** A reason (flow). */
893
- deleteOrigin?: string;
894
- /** A service that deleted it. */
895
- initiatorId?: string | null;
896
- }
897
- declare enum DeleteStatus {
898
- UNKNOWN = "UNKNOWN",
899
- TRASH = "TRASH",
900
- DELETED = "DELETED",
901
- PENDING_PURGE = "PENDING_PURGE"
902
- }
903
- /** Restoration of the meta site. */
904
- interface SiteUndeleted {
905
- }
906
- /** First publish of a meta site. Or subsequent publish after unpublish. */
907
- interface SitePublished {
908
- }
909
- interface SiteUnpublished {
910
- /** A list of URLs previously associated with the meta site. */
911
- urls?: string[];
912
- }
913
- interface SiteMarkedAsTemplate {
914
- }
915
- interface SiteMarkedAsWixSite {
916
- }
917
- interface ServiceProvisioned {
918
- /** Either UUID or EmbeddedServiceType. */
919
- appDefId?: string;
920
- /** Not only UUID. Something here could be something weird. */
921
- instanceId?: string;
922
- /** An instance id from which this instance is originated. */
923
- originInstanceId?: string;
924
- /** A version. */
925
- version?: string | null;
926
- /** The origin meta site id */
927
- originMetaSiteId?: string | null;
928
- }
929
- interface ServiceRemoved {
930
- /** Either UUID or EmbeddedServiceType. */
931
- appDefId?: string;
932
- /** Not only UUID. Something here could be something weird. */
933
- instanceId?: string;
934
- /** A version. */
935
- version?: string | null;
936
- }
937
- /** Rename of the site. Meaning, free public url has been changed as well. */
938
- interface SiteRenamed {
939
- /** A new meta site name (URL slug). */
940
- newSiteName?: string;
941
- /** A previous meta site name (URL slug). */
942
- oldSiteName?: string;
943
- }
944
- /**
945
- * Hard deletion of the meta site.
946
- *
947
- * Could not be restored. Therefore it's desirable to cleanup data.
948
- */
949
- interface SiteHardDeleted {
950
- /** A deletion context. */
951
- deleteContext?: DeleteContext;
952
- }
953
- interface NamespaceChanged {
954
- /** A previous namespace. */
955
- oldNamespace?: Namespace;
956
- /** A new namespace. */
957
- newNamespace?: Namespace;
958
- }
959
- /** Assigned Studio editor */
960
- interface StudioAssigned {
961
- }
962
- /** Unassigned Studio editor */
963
- interface StudioUnassigned {
964
- }
965
- interface Empty {
966
- }
967
- interface DomainEvent extends DomainEventBodyOneOf {
968
- createdEvent?: EntityCreatedEvent;
969
- updatedEvent?: EntityUpdatedEvent;
970
- deletedEvent?: EntityDeletedEvent;
971
- actionEvent?: ActionEvent;
972
- /**
973
- * Unique event ID.
974
- * Allows clients to ignore duplicate webhooks.
975
- */
976
- _id?: string;
977
- /**
978
- * Assumes actions are also always typed to an entity_type
979
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
980
- */
981
- entityFqdn?: string;
982
- /**
983
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
984
- * This is although the created/updated/deleted notion is duplication of the oneof types
985
- * Example: created/updated/deleted/started/completed/email_opened
986
- */
987
- slug?: string;
988
- /** ID of the entity associated with the event. */
989
- entityId?: string;
990
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
991
- eventTime?: Date | null;
992
- /**
993
- * Whether the event was triggered as a result of a privacy regulation application
994
- * (for example, GDPR).
995
- */
996
- triggeredByAnonymizeRequest?: boolean | null;
997
- /** If present, indicates the action that triggered the event. */
998
- originatedFrom?: string | null;
999
- /**
1000
- * A sequence number defining the order of updates to the underlying entity.
1001
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
1002
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
1003
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
1004
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
1005
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
1006
- */
1007
- entityEventSequence?: string | null;
1008
- }
1009
- /** @oneof */
1010
- interface DomainEventBodyOneOf {
1011
- createdEvent?: EntityCreatedEvent;
1012
- updatedEvent?: EntityUpdatedEvent;
1013
- deletedEvent?: EntityDeletedEvent;
1014
- actionEvent?: ActionEvent;
1015
- }
1016
- interface EntityCreatedEvent {
1017
- entity?: string;
1018
- }
1019
- interface RestoreInfo {
1020
- deletedDate?: Date | null;
1021
- }
1022
- interface EntityUpdatedEvent {
1023
- /**
1024
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
1025
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
1026
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
1027
- */
1028
- currentEntity?: string;
1029
- }
1030
- interface EntityDeletedEvent {
1031
- /** Entity that was deleted */
1032
- deletedEntity?: string | null;
1033
- }
1034
- interface ActionEvent {
1035
- body?: string;
1036
- }
1037
- interface MessageEnvelope {
1038
- /** App instance ID. */
1039
- instanceId?: string | null;
1040
- /** Event type. */
1041
- eventType?: string;
1042
- /** The identification type and identity data. */
1043
- identity?: IdentificationData;
1044
- /** Stringify payload. */
1045
- data?: string;
1046
- }
1047
- interface IdentificationData extends IdentificationDataIdOneOf {
1048
- /** ID of a site visitor that has not logged in to the site. */
1049
- anonymousVisitorId?: string;
1050
- /** ID of a site visitor that has logged in to the site. */
1051
- memberId?: string;
1052
- /** ID of a Wix user (site owner, contributor, etc.). */
1053
- wixUserId?: string;
1054
- /** ID of an app. */
1055
- appId?: string;
1056
- /** @readonly */
1057
- identityType?: WebhookIdentityType;
1058
- }
1059
- /** @oneof */
1060
- interface IdentificationDataIdOneOf {
1061
- /** ID of a site visitor that has not logged in to the site. */
1062
- anonymousVisitorId?: string;
1063
- /** ID of a site visitor that has logged in to the site. */
1064
- memberId?: string;
1065
- /** ID of a Wix user (site owner, contributor, etc.). */
1066
- wixUserId?: string;
1067
- /** ID of an app. */
1068
- appId?: string;
1069
- }
1070
- declare enum WebhookIdentityType {
1071
- UNKNOWN = "UNKNOWN",
1072
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1073
- MEMBER = "MEMBER",
1074
- WIX_USER = "WIX_USER",
1075
- APP = "APP"
1076
- }
1077
- interface OAuthAppNonNullableFields {
1078
- allowedDomains: string[];
1079
- allowedRedirectUris: string[];
1080
- allowedRedirectDomains: string[];
1081
- applicationType: OAuthAppType;
1082
- technology: OAuthTechnologies;
1083
- }
1084
- interface CreateOAuthAppResponseNonNullableFields {
1085
- oAuthApp?: OAuthAppNonNullableFields;
1086
- }
1087
- interface GetOAuthAppResponseNonNullableFields {
1088
- oAuthApp?: OAuthAppNonNullableFields;
1089
- }
1090
- interface UpdateOAuthAppResponseNonNullableFields {
1091
- oAuthApp?: OAuthAppNonNullableFields;
1092
- }
1093
- interface QueryOAuthAppsResponseNonNullableFields {
1094
- oAuthApps: OAuthAppNonNullableFields[];
1095
- }
1096
- interface BaseEventMetadata {
1097
- /** App instance ID. */
1098
- instanceId?: string | null;
1099
- /** Event type. */
1100
- eventType?: string;
1101
- /** The identification type and identity data. */
1102
- identity?: IdentificationData;
1103
- }
1104
- interface EventMetadata extends BaseEventMetadata {
1105
- /**
1106
- * Unique event ID.
1107
- * Allows clients to ignore duplicate webhooks.
1108
- */
1109
- _id?: string;
1110
- /**
1111
- * Assumes actions are also always typed to an entity_type
1112
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
1113
- */
1114
- entityFqdn?: string;
1115
- /**
1116
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
1117
- * This is although the created/updated/deleted notion is duplication of the oneof types
1118
- * Example: created/updated/deleted/started/completed/email_opened
1119
- */
1120
- slug?: string;
1121
- /** ID of the entity associated with the event. */
1122
- entityId?: string;
1123
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1124
- eventTime?: Date | null;
1125
- /**
1126
- * Whether the event was triggered as a result of a privacy regulation application
1127
- * (for example, GDPR).
1128
- */
1129
- triggeredByAnonymizeRequest?: boolean | null;
1130
- /** If present, indicates the action that triggered the event. */
1131
- originatedFrom?: string | null;
1132
- /**
1133
- * A sequence number defining the order of updates to the underlying entity.
1134
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
1135
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
1136
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
1137
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
1138
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
1139
- */
1140
- entityEventSequence?: string | null;
1141
- }
1142
- interface OAuthAppCreatedEnvelope {
1143
- entity: OAuthApp;
1144
- metadata: EventMetadata;
1145
- }
1146
- interface OAuthAppUpdatedEnvelope {
1147
- entity: OAuthApp;
1148
- metadata: EventMetadata;
1149
- }
1150
- interface OAuthAppDeletedEnvelope {
1151
- metadata: EventMetadata;
1152
- }
1153
- interface UpdateOAuthApp {
1154
- /**
1155
- * ID of the OAuth app.
1156
- * @readonly
1157
- */
1158
- _id?: string | null;
1159
- /**
1160
- * Date and time the OAuth app was created, in ISO 8601 format.
1161
- * @readonly
1162
- */
1163
- _createdDate?: Date | null;
1164
- /** Display name of the OAuth app, as it appears in the dashboard. */
1165
- name?: string | null;
1166
- /** Description of the OAuth app, as it appears in the dashboard. */
1167
- description?: string | null;
1168
- /**
1169
- * For internal use only.
1170
- * @readonly
1171
- * @deprecated
1172
- */
1173
- secret?: string | null;
1174
- /** External login URL to which users are redirected automatically to authenticate. If no login URL is specified, the user is redirected to Wix to authenticate. */
1175
- loginUrl?: string | null;
1176
- /**
1177
- * List of URIs to which redirection from Wix is allowed after authentication.
1178
- *
1179
- * When a client redirects a user to Wix for authentication, the client provides a URI to redirect the user back to after the user has been authenticated.
1180
- * Wix only redirects the user if the exact URI is contained in this array.
1181
- */
1182
- allowedRedirectUris?: string[];
1183
- /**
1184
- * List of domains to which redirection from Wix is allowed after processes other than authentication.
1185
- *
1186
- * When a client redirects a user to a Wix page (for example, for checkout), the client provides a URL to redirect the user back to.
1187
- * Wix only redirects the user if the URL is in one of the specified domains.
1188
- */
1189
- allowedRedirectDomains?: string[];
1190
- /**
1191
- * Whether a secret can be generated for this OAuth app.
1192
- *
1193
- * Default: `true` until a secret has been generated for the OAuth App.
1194
- */
1195
- allowSecretGeneration?: boolean | null;
1196
- /** External logout URL to which we invoke when user logout at wix. If no logout URL is specified, the user is logged out only at Wix. */
1197
- logoutUrl?: string | null;
1198
- /** OAuth application type. */
1199
- applicationType?: OAuthAppType;
1200
- /** OAuth technology used by the oauth application. */
1201
- technology?: OAuthTechnologies;
1202
- }
1203
- interface QueryOffsetResult {
1204
- currentPage: number | undefined;
1205
- totalPages: number | undefined;
1206
- totalCount: number | undefined;
1207
- hasNext: () => boolean;
1208
- hasPrev: () => boolean;
1209
- length: number;
1210
- pageSize: number;
1211
- }
1212
- interface OAuthAppsQueryResult extends QueryOffsetResult {
1213
- items: OAuthApp[];
1214
- query: OAuthAppsQueryBuilder;
1215
- next: () => Promise<OAuthAppsQueryResult>;
1216
- prev: () => Promise<OAuthAppsQueryResult>;
1217
- }
1218
- interface OAuthAppsQueryBuilder {
1219
- /** @param propertyName - Property whose value is compared with `value`.
1220
- * @param value - Value to compare against.
1221
- * @documentationMaturity preview
1222
- */
1223
- eq: (propertyName: '_id', value: any) => OAuthAppsQueryBuilder;
1224
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1225
- * @documentationMaturity preview
1226
- */
1227
- ascending: (...propertyNames: Array<'_createdDate' | 'name'>) => OAuthAppsQueryBuilder;
1228
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1229
- * @documentationMaturity preview
1230
- */
1231
- descending: (...propertyNames: Array<'_createdDate' | 'name'>) => OAuthAppsQueryBuilder;
1232
- /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
1233
- * @documentationMaturity preview
1234
- */
1235
- limit: (limit: number) => OAuthAppsQueryBuilder;
1236
- /** @param skip - Number of items to skip in the query results before returning the results.
1237
- * @documentationMaturity preview
1238
- */
1239
- skip: (skip: number) => OAuthAppsQueryBuilder;
1240
- /** @documentationMaturity preview */
1241
- find: () => Promise<OAuthAppsQueryResult>;
1242
- }
1243
-
1244
- declare function createOAuthApp$1(httpClient: HttpClient): CreateOAuthAppSignature;
1245
- interface CreateOAuthAppSignature {
1246
- /**
1247
- * Creates a new OAuth app for a Wix Headless client.
1248
- *
1249
- *
1250
- * An OAuth app authorizes an external client app or site, on any platform, to authenticate with a Wix site or project and manage its data.
1251
- *
1252
- * > **Note:** The OAuth app secret is returned only when creating the OAuth app, and can't be retrieved later. Store the secret in a secure location.
1253
- * @param - OAuth app to create.
1254
- * @returns Created OAuth app info.
1255
- */
1256
- (oAuthApp: OAuthApp): Promise<OAuthApp & OAuthAppNonNullableFields>;
1257
- }
1258
- declare function getOAuthApp$1(httpClient: HttpClient): GetOAuthAppSignature;
1259
- interface GetOAuthAppSignature {
1260
- /**
1261
- * Retrieves an OAuth app by ID.
1262
- * @param - ID of the OAuth app to retrieve.
1263
- * @returns Retrieved OAuth app info.
1264
- */
1265
- (oAuthAppId: string): Promise<OAuthApp & OAuthAppNonNullableFields>;
1266
- }
1267
- declare function updateOAuthApp$1(httpClient: HttpClient): UpdateOAuthAppSignature;
1268
- interface UpdateOAuthAppSignature {
1269
- /**
1270
- * Updates an OAuth app.
1271
- *
1272
- *
1273
- * Only fields provided in `mask` are updated.
1274
- *
1275
- * You can update the following fields:
1276
- * + `name`
1277
- * + `description`
1278
- * + `allowedDomain`
1279
- * + `loginUrl`
1280
- * + `logoutUrl`
1281
- * + `technology`
1282
- * @param - ID of the OAuth app.
1283
- * @returns Updated OAuth app info.
1284
- */
1285
- (_id: string | null, oAuthApp: UpdateOAuthApp): Promise<OAuthApp & OAuthAppNonNullableFields>;
1286
- }
1287
- declare function queryOAuthApps$1(httpClient: HttpClient): QueryOAuthAppsSignature;
1288
- interface QueryOAuthAppsSignature {
1289
- /**
1290
- * Retrieves a list of OAuth apps, given the provided paging, filtering, and sorting.
1291
- *
1292
- *
1293
- * Query OAuth Apps runs with these defaults, which you can override:
1294
- * + Results are sorted by `id` in descending order.
1295
- * + `paging.offset` is `0`.
1296
- */
1297
- (): OAuthAppsQueryBuilder;
1298
- }
1299
- declare const onOAuthAppCreated$1: EventDefinition<OAuthAppCreatedEnvelope, "wix.headless.v1.o_auth_app_created">;
1300
- declare const onOAuthAppUpdated$1: EventDefinition<OAuthAppUpdatedEnvelope, "wix.headless.v1.o_auth_app_updated">;
1301
- declare const onOAuthAppDeleted$1: EventDefinition<OAuthAppDeletedEnvelope, "wix.headless.v1.o_auth_app_deleted">;
1302
-
1303
- declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1304
-
1305
- declare const createOAuthApp: MaybeContext<BuildRESTFunction<typeof createOAuthApp$1> & typeof createOAuthApp$1>;
1306
- declare const getOAuthApp: MaybeContext<BuildRESTFunction<typeof getOAuthApp$1> & typeof getOAuthApp$1>;
1307
- declare const updateOAuthApp: MaybeContext<BuildRESTFunction<typeof updateOAuthApp$1> & typeof updateOAuthApp$1>;
1308
- declare const queryOAuthApps: MaybeContext<BuildRESTFunction<typeof queryOAuthApps$1> & typeof queryOAuthApps$1>;
1309
-
1310
- type _publicOnOAuthAppCreatedType = typeof onOAuthAppCreated$1;
1311
- /**
1312
- * Triggered when an OAuth app is created.
1313
- */
1314
- declare const onOAuthAppCreated: ReturnType<typeof createEventModule<_publicOnOAuthAppCreatedType>>;
1315
-
1316
- type _publicOnOAuthAppUpdatedType = typeof onOAuthAppUpdated$1;
1317
- /**
1318
- * Triggered when an OAuth app is updated.
1319
- */
1320
- declare const onOAuthAppUpdated: ReturnType<typeof createEventModule<_publicOnOAuthAppUpdatedType>>;
1321
-
1322
- type _publicOnOAuthAppDeletedType = typeof onOAuthAppDeleted$1;
1323
- /**
1324
- * Triggered when an OAuth app is deleted.
1325
- */
1326
- declare const onOAuthAppDeleted: ReturnType<typeof createEventModule<_publicOnOAuthAppDeletedType>>;
1327
-
1328
- type context_ActionEvent = ActionEvent;
1329
- type context_Asset = Asset;
1330
- type context_BaseEventMetadata = BaseEventMetadata;
1331
- type context_CreateOAuthAppRequest = CreateOAuthAppRequest;
1332
- type context_CreateOAuthAppResponse = CreateOAuthAppResponse;
1333
- type context_CreateOAuthAppResponseNonNullableFields = CreateOAuthAppResponseNonNullableFields;
1334
- type context_CursorPaging = CursorPaging;
1335
- type context_Cursors = Cursors;
1336
- type context_DeleteContext = DeleteContext;
1337
- type context_DeleteOAuthAppRequest = DeleteOAuthAppRequest;
1338
- type context_DeleteOAuthAppResponse = DeleteOAuthAppResponse;
1339
- type context_DeleteStatus = DeleteStatus;
1340
- declare const context_DeleteStatus: typeof DeleteStatus;
1341
- type context_DomainEvent = DomainEvent;
1342
- type context_DomainEventBodyOneOf = DomainEventBodyOneOf;
1343
- type context_Empty = Empty;
1344
- type context_EntityCreatedEvent = EntityCreatedEvent;
1345
- type context_EntityDeletedEvent = EntityDeletedEvent;
1346
- type context_EntityUpdatedEvent = EntityUpdatedEvent;
1347
- type context_EventMetadata = EventMetadata;
1348
- type context_GenerateOAuthAppSecretRequest = GenerateOAuthAppSecretRequest;
1349
- type context_GenerateOAuthAppSecretResponse = GenerateOAuthAppSecretResponse;
1350
- type context_GetOAuthAppRequest = GetOAuthAppRequest;
1351
- type context_GetOAuthAppResponse = GetOAuthAppResponse;
1352
- type context_GetOAuthAppResponseNonNullableFields = GetOAuthAppResponseNonNullableFields;
1353
- type context_IdentificationData = IdentificationData;
1354
- type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
1355
- type context_MessageEnvelope = MessageEnvelope;
1356
- type context_MetaSiteSpecialEvent = MetaSiteSpecialEvent;
1357
- type context_MetaSiteSpecialEventPayloadOneOf = MetaSiteSpecialEventPayloadOneOf;
1358
- type context_Namespace = Namespace;
1359
- declare const context_Namespace: typeof Namespace;
1360
- type context_NamespaceChanged = NamespaceChanged;
1361
- type context_OAuthApp = OAuthApp;
1362
- type context_OAuthAppCreatedEnvelope = OAuthAppCreatedEnvelope;
1363
- type context_OAuthAppDeletedEnvelope = OAuthAppDeletedEnvelope;
1364
- type context_OAuthAppNonNullableFields = OAuthAppNonNullableFields;
1365
- type context_OAuthAppType = OAuthAppType;
1366
- declare const context_OAuthAppType: typeof OAuthAppType;
1367
- type context_OAuthAppUpdatedEnvelope = OAuthAppUpdatedEnvelope;
1368
- type context_OAuthAppsQueryBuilder = OAuthAppsQueryBuilder;
1369
- type context_OAuthAppsQueryResult = OAuthAppsQueryResult;
1370
- type context_OAuthTechnologies = OAuthTechnologies;
1371
- declare const context_OAuthTechnologies: typeof OAuthTechnologies;
1372
- type context_Paging = Paging;
1373
- type context_PagingMetadataV2 = PagingMetadataV2;
1374
- type context_PlatformQuery = PlatformQuery;
1375
- type context_PlatformQueryPagingMethodOneOf = PlatformQueryPagingMethodOneOf;
1376
- type context_QueryOAuthAppsRequest = QueryOAuthAppsRequest;
1377
- type context_QueryOAuthAppsResponse = QueryOAuthAppsResponse;
1378
- type context_QueryOAuthAppsResponseNonNullableFields = QueryOAuthAppsResponseNonNullableFields;
1379
- type context_RestoreInfo = RestoreInfo;
1380
- type context_ServiceProvisioned = ServiceProvisioned;
1381
- type context_ServiceRemoved = ServiceRemoved;
1382
- type context_SiteCreated = SiteCreated;
1383
- type context_SiteCreatedContext = SiteCreatedContext;
1384
- declare const context_SiteCreatedContext: typeof SiteCreatedContext;
1385
- type context_SiteDeleted = SiteDeleted;
1386
- type context_SiteHardDeleted = SiteHardDeleted;
1387
- type context_SiteMarkedAsTemplate = SiteMarkedAsTemplate;
1388
- type context_SiteMarkedAsWixSite = SiteMarkedAsWixSite;
1389
- type context_SitePublished = SitePublished;
1390
- type context_SiteRenamed = SiteRenamed;
1391
- type context_SiteTransferred = SiteTransferred;
1392
- type context_SiteUndeleted = SiteUndeleted;
1393
- type context_SiteUnpublished = SiteUnpublished;
1394
- type context_SortOrder = SortOrder;
1395
- declare const context_SortOrder: typeof SortOrder;
1396
- type context_Sorting = Sorting;
1397
- type context_State = State;
1398
- declare const context_State: typeof State;
1399
- type context_StudioAssigned = StudioAssigned;
1400
- type context_StudioUnassigned = StudioUnassigned;
1401
- type context_UpdateOAuthApp = UpdateOAuthApp;
1402
- type context_UpdateOAuthAppRequest = UpdateOAuthAppRequest;
1403
- type context_UpdateOAuthAppResponse = UpdateOAuthAppResponse;
1404
- type context_UpdateOAuthAppResponseNonNullableFields = UpdateOAuthAppResponseNonNullableFields;
1405
- type context_WebhookIdentityType = WebhookIdentityType;
1406
- declare const context_WebhookIdentityType: typeof WebhookIdentityType;
1407
- type context__publicOnOAuthAppCreatedType = _publicOnOAuthAppCreatedType;
1408
- type context__publicOnOAuthAppDeletedType = _publicOnOAuthAppDeletedType;
1409
- type context__publicOnOAuthAppUpdatedType = _publicOnOAuthAppUpdatedType;
1410
- declare const context_createOAuthApp: typeof createOAuthApp;
1411
- declare const context_getOAuthApp: typeof getOAuthApp;
1412
- declare const context_onOAuthAppCreated: typeof onOAuthAppCreated;
1413
- declare const context_onOAuthAppDeleted: typeof onOAuthAppDeleted;
1414
- declare const context_onOAuthAppUpdated: typeof onOAuthAppUpdated;
1415
- declare const context_queryOAuthApps: typeof queryOAuthApps;
1416
- declare const context_updateOAuthApp: typeof updateOAuthApp;
1417
- declare namespace context {
1418
- export { type context_ActionEvent as ActionEvent, type context_Asset as Asset, type context_BaseEventMetadata as BaseEventMetadata, type context_CreateOAuthAppRequest as CreateOAuthAppRequest, type context_CreateOAuthAppResponse as CreateOAuthAppResponse, type context_CreateOAuthAppResponseNonNullableFields as CreateOAuthAppResponseNonNullableFields, type context_CursorPaging as CursorPaging, type context_Cursors as Cursors, type context_DeleteContext as DeleteContext, type context_DeleteOAuthAppRequest as DeleteOAuthAppRequest, type context_DeleteOAuthAppResponse as DeleteOAuthAppResponse, context_DeleteStatus as DeleteStatus, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_Empty as Empty, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_GenerateOAuthAppSecretRequest as GenerateOAuthAppSecretRequest, type context_GenerateOAuthAppSecretResponse as GenerateOAuthAppSecretResponse, type context_GetOAuthAppRequest as GetOAuthAppRequest, type context_GetOAuthAppResponse as GetOAuthAppResponse, type context_GetOAuthAppResponseNonNullableFields as GetOAuthAppResponseNonNullableFields, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context_MessageEnvelope as MessageEnvelope, type context_MetaSiteSpecialEvent as MetaSiteSpecialEvent, type context_MetaSiteSpecialEventPayloadOneOf as MetaSiteSpecialEventPayloadOneOf, context_Namespace as Namespace, type context_NamespaceChanged as NamespaceChanged, type context_OAuthApp as OAuthApp, type context_OAuthAppCreatedEnvelope as OAuthAppCreatedEnvelope, type context_OAuthAppDeletedEnvelope as OAuthAppDeletedEnvelope, type context_OAuthAppNonNullableFields as OAuthAppNonNullableFields, context_OAuthAppType as OAuthAppType, type context_OAuthAppUpdatedEnvelope as OAuthAppUpdatedEnvelope, type context_OAuthAppsQueryBuilder as OAuthAppsQueryBuilder, type context_OAuthAppsQueryResult as OAuthAppsQueryResult, context_OAuthTechnologies as OAuthTechnologies, type context_Paging as Paging, type context_PagingMetadataV2 as PagingMetadataV2, type context_PlatformQuery as PlatformQuery, type context_PlatformQueryPagingMethodOneOf as PlatformQueryPagingMethodOneOf, type context_QueryOAuthAppsRequest as QueryOAuthAppsRequest, type context_QueryOAuthAppsResponse as QueryOAuthAppsResponse, type context_QueryOAuthAppsResponseNonNullableFields as QueryOAuthAppsResponseNonNullableFields, type context_RestoreInfo as RestoreInfo, type context_ServiceProvisioned as ServiceProvisioned, type context_ServiceRemoved as ServiceRemoved, type context_SiteCreated as SiteCreated, context_SiteCreatedContext as SiteCreatedContext, type context_SiteDeleted as SiteDeleted, type context_SiteHardDeleted as SiteHardDeleted, type context_SiteMarkedAsTemplate as SiteMarkedAsTemplate, type context_SiteMarkedAsWixSite as SiteMarkedAsWixSite, type context_SitePublished as SitePublished, type context_SiteRenamed as SiteRenamed, type context_SiteTransferred as SiteTransferred, type context_SiteUndeleted as SiteUndeleted, type context_SiteUnpublished as SiteUnpublished, context_SortOrder as SortOrder, type context_Sorting as Sorting, context_State as State, type context_StudioAssigned as StudioAssigned, type context_StudioUnassigned as StudioUnassigned, type context_UpdateOAuthApp as UpdateOAuthApp, type context_UpdateOAuthAppRequest as UpdateOAuthAppRequest, type context_UpdateOAuthAppResponse as UpdateOAuthAppResponse, type context_UpdateOAuthAppResponseNonNullableFields as UpdateOAuthAppResponseNonNullableFields, context_WebhookIdentityType as WebhookIdentityType, type context__publicOnOAuthAppCreatedType as _publicOnOAuthAppCreatedType, type context__publicOnOAuthAppDeletedType as _publicOnOAuthAppDeletedType, type context__publicOnOAuthAppUpdatedType as _publicOnOAuthAppUpdatedType, context_createOAuthApp as createOAuthApp, context_getOAuthApp as getOAuthApp, context_onOAuthAppCreated as onOAuthAppCreated, context_onOAuthAppDeleted as onOAuthAppDeleted, context_onOAuthAppUpdated as onOAuthAppUpdated, onOAuthAppCreated$1 as publicOnOAuthAppCreated, onOAuthAppDeleted$1 as publicOnOAuthAppDeleted, onOAuthAppUpdated$1 as publicOnOAuthAppUpdated, context_queryOAuthApps as queryOAuthApps, context_updateOAuthApp as updateOAuthApp };
1419
- }
1420
-
1421
- export { context as oAuthApps };