@wix/analytics-session 1.0.19 → 1.0.21

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,852 +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 Session {
480
- /** Session ID. */
481
- _id?: string;
482
- }
483
- /** List sessions async request. */
484
- interface ListSessionsAsyncRequest extends ListSessionsAsyncRequestPeriodOneOf, ListSessionsAsyncRequestParamsOneOf {
485
- /** Custom time period with start & end dates. */
486
- customTimePeriod?: CustomTimePeriod;
487
- /** Predefined time period. */
488
- predefinedTimePeriod?: PredefinedTimePeriod;
489
- /** Navigation flow details. */
490
- navigationFlow?: NavigationFlowSessionsParams;
491
- /** Conversion funnel details. The steps in the journey the visitor has taken on the site. */
492
- conversionFunnel?: ConversionFunnelSessionsParams;
493
- /** Device type. */
494
- deviceType?: SessionsByDeviceParams;
495
- /** User's timezone. Defaults to timezone as set in the [Site Properties API](https://dev.wix.com/docs/rest/business-management/site-properties/properties/properties-object). */
496
- timezone?: string | null;
497
- }
498
- /** @oneof */
499
- interface ListSessionsAsyncRequestPeriodOneOf {
500
- /** Custom time period with start & end dates. */
501
- customTimePeriod?: CustomTimePeriod;
502
- /** Predefined time period. */
503
- predefinedTimePeriod?: PredefinedTimePeriod;
504
- }
505
- /** @oneof */
506
- interface ListSessionsAsyncRequestParamsOneOf {
507
- /** Navigation flow details. */
508
- navigationFlow?: NavigationFlowSessionsParams;
509
- /** Conversion funnel details. The steps in the journey the visitor has taken on the site. */
510
- conversionFunnel?: ConversionFunnelSessionsParams;
511
- /** Device type. */
512
- deviceType?: SessionsByDeviceParams;
513
- }
514
- /** Custom time period. */
515
- interface CustomTimePeriod {
516
- /** Custom period start date in provided timezone. */
517
- startDate?: string;
518
- /**
519
- * Custom period end date in provided timezone. Returned data will include all dates until the requested end date.
520
- * For example, { startDate: '2024-01-01', endDate: '2024-01-03' } will return data for '2024-01-01' and '2024-01-02'
521
- */
522
- endDate?: string;
523
- }
524
- /**
525
- * Predefined time period.
526
- * `THIS_WEEK`begins with Monday.
527
- */
528
- declare enum PredefinedTimePeriod {
529
- /** Today. */
530
- TODAY = "TODAY",
531
- /** Yesterday. */
532
- YESTERDAY = "YESTERDAY",
533
- /** Last 7 days. */
534
- LAST_7_DAYS = "LAST_7_DAYS",
535
- /** Last 14 days. */
536
- LAST_14_DAYS = "LAST_14_DAYS",
537
- /** Last 30 days. */
538
- LAST_30_DAYS = "LAST_30_DAYS",
539
- /** Last 90 days. */
540
- LAST_90_DAYS = "LAST_90_DAYS",
541
- /** Last 28 days. */
542
- LAST_28_DAYS = "LAST_28_DAYS",
543
- /** Last 180 days. */
544
- LAST_180_DAYS = "LAST_180_DAYS",
545
- /** Last 365 days. */
546
- LAST_365_DAYS = "LAST_365_DAYS",
547
- /** Current week, starting on Monday. */
548
- THIS_WEEK = "THIS_WEEK",
549
- /** Current month. */
550
- THIS_MONTH = "THIS_MONTH",
551
- /** Current quarter. */
552
- THIS_QUARTER = "THIS_QUARTER",
553
- /** This year. */
554
- THIS_YEAR = "THIS_YEAR",
555
- /** Last week (previous week). */
556
- LAST_WEEK = "LAST_WEEK",
557
- /** Last month. */
558
- LAST_MONTH = "LAST_MONTH",
559
- /** Last quarter. */
560
- LAST_QUARTER = "LAST_QUARTER",
561
- /** Last year. */
562
- LAST_YEAR = "LAST_YEAR",
563
- /** Last 12 months. */
564
- LAST_12_MONTHS = "LAST_12_MONTHS"
565
- }
566
- /** Navigation flow details. */
567
- interface NavigationFlowSessionsParams {
568
- /**
569
- * Page interactions, including where the user dropped off. For example:
570
- * - ["/{Homepage}", "__DROP__"]: Sessions where a user visited the site's homepage and then dropped off.
571
- * - ["", "__DROP__"]: Sessions where a user visited (any page) and then dropped off.
572
- * - ["", "", "__DROP__"]: Session where a user visited any page, then navigated to any page, and then dropped off.
573
- */
574
- pageInteractions?: string[] | null;
575
- }
576
- /** Conversion funnel details, meaning the steps in the journey the visitor has taken on the site. */
577
- interface ConversionFunnelSessionsParams {
578
- /** Funnel step to include. */
579
- include?: FunnelStep;
580
- /** Funnel step to exclude. */
581
- exclude?: FunnelStep;
582
- }
583
- /** Funnel step. */
584
- declare enum FunnelStep {
585
- /** Not selected. */
586
- NOT_SELECTED_FUNNEL_STEP = "NOT_SELECTED_FUNNEL_STEP",
587
- /** Site sessions. */
588
- SITE_SESSIONS = "SITE_SESSIONS",
589
- /** Viewed product. */
590
- VIEWED_PRODUCT = "VIEWED_PRODUCT",
591
- /** Added to cart. */
592
- ADDED_TO_CART = "ADDED_TO_CART",
593
- /** Reached checkout. */
594
- REACHED_CHECKOUT = "REACHED_CHECKOUT",
595
- /** Sessions converted. */
596
- SESSIONS_CONVERTED = "SESSIONS_CONVERTED"
597
- }
598
- /** Device details. */
599
- interface SessionsByDeviceParams {
600
- /** Device type. */
601
- type?: DeviceType;
602
- }
603
- /** Device type. */
604
- declare enum DeviceType {
605
- /** Not selected. */
606
- NOT_SELECTED_DEVICE_TYPE = "NOT_SELECTED_DEVICE_TYPE",
607
- /** Desktop. */
608
- DESKTOP = "DESKTOP",
609
- /** Mobile. */
610
- MOBILE = "MOBILE",
611
- /** Tablet. */
612
- TABLET = "TABLET",
613
- /** All. */
614
- ALL = "ALL"
615
- }
616
- /** List sessions async response. */
617
- interface ListSessionsAsyncResponse {
618
- /**
619
- * List sessions job ID.
620
- * Pass this ID to Get List Sessions Job Result to retrieve job details and metadata.
621
- */
622
- jobId?: string;
623
- }
624
- /** Get list sessions job result request. */
625
- interface GetListSessionsJobResultRequest {
626
- /** List sessions job ID. */
627
- jobId: string;
628
- /** Number of items to load. */
629
- limit: number;
630
- /** Number of items to skip in the current sort order. */
631
- offset: number;
632
- }
633
- /** Get list sessions job result response. */
634
- interface GetListSessionsJobResultResponse {
635
- /** List sessions job result data. */
636
- result?: JobResult;
637
- }
638
- /** List sessions job result. */
639
- interface JobResult {
640
- /** Job status. */
641
- jobStatus?: JobStatus;
642
- /** Total number of sessions. */
643
- total?: number | null;
644
- /** Session IDs. */
645
- sessionIds?: string[];
646
- }
647
- /** Job status. */
648
- declare enum JobStatus {
649
- /** Unknown. */
650
- UNKNOWN_JOB_STATUS = "UNKNOWN_JOB_STATUS",
651
- /** In progress. */
652
- IN_PROGRESS = "IN_PROGRESS",
653
- /** Finished. */
654
- FINISHED = "FINISHED",
655
- /** Error. */
656
- ERROR = "ERROR"
657
- }
658
- /** Request for getting store conversion sessions. */
659
- interface CountFunnelSessionsRequest extends CountFunnelSessionsRequestPeriodOneOf {
660
- /** Custom time period with start & end dates. */
661
- customTimePeriod?: CustomTimePeriod;
662
- /** Predefined time period. */
663
- predefinedTimePeriod?: PredefinedTimePeriod;
664
- /** User timezone. If not provided it will be taken from site properties. */
665
- timezone?: string | null;
666
- }
667
- /** @oneof */
668
- interface CountFunnelSessionsRequestPeriodOneOf {
669
- /** Custom time period with start & end dates. */
670
- customTimePeriod?: CustomTimePeriod;
671
- /** Predefined time period. */
672
- predefinedTimePeriod?: PredefinedTimePeriod;
673
- }
674
- /** Response for getting store conversion sessions. */
675
- interface CountFunnelSessionsResponse {
676
- /** Recordings. */
677
- recordings?: Recordings;
678
- }
679
- /** Recordings. */
680
- interface Recordings {
681
- /** Saved Session count. */
682
- siteSessions?: number | null;
683
- /** Saved Sessions with Product Views */
684
- productViewSessions?: number | null;
685
- /** Saved Sessions with Cart Views */
686
- cartViewSessions?: number | null;
687
- /** Saved Sessions with Checkouts */
688
- checkoutSessions?: number | null;
689
- /** Saved Converted Sessions */
690
- convertedSessions?: number | null;
691
- }
692
- /** Request for getting the total number of sessions. */
693
- interface CountSessionsRequest extends CountSessionsRequestPeriodOneOf {
694
- /** Custom time period with start & end dates. */
695
- customTimePeriod?: CustomTimePeriod;
696
- /** Predefined time period. */
697
- predefinedTimePeriod?: PredefinedTimePeriod;
698
- /** User timezone. If not provided it will be taken from site properties. */
699
- timezone?: string | null;
700
- }
701
- /** @oneof */
702
- interface CountSessionsRequestPeriodOneOf {
703
- /** Custom time period with start & end dates. */
704
- customTimePeriod?: CustomTimePeriod;
705
- /** Predefined time period. */
706
- predefinedTimePeriod?: PredefinedTimePeriod;
707
- }
708
- /** Response for getting the total number of sessions. */
709
- interface CountSessionsResponse {
710
- /** Total number of sessions. */
711
- sessions?: number;
712
- }
713
- /** Mark a browser session as recorded. */
714
- interface MarkSessionAsRecordedRequest {
715
- /** Browser session ID. */
716
- sessionId: string;
717
- }
718
- /** Mark a browser session as recorded. */
719
- interface MarkSessionAsRecordedResponse {
720
- }
721
- /** Marks browser session recordings as deleted. */
722
- interface MarkRecordingsAsDeletedRequest {
723
- /** Browser session IDs. */
724
- sessionIds: string[];
725
- }
726
- /** Marks browser session recordings as deleted. */
727
- interface MarkRecordingsAsDeletedResponse {
728
- }
729
- interface ListSessionsAsyncResponseNonNullableFields {
730
- jobId: string;
731
- }
732
- interface JobResultNonNullableFields {
733
- jobStatus: JobStatus;
734
- sessionIds: string[];
735
- }
736
- interface GetListSessionsJobResultResponseNonNullableFields {
737
- result?: JobResultNonNullableFields;
738
- }
739
- interface ListSessionsAsyncOptions extends ListSessionsAsyncRequestPeriodOneOf, ListSessionsAsyncRequestParamsOneOf {
740
- /** Custom time period with start & end dates. */
741
- customTimePeriod?: CustomTimePeriod;
742
- /** Predefined time period. */
743
- predefinedTimePeriod?: PredefinedTimePeriod;
744
- /** User's timezone. Defaults to timezone as set in the [Site Properties API](https://dev.wix.com/docs/rest/business-management/site-properties/properties/properties-object). */
745
- timezone?: string | null;
746
- /** Navigation flow details. */
747
- navigationFlow?: NavigationFlowSessionsParams;
748
- /** Conversion funnel details. The steps in the journey the visitor has taken on the site. */
749
- conversionFunnel?: ConversionFunnelSessionsParams;
750
- /** Device type. */
751
- deviceType?: SessionsByDeviceParams;
752
- }
753
- interface GetListSessionsJobResultOptions {
754
- /** Number of items to load. */
755
- limit: number;
756
- /** Number of items to skip in the current sort order. */
757
- offset: number;
758
- }
759
-
760
- declare function listSessionsAsync$1(httpClient: HttpClient): ListSessionsAsyncSignature;
761
- interface ListSessionsAsyncSignature {
762
- /**
763
- * Start an async job to retrieve a list of session IDs, given the specified filters. The following filters **must** be passed:
764
- * - Time period, either predefined or custom.
765
- * - Session filter, either navigation flow (page interactions), conversion funnel steps, or device type.
766
- * @param - Filter options. The following filters **must** be passed:
767
- *
768
- * - Time period, either predefined or custom.
769
- *
770
- * - Session filter, either navigation flow (page interactions), conversion funnel steps, or device type.
771
- * @returns List sessions async response.
772
- */
773
- (options?: ListSessionsAsyncOptions | undefined): Promise<ListSessionsAsyncResponse & ListSessionsAsyncResponseNonNullableFields>;
774
- }
775
- declare function getListSessionsJobResult$1(httpClient: HttpClient): GetListSessionsJobResultSignature;
776
- interface GetListSessionsJobResultSignature {
777
- /**
778
- * Retrieves the job status and a list of session IDs, if ready.
779
- * @param - List sessions job ID.
780
- * @param - Field options. The `limit` and `offset` filters **must** be passed.
781
- * @returns Get list sessions job result response.
782
- */
783
- (jobId: string, options: GetListSessionsJobResultOptions): Promise<GetListSessionsJobResultResponse & GetListSessionsJobResultResponseNonNullableFields>;
784
- }
785
- declare function markSessionAsRecorded$1(httpClient: HttpClient): MarkSessionAsRecordedSignature;
786
- interface MarkSessionAsRecordedSignature {
787
- /**
788
- * Marks a browser session as recorded.
789
- * @param - Browser session ID.
790
- * @returns Mark a browser session as recorded.
791
- */
792
- (sessionId: string): Promise<void>;
793
- }
794
- declare function markRecordingsAsDeleted$1(httpClient: HttpClient): MarkRecordingsAsDeletedSignature;
795
- interface MarkRecordingsAsDeletedSignature {
796
- /**
797
- * Marks browser session recordings as deleted.
798
- * @param - Browser session IDs.
799
- * @returns Marks browser session recordings as deleted.
800
- */
801
- (sessionIds: string[]): Promise<void>;
802
- }
803
-
804
- declare const listSessionsAsync: MaybeContext<BuildRESTFunction<typeof listSessionsAsync$1> & typeof listSessionsAsync$1>;
805
- declare const getListSessionsJobResult: MaybeContext<BuildRESTFunction<typeof getListSessionsJobResult$1> & typeof getListSessionsJobResult$1>;
806
- declare const markSessionAsRecorded: MaybeContext<BuildRESTFunction<typeof markSessionAsRecorded$1> & typeof markSessionAsRecorded$1>;
807
- declare const markRecordingsAsDeleted: MaybeContext<BuildRESTFunction<typeof markRecordingsAsDeleted$1> & typeof markRecordingsAsDeleted$1>;
808
-
809
- type context_ConversionFunnelSessionsParams = ConversionFunnelSessionsParams;
810
- type context_CountFunnelSessionsRequest = CountFunnelSessionsRequest;
811
- type context_CountFunnelSessionsRequestPeriodOneOf = CountFunnelSessionsRequestPeriodOneOf;
812
- type context_CountFunnelSessionsResponse = CountFunnelSessionsResponse;
813
- type context_CountSessionsRequest = CountSessionsRequest;
814
- type context_CountSessionsRequestPeriodOneOf = CountSessionsRequestPeriodOneOf;
815
- type context_CountSessionsResponse = CountSessionsResponse;
816
- type context_CustomTimePeriod = CustomTimePeriod;
817
- type context_DeviceType = DeviceType;
818
- declare const context_DeviceType: typeof DeviceType;
819
- type context_FunnelStep = FunnelStep;
820
- declare const context_FunnelStep: typeof FunnelStep;
821
- type context_GetListSessionsJobResultOptions = GetListSessionsJobResultOptions;
822
- type context_GetListSessionsJobResultRequest = GetListSessionsJobResultRequest;
823
- type context_GetListSessionsJobResultResponse = GetListSessionsJobResultResponse;
824
- type context_GetListSessionsJobResultResponseNonNullableFields = GetListSessionsJobResultResponseNonNullableFields;
825
- type context_JobResult = JobResult;
826
- type context_JobStatus = JobStatus;
827
- declare const context_JobStatus: typeof JobStatus;
828
- type context_ListSessionsAsyncOptions = ListSessionsAsyncOptions;
829
- type context_ListSessionsAsyncRequest = ListSessionsAsyncRequest;
830
- type context_ListSessionsAsyncRequestParamsOneOf = ListSessionsAsyncRequestParamsOneOf;
831
- type context_ListSessionsAsyncRequestPeriodOneOf = ListSessionsAsyncRequestPeriodOneOf;
832
- type context_ListSessionsAsyncResponse = ListSessionsAsyncResponse;
833
- type context_ListSessionsAsyncResponseNonNullableFields = ListSessionsAsyncResponseNonNullableFields;
834
- type context_MarkRecordingsAsDeletedRequest = MarkRecordingsAsDeletedRequest;
835
- type context_MarkRecordingsAsDeletedResponse = MarkRecordingsAsDeletedResponse;
836
- type context_MarkSessionAsRecordedRequest = MarkSessionAsRecordedRequest;
837
- type context_MarkSessionAsRecordedResponse = MarkSessionAsRecordedResponse;
838
- type context_NavigationFlowSessionsParams = NavigationFlowSessionsParams;
839
- type context_PredefinedTimePeriod = PredefinedTimePeriod;
840
- declare const context_PredefinedTimePeriod: typeof PredefinedTimePeriod;
841
- type context_Recordings = Recordings;
842
- type context_Session = Session;
843
- type context_SessionsByDeviceParams = SessionsByDeviceParams;
844
- declare const context_getListSessionsJobResult: typeof getListSessionsJobResult;
845
- declare const context_listSessionsAsync: typeof listSessionsAsync;
846
- declare const context_markRecordingsAsDeleted: typeof markRecordingsAsDeleted;
847
- declare const context_markSessionAsRecorded: typeof markSessionAsRecorded;
848
- declare namespace context {
849
- export { type context_ConversionFunnelSessionsParams as ConversionFunnelSessionsParams, type context_CountFunnelSessionsRequest as CountFunnelSessionsRequest, type context_CountFunnelSessionsRequestPeriodOneOf as CountFunnelSessionsRequestPeriodOneOf, type context_CountFunnelSessionsResponse as CountFunnelSessionsResponse, type context_CountSessionsRequest as CountSessionsRequest, type context_CountSessionsRequestPeriodOneOf as CountSessionsRequestPeriodOneOf, type context_CountSessionsResponse as CountSessionsResponse, type context_CustomTimePeriod as CustomTimePeriod, context_DeviceType as DeviceType, context_FunnelStep as FunnelStep, type context_GetListSessionsJobResultOptions as GetListSessionsJobResultOptions, type context_GetListSessionsJobResultRequest as GetListSessionsJobResultRequest, type context_GetListSessionsJobResultResponse as GetListSessionsJobResultResponse, type context_GetListSessionsJobResultResponseNonNullableFields as GetListSessionsJobResultResponseNonNullableFields, type context_JobResult as JobResult, context_JobStatus as JobStatus, type context_ListSessionsAsyncOptions as ListSessionsAsyncOptions, type context_ListSessionsAsyncRequest as ListSessionsAsyncRequest, type context_ListSessionsAsyncRequestParamsOneOf as ListSessionsAsyncRequestParamsOneOf, type context_ListSessionsAsyncRequestPeriodOneOf as ListSessionsAsyncRequestPeriodOneOf, type context_ListSessionsAsyncResponse as ListSessionsAsyncResponse, type context_ListSessionsAsyncResponseNonNullableFields as ListSessionsAsyncResponseNonNullableFields, type context_MarkRecordingsAsDeletedRequest as MarkRecordingsAsDeletedRequest, type context_MarkRecordingsAsDeletedResponse as MarkRecordingsAsDeletedResponse, type context_MarkSessionAsRecordedRequest as MarkSessionAsRecordedRequest, type context_MarkSessionAsRecordedResponse as MarkSessionAsRecordedResponse, type context_NavigationFlowSessionsParams as NavigationFlowSessionsParams, context_PredefinedTimePeriod as PredefinedTimePeriod, type context_Recordings as Recordings, type context_Session as Session, type context_SessionsByDeviceParams as SessionsByDeviceParams, context_getListSessionsJobResult as getListSessionsJobResult, context_listSessionsAsync as listSessionsAsync, context_markRecordingsAsDeleted as markRecordingsAsDeleted, context_markSessionAsRecorded as markSessionAsRecorded };
850
- }
851
-
852
- export { context as analyticsSession };