@wix/reports 1.0.4 → 1.0.6

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,1355 +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
- interface Report {
480
- /**
481
- * Report ID.
482
- * @readonly
483
- */
484
- _id?: string | null;
485
- /** Reported entity name, such as `comment`. */
486
- entityName?: string;
487
- /** Reported entity ID. */
488
- entityId?: string;
489
- /**
490
- * Identity of who created a report.
491
- * @readonly
492
- */
493
- identity?: CommonIdentificationData;
494
- /** Reason for the report. */
495
- reason?: Reason;
496
- /**
497
- * Revision number, which increments by 1 each time the rule is updated. To prevent conflicting changes, the existing revision must be used when updating a rule.
498
- * @readonly
499
- */
500
- revision?: string | null;
501
- /**
502
- * Date and time when the report created.
503
- * @readonly
504
- */
505
- _createdDate?: Date | null;
506
- /**
507
- * Date and time when the report updated.
508
- * @readonly
509
- */
510
- _updatedDate?: Date | null;
511
- /**
512
- * Custom field data for the report object.
513
- *
514
- * **Note:** You must configure extended fields using schema plugin extensions in your app's dashboard before you can access the extended fields with API calls.
515
- */
516
- extendedFields?: ExtendedFields;
517
- }
518
- interface CommonIdentificationData extends CommonIdentificationDataIdOneOf {
519
- /** ID of a site visitor that has not logged in to the site. */
520
- anonymousVisitorId?: string;
521
- /** ID of a site visitor that has logged in to the site. */
522
- memberId?: string;
523
- /**
524
- * Identity type
525
- * @readonly
526
- */
527
- identityType?: IdentityType;
528
- }
529
- /** @oneof */
530
- interface CommonIdentificationDataIdOneOf {
531
- /** ID of a site visitor that has not logged in to the site. */
532
- anonymousVisitorId?: string;
533
- /** ID of a site visitor that has logged in to the site. */
534
- memberId?: string;
535
- }
536
- declare enum IdentityType {
537
- /** Unknown type. This value is not used. */
538
- UNKNOWN = "UNKNOWN",
539
- /** A site visitor who has not logged in. */
540
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
541
- /** A logged-in site member. */
542
- MEMBER = "MEMBER",
543
- /** A Wix account holder, such as a site owner or contributor. This value is not used. */
544
- WIX_USER = "WIX_USER",
545
- /** An application integrated with the Wix platform. This value is not used. */
546
- APP = "APP"
547
- }
548
- interface Reason {
549
- /** Report reason type. */
550
- reasonType?: Type;
551
- /** Why the entity is reported. */
552
- details?: string | null;
553
- }
554
- declare enum Type {
555
- /** Unknown type. This value is not used. */
556
- UNKNOWN_TYPE = "UNKNOWN_TYPE",
557
- /** Entity is reported for other reasons. Specify in `details`. */
558
- OTHER = "OTHER",
559
- /** Entity is reported for spam. */
560
- SPAM = "SPAM",
561
- /** Entity is reported for nudity or sexual harassment. */
562
- NUDITY_OR_SEXUAL_HARASSMENT = "NUDITY_OR_SEXUAL_HARASSMENT",
563
- /** Entity is reported for hate speech. */
564
- HATE_SPEECH_OR_SYMBOLS = "HATE_SPEECH_OR_SYMBOLS",
565
- /** Entity is reported for false information. */
566
- FALSE_INFORMATION = "FALSE_INFORMATION",
567
- /** Entity is reported for a community guideline violation. */
568
- COMMUNITY_GUIDELINES_VIOLATION = "COMMUNITY_GUIDELINES_VIOLATION",
569
- /** Entity is reported for violence. */
570
- VIOLENCE = "VIOLENCE",
571
- /** Entity is reported for mentioning suicide. */
572
- SUICIDE_OR_SELF_INJURY = "SUICIDE_OR_SELF_INJURY",
573
- /** Entity is reported for unuathorized sales. */
574
- UNAUTHORIZED_SALES = "UNAUTHORIZED_SALES",
575
- /** Entity is reported for mentioning an eating disorder. */
576
- EATING_DISORDER = "EATING_DISORDER",
577
- /** Entity is reported for involving a minor. */
578
- INVOLVES_A_CHILD = "INVOLVES_A_CHILD",
579
- /** Entity is reported for mentioning terrorism. */
580
- TERRORISM = "TERRORISM",
581
- /** Entity is reported for mentioning drugs. */
582
- DRUGS = "DRUGS",
583
- /** Entity is reported for unlawful actions. */
584
- UNLAWFUL = "UNLAWFUL",
585
- /** Entity is reported for exposing identifying details. */
586
- EXPOSING_IDENTIFYING_INFO = "EXPOSING_IDENTIFYING_INFO"
587
- }
588
- interface ExtendedFields {
589
- /**
590
- * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
591
- * The value of each key is structured according to the schema defined when the extended fields were configured.
592
- *
593
- * You can only access fields for which you have the appropriate permissions.
594
- *
595
- * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
596
- */
597
- namespaces?: Record<string, Record<string, any>>;
598
- }
599
- interface EntityReportSummaryChanged {
600
- /** Reported entity name. */
601
- entityName?: string;
602
- /** Reported entity ID. */
603
- entityId?: string;
604
- /** Number of reports. */
605
- reportCount?: number;
606
- /** Number of reports per reason type. */
607
- reasonCounts?: ReasonCount[];
608
- }
609
- interface ReasonCount {
610
- /** Reason type. */
611
- reasonType?: Type;
612
- /** Number of reports. */
613
- count?: number;
614
- }
615
- interface CreateReportRequest {
616
- /** Report details. */
617
- report: Report;
618
- }
619
- interface CreateReportResponse {
620
- /** Created report. */
621
- report?: Report;
622
- }
623
- interface GetReportRequest {
624
- /** ID of the report to retrieve. */
625
- reportId: string;
626
- }
627
- interface GetReportResponse {
628
- /** Retrieved report. */
629
- report?: Report;
630
- }
631
- interface UpdateReportRequest {
632
- /** Report to update. */
633
- report: Report;
634
- }
635
- interface UpdateReportResponse {
636
- /** Updated report. */
637
- report?: Report;
638
- }
639
- interface DeleteReportRequest {
640
- /** ID of the report to delete. */
641
- reportId: string;
642
- }
643
- interface DeleteReportResponse {
644
- }
645
- interface UpsertReportRequest {
646
- /** Report to create or update. */
647
- report?: Report;
648
- }
649
- interface UpsertReportResponse {
650
- /** Updated or created report. */
651
- report?: Report;
652
- }
653
- interface BulkDeleteReportsByFilterRequest {
654
- /** Query options. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language) for more details. */
655
- filter: Record<string, any> | null;
656
- }
657
- interface BulkDeleteReportsByFilterResponse {
658
- /** Job ID. Pass this ID to [Get Async Job](https://dev.wix.com/docs/rest/business-management/async-job/introduction) to retrieve job details and metadata. */
659
- jobId?: string;
660
- }
661
- interface CountReportsByReasonTypesRequest {
662
- /** Reported entity name. For example, `comment`. */
663
- entityName: string;
664
- /** ID of the reported entity. */
665
- entityId: string;
666
- }
667
- interface CountReportsByReasonTypesResponse {
668
- /** List of reports grouped by the reason type. */
669
- reasonTypeCount?: ReasonTypeCount[];
670
- }
671
- interface ReasonTypeCount {
672
- /** Reason for report. */
673
- reasonType?: Type;
674
- /** Number of reports by reason type. */
675
- count?: number;
676
- }
677
- interface QueryReportsRequest {
678
- /** Query options. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language) for more details. */
679
- query?: CursorQuery;
680
- }
681
- interface CursorQuery extends CursorQueryPagingMethodOneOf {
682
- /** Cursor paging options */
683
- cursorPaging?: CursorPaging;
684
- /** Filter object. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) for more information. */
685
- filter?: Record<string, any> | null;
686
- /** Sorting options */
687
- sort?: Sorting[];
688
- }
689
- /** @oneof */
690
- interface CursorQueryPagingMethodOneOf {
691
- /** Cursor paging options */
692
- cursorPaging?: CursorPaging;
693
- }
694
- interface Sorting {
695
- /** Name of the field to sort by. */
696
- fieldName?: string;
697
- /** Sort order. */
698
- order?: SortOrder;
699
- }
700
- declare enum SortOrder {
701
- ASC = "ASC",
702
- DESC = "DESC"
703
- }
704
- interface CursorPaging {
705
- /** Maximum number of items to return in the results. */
706
- limit?: number | null;
707
- /**
708
- * Pointer to the next or previous page in the list of results.
709
- * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
710
- */
711
- cursor?: string | null;
712
- }
713
- interface QueryReportsResponse {
714
- /** List of reports. */
715
- reports?: Report[];
716
- /** Paging metadata. */
717
- pagingMetadata?: CursorPagingMetadata;
718
- }
719
- interface CursorPagingMetadata {
720
- /** Number of items returned in the response. */
721
- count?: number | null;
722
- /** Cursor strings that point to the next page, previous page, or both. */
723
- cursors?: Cursors;
724
- /** Whether there are more pages to retrieve following the current page. */
725
- hasNext?: boolean | null;
726
- }
727
- interface Cursors {
728
- /** Cursor string pointing to the next page in the list of results. */
729
- next?: string | null;
730
- /** Cursor pointing to the previous page in the list of results. */
731
- prev?: string | null;
732
- }
733
- interface UpdateExtendedFieldsRequest {
734
- /** ID of the report to update. */
735
- _id: string;
736
- /** Identifier for the app whose extended fields are being updated. */
737
- namespace: string;
738
- /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */
739
- namespaceData: Record<string, any> | null;
740
- }
741
- interface UpdateExtendedFieldsResponse {
742
- /** Updated report. */
743
- report?: Report;
744
- }
745
- interface DomainEvent extends DomainEventBodyOneOf {
746
- createdEvent?: EntityCreatedEvent;
747
- updatedEvent?: EntityUpdatedEvent;
748
- deletedEvent?: EntityDeletedEvent;
749
- actionEvent?: ActionEvent;
750
- /**
751
- * Unique event ID.
752
- * Allows clients to ignore duplicate webhooks.
753
- */
754
- _id?: string;
755
- /**
756
- * Assumes actions are also always typed to an entity_type
757
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
758
- */
759
- entityFqdn?: string;
760
- /**
761
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
762
- * This is although the created/updated/deleted notion is duplication of the oneof types
763
- * Example: created/updated/deleted/started/completed/email_opened
764
- */
765
- slug?: string;
766
- /** ID of the entity associated with the event. */
767
- entityId?: string;
768
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
769
- eventTime?: Date | null;
770
- /**
771
- * Whether the event was triggered as a result of a privacy regulation application
772
- * (for example, GDPR).
773
- */
774
- triggeredByAnonymizeRequest?: boolean | null;
775
- /** If present, indicates the action that triggered the event. */
776
- originatedFrom?: string | null;
777
- /**
778
- * A sequence number defining the order of updates to the underlying entity.
779
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
780
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
781
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
782
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
783
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
784
- */
785
- entityEventSequence?: string | null;
786
- }
787
- /** @oneof */
788
- interface DomainEventBodyOneOf {
789
- createdEvent?: EntityCreatedEvent;
790
- updatedEvent?: EntityUpdatedEvent;
791
- deletedEvent?: EntityDeletedEvent;
792
- actionEvent?: ActionEvent;
793
- }
794
- interface EntityCreatedEvent {
795
- entity?: string;
796
- }
797
- interface RestoreInfo {
798
- deletedDate?: Date | null;
799
- }
800
- interface EntityUpdatedEvent {
801
- /**
802
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
803
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
804
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
805
- */
806
- currentEntity?: string;
807
- }
808
- interface EntityDeletedEvent {
809
- /** Entity that was deleted */
810
- deletedEntity?: string | null;
811
- }
812
- interface ActionEvent {
813
- body?: string;
814
- }
815
- interface Empty {
816
- }
817
- interface MessageEnvelope {
818
- /** App instance ID. */
819
- instanceId?: string | null;
820
- /** Event type. */
821
- eventType?: string;
822
- /** The identification type and identity data. */
823
- identity?: IdentificationData;
824
- /** Stringify payload. */
825
- data?: string;
826
- }
827
- interface IdentificationData extends IdentificationDataIdOneOf {
828
- /** ID of a site visitor that has not logged in to the site. */
829
- anonymousVisitorId?: string;
830
- /** ID of a site visitor that has logged in to the site. */
831
- memberId?: string;
832
- /** ID of a Wix user (site owner, contributor, etc.). */
833
- wixUserId?: string;
834
- /** ID of an app. */
835
- appId?: string;
836
- /** @readonly */
837
- identityType?: WebhookIdentityType;
838
- }
839
- /** @oneof */
840
- interface IdentificationDataIdOneOf {
841
- /** ID of a site visitor that has not logged in to the site. */
842
- anonymousVisitorId?: string;
843
- /** ID of a site visitor that has logged in to the site. */
844
- memberId?: string;
845
- /** ID of a Wix user (site owner, contributor, etc.). */
846
- wixUserId?: string;
847
- /** ID of an app. */
848
- appId?: string;
849
- }
850
- declare enum WebhookIdentityType {
851
- UNKNOWN = "UNKNOWN",
852
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
853
- MEMBER = "MEMBER",
854
- WIX_USER = "WIX_USER",
855
- APP = "APP"
856
- }
857
- interface CommonIdentificationDataNonNullableFields {
858
- anonymousVisitorId: string;
859
- memberId: string;
860
- wixUserId: string;
861
- appId: string;
862
- identityType: IdentityType;
863
- }
864
- interface ReasonNonNullableFields {
865
- reasonType: Type;
866
- }
867
- interface ReportNonNullableFields {
868
- entityName: string;
869
- entityId: string;
870
- identity?: CommonIdentificationDataNonNullableFields;
871
- reason?: ReasonNonNullableFields;
872
- }
873
- interface CreateReportResponseNonNullableFields {
874
- report?: ReportNonNullableFields;
875
- }
876
- interface GetReportResponseNonNullableFields {
877
- report?: ReportNonNullableFields;
878
- }
879
- interface UpdateReportResponseNonNullableFields {
880
- report?: ReportNonNullableFields;
881
- }
882
- interface UpsertReportResponseNonNullableFields {
883
- report?: ReportNonNullableFields;
884
- }
885
- interface BulkDeleteReportsByFilterResponseNonNullableFields {
886
- jobId: string;
887
- }
888
- interface ReasonTypeCountNonNullableFields {
889
- reasonType: Type;
890
- count: number;
891
- }
892
- interface CountReportsByReasonTypesResponseNonNullableFields {
893
- reasonTypeCount: ReasonTypeCountNonNullableFields[];
894
- }
895
- interface QueryReportsResponseNonNullableFields {
896
- reports: ReportNonNullableFields[];
897
- }
898
- interface UpdateExtendedFieldsResponseNonNullableFields {
899
- report?: ReportNonNullableFields;
900
- }
901
- interface BaseEventMetadata {
902
- /** App instance ID. */
903
- instanceId?: string | null;
904
- /** Event type. */
905
- eventType?: string;
906
- /** The identification type and identity data. */
907
- identity?: IdentificationData;
908
- }
909
- interface EventMetadata extends BaseEventMetadata {
910
- /**
911
- * Unique event ID.
912
- * Allows clients to ignore duplicate webhooks.
913
- */
914
- _id?: string;
915
- /**
916
- * Assumes actions are also always typed to an entity_type
917
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
918
- */
919
- entityFqdn?: string;
920
- /**
921
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
922
- * This is although the created/updated/deleted notion is duplication of the oneof types
923
- * Example: created/updated/deleted/started/completed/email_opened
924
- */
925
- slug?: string;
926
- /** ID of the entity associated with the event. */
927
- entityId?: string;
928
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
929
- eventTime?: Date | null;
930
- /**
931
- * Whether the event was triggered as a result of a privacy regulation application
932
- * (for example, GDPR).
933
- */
934
- triggeredByAnonymizeRequest?: boolean | null;
935
- /** If present, indicates the action that triggered the event. */
936
- originatedFrom?: string | null;
937
- /**
938
- * A sequence number defining the order of updates to the underlying entity.
939
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
940
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
941
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
942
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
943
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
944
- */
945
- entityEventSequence?: string | null;
946
- }
947
- interface ReportCreatedEnvelope {
948
- entity: Report;
949
- metadata: EventMetadata;
950
- }
951
- interface ReportDeletedEnvelope {
952
- entity: Report;
953
- metadata: EventMetadata;
954
- }
955
- interface ReportEntityReportSummaryChangedEnvelope {
956
- data: EntityReportSummaryChanged;
957
- metadata: EventMetadata;
958
- }
959
- interface ReportUpdatedEnvelope {
960
- entity: Report;
961
- metadata: EventMetadata;
962
- }
963
- interface UpdateReport {
964
- /**
965
- * Report ID.
966
- * @readonly
967
- */
968
- _id?: string | null;
969
- /** Reported entity name, such as `comment`. */
970
- entityName?: string;
971
- /** Reported entity ID. */
972
- entityId?: string;
973
- /**
974
- * Identity of who created a report.
975
- * @readonly
976
- */
977
- identity?: CommonIdentificationData;
978
- /** Reason for the report. */
979
- reason?: Reason;
980
- /**
981
- * Revision number, which increments by 1 each time the rule is updated. To prevent conflicting changes, the existing revision must be used when updating a rule.
982
- * @readonly
983
- */
984
- revision?: string | null;
985
- /**
986
- * Date and time when the report created.
987
- * @readonly
988
- */
989
- _createdDate?: Date | null;
990
- /**
991
- * Date and time when the report updated.
992
- * @readonly
993
- */
994
- _updatedDate?: Date | null;
995
- /**
996
- * Custom field data for the report object.
997
- *
998
- * **Note:** You must configure extended fields using schema plugin extensions in your app's dashboard before you can access the extended fields with API calls.
999
- */
1000
- extendedFields?: ExtendedFields;
1001
- }
1002
- interface UpsertReportOptions {
1003
- report: {
1004
- /**
1005
- * Report ID.
1006
- * @readonly
1007
- */
1008
- _id?: string | null;
1009
- /**
1010
- * Identity of who created a report.
1011
- * @readonly
1012
- */
1013
- identity?: CommonIdentificationData;
1014
- /** Reason for the report. */
1015
- reason?: Reason;
1016
- /**
1017
- * Revision number, which increments by 1 each time the rule is updated. To prevent conflicting changes, the existing revision must be used when updating a rule.
1018
- * @readonly
1019
- */
1020
- revision?: string | null;
1021
- /**
1022
- * Date and time when the report created.
1023
- * @readonly
1024
- */
1025
- _createdDate?: Date | null;
1026
- /**
1027
- * Date and time when the report updated.
1028
- * @readonly
1029
- */
1030
- _updatedDate?: Date | null;
1031
- /**
1032
- * Custom field data for the report object.
1033
- *
1034
- * **Note:** You must configure extended fields using schema plugin extensions in your app's dashboard before you can access the extended fields with API calls.
1035
- */
1036
- extendedFields?: ExtendedFields;
1037
- };
1038
- }
1039
- interface UpsertReportIdentifiers {
1040
- /** Reported entity name, such as `comment`. */
1041
- reportEntityName?: string;
1042
- /** Reported entity ID. */
1043
- reportEntityId?: string;
1044
- }
1045
- interface CountReportsByReasonTypesOptions {
1046
- /** ID of the reported entity. */
1047
- entityId: string;
1048
- }
1049
- interface QueryCursorResult {
1050
- cursors: Cursors;
1051
- hasNext: () => boolean;
1052
- hasPrev: () => boolean;
1053
- length: number;
1054
- pageSize: number;
1055
- }
1056
- interface ReportsQueryResult extends QueryCursorResult {
1057
- items: Report[];
1058
- query: ReportsQueryBuilder;
1059
- next: () => Promise<ReportsQueryResult>;
1060
- prev: () => Promise<ReportsQueryResult>;
1061
- }
1062
- interface ReportsQueryBuilder {
1063
- /** @param propertyName - Property whose value is compared with `value`.
1064
- * @param value - Value to compare against.
1065
- * @documentationMaturity preview
1066
- */
1067
- eq: (propertyName: '_id' | 'entityName' | 'entityId' | '_createdDate' | 'extendedFields', value: any) => ReportsQueryBuilder;
1068
- /** @param propertyName - Property whose value is compared with `value`.
1069
- * @param value - Value to compare against.
1070
- * @documentationMaturity preview
1071
- */
1072
- ne: (propertyName: '_id' | 'entityName' | 'entityId' | '_createdDate' | 'extendedFields', value: any) => ReportsQueryBuilder;
1073
- /** @param propertyName - Property whose value is compared with `value`.
1074
- * @param value - Value to compare against.
1075
- * @documentationMaturity preview
1076
- */
1077
- ge: (propertyName: '_createdDate', value: any) => ReportsQueryBuilder;
1078
- /** @param propertyName - Property whose value is compared with `value`.
1079
- * @param value - Value to compare against.
1080
- * @documentationMaturity preview
1081
- */
1082
- gt: (propertyName: '_createdDate', value: any) => ReportsQueryBuilder;
1083
- /** @param propertyName - Property whose value is compared with `value`.
1084
- * @param value - Value to compare against.
1085
- * @documentationMaturity preview
1086
- */
1087
- le: (propertyName: '_createdDate', value: any) => ReportsQueryBuilder;
1088
- /** @param propertyName - Property whose value is compared with `value`.
1089
- * @param value - Value to compare against.
1090
- * @documentationMaturity preview
1091
- */
1092
- lt: (propertyName: '_createdDate', value: any) => ReportsQueryBuilder;
1093
- /** @param propertyName - Property whose value is compared with `string`.
1094
- * @param string - String to compare against. Case-insensitive.
1095
- * @documentationMaturity preview
1096
- */
1097
- startsWith: (propertyName: '_id' | 'entityName' | 'entityId', value: string) => ReportsQueryBuilder;
1098
- /** @param propertyName - Property whose value is compared with `values`.
1099
- * @param values - List of values to compare against.
1100
- * @documentationMaturity preview
1101
- */
1102
- hasSome: (propertyName: '_id' | 'entityName' | 'entityId' | '_createdDate' | 'extendedFields', value: any[]) => ReportsQueryBuilder;
1103
- /** @documentationMaturity preview */
1104
- in: (propertyName: '_id' | 'entityName' | 'entityId' | '_createdDate' | 'extendedFields', value: any) => ReportsQueryBuilder;
1105
- /** @documentationMaturity preview */
1106
- exists: (propertyName: '_id' | 'entityName' | 'entityId' | '_createdDate' | 'extendedFields', value: boolean) => ReportsQueryBuilder;
1107
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1108
- * @documentationMaturity preview
1109
- */
1110
- ascending: (...propertyNames: Array<'_id' | 'entityName' | 'entityId' | '_createdDate' | 'extendedFields'>) => ReportsQueryBuilder;
1111
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1112
- * @documentationMaturity preview
1113
- */
1114
- descending: (...propertyNames: Array<'_id' | 'entityName' | 'entityId' | '_createdDate' | 'extendedFields'>) => ReportsQueryBuilder;
1115
- /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
1116
- * @documentationMaturity preview
1117
- */
1118
- limit: (limit: number) => ReportsQueryBuilder;
1119
- /** @param cursor - A pointer to specific record
1120
- * @documentationMaturity preview
1121
- */
1122
- skipTo: (cursor: string) => ReportsQueryBuilder;
1123
- /** @documentationMaturity preview */
1124
- find: () => Promise<ReportsQueryResult>;
1125
- }
1126
- interface UpdateExtendedFieldsOptions {
1127
- /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */
1128
- namespaceData: Record<string, any> | null;
1129
- }
1130
-
1131
- declare function createReport$1(httpClient: HttpClient): CreateReportSignature;
1132
- interface CreateReportSignature {
1133
- /**
1134
- * Creates a report.
1135
- * @param - Report details.
1136
- * @returns Created report.
1137
- */
1138
- (report: Report): Promise<Report & ReportNonNullableFields>;
1139
- }
1140
- declare function getReport$1(httpClient: HttpClient): GetReportSignature;
1141
- interface GetReportSignature {
1142
- /**
1143
- * Retrieves a report.
1144
- *
1145
- * Site members and visitors can only access their own reports.
1146
- * @param - ID of the report to retrieve.
1147
- * @returns Retrieved report.
1148
- */
1149
- (reportId: string): Promise<Report & ReportNonNullableFields>;
1150
- }
1151
- declare function updateReport$1(httpClient: HttpClient): UpdateReportSignature;
1152
- interface UpdateReportSignature {
1153
- /**
1154
- * Updates a report.
1155
- *
1156
- * Each time the report is updated, `revision` increments by 1. The current `revision` must be passed when updating the report. This ensures you're working with the latest report and prevents unintended overwrites.
1157
- * @param - Report ID.
1158
- * @returns Updated report.
1159
- */
1160
- (_id: string | null, report: UpdateReport): Promise<Report & ReportNonNullableFields>;
1161
- }
1162
- declare function deleteReport$1(httpClient: HttpClient): DeleteReportSignature;
1163
- interface DeleteReportSignature {
1164
- /**
1165
- * Deletes a report and removes it from the report list in the dashboard.
1166
- *
1167
- * Site members and visitors can only delete their own reports.
1168
- * @param - ID of the report to delete.
1169
- */
1170
- (reportId: string): Promise<void>;
1171
- }
1172
- declare function upsertReport$1(httpClient: HttpClient): UpsertReportSignature;
1173
- interface UpsertReportSignature {
1174
- /**
1175
- * Creates or updates a report.
1176
- * If the report for the requested entity already exists, updates the report with the provided `reason` value. Otherwise, creates the report.
1177
- */
1178
- (identifiers: UpsertReportIdentifiers, options?: UpsertReportOptions | undefined): Promise<UpsertReportResponse & UpsertReportResponseNonNullableFields>;
1179
- }
1180
- declare function bulkDeleteReportsByFilter$1(httpClient: HttpClient): BulkDeleteReportsByFilterSignature;
1181
- interface BulkDeleteReportsByFilterSignature {
1182
- /**
1183
- * Deletes multiple reports by filter, and removes them from the report list in the dashboard.
1184
- * @param - Query options. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language) for more details.
1185
- */
1186
- (filter: Record<string, any> | null): Promise<BulkDeleteReportsByFilterResponse & BulkDeleteReportsByFilterResponseNonNullableFields>;
1187
- }
1188
- declare function countReportsByReasonTypes$1(httpClient: HttpClient): CountReportsByReasonTypesSignature;
1189
- interface CountReportsByReasonTypesSignature {
1190
- /**
1191
- * Counts reports by reason types.
1192
- * @param - Reported entity name. For example, `comment`.
1193
- */
1194
- (entityName: string, options: CountReportsByReasonTypesOptions): Promise<CountReportsByReasonTypesResponse & CountReportsByReasonTypesResponseNonNullableFields>;
1195
- }
1196
- declare function queryReports$1(httpClient: HttpClient): QueryReportsSignature;
1197
- interface QueryReportsSignature {
1198
- /**
1199
- * Retrieves a list of reports, given the provided paging, filtering, and sorting.
1200
- * Query Reports runs with these defaults, which you can override:
1201
- * - `createdDate` is sorted in `ASC` order
1202
- * - `paging.limit` is `100`
1203
- * - `paging.offset` is `0`
1204
- *
1205
- * For field support for filters and sorting, see [Reports: Supported Filters and Sorting]().
1206
- * To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
1207
- */
1208
- (): ReportsQueryBuilder;
1209
- }
1210
- declare function updateExtendedFields$1(httpClient: HttpClient): UpdateExtendedFieldsSignature;
1211
- interface UpdateExtendedFieldsSignature {
1212
- /**
1213
- * Updates extended fields of a report.
1214
- * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must first be configured in the app dashboard.
1215
- * @param - ID of the report to update.
1216
- * @param - Identifier for the app whose extended fields are being updated.
1217
- */
1218
- (_id: string, namespace: string, options: UpdateExtendedFieldsOptions): Promise<UpdateExtendedFieldsResponse & UpdateExtendedFieldsResponseNonNullableFields>;
1219
- }
1220
- declare const onReportCreated$1: EventDefinition<ReportCreatedEnvelope, "wix.reports.v2.report_created">;
1221
- declare const onReportDeleted$1: EventDefinition<ReportDeletedEnvelope, "wix.reports.v2.report_deleted">;
1222
- declare const onReportEntityReportSummaryChanged$1: EventDefinition<ReportEntityReportSummaryChangedEnvelope, "wix.reports.v2.report_entity_report_summary_changed">;
1223
- declare const onReportUpdated$1: EventDefinition<ReportUpdatedEnvelope, "wix.reports.v2.report_updated">;
1224
-
1225
- declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1226
-
1227
- declare const createReport: MaybeContext<BuildRESTFunction<typeof createReport$1> & typeof createReport$1>;
1228
- declare const getReport: MaybeContext<BuildRESTFunction<typeof getReport$1> & typeof getReport$1>;
1229
- declare const updateReport: MaybeContext<BuildRESTFunction<typeof updateReport$1> & typeof updateReport$1>;
1230
- declare const deleteReport: MaybeContext<BuildRESTFunction<typeof deleteReport$1> & typeof deleteReport$1>;
1231
- declare const upsertReport: MaybeContext<BuildRESTFunction<typeof upsertReport$1> & typeof upsertReport$1>;
1232
- declare const bulkDeleteReportsByFilter: MaybeContext<BuildRESTFunction<typeof bulkDeleteReportsByFilter$1> & typeof bulkDeleteReportsByFilter$1>;
1233
- declare const countReportsByReasonTypes: MaybeContext<BuildRESTFunction<typeof countReportsByReasonTypes$1> & typeof countReportsByReasonTypes$1>;
1234
- declare const queryReports: MaybeContext<BuildRESTFunction<typeof queryReports$1> & typeof queryReports$1>;
1235
- declare const updateExtendedFields: MaybeContext<BuildRESTFunction<typeof updateExtendedFields$1> & typeof updateExtendedFields$1>;
1236
-
1237
- type _publicOnReportCreatedType = typeof onReportCreated$1;
1238
- /**
1239
- * Triggered when a report is created.
1240
- */
1241
- declare const onReportCreated: ReturnType<typeof createEventModule<_publicOnReportCreatedType>>;
1242
-
1243
- type _publicOnReportDeletedType = typeof onReportDeleted$1;
1244
- /**
1245
- * Triggered when a report is deleted.
1246
- */
1247
- declare const onReportDeleted: ReturnType<typeof createEventModule<_publicOnReportDeletedType>>;
1248
-
1249
- type _publicOnReportEntityReportSummaryChangedType = typeof onReportEntityReportSummaryChanged$1;
1250
- /**
1251
- * Triggered when count of reports by reason is updated.
1252
- */
1253
- declare const onReportEntityReportSummaryChanged: ReturnType<typeof createEventModule<_publicOnReportEntityReportSummaryChangedType>>;
1254
-
1255
- type _publicOnReportUpdatedType = typeof onReportUpdated$1;
1256
- /**
1257
- * Triggered when a report is updated.
1258
- */
1259
- declare const onReportUpdated: ReturnType<typeof createEventModule<_publicOnReportUpdatedType>>;
1260
-
1261
- type context_ActionEvent = ActionEvent;
1262
- type context_BaseEventMetadata = BaseEventMetadata;
1263
- type context_BulkDeleteReportsByFilterRequest = BulkDeleteReportsByFilterRequest;
1264
- type context_BulkDeleteReportsByFilterResponse = BulkDeleteReportsByFilterResponse;
1265
- type context_BulkDeleteReportsByFilterResponseNonNullableFields = BulkDeleteReportsByFilterResponseNonNullableFields;
1266
- type context_CommonIdentificationData = CommonIdentificationData;
1267
- type context_CommonIdentificationDataIdOneOf = CommonIdentificationDataIdOneOf;
1268
- type context_CountReportsByReasonTypesOptions = CountReportsByReasonTypesOptions;
1269
- type context_CountReportsByReasonTypesRequest = CountReportsByReasonTypesRequest;
1270
- type context_CountReportsByReasonTypesResponse = CountReportsByReasonTypesResponse;
1271
- type context_CountReportsByReasonTypesResponseNonNullableFields = CountReportsByReasonTypesResponseNonNullableFields;
1272
- type context_CreateReportRequest = CreateReportRequest;
1273
- type context_CreateReportResponse = CreateReportResponse;
1274
- type context_CreateReportResponseNonNullableFields = CreateReportResponseNonNullableFields;
1275
- type context_CursorPaging = CursorPaging;
1276
- type context_CursorPagingMetadata = CursorPagingMetadata;
1277
- type context_CursorQuery = CursorQuery;
1278
- type context_CursorQueryPagingMethodOneOf = CursorQueryPagingMethodOneOf;
1279
- type context_Cursors = Cursors;
1280
- type context_DeleteReportRequest = DeleteReportRequest;
1281
- type context_DeleteReportResponse = DeleteReportResponse;
1282
- type context_DomainEvent = DomainEvent;
1283
- type context_DomainEventBodyOneOf = DomainEventBodyOneOf;
1284
- type context_Empty = Empty;
1285
- type context_EntityCreatedEvent = EntityCreatedEvent;
1286
- type context_EntityDeletedEvent = EntityDeletedEvent;
1287
- type context_EntityReportSummaryChanged = EntityReportSummaryChanged;
1288
- type context_EntityUpdatedEvent = EntityUpdatedEvent;
1289
- type context_EventMetadata = EventMetadata;
1290
- type context_ExtendedFields = ExtendedFields;
1291
- type context_GetReportRequest = GetReportRequest;
1292
- type context_GetReportResponse = GetReportResponse;
1293
- type context_GetReportResponseNonNullableFields = GetReportResponseNonNullableFields;
1294
- type context_IdentificationData = IdentificationData;
1295
- type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
1296
- type context_IdentityType = IdentityType;
1297
- declare const context_IdentityType: typeof IdentityType;
1298
- type context_MessageEnvelope = MessageEnvelope;
1299
- type context_QueryReportsRequest = QueryReportsRequest;
1300
- type context_QueryReportsResponse = QueryReportsResponse;
1301
- type context_QueryReportsResponseNonNullableFields = QueryReportsResponseNonNullableFields;
1302
- type context_Reason = Reason;
1303
- type context_ReasonCount = ReasonCount;
1304
- type context_ReasonTypeCount = ReasonTypeCount;
1305
- type context_Report = Report;
1306
- type context_ReportCreatedEnvelope = ReportCreatedEnvelope;
1307
- type context_ReportDeletedEnvelope = ReportDeletedEnvelope;
1308
- type context_ReportEntityReportSummaryChangedEnvelope = ReportEntityReportSummaryChangedEnvelope;
1309
- type context_ReportNonNullableFields = ReportNonNullableFields;
1310
- type context_ReportUpdatedEnvelope = ReportUpdatedEnvelope;
1311
- type context_ReportsQueryBuilder = ReportsQueryBuilder;
1312
- type context_ReportsQueryResult = ReportsQueryResult;
1313
- type context_RestoreInfo = RestoreInfo;
1314
- type context_SortOrder = SortOrder;
1315
- declare const context_SortOrder: typeof SortOrder;
1316
- type context_Sorting = Sorting;
1317
- type context_Type = Type;
1318
- declare const context_Type: typeof Type;
1319
- type context_UpdateExtendedFieldsOptions = UpdateExtendedFieldsOptions;
1320
- type context_UpdateExtendedFieldsRequest = UpdateExtendedFieldsRequest;
1321
- type context_UpdateExtendedFieldsResponse = UpdateExtendedFieldsResponse;
1322
- type context_UpdateExtendedFieldsResponseNonNullableFields = UpdateExtendedFieldsResponseNonNullableFields;
1323
- type context_UpdateReport = UpdateReport;
1324
- type context_UpdateReportRequest = UpdateReportRequest;
1325
- type context_UpdateReportResponse = UpdateReportResponse;
1326
- type context_UpdateReportResponseNonNullableFields = UpdateReportResponseNonNullableFields;
1327
- type context_UpsertReportIdentifiers = UpsertReportIdentifiers;
1328
- type context_UpsertReportOptions = UpsertReportOptions;
1329
- type context_UpsertReportRequest = UpsertReportRequest;
1330
- type context_UpsertReportResponse = UpsertReportResponse;
1331
- type context_UpsertReportResponseNonNullableFields = UpsertReportResponseNonNullableFields;
1332
- type context_WebhookIdentityType = WebhookIdentityType;
1333
- declare const context_WebhookIdentityType: typeof WebhookIdentityType;
1334
- type context__publicOnReportCreatedType = _publicOnReportCreatedType;
1335
- type context__publicOnReportDeletedType = _publicOnReportDeletedType;
1336
- type context__publicOnReportEntityReportSummaryChangedType = _publicOnReportEntityReportSummaryChangedType;
1337
- type context__publicOnReportUpdatedType = _publicOnReportUpdatedType;
1338
- declare const context_bulkDeleteReportsByFilter: typeof bulkDeleteReportsByFilter;
1339
- declare const context_countReportsByReasonTypes: typeof countReportsByReasonTypes;
1340
- declare const context_createReport: typeof createReport;
1341
- declare const context_deleteReport: typeof deleteReport;
1342
- declare const context_getReport: typeof getReport;
1343
- declare const context_onReportCreated: typeof onReportCreated;
1344
- declare const context_onReportDeleted: typeof onReportDeleted;
1345
- declare const context_onReportEntityReportSummaryChanged: typeof onReportEntityReportSummaryChanged;
1346
- declare const context_onReportUpdated: typeof onReportUpdated;
1347
- declare const context_queryReports: typeof queryReports;
1348
- declare const context_updateExtendedFields: typeof updateExtendedFields;
1349
- declare const context_updateReport: typeof updateReport;
1350
- declare const context_upsertReport: typeof upsertReport;
1351
- declare namespace context {
1352
- export { type context_ActionEvent as ActionEvent, type context_BaseEventMetadata as BaseEventMetadata, type context_BulkDeleteReportsByFilterRequest as BulkDeleteReportsByFilterRequest, type context_BulkDeleteReportsByFilterResponse as BulkDeleteReportsByFilterResponse, type context_BulkDeleteReportsByFilterResponseNonNullableFields as BulkDeleteReportsByFilterResponseNonNullableFields, type context_CommonIdentificationData as CommonIdentificationData, type context_CommonIdentificationDataIdOneOf as CommonIdentificationDataIdOneOf, type context_CountReportsByReasonTypesOptions as CountReportsByReasonTypesOptions, type context_CountReportsByReasonTypesRequest as CountReportsByReasonTypesRequest, type context_CountReportsByReasonTypesResponse as CountReportsByReasonTypesResponse, type context_CountReportsByReasonTypesResponseNonNullableFields as CountReportsByReasonTypesResponseNonNullableFields, type context_CreateReportRequest as CreateReportRequest, type context_CreateReportResponse as CreateReportResponse, type context_CreateReportResponseNonNullableFields as CreateReportResponseNonNullableFields, type context_CursorPaging as CursorPaging, type context_CursorPagingMetadata as CursorPagingMetadata, type context_CursorQuery as CursorQuery, type context_CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOf, type context_Cursors as Cursors, type context_DeleteReportRequest as DeleteReportRequest, type context_DeleteReportResponse as DeleteReportResponse, 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_EntityReportSummaryChanged as EntityReportSummaryChanged, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_ExtendedFields as ExtendedFields, type context_GetReportRequest as GetReportRequest, type context_GetReportResponse as GetReportResponse, type context_GetReportResponseNonNullableFields as GetReportResponseNonNullableFields, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, context_IdentityType as IdentityType, type context_MessageEnvelope as MessageEnvelope, type context_QueryReportsRequest as QueryReportsRequest, type context_QueryReportsResponse as QueryReportsResponse, type context_QueryReportsResponseNonNullableFields as QueryReportsResponseNonNullableFields, type context_Reason as Reason, type context_ReasonCount as ReasonCount, type context_ReasonTypeCount as ReasonTypeCount, type context_Report as Report, type context_ReportCreatedEnvelope as ReportCreatedEnvelope, type context_ReportDeletedEnvelope as ReportDeletedEnvelope, type context_ReportEntityReportSummaryChangedEnvelope as ReportEntityReportSummaryChangedEnvelope, type context_ReportNonNullableFields as ReportNonNullableFields, type context_ReportUpdatedEnvelope as ReportUpdatedEnvelope, type context_ReportsQueryBuilder as ReportsQueryBuilder, type context_ReportsQueryResult as ReportsQueryResult, type context_RestoreInfo as RestoreInfo, context_SortOrder as SortOrder, type context_Sorting as Sorting, context_Type as Type, type context_UpdateExtendedFieldsOptions as UpdateExtendedFieldsOptions, type context_UpdateExtendedFieldsRequest as UpdateExtendedFieldsRequest, type context_UpdateExtendedFieldsResponse as UpdateExtendedFieldsResponse, type context_UpdateExtendedFieldsResponseNonNullableFields as UpdateExtendedFieldsResponseNonNullableFields, type context_UpdateReport as UpdateReport, type context_UpdateReportRequest as UpdateReportRequest, type context_UpdateReportResponse as UpdateReportResponse, type context_UpdateReportResponseNonNullableFields as UpdateReportResponseNonNullableFields, type context_UpsertReportIdentifiers as UpsertReportIdentifiers, type context_UpsertReportOptions as UpsertReportOptions, type context_UpsertReportRequest as UpsertReportRequest, type context_UpsertReportResponse as UpsertReportResponse, type context_UpsertReportResponseNonNullableFields as UpsertReportResponseNonNullableFields, context_WebhookIdentityType as WebhookIdentityType, type context__publicOnReportCreatedType as _publicOnReportCreatedType, type context__publicOnReportDeletedType as _publicOnReportDeletedType, type context__publicOnReportEntityReportSummaryChangedType as _publicOnReportEntityReportSummaryChangedType, type context__publicOnReportUpdatedType as _publicOnReportUpdatedType, context_bulkDeleteReportsByFilter as bulkDeleteReportsByFilter, context_countReportsByReasonTypes as countReportsByReasonTypes, context_createReport as createReport, context_deleteReport as deleteReport, context_getReport as getReport, context_onReportCreated as onReportCreated, context_onReportDeleted as onReportDeleted, context_onReportEntityReportSummaryChanged as onReportEntityReportSummaryChanged, context_onReportUpdated as onReportUpdated, onReportCreated$1 as publicOnReportCreated, onReportDeleted$1 as publicOnReportDeleted, onReportEntityReportSummaryChanged$1 as publicOnReportEntityReportSummaryChanged, onReportUpdated$1 as publicOnReportUpdated, context_queryReports as queryReports, context_updateExtendedFields as updateExtendedFields, context_updateReport as updateReport, context_upsertReport as upsertReport };
1353
- }
1354
-
1355
- export { context as reports };