@wix/analytics-session 1.0.1 → 1.0.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/analytics-session",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -18,7 +18,7 @@
18
18
  "type-bundles"
19
19
  ],
20
20
  "dependencies": {
21
- "@wix/analytics-session_analytics-session": "1.0.1"
21
+ "@wix/analytics-session_analytics-session": "1.0.2"
22
22
  },
23
23
  "devDependencies": {
24
24
  "glob": "^10.4.1",
@@ -42,5 +42,5 @@
42
42
  "fqdn": ""
43
43
  }
44
44
  },
45
- "falconPackageHash": "fdd8fda44cc097c8cebc62bf5a160fd5413b4d5e71be294e87bacf4f"
45
+ "falconPackageHash": "789b07d700179eb99b7101cd0e9649e6d3b771e8be52efe577035d7e"
46
46
  }
@@ -1,3 +1,340 @@
1
+ interface Session {
2
+ /** Session ID. */
3
+ _id?: string;
4
+ }
5
+ /** List sessions async request. */
6
+ interface ListSessionsAsyncRequest extends ListSessionsAsyncRequestPeriodOneOf, ListSessionsAsyncRequestParamsOneOf {
7
+ /** Custom time period with start & end dates. */
8
+ customTimePeriod?: CustomTimePeriod;
9
+ /** Predefined time period. */
10
+ predefinedTimePeriod?: PredefinedTimePeriod;
11
+ /** Navigation flow details. */
12
+ navigationFlow?: NavigationFlowSessionsParams;
13
+ /** Conversion funnel details. The steps in the journey the visitor has taken on the site. */
14
+ conversionFunnel?: ConversionFunnelSessionsParams;
15
+ /** Device type. */
16
+ deviceType?: SessionsByDeviceParams;
17
+ /** 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). */
18
+ timezone?: string | null;
19
+ }
20
+ /** @oneof */
21
+ interface ListSessionsAsyncRequestPeriodOneOf {
22
+ /** Custom time period with start & end dates. */
23
+ customTimePeriod?: CustomTimePeriod;
24
+ /** Predefined time period. */
25
+ predefinedTimePeriod?: PredefinedTimePeriod;
26
+ }
27
+ /** @oneof */
28
+ interface ListSessionsAsyncRequestParamsOneOf {
29
+ /** Navigation flow details. */
30
+ navigationFlow?: NavigationFlowSessionsParams;
31
+ /** Conversion funnel details. The steps in the journey the visitor has taken on the site. */
32
+ conversionFunnel?: ConversionFunnelSessionsParams;
33
+ /** Device type. */
34
+ deviceType?: SessionsByDeviceParams;
35
+ }
36
+ /** Custom time period. */
37
+ interface CustomTimePeriod {
38
+ /** Custom period start date in provided timezone. */
39
+ startDate?: string;
40
+ /**
41
+ * Custom period end date in provided timezone. Returned data will include all dates until the requested end date.
42
+ * For example, { startDate: '2024-01-01', endDate: '2024-01-03' } will return data for '2024-01-01' and '2024-01-02'
43
+ */
44
+ endDate?: string;
45
+ }
46
+ /**
47
+ * Predefined time period.
48
+ * `THIS_WEEK`begins with Monday.
49
+ */
50
+ declare enum PredefinedTimePeriod {
51
+ /** Today. */
52
+ TODAY = "TODAY",
53
+ /** Yesterday. */
54
+ YESTERDAY = "YESTERDAY",
55
+ /** Last 7 days. */
56
+ LAST_7_DAYS = "LAST_7_DAYS",
57
+ /** Last 14 days. */
58
+ LAST_14_DAYS = "LAST_14_DAYS",
59
+ /** Last 30 days. */
60
+ LAST_30_DAYS = "LAST_30_DAYS",
61
+ /** Last 90 days. */
62
+ LAST_90_DAYS = "LAST_90_DAYS",
63
+ /** Last 28 days. */
64
+ LAST_28_DAYS = "LAST_28_DAYS",
65
+ /** Last 180 days. */
66
+ LAST_180_DAYS = "LAST_180_DAYS",
67
+ /** Last 365 days. */
68
+ LAST_365_DAYS = "LAST_365_DAYS",
69
+ /** Current week, starting on Monday. */
70
+ THIS_WEEK = "THIS_WEEK",
71
+ /** Current month. */
72
+ THIS_MONTH = "THIS_MONTH",
73
+ /** Current quarter. */
74
+ THIS_QUARTER = "THIS_QUARTER",
75
+ /** This year. */
76
+ THIS_YEAR = "THIS_YEAR",
77
+ /** Last week (previous week). */
78
+ LAST_WEEK = "LAST_WEEK",
79
+ /** Last month. */
80
+ LAST_MONTH = "LAST_MONTH",
81
+ /** Last quarter. */
82
+ LAST_QUARTER = "LAST_QUARTER",
83
+ /** Last year. */
84
+ LAST_YEAR = "LAST_YEAR",
85
+ /** Last 12 months. */
86
+ LAST_12_MONTHS = "LAST_12_MONTHS"
87
+ }
88
+ /** Navigation flow details. */
89
+ interface NavigationFlowSessionsParams {
90
+ /**
91
+ * Page interactions, including where the user dropped off. For example:
92
+ * - ["/{Homepage}", "__DROP__"]: Sessions where a user visited the site's homepage and then dropped off.
93
+ * - ["", "__DROP__"]: Sessions where a user visited (any page) and then dropped off.
94
+ * - ["", "", "__DROP__"]: Session where a user visited any page, then navigated to any page, and then dropped off.
95
+ */
96
+ pageInteractions?: string[] | null;
97
+ }
98
+ /** Conversion funnel details, meaning the steps in the journey the visitor has taken on the site. */
99
+ interface ConversionFunnelSessionsParams {
100
+ /** Funnel step to include. */
101
+ include?: FunnelStep;
102
+ /** Funnel step to exclude. */
103
+ exclude?: FunnelStep;
104
+ }
105
+ /** Funnel step. */
106
+ declare enum FunnelStep {
107
+ /** Not selected. */
108
+ NOT_SELECTED_FUNNEL_STEP = "NOT_SELECTED_FUNNEL_STEP",
109
+ /** Site sessions. */
110
+ SITE_SESSIONS = "SITE_SESSIONS",
111
+ /** Viewed product. */
112
+ VIEWED_PRODUCT = "VIEWED_PRODUCT",
113
+ /** Added to cart. */
114
+ ADDED_TO_CART = "ADDED_TO_CART",
115
+ /** Reached checkout. */
116
+ REACHED_CHECKOUT = "REACHED_CHECKOUT",
117
+ /** Sessions converted. */
118
+ SESSIONS_CONVERTED = "SESSIONS_CONVERTED"
119
+ }
120
+ /** Device details. */
121
+ interface SessionsByDeviceParams {
122
+ /** Device type. */
123
+ type?: DeviceType;
124
+ }
125
+ /** Device type. */
126
+ declare enum DeviceType {
127
+ /** Not selected. */
128
+ NOT_SELECTED_DEVICE_TYPE = "NOT_SELECTED_DEVICE_TYPE",
129
+ /** Desktop. */
130
+ DESKTOP = "DESKTOP",
131
+ /** Mobile. */
132
+ MOBILE = "MOBILE",
133
+ /** Tablet. */
134
+ TABLET = "TABLET"
135
+ }
136
+ /** List sessions async response. */
137
+ interface ListSessionsAsyncResponse {
138
+ /** List sessions job ID. */
139
+ jobId?: string;
140
+ }
141
+ /** Get list sessions job result request. */
142
+ interface GetListSessionsJobResultRequest {
143
+ /** List sessions job ID. */
144
+ jobId?: string;
145
+ /** Number of items to load. */
146
+ limit?: number;
147
+ /** Number of items to skip in the current sort order. */
148
+ offset?: number;
149
+ }
150
+ /** Get list sessions job result response. */
151
+ interface GetListSessionsJobResultResponse {
152
+ /** List sessions job result data. */
153
+ result?: JobResult;
154
+ }
155
+ /** List sessions job result. */
156
+ interface JobResult {
157
+ /** Job status. */
158
+ jobStatus?: JobStatus;
159
+ /** Total number of sessions. */
160
+ total?: number | null;
161
+ /** Session IDs. */
162
+ sessionIds?: string[];
163
+ }
164
+ /** Job status. */
165
+ declare enum JobStatus {
166
+ /** Unknown. */
167
+ UNKNOWN_JOB_STATUS = "UNKNOWN_JOB_STATUS",
168
+ /** In progress. */
169
+ IN_PROGRESS = "IN_PROGRESS",
170
+ /** Finished. */
171
+ FINISHED = "FINISHED",
172
+ /** Error. */
173
+ ERROR = "ERROR"
174
+ }
175
+ /** Request for getting store conversion sessions. */
176
+ interface CountFunnelSessionsRequest extends CountFunnelSessionsRequestPeriodOneOf {
177
+ /** Custom time period with start & end dates. */
178
+ customPeriod?: CustomPeriod;
179
+ /** Predefined time period. */
180
+ predefinedPeriod?: PredefinedPeriod;
181
+ /** User timezone. If not provided it will be taken from site properties. */
182
+ timezone?: string | null;
183
+ }
184
+ /** @oneof */
185
+ interface CountFunnelSessionsRequestPeriodOneOf {
186
+ /** Custom time period with start & end dates. */
187
+ customPeriod?: CustomPeriod;
188
+ /** Predefined time period. */
189
+ predefinedPeriod?: PredefinedPeriod;
190
+ }
191
+ /** Custom period. Doesn't have comparison period, so use with SELECTED_PERIOD. */
192
+ interface CustomPeriod {
193
+ /** Custom period start date in provided timezone. By default in UTC. */
194
+ start?: string;
195
+ /** Custom period end date in provided timezone. By default in UTC. */
196
+ end?: string;
197
+ }
198
+ /** Predefined period. Could be used with comparison period. */
199
+ interface PredefinedPeriod {
200
+ /** Predefined period type. */
201
+ period?: PredefinedPeriodEnum;
202
+ }
203
+ /** Query period. */
204
+ declare enum PredefinedPeriodEnum {
205
+ /** Today. */
206
+ TODAY = "TODAY",
207
+ /** Yesterday. */
208
+ YESTERDAY = "YESTERDAY",
209
+ /** Last 7 days. */
210
+ LAST_7_DAYS = "LAST_7_DAYS",
211
+ /** Lat 14 days. */
212
+ LAST_14_DAYS = "LAST_14_DAYS",
213
+ /** Last 30 days. */
214
+ LAST_30_DAYS = "LAST_30_DAYS",
215
+ /** Last 90 days. */
216
+ LAST_90_DAYS = "LAST_90_DAYS",
217
+ /** Last 28 days. */
218
+ LAST_28_DAYS = "LAST_28_DAYS",
219
+ /** Last 180 days. */
220
+ LAST_180_DAYS = "LAST_180_DAYS",
221
+ /** Last 365 days. */
222
+ LAST_365_DAYS = "LAST_365_DAYS",
223
+ /** Current week. Week start is Monday. */
224
+ THIS_WEEK = "THIS_WEEK",
225
+ /** Current month. */
226
+ THIS_MONTH = "THIS_MONTH",
227
+ /** Current quater. */
228
+ THIS_QUATER = "THIS_QUATER",
229
+ /** This year. */
230
+ THIS_YEAR = "THIS_YEAR",
231
+ /** Last week (previous week). */
232
+ LAST_WEEK = "LAST_WEEK",
233
+ /** Last month. */
234
+ LAST_MONTH = "LAST_MONTH",
235
+ /** Last quater. */
236
+ LAST_QUATER = "LAST_QUATER",
237
+ /** Last year. */
238
+ LAST_YEAR = "LAST_YEAR",
239
+ /** Last 7 days up until yesterday. */
240
+ LAST_7_DAYS_BEFORE_TODAY = "LAST_7_DAYS_BEFORE_TODAY",
241
+ /** Lat 14 days up until yesterday. */
242
+ LAST_14_DAYS_BEFORE_TODAY = "LAST_14_DAYS_BEFORE_TODAY",
243
+ /** Last 30 days up until yesterday. */
244
+ LAST_30_DAYS_BEFORE_TODAY = "LAST_30_DAYS_BEFORE_TODAY",
245
+ /** Last 90 days up until yesterday. */
246
+ LAST_90_DAYS_BEFORE_TODAY = "LAST_90_DAYS_BEFORE_TODAY",
247
+ /** Last 28 days up until yesterday. */
248
+ LAST_28_DAYS_BEFORE_TODAY = "LAST_28_DAYS_BEFORE_TODAY",
249
+ /** Last 180 days up until yesterday. */
250
+ LAST_180_DAYS_BEFORE_TODAY = "LAST_180_DAYS_BEFORE_TODAY",
251
+ /** Last 365 days up until yesterday. */
252
+ LAST_365_DAYS_BEFORE_TODAY = "LAST_365_DAYS_BEFORE_TODAY",
253
+ /** Last 12 months. */
254
+ LAST_12_MONTHS = "LAST_12_MONTHS"
255
+ }
256
+ /** Response for getting store conversion sessions. */
257
+ interface CountFunnelSessionsResponse {
258
+ recordings?: Recordings;
259
+ }
260
+ interface Recordings {
261
+ /** Saved Session count. */
262
+ siteSessions?: number | null;
263
+ /** Saved Sessions with Product Views */
264
+ productViewSessions?: number | null;
265
+ /** Saved Sessions with Cart Views */
266
+ cartViewSessions?: number | null;
267
+ /** Saved Sessions with Checkouts */
268
+ checkoutSessions?: number | null;
269
+ /** Saved Converted Sessions */
270
+ convertedSessions?: number | null;
271
+ }
272
+ /** Request for getting the total number of sessions. */
273
+ interface CountSessionsRequest extends CountSessionsRequestPeriodOneOf {
274
+ /** Custom time period with start & end dates. */
275
+ customPeriod?: CustomPeriod;
276
+ /** Predefined time period. */
277
+ predefinedPeriod?: PredefinedPeriod;
278
+ /** User timezone. If not provided it will be taken from site properties. */
279
+ timezone?: string | null;
280
+ }
281
+ /** @oneof */
282
+ interface CountSessionsRequestPeriodOneOf {
283
+ /** Custom time period with start & end dates. */
284
+ customPeriod?: CustomPeriod;
285
+ /** Predefined time period. */
286
+ predefinedPeriod?: PredefinedPeriod;
287
+ }
288
+ /** Response for getting the total number of sessions. */
289
+ interface CountSessionsResponse {
290
+ /** Total number of sessions. */
291
+ sessions?: number;
292
+ }
293
+ /** Mark a browser session as recorded. */
294
+ interface MarkSessionAsRecordedRequest {
295
+ /** Browser session ID. */
296
+ sessionId?: string;
297
+ }
298
+ /** Mark a browser session as recorded. */
299
+ interface MarkSessionAsRecordedResponse {
300
+ }
301
+ interface ListSessionsAsyncResponseNonNullableFields {
302
+ jobId: string;
303
+ }
304
+ interface JobResultNonNullableFields {
305
+ jobStatus: JobStatus;
306
+ sessionIds: string[];
307
+ }
308
+ interface GetListSessionsJobResultResponseNonNullableFields {
309
+ result?: JobResultNonNullableFields;
310
+ }
311
+ interface ListSessionsAsyncOptions extends ListSessionsAsyncRequestPeriodOneOf, ListSessionsAsyncRequestParamsOneOf {
312
+ /** Custom time period with start & end dates. */
313
+ customTimePeriod?: CustomTimePeriod;
314
+ /** Predefined time period. */
315
+ predefinedTimePeriod?: PredefinedTimePeriod;
316
+ /** 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). */
317
+ timezone?: string | null;
318
+ /** Navigation flow details. */
319
+ navigationFlow?: NavigationFlowSessionsParams;
320
+ /** Conversion funnel details. The steps in the journey the visitor has taken on the site. */
321
+ conversionFunnel?: ConversionFunnelSessionsParams;
322
+ /** Device type. */
323
+ deviceType?: SessionsByDeviceParams;
324
+ }
325
+ interface GetListSessionsJobResultOptions {
326
+ /** List sessions job ID. */
327
+ jobId?: string;
328
+ /** Number of items to load. */
329
+ limit?: number;
330
+ /** Number of items to skip in the current sort order. */
331
+ offset?: number;
332
+ }
333
+ interface MarkSessionAsRecordedOptions {
334
+ /** Browser session ID. */
335
+ sessionId?: string;
336
+ }
337
+
1
338
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
2
339
  interface HttpClient {
3
340
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
@@ -38,11 +375,49 @@ declare const listSessionsAsync: ReturnType<typeof createRESTModule<typeof publi
38
375
  declare const getListSessionsJobResult: ReturnType<typeof createRESTModule<typeof publicGetListSessionsJobResult>>;
39
376
  declare const markSessionAsRecorded: ReturnType<typeof createRESTModule<typeof publicMarkSessionAsRecorded>>;
40
377
 
378
+ type context_ConversionFunnelSessionsParams = ConversionFunnelSessionsParams;
379
+ type context_CountFunnelSessionsRequest = CountFunnelSessionsRequest;
380
+ type context_CountFunnelSessionsRequestPeriodOneOf = CountFunnelSessionsRequestPeriodOneOf;
381
+ type context_CountFunnelSessionsResponse = CountFunnelSessionsResponse;
382
+ type context_CountSessionsRequest = CountSessionsRequest;
383
+ type context_CountSessionsRequestPeriodOneOf = CountSessionsRequestPeriodOneOf;
384
+ type context_CountSessionsResponse = CountSessionsResponse;
385
+ type context_CustomPeriod = CustomPeriod;
386
+ type context_CustomTimePeriod = CustomTimePeriod;
387
+ type context_DeviceType = DeviceType;
388
+ declare const context_DeviceType: typeof DeviceType;
389
+ type context_FunnelStep = FunnelStep;
390
+ declare const context_FunnelStep: typeof FunnelStep;
391
+ type context_GetListSessionsJobResultOptions = GetListSessionsJobResultOptions;
392
+ type context_GetListSessionsJobResultRequest = GetListSessionsJobResultRequest;
393
+ type context_GetListSessionsJobResultResponse = GetListSessionsJobResultResponse;
394
+ type context_GetListSessionsJobResultResponseNonNullableFields = GetListSessionsJobResultResponseNonNullableFields;
395
+ type context_JobResult = JobResult;
396
+ type context_JobStatus = JobStatus;
397
+ declare const context_JobStatus: typeof JobStatus;
398
+ type context_ListSessionsAsyncOptions = ListSessionsAsyncOptions;
399
+ type context_ListSessionsAsyncRequest = ListSessionsAsyncRequest;
400
+ type context_ListSessionsAsyncRequestParamsOneOf = ListSessionsAsyncRequestParamsOneOf;
401
+ type context_ListSessionsAsyncRequestPeriodOneOf = ListSessionsAsyncRequestPeriodOneOf;
402
+ type context_ListSessionsAsyncResponse = ListSessionsAsyncResponse;
403
+ type context_ListSessionsAsyncResponseNonNullableFields = ListSessionsAsyncResponseNonNullableFields;
404
+ type context_MarkSessionAsRecordedOptions = MarkSessionAsRecordedOptions;
405
+ type context_MarkSessionAsRecordedRequest = MarkSessionAsRecordedRequest;
406
+ type context_MarkSessionAsRecordedResponse = MarkSessionAsRecordedResponse;
407
+ type context_NavigationFlowSessionsParams = NavigationFlowSessionsParams;
408
+ type context_PredefinedPeriod = PredefinedPeriod;
409
+ type context_PredefinedPeriodEnum = PredefinedPeriodEnum;
410
+ declare const context_PredefinedPeriodEnum: typeof PredefinedPeriodEnum;
411
+ type context_PredefinedTimePeriod = PredefinedTimePeriod;
412
+ declare const context_PredefinedTimePeriod: typeof PredefinedTimePeriod;
413
+ type context_Recordings = Recordings;
414
+ type context_Session = Session;
415
+ type context_SessionsByDeviceParams = SessionsByDeviceParams;
41
416
  declare const context_getListSessionsJobResult: typeof getListSessionsJobResult;
42
417
  declare const context_listSessionsAsync: typeof listSessionsAsync;
43
418
  declare const context_markSessionAsRecorded: typeof markSessionAsRecorded;
44
419
  declare namespace context {
45
- export { context_getListSessionsJobResult as getListSessionsJobResult, context_listSessionsAsync as listSessionsAsync, context_markSessionAsRecorded as markSessionAsRecorded };
420
+ 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_CustomPeriod as CustomPeriod, 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_MarkSessionAsRecordedOptions as MarkSessionAsRecordedOptions, type context_MarkSessionAsRecordedRequest as MarkSessionAsRecordedRequest, type context_MarkSessionAsRecordedResponse as MarkSessionAsRecordedResponse, type context_NavigationFlowSessionsParams as NavigationFlowSessionsParams, type context_PredefinedPeriod as PredefinedPeriod, context_PredefinedPeriodEnum as PredefinedPeriodEnum, 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_markSessionAsRecorded as markSessionAsRecorded };
46
421
  }
47
422
 
48
423
  export { context as analyticsSession };
@@ -301,11 +301,12 @@ interface MarkSessionAsRecordedResponse {
301
301
  interface ListSessionsAsyncResponseNonNullableFields {
302
302
  jobId: string;
303
303
  }
304
+ interface JobResultNonNullableFields {
305
+ jobStatus: JobStatus;
306
+ sessionIds: string[];
307
+ }
304
308
  interface GetListSessionsJobResultResponseNonNullableFields {
305
- result?: {
306
- jobStatus: JobStatus;
307
- sessionIds: string[];
308
- };
309
+ result?: JobResultNonNullableFields;
309
310
  }
310
311
  interface ListSessionsAsyncOptions extends ListSessionsAsyncRequestPeriodOneOf, ListSessionsAsyncRequestParamsOneOf {
311
312
  /** Custom time period with start & end dates. */
@@ -334,6 +335,7 @@ interface MarkSessionAsRecordedOptions {
334
335
  sessionId?: string;
335
336
  }
336
337
 
338
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
337
339
  interface HttpClient {
338
340
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
339
341
  fetchWithAuth: typeof fetch;
@@ -358,6 +360,7 @@ type APIMetadata = {
358
360
  entityFqdn?: string;
359
361
  packageName?: string;
360
362
  };
363
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
361
364
 
362
365
  declare global {
363
366
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -366,12 +369,11 @@ declare global {
366
369
  }
367
370
  }
368
371
 
369
- declare const __metadata: {
370
- PACKAGE_NAME: string;
371
- };
372
- declare function listSessionsAsync(httpClient: HttpClient): (options?: ListSessionsAsyncOptions) => Promise<ListSessionsAsyncResponse & ListSessionsAsyncResponseNonNullableFields>;
373
- declare function getListSessionsJobResult(httpClient: HttpClient): (options?: GetListSessionsJobResultOptions) => Promise<GetListSessionsJobResultResponse & GetListSessionsJobResultResponseNonNullableFields>;
374
- declare function markSessionAsRecorded(httpClient: HttpClient): (options?: MarkSessionAsRecordedOptions) => Promise<void>;
372
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
373
+
374
+ declare const listSessionsAsync: ReturnType<typeof createRESTModule<typeof publicListSessionsAsync>>;
375
+ declare const getListSessionsJobResult: ReturnType<typeof createRESTModule<typeof publicGetListSessionsJobResult>>;
376
+ declare const markSessionAsRecorded: ReturnType<typeof createRESTModule<typeof publicMarkSessionAsRecorded>>;
375
377
 
376
378
  type index_d_ConversionFunnelSessionsParams = ConversionFunnelSessionsParams;
377
379
  type index_d_CountFunnelSessionsRequest = CountFunnelSessionsRequest;
@@ -411,12 +413,11 @@ declare const index_d_PredefinedTimePeriod: typeof PredefinedTimePeriod;
411
413
  type index_d_Recordings = Recordings;
412
414
  type index_d_Session = Session;
413
415
  type index_d_SessionsByDeviceParams = SessionsByDeviceParams;
414
- declare const index_d___metadata: typeof __metadata;
415
416
  declare const index_d_getListSessionsJobResult: typeof getListSessionsJobResult;
416
417
  declare const index_d_listSessionsAsync: typeof listSessionsAsync;
417
418
  declare const index_d_markSessionAsRecorded: typeof markSessionAsRecorded;
418
419
  declare namespace index_d {
419
- export { type index_d_ConversionFunnelSessionsParams as ConversionFunnelSessionsParams, type index_d_CountFunnelSessionsRequest as CountFunnelSessionsRequest, type index_d_CountFunnelSessionsRequestPeriodOneOf as CountFunnelSessionsRequestPeriodOneOf, type index_d_CountFunnelSessionsResponse as CountFunnelSessionsResponse, type index_d_CountSessionsRequest as CountSessionsRequest, type index_d_CountSessionsRequestPeriodOneOf as CountSessionsRequestPeriodOneOf, type index_d_CountSessionsResponse as CountSessionsResponse, type index_d_CustomPeriod as CustomPeriod, type index_d_CustomTimePeriod as CustomTimePeriod, index_d_DeviceType as DeviceType, index_d_FunnelStep as FunnelStep, type index_d_GetListSessionsJobResultOptions as GetListSessionsJobResultOptions, type index_d_GetListSessionsJobResultRequest as GetListSessionsJobResultRequest, type index_d_GetListSessionsJobResultResponse as GetListSessionsJobResultResponse, type index_d_GetListSessionsJobResultResponseNonNullableFields as GetListSessionsJobResultResponseNonNullableFields, type index_d_JobResult as JobResult, index_d_JobStatus as JobStatus, type index_d_ListSessionsAsyncOptions as ListSessionsAsyncOptions, type index_d_ListSessionsAsyncRequest as ListSessionsAsyncRequest, type index_d_ListSessionsAsyncRequestParamsOneOf as ListSessionsAsyncRequestParamsOneOf, type index_d_ListSessionsAsyncRequestPeriodOneOf as ListSessionsAsyncRequestPeriodOneOf, type index_d_ListSessionsAsyncResponse as ListSessionsAsyncResponse, type index_d_ListSessionsAsyncResponseNonNullableFields as ListSessionsAsyncResponseNonNullableFields, type index_d_MarkSessionAsRecordedOptions as MarkSessionAsRecordedOptions, type index_d_MarkSessionAsRecordedRequest as MarkSessionAsRecordedRequest, type index_d_MarkSessionAsRecordedResponse as MarkSessionAsRecordedResponse, type index_d_NavigationFlowSessionsParams as NavigationFlowSessionsParams, type index_d_PredefinedPeriod as PredefinedPeriod, index_d_PredefinedPeriodEnum as PredefinedPeriodEnum, index_d_PredefinedTimePeriod as PredefinedTimePeriod, type index_d_Recordings as Recordings, type index_d_Session as Session, type index_d_SessionsByDeviceParams as SessionsByDeviceParams, index_d___metadata as __metadata, index_d_getListSessionsJobResult as getListSessionsJobResult, index_d_listSessionsAsync as listSessionsAsync, index_d_markSessionAsRecorded as markSessionAsRecorded };
420
+ export { type index_d_ConversionFunnelSessionsParams as ConversionFunnelSessionsParams, type index_d_CountFunnelSessionsRequest as CountFunnelSessionsRequest, type index_d_CountFunnelSessionsRequestPeriodOneOf as CountFunnelSessionsRequestPeriodOneOf, type index_d_CountFunnelSessionsResponse as CountFunnelSessionsResponse, type index_d_CountSessionsRequest as CountSessionsRequest, type index_d_CountSessionsRequestPeriodOneOf as CountSessionsRequestPeriodOneOf, type index_d_CountSessionsResponse as CountSessionsResponse, type index_d_CustomPeriod as CustomPeriod, type index_d_CustomTimePeriod as CustomTimePeriod, index_d_DeviceType as DeviceType, index_d_FunnelStep as FunnelStep, type index_d_GetListSessionsJobResultOptions as GetListSessionsJobResultOptions, type index_d_GetListSessionsJobResultRequest as GetListSessionsJobResultRequest, type index_d_GetListSessionsJobResultResponse as GetListSessionsJobResultResponse, type index_d_GetListSessionsJobResultResponseNonNullableFields as GetListSessionsJobResultResponseNonNullableFields, type index_d_JobResult as JobResult, index_d_JobStatus as JobStatus, type index_d_ListSessionsAsyncOptions as ListSessionsAsyncOptions, type index_d_ListSessionsAsyncRequest as ListSessionsAsyncRequest, type index_d_ListSessionsAsyncRequestParamsOneOf as ListSessionsAsyncRequestParamsOneOf, type index_d_ListSessionsAsyncRequestPeriodOneOf as ListSessionsAsyncRequestPeriodOneOf, type index_d_ListSessionsAsyncResponse as ListSessionsAsyncResponse, type index_d_ListSessionsAsyncResponseNonNullableFields as ListSessionsAsyncResponseNonNullableFields, type index_d_MarkSessionAsRecordedOptions as MarkSessionAsRecordedOptions, type index_d_MarkSessionAsRecordedRequest as MarkSessionAsRecordedRequest, type index_d_MarkSessionAsRecordedResponse as MarkSessionAsRecordedResponse, type index_d_NavigationFlowSessionsParams as NavigationFlowSessionsParams, type index_d_PredefinedPeriod as PredefinedPeriod, index_d_PredefinedPeriodEnum as PredefinedPeriodEnum, index_d_PredefinedTimePeriod as PredefinedTimePeriod, type index_d_Recordings as Recordings, type index_d_Session as Session, type index_d_SessionsByDeviceParams as SessionsByDeviceParams, index_d_getListSessionsJobResult as getListSessionsJobResult, index_d_listSessionsAsync as listSessionsAsync, index_d_markSessionAsRecorded as markSessionAsRecorded };
420
421
  }
421
422
 
422
423
  export { index_d as analyticsSession };
@@ -179,11 +179,12 @@ interface MarkSessionAsRecordedResponse$1 {
179
179
  interface ListSessionsAsyncResponseNonNullableFields$1 {
180
180
  jobId: string;
181
181
  }
182
+ interface JobResultNonNullableFields$1 {
183
+ jobStatus: JobStatus$1;
184
+ sessionIds: string[];
185
+ }
182
186
  interface GetListSessionsJobResultResponseNonNullableFields$1 {
183
- result?: {
184
- jobStatus: JobStatus$1;
185
- sessionIds: string[];
186
- };
187
+ result?: JobResultNonNullableFields$1;
187
188
  }
188
189
 
189
190
  /** List sessions async request. */
@@ -367,11 +368,12 @@ interface MarkSessionAsRecordedResponse {
367
368
  interface ListSessionsAsyncResponseNonNullableFields {
368
369
  jobId: string;
369
370
  }
371
+ interface JobResultNonNullableFields {
372
+ jobStatus: JobStatus;
373
+ sessionIds: string[];
374
+ }
370
375
  interface GetListSessionsJobResultResponseNonNullableFields {
371
- result?: {
372
- jobStatus: JobStatus;
373
- sessionIds: string[];
374
- };
376
+ result?: JobResultNonNullableFields;
375
377
  }
376
378
 
377
379
  type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {