@contentful/optimization-api-client 0.1.0-alpha8 → 0.1.0-alpha9
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/README.md +55 -24
- package/dist/199.mjs +2 -0
- package/dist/649.mjs +131 -0
- package/dist/649.mjs.map +1 -0
- package/dist/api-schemas.cjs +60 -0
- package/dist/api-schemas.cjs.map +1 -0
- package/dist/api-schemas.d.cts +4 -0
- package/dist/api-schemas.d.mts +4 -0
- package/dist/api-schemas.d.ts +4 -0
- package/dist/api-schemas.mjs +2 -0
- package/dist/index.cjs +588 -575
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +327 -68
- package/dist/index.d.mts +327 -68
- package/dist/index.d.ts +1649 -8
- package/dist/index.mjs +103 -136
- package/dist/index.mjs.map +1 -1
- package/dist/logger.cjs +207 -0
- package/dist/logger.cjs.map +1 -0
- package/dist/logger.d.cts +287 -0
- package/dist/logger.d.mts +287 -0
- package/dist/logger.d.ts +287 -0
- package/dist/logger.mjs +1 -0
- package/package.json +24 -6
- package/dist/ApiClient.d.ts +0 -74
- package/dist/ApiClient.d.ts.map +0 -1
- package/dist/ApiClient.js +0 -61
- package/dist/ApiClient.js.map +0 -1
- package/dist/ApiClientBase.d.ts +0 -113
- package/dist/ApiClientBase.d.ts.map +0 -1
- package/dist/ApiClientBase.js +0 -94
- package/dist/ApiClientBase.js.map +0 -1
- package/dist/builders/EventBuilder.d.ts +0 -589
- package/dist/builders/EventBuilder.d.ts.map +0 -1
- package/dist/builders/EventBuilder.js +0 -349
- package/dist/builders/EventBuilder.js.map +0 -1
- package/dist/builders/index.d.ts +0 -3
- package/dist/builders/index.d.ts.map +0 -1
- package/dist/builders/index.js +0 -3
- package/dist/builders/index.js.map +0 -1
- package/dist/experience/ExperienceApiClient.d.ts +0 -267
- package/dist/experience/ExperienceApiClient.d.ts.map +0 -1
- package/dist/experience/ExperienceApiClient.js +0 -324
- package/dist/experience/ExperienceApiClient.js.map +0 -1
- package/dist/experience/index.d.ts +0 -4
- package/dist/experience/index.d.ts.map +0 -1
- package/dist/experience/index.js +0 -4
- package/dist/experience/index.js.map +0 -1
- package/dist/fetch/Fetch.d.ts +0 -96
- package/dist/fetch/Fetch.d.ts.map +0 -1
- package/dist/fetch/Fetch.js +0 -27
- package/dist/fetch/Fetch.js.map +0 -1
- package/dist/fetch/createProtectedFetchMethod.d.ts +0 -40
- package/dist/fetch/createProtectedFetchMethod.d.ts.map +0 -1
- package/dist/fetch/createProtectedFetchMethod.js +0 -53
- package/dist/fetch/createProtectedFetchMethod.js.map +0 -1
- package/dist/fetch/createRetryFetchMethod.d.ts +0 -60
- package/dist/fetch/createRetryFetchMethod.d.ts.map +0 -1
- package/dist/fetch/createRetryFetchMethod.js +0 -138
- package/dist/fetch/createRetryFetchMethod.js.map +0 -1
- package/dist/fetch/createTimeoutFetchMethod.d.ts +0 -51
- package/dist/fetch/createTimeoutFetchMethod.d.ts.map +0 -1
- package/dist/fetch/createTimeoutFetchMethod.js +0 -51
- package/dist/fetch/createTimeoutFetchMethod.js.map +0 -1
- package/dist/fetch/index.d.ts +0 -7
- package/dist/fetch/index.d.ts.map +0 -1
- package/dist/fetch/index.js +0 -7
- package/dist/fetch/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -8
- package/dist/index.js.map +0 -1
- package/dist/insights/InsightsApiClient.d.ts +0 -130
- package/dist/insights/InsightsApiClient.d.ts.map +0 -1
- package/dist/insights/InsightsApiClient.js +0 -143
- package/dist/insights/InsightsApiClient.js.map +0 -1
- package/dist/insights/index.d.ts +0 -4
- package/dist/insights/index.d.ts.map +0 -1
- package/dist/insights/index.js +0 -4
- package/dist/insights/index.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* The Contentful Optimization API Client Library provides methods for
|
|
5
|
+
* interfacing with Contentful's Experience and Insights APIs, which serve its
|
|
6
|
+
* Personalization and Analytics products.
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
import { App } from '@contentful/optimization-api-schemas';
|
|
2
|
-
import { BatchExperienceData } from '@contentful/optimization-api-schemas';
|
|
3
10
|
import { BatchExperienceEventArray } from '@contentful/optimization-api-schemas';
|
|
11
|
+
import { BatchExperienceResponseData } from '@contentful/optimization-api-schemas';
|
|
4
12
|
import { BatchInsightsEventArray } from '@contentful/optimization-api-schemas';
|
|
5
13
|
import { Channel } from '@contentful/optimization-api-schemas';
|
|
14
|
+
import { ComponentClickEvent } from '@contentful/optimization-api-schemas';
|
|
15
|
+
import { ComponentHoverEvent } from '@contentful/optimization-api-schemas';
|
|
6
16
|
import { ComponentViewEvent } from '@contentful/optimization-api-schemas';
|
|
7
17
|
import { ExperienceEventArray } from '@contentful/optimization-api-schemas';
|
|
8
18
|
import { IdentifyEvent } from '@contentful/optimization-api-schemas';
|
|
@@ -18,8 +28,6 @@ import * as z from 'zod/mini';
|
|
|
18
28
|
/**
|
|
19
29
|
* Aggregated API client providing access to Experience and Insights APIs.
|
|
20
30
|
*
|
|
21
|
-
* @public
|
|
22
|
-
*
|
|
23
31
|
* @remarks
|
|
24
32
|
* This client encapsulates shared configuration and exposes dedicated
|
|
25
33
|
* sub-clients for personalization and analytics use cases.
|
|
@@ -29,7 +37,6 @@ import * as z from 'zod/mini';
|
|
|
29
37
|
* const client = new ApiClient({
|
|
30
38
|
* clientId: 'org-id',
|
|
31
39
|
* environment: 'main',
|
|
32
|
-
* preview: false,
|
|
33
40
|
* personalization: {
|
|
34
41
|
* // experience-specific overrides
|
|
35
42
|
* },
|
|
@@ -39,20 +46,31 @@ import * as z from 'zod/mini';
|
|
|
39
46
|
* })
|
|
40
47
|
*
|
|
41
48
|
* const profile = await client.experience.getProfile('profile-id')
|
|
42
|
-
*
|
|
49
|
+
* await client.insights.sendBatchEvents(batches)
|
|
43
50
|
* ```
|
|
51
|
+
*
|
|
52
|
+
* @see {@link ExperienceApiClient}
|
|
53
|
+
* @see {@link InsightsApiClient}
|
|
54
|
+
*
|
|
55
|
+
* @public
|
|
44
56
|
*/
|
|
45
57
|
export declare class ApiClient {
|
|
46
58
|
/**
|
|
47
59
|
* Shared configuration applied to both Experience and Insights clients.
|
|
60
|
+
*
|
|
61
|
+
* @see {@link ApiConfig}
|
|
48
62
|
*/
|
|
49
63
|
readonly config: ApiConfig;
|
|
50
64
|
/**
|
|
51
65
|
* Client for personalization and experience-related operations.
|
|
66
|
+
*
|
|
67
|
+
* @see {@link ExperienceApiClient}
|
|
52
68
|
*/
|
|
53
69
|
readonly experience: ExperienceApiClient;
|
|
54
70
|
/**
|
|
55
71
|
* Client for analytics and insights-related operations.
|
|
72
|
+
*
|
|
73
|
+
* @see {@link InsightsApiClient}
|
|
56
74
|
*/
|
|
57
75
|
readonly insights: InsightsApiClient;
|
|
58
76
|
/**
|
|
@@ -66,8 +84,6 @@ export declare class ApiClient {
|
|
|
66
84
|
/**
|
|
67
85
|
* Base class for API clients that provides shared configuration and error logging.
|
|
68
86
|
*
|
|
69
|
-
* @internal
|
|
70
|
-
*
|
|
71
87
|
* @remarks
|
|
72
88
|
* This abstract class is intended for internal use within the package and
|
|
73
89
|
* should not be treated as part of the public API surface.
|
|
@@ -92,6 +108,8 @@ export declare class ApiClient {
|
|
|
92
108
|
* }
|
|
93
109
|
* }
|
|
94
110
|
* ```
|
|
111
|
+
*
|
|
112
|
+
* @internal
|
|
95
113
|
*/
|
|
96
114
|
declare abstract class ApiClientBase {
|
|
97
115
|
/**
|
|
@@ -124,8 +142,6 @@ declare abstract class ApiClientBase {
|
|
|
124
142
|
* @param options - Additional metadata about the request.
|
|
125
143
|
* @param options.requestName - Human-readable name of the request operation.
|
|
126
144
|
*
|
|
127
|
-
* @protected
|
|
128
|
-
*
|
|
129
145
|
* @remarks
|
|
130
146
|
* Abort errors are logged at `warn` level and other errors at `error` level.
|
|
131
147
|
* The log message includes the client name for better debugging context.
|
|
@@ -145,16 +161,16 @@ export declare interface ApiClientConfig extends Pick<ApiConfig, GlobalApiConfig
|
|
|
145
161
|
* Configuration for the personalization (Experience) API client.
|
|
146
162
|
*
|
|
147
163
|
* @remarks
|
|
148
|
-
*
|
|
149
|
-
*
|
|
164
|
+
* Shared fields (`clientId`, `environment`, `fetchOptions`) are inherited
|
|
165
|
+
* from top-level config; this object is for Experience-specific options.
|
|
150
166
|
*/
|
|
151
167
|
personalization?: Omit<ExperienceApiClientConfig, GlobalApiConfigProperties>;
|
|
152
168
|
/**
|
|
153
169
|
* Configuration for the analytics (Insights) API client.
|
|
154
170
|
*
|
|
155
171
|
* @remarks
|
|
156
|
-
*
|
|
157
|
-
*
|
|
172
|
+
* Shared fields (`clientId`, `environment`, `fetchOptions`) are inherited
|
|
173
|
+
* from top-level config; this object is for Insights-specific options.
|
|
158
174
|
*/
|
|
159
175
|
analytics?: Omit<InsightsApiClientConfig, GlobalApiConfigProperties>;
|
|
160
176
|
}
|
|
@@ -176,8 +192,7 @@ export declare interface ApiConfig {
|
|
|
176
192
|
/**
|
|
177
193
|
* Contentful environment identifier.
|
|
178
194
|
*
|
|
179
|
-
* @
|
|
180
|
-
* Defaults to `main` when not provided.
|
|
195
|
+
* @defaultValue `'main'`
|
|
181
196
|
*/
|
|
182
197
|
environment?: string;
|
|
183
198
|
/**
|
|
@@ -218,6 +233,8 @@ declare interface BaseFetchMethodOptions {
|
|
|
218
233
|
|
|
219
234
|
/**
|
|
220
235
|
* Parameters used when performing a batch profile update.
|
|
236
|
+
*
|
|
237
|
+
* @internal
|
|
221
238
|
*/
|
|
222
239
|
declare interface BatchUpdateProfileParams {
|
|
223
240
|
/**
|
|
@@ -226,6 +243,170 @@ declare interface BatchUpdateProfileParams {
|
|
|
226
243
|
events: BatchExperienceEventArray;
|
|
227
244
|
}
|
|
228
245
|
|
|
246
|
+
/**
|
|
247
|
+
* Arguments for constructing component click events.
|
|
248
|
+
*
|
|
249
|
+
* @public
|
|
250
|
+
*/
|
|
251
|
+
export declare type ComponentClickBuilderArgs = z.infer<typeof ComponentClickBuilderArgs_2>;
|
|
252
|
+
|
|
253
|
+
declare const ComponentClickBuilderArgs_2: z.ZodMiniObject<{
|
|
254
|
+
campaign: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
255
|
+
name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
256
|
+
source: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
257
|
+
medium: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
258
|
+
term: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
259
|
+
content: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
260
|
+
}, z.core.$strip>>;
|
|
261
|
+
locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
262
|
+
location: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
263
|
+
coordinates: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
264
|
+
latitude: z.ZodMiniNumber<number>;
|
|
265
|
+
longitude: z.ZodMiniNumber<number>;
|
|
266
|
+
}, z.core.$strip>>;
|
|
267
|
+
city: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
268
|
+
postalCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
269
|
+
region: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
270
|
+
regionCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
271
|
+
country: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
272
|
+
countryCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
273
|
+
continent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
274
|
+
timezone: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
275
|
+
}, z.core.$strip>>;
|
|
276
|
+
page: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
277
|
+
path: z.ZodMiniString<string>;
|
|
278
|
+
query: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
|
|
279
|
+
referrer: z.ZodMiniString<string>;
|
|
280
|
+
search: z.ZodMiniString<string>;
|
|
281
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
282
|
+
url: z.ZodMiniString<string>;
|
|
283
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>>;
|
|
284
|
+
screen: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
285
|
+
name: z.ZodMiniString<string>;
|
|
286
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>>;
|
|
287
|
+
userAgent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
288
|
+
componentId: z.ZodMiniString<string>;
|
|
289
|
+
experienceId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
290
|
+
variantIndex: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
291
|
+
}, z.core.$strip>;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Arguments for constructing component click events.
|
|
295
|
+
*
|
|
296
|
+
* @public
|
|
297
|
+
*/
|
|
298
|
+
declare type ComponentClickBuilderArgs = z.infer<typeof ComponentClickBuilderArgs_2>;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Arguments for constructing component hover events.
|
|
302
|
+
*
|
|
303
|
+
* @public
|
|
304
|
+
*/
|
|
305
|
+
export declare type ComponentHoverBuilderArgs = z.infer<typeof ComponentHoverBuilderArgs_2>;
|
|
306
|
+
|
|
307
|
+
declare const ComponentHoverBuilderArgs_2: z.ZodMiniObject<{
|
|
308
|
+
campaign: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
309
|
+
name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
310
|
+
source: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
311
|
+
medium: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
312
|
+
term: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
313
|
+
content: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
314
|
+
}, z.core.$strip>>;
|
|
315
|
+
locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
316
|
+
location: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
317
|
+
coordinates: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
318
|
+
latitude: z.ZodMiniNumber<number>;
|
|
319
|
+
longitude: z.ZodMiniNumber<number>;
|
|
320
|
+
}, z.core.$strip>>;
|
|
321
|
+
city: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
322
|
+
postalCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
323
|
+
region: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
324
|
+
regionCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
325
|
+
country: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
326
|
+
countryCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
327
|
+
continent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
328
|
+
timezone: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
329
|
+
}, z.core.$strip>>;
|
|
330
|
+
page: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
331
|
+
path: z.ZodMiniString<string>;
|
|
332
|
+
query: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
|
|
333
|
+
referrer: z.ZodMiniString<string>;
|
|
334
|
+
search: z.ZodMiniString<string>;
|
|
335
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
336
|
+
url: z.ZodMiniString<string>;
|
|
337
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>>;
|
|
338
|
+
screen: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
339
|
+
name: z.ZodMiniString<string>;
|
|
340
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>>;
|
|
341
|
+
userAgent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
342
|
+
componentId: z.ZodMiniString<string>;
|
|
343
|
+
experienceId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
344
|
+
variantIndex: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
345
|
+
componentHoverId: z.ZodMiniString<string>;
|
|
346
|
+
hoverDurationMs: z.ZodMiniNumber<number>;
|
|
347
|
+
}, z.core.$strip>;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Arguments for constructing component hover events.
|
|
351
|
+
*
|
|
352
|
+
* @public
|
|
353
|
+
*/
|
|
354
|
+
declare type ComponentHoverBuilderArgs = z.infer<typeof ComponentHoverBuilderArgs_2>;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Arguments shared by component view, click, and hover events.
|
|
358
|
+
*
|
|
359
|
+
* @public
|
|
360
|
+
*/
|
|
361
|
+
export declare type ComponentInteractionBuilderArgsBase = z.infer<typeof ComponentInteractionBuilderArgsBase_2>;
|
|
362
|
+
|
|
363
|
+
declare const ComponentInteractionBuilderArgsBase_2: z.ZodMiniObject<{
|
|
364
|
+
campaign: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
365
|
+
name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
366
|
+
source: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
367
|
+
medium: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
368
|
+
term: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
369
|
+
content: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
370
|
+
}, z.core.$strip>>;
|
|
371
|
+
locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
372
|
+
location: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
373
|
+
coordinates: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
374
|
+
latitude: z.ZodMiniNumber<number>;
|
|
375
|
+
longitude: z.ZodMiniNumber<number>;
|
|
376
|
+
}, z.core.$strip>>;
|
|
377
|
+
city: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
378
|
+
postalCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
379
|
+
region: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
380
|
+
regionCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
381
|
+
country: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
382
|
+
countryCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
383
|
+
continent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
384
|
+
timezone: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
385
|
+
}, z.core.$strip>>;
|
|
386
|
+
page: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
387
|
+
path: z.ZodMiniString<string>;
|
|
388
|
+
query: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
|
|
389
|
+
referrer: z.ZodMiniString<string>;
|
|
390
|
+
search: z.ZodMiniString<string>;
|
|
391
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
392
|
+
url: z.ZodMiniString<string>;
|
|
393
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>>;
|
|
394
|
+
screen: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
395
|
+
name: z.ZodMiniString<string>;
|
|
396
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>>;
|
|
397
|
+
userAgent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
398
|
+
componentId: z.ZodMiniString<string>;
|
|
399
|
+
experienceId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
400
|
+
variantIndex: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
401
|
+
}, z.core.$strip>;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Arguments shared by component view, click, and hover events.
|
|
405
|
+
*
|
|
406
|
+
* @public
|
|
407
|
+
*/
|
|
408
|
+
declare type ComponentInteractionBuilderArgsBase = z.infer<typeof ComponentInteractionBuilderArgsBase_2>;
|
|
409
|
+
|
|
229
410
|
/**
|
|
230
411
|
* Arguments for constructing component view events.
|
|
231
412
|
*
|
|
@@ -272,6 +453,8 @@ declare const ComponentViewBuilderArgs_2: z.ZodMiniObject<{
|
|
|
272
453
|
experienceId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
273
454
|
variantIndex: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
274
455
|
sticky: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
456
|
+
componentViewId: z.ZodMiniString<string>;
|
|
457
|
+
viewDurationMs: z.ZodMiniNumber<number>;
|
|
275
458
|
}, z.core.$strip>;
|
|
276
459
|
|
|
277
460
|
/**
|
|
@@ -283,6 +466,8 @@ declare type ComponentViewBuilderArgs = z.infer<typeof ComponentViewBuilderArgs_
|
|
|
283
466
|
|
|
284
467
|
/**
|
|
285
468
|
* Parameters used when creating a profile.
|
|
469
|
+
*
|
|
470
|
+
* @internal
|
|
286
471
|
*/
|
|
287
472
|
declare interface CreateProfileParams {
|
|
288
473
|
/**
|
|
@@ -294,8 +479,6 @@ declare interface CreateProfileParams {
|
|
|
294
479
|
/**
|
|
295
480
|
* Default page properties used when no explicit page information is available.
|
|
296
481
|
*
|
|
297
|
-
* @public
|
|
298
|
-
*
|
|
299
482
|
* @defaultValue
|
|
300
483
|
* ```ts
|
|
301
484
|
* {
|
|
@@ -310,6 +493,8 @@ declare interface CreateProfileParams {
|
|
|
310
493
|
*
|
|
311
494
|
* @remarks
|
|
312
495
|
* Values are required by the API; values may not be `undefined`. Empty values are valid.
|
|
496
|
+
*
|
|
497
|
+
* @public
|
|
313
498
|
*/
|
|
314
499
|
export declare const DEFAULT_PAGE_PROPERTIES: {
|
|
315
500
|
path: string;
|
|
@@ -321,13 +506,15 @@ export declare const DEFAULT_PAGE_PROPERTIES: {
|
|
|
321
506
|
};
|
|
322
507
|
|
|
323
508
|
/**
|
|
324
|
-
*
|
|
509
|
+
* Helper class for building analytics and personalization events.
|
|
325
510
|
*
|
|
326
511
|
* @remarks
|
|
327
512
|
* This class coordinates configuration and argument validation to produce
|
|
328
513
|
* strongly-typed event payloads compatible with
|
|
329
514
|
* `@contentful/optimization-api-schemas`.
|
|
330
515
|
*
|
|
516
|
+
* @see {@link EventBuilderConfig}
|
|
517
|
+
*
|
|
331
518
|
* @public
|
|
332
519
|
*/
|
|
333
520
|
export declare class EventBuilder {
|
|
@@ -372,7 +559,6 @@ export declare class EventBuilder {
|
|
|
372
559
|
*
|
|
373
560
|
* @param config - Configuration used to customize event payloads.
|
|
374
561
|
*
|
|
375
|
-
* @internal
|
|
376
562
|
* @remarks
|
|
377
563
|
* Callers are expected to reuse a single instance when possible to avoid
|
|
378
564
|
* repeatedly reconfiguring the builder.
|
|
@@ -392,39 +578,76 @@ export declare class EventBuilder {
|
|
|
392
578
|
* @param args - Arguments overriding the default context values.
|
|
393
579
|
* @returns A fully populated {@link UniversalEventProperties} object.
|
|
394
580
|
*
|
|
395
|
-
* @protected
|
|
396
|
-
*
|
|
397
581
|
* @remarks
|
|
398
582
|
* This method is used internally by the specific event-builder methods
|
|
399
583
|
* (e.g. {@link EventBuilder.buildPageView}).
|
|
400
584
|
*/
|
|
401
585
|
protected buildUniversalEventProperties({ campaign, locale, location, page, screen, userAgent, }: UniversalEventBuilderArgs): UniversalEventProperties;
|
|
586
|
+
private buildEntryComponentBase;
|
|
402
587
|
/**
|
|
403
588
|
* Builds a component view event payload for a Contentful entry-based component.
|
|
404
589
|
*
|
|
405
590
|
* @param args - {@link ComponentViewBuilderArgs} arguments describing the component view.
|
|
406
591
|
* @returns A {@link ComponentViewEvent} describing the view.
|
|
407
592
|
*
|
|
408
|
-
* @public
|
|
409
|
-
*
|
|
410
593
|
* @example
|
|
411
594
|
* ```ts
|
|
412
595
|
* const event = builder.buildComponentView({
|
|
413
596
|
* componentId: 'entry-123',
|
|
597
|
+
* componentViewId: crypto.randomUUID(),
|
|
414
598
|
* experienceId: 'personalization-123',
|
|
415
599
|
* variantIndex: 1,
|
|
600
|
+
* viewDurationMs: 1_000,
|
|
416
601
|
* })
|
|
417
602
|
* ```
|
|
603
|
+
*
|
|
604
|
+
* @public
|
|
418
605
|
*/
|
|
419
606
|
buildComponentView(args: ComponentViewBuilderArgs): ComponentViewEvent;
|
|
607
|
+
/**
|
|
608
|
+
* Builds a component click event payload for a Contentful entry-based component.
|
|
609
|
+
*
|
|
610
|
+
* @param args - {@link ComponentClickBuilderArgs} arguments describing the component click.
|
|
611
|
+
* @returns A {@link ComponentClickEvent} describing the click.
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
* ```ts
|
|
615
|
+
* const event = builder.buildComponentClick({
|
|
616
|
+
* componentId: 'entry-123',
|
|
617
|
+
* experienceId: 'personalization-123',
|
|
618
|
+
* variantIndex: 1,
|
|
619
|
+
* })
|
|
620
|
+
* ```
|
|
621
|
+
*
|
|
622
|
+
* @public
|
|
623
|
+
*/
|
|
624
|
+
buildComponentClick(args: ComponentClickBuilderArgs): ComponentClickEvent;
|
|
625
|
+
/**
|
|
626
|
+
* Builds a component hover event payload for a Contentful entry-based component.
|
|
627
|
+
*
|
|
628
|
+
* @param args - {@link ComponentHoverBuilderArgs} arguments describing the component hover.
|
|
629
|
+
* @returns A {@link ComponentHoverEvent} describing the hover.
|
|
630
|
+
*
|
|
631
|
+
* @example
|
|
632
|
+
* ```ts
|
|
633
|
+
* const event = builder.buildComponentHover({
|
|
634
|
+
* componentId: 'entry-123',
|
|
635
|
+
* componentHoverId: crypto.randomUUID(),
|
|
636
|
+
* experienceId: 'personalization-123',
|
|
637
|
+
* hoverDurationMs: 1_000,
|
|
638
|
+
* variantIndex: 1,
|
|
639
|
+
* })
|
|
640
|
+
* ```
|
|
641
|
+
*
|
|
642
|
+
* @public
|
|
643
|
+
*/
|
|
644
|
+
buildComponentHover(args: ComponentHoverBuilderArgs): ComponentHoverEvent;
|
|
420
645
|
/**
|
|
421
646
|
* Builds a component view event payload for a Custom Flag component.
|
|
422
647
|
*
|
|
423
648
|
* @param args - {@link ComponentViewBuilderArgs} arguments describing the Custom Flag view.
|
|
424
649
|
* @returns A {@link ComponentViewEvent} describing the view.
|
|
425
650
|
*
|
|
426
|
-
* @public
|
|
427
|
-
*
|
|
428
651
|
* @remarks
|
|
429
652
|
* This is a specialized variant of {@link EventBuilder.buildComponentView}
|
|
430
653
|
* that sets `componentType` to `'Variable'`.
|
|
@@ -433,9 +656,13 @@ export declare class EventBuilder {
|
|
|
433
656
|
* ```ts
|
|
434
657
|
* const event = builder.buildFlagView({
|
|
435
658
|
* componentId: 'feature-flag-key',
|
|
659
|
+
* componentViewId: crypto.randomUUID(),
|
|
436
660
|
* experienceId: 'personalization-123',
|
|
661
|
+
* viewDurationMs: 1_000,
|
|
437
662
|
* })
|
|
438
663
|
* ```
|
|
664
|
+
*
|
|
665
|
+
* @public
|
|
439
666
|
*/
|
|
440
667
|
buildFlagView(args: ComponentViewBuilderArgs): ComponentViewEvent;
|
|
441
668
|
/**
|
|
@@ -444,8 +671,6 @@ export declare class EventBuilder {
|
|
|
444
671
|
* @param args - {@link IdentifyBuilderArgs} arguments describing the identified user.
|
|
445
672
|
* @returns An {@link IdentifyEvent} payload.
|
|
446
673
|
*
|
|
447
|
-
* @public
|
|
448
|
-
*
|
|
449
674
|
* @remarks
|
|
450
675
|
* - Traits are merged by the API; only specified properties may be overwritten.
|
|
451
676
|
* - The User ID is consumer-specified and should not contain the value of any
|
|
@@ -458,6 +683,8 @@ export declare class EventBuilder {
|
|
|
458
683
|
* traits: { plan: 'pro' },
|
|
459
684
|
* })
|
|
460
685
|
* ```
|
|
686
|
+
*
|
|
687
|
+
* @public
|
|
461
688
|
*/
|
|
462
689
|
buildIdentify(args: IdentifyBuilderArgs): IdentifyEvent;
|
|
463
690
|
/**
|
|
@@ -466,8 +693,6 @@ export declare class EventBuilder {
|
|
|
466
693
|
* @param args - Optional {@link PageViewBuilderArgs} overrides for the page view event.
|
|
467
694
|
* @returns A {@link PageViewEvent} payload.
|
|
468
695
|
*
|
|
469
|
-
* @public
|
|
470
|
-
*
|
|
471
696
|
* @remarks
|
|
472
697
|
* Page properties are created by merging:
|
|
473
698
|
* 1. The base page properties from {@link EventBuilderConfig.getPageProperties}, and
|
|
@@ -483,6 +708,8 @@ export declare class EventBuilder {
|
|
|
483
708
|
* },
|
|
484
709
|
* })
|
|
485
710
|
* ```
|
|
711
|
+
*
|
|
712
|
+
* @public
|
|
486
713
|
*/
|
|
487
714
|
buildPageView(args?: PageViewBuilderArgs): PageViewEvent;
|
|
488
715
|
/**
|
|
@@ -491,8 +718,6 @@ export declare class EventBuilder {
|
|
|
491
718
|
* @param args - {@link ScreenViewBuilderArgs} arguments for the screen view event.
|
|
492
719
|
* @returns A {@link ScreenViewEvent} payload.
|
|
493
720
|
*
|
|
494
|
-
* @public
|
|
495
|
-
*
|
|
496
721
|
* @example
|
|
497
722
|
* ```ts
|
|
498
723
|
* const event = builder.buildScreenView({
|
|
@@ -502,6 +727,8 @@ export declare class EventBuilder {
|
|
|
502
727
|
* },
|
|
503
728
|
* })
|
|
504
729
|
* ```
|
|
730
|
+
*
|
|
731
|
+
* @public
|
|
505
732
|
*/
|
|
506
733
|
buildScreenView(args: ScreenViewBuilderArgs): ScreenViewEvent;
|
|
507
734
|
/**
|
|
@@ -510,8 +737,6 @@ export declare class EventBuilder {
|
|
|
510
737
|
* @param args - {@link TrackBuilderArgs} arguments describing the tracked event.
|
|
511
738
|
* @returns A {@link TrackEvent} payload.
|
|
512
739
|
*
|
|
513
|
-
* @public
|
|
514
|
-
*
|
|
515
740
|
* @example
|
|
516
741
|
* ```ts
|
|
517
742
|
* const event = builder.buildTrack({
|
|
@@ -519,6 +744,8 @@ export declare class EventBuilder {
|
|
|
519
744
|
* properties: { id: 'primary-cta', location: 'hero' },
|
|
520
745
|
* })
|
|
521
746
|
* ```
|
|
747
|
+
*
|
|
748
|
+
* @public
|
|
522
749
|
*/
|
|
523
750
|
buildTrack(args: TrackBuilderArgs): TrackEvent_2;
|
|
524
751
|
}
|
|
@@ -526,7 +753,6 @@ export declare class EventBuilder {
|
|
|
526
753
|
/**
|
|
527
754
|
* Configuration options for creating an {@link EventBuilder} instance.
|
|
528
755
|
*
|
|
529
|
-
* @public
|
|
530
756
|
* @remarks
|
|
531
757
|
* The configuration is typically provided by the host application to adapt
|
|
532
758
|
* event payloads to the runtime environment (browser, framework, etc.).
|
|
@@ -548,6 +774,8 @@ export declare class EventBuilder {
|
|
|
548
774
|
* }),
|
|
549
775
|
* })
|
|
550
776
|
* ```
|
|
777
|
+
*
|
|
778
|
+
* @public
|
|
551
779
|
*/
|
|
552
780
|
export declare interface EventBuilderConfig {
|
|
553
781
|
/**
|
|
@@ -611,8 +839,6 @@ export declare const EXPERIENCE_BASE_URL = "https://experience.ninetailed.co/";
|
|
|
611
839
|
/**
|
|
612
840
|
* Client for interacting with the Experience API.
|
|
613
841
|
*
|
|
614
|
-
* @public
|
|
615
|
-
*
|
|
616
842
|
* @remarks
|
|
617
843
|
* This client is responsible for reading and mutating Ninetailed profiles
|
|
618
844
|
* using the Experience API.
|
|
@@ -626,6 +852,10 @@ export declare const EXPERIENCE_BASE_URL = "https://experience.ninetailed.co/";
|
|
|
626
852
|
*
|
|
627
853
|
* const profile = await client.getProfile('profile-id')
|
|
628
854
|
* ```
|
|
855
|
+
*
|
|
856
|
+
* @see {@link ApiClientBase}
|
|
857
|
+
*
|
|
858
|
+
* @public
|
|
629
859
|
*/
|
|
630
860
|
declare class ExperienceApiClient extends ApiClientBase {
|
|
631
861
|
/**
|
|
@@ -732,8 +962,9 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
732
962
|
* @returns The list of profiles affected by the batch operation.
|
|
733
963
|
*
|
|
734
964
|
* @remarks
|
|
735
|
-
*
|
|
736
|
-
* updated according to the
|
|
965
|
+
* Batch requests must contain at least one event. Every event must contain
|
|
966
|
+
* an anonymous ID. Profiles will be created or updated according to the
|
|
967
|
+
* anonymous ID.
|
|
737
968
|
*
|
|
738
969
|
* This method is intended to be used from server environments.
|
|
739
970
|
*
|
|
@@ -741,13 +972,13 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
741
972
|
* ```ts
|
|
742
973
|
* const profiles = await client.upsertManyProfiles({
|
|
743
974
|
* events: [
|
|
744
|
-
*
|
|
745
|
-
*
|
|
975
|
+
* { anonymousId: 'anon-1', type: 'identify', ... },
|
|
976
|
+
* { anonymousId: 'anon-2', type: 'identify', ... },
|
|
746
977
|
* ],
|
|
747
978
|
* })
|
|
748
979
|
* ```
|
|
749
980
|
*/
|
|
750
|
-
upsertManyProfiles({ events }: BatchUpdateProfileParams, options?: RequestOptions): Promise<
|
|
981
|
+
upsertManyProfiles({ events }: BatchUpdateProfileParams, options?: RequestOptions): Promise<BatchExperienceResponseData['profiles']>;
|
|
751
982
|
/**
|
|
752
983
|
* Constructs a request URL with query parameters derived from request options.
|
|
753
984
|
*
|
|
@@ -776,16 +1007,30 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
776
1007
|
* @internal
|
|
777
1008
|
*/
|
|
778
1009
|
private readonly constructBodyOptions;
|
|
1010
|
+
/**
|
|
1011
|
+
* Construct and validate the singular Experience mutation request payload.
|
|
1012
|
+
*
|
|
1013
|
+
* @param events - Events that should be evaluated by the Experience API.
|
|
1014
|
+
* @param options - Request options that may contribute body options.
|
|
1015
|
+
* @returns Validated singular Experience request body.
|
|
1016
|
+
*
|
|
1017
|
+
* @internal
|
|
1018
|
+
*/
|
|
1019
|
+
private constructExperienceRequestBody;
|
|
779
1020
|
}
|
|
780
1021
|
|
|
781
1022
|
/**
|
|
782
1023
|
* Configuration for {@link ExperienceApiClient}.
|
|
1024
|
+
*
|
|
1025
|
+
* @public
|
|
783
1026
|
*/
|
|
784
1027
|
export declare interface ExperienceApiClientConfig extends ApiConfig, RequestOptions {
|
|
785
1028
|
}
|
|
786
1029
|
|
|
787
1030
|
/**
|
|
788
1031
|
* Feature flags supported by the Experience API.
|
|
1032
|
+
*
|
|
1033
|
+
* @internal
|
|
789
1034
|
*/
|
|
790
1035
|
declare type Feature = 'ip-enrichment' | 'location';
|
|
791
1036
|
|
|
@@ -796,8 +1041,6 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
796
1041
|
* @param init - Initialization options passed to `fetch`.
|
|
797
1042
|
* @returns A promise that resolves with the {@link Response}.
|
|
798
1043
|
*
|
|
799
|
-
* @public
|
|
800
|
-
*
|
|
801
1044
|
* @remarks
|
|
802
1045
|
* This abstraction allows the underlying implementation to be replaced,
|
|
803
1046
|
* for example in tests or different runtime environments.
|
|
@@ -808,16 +1051,18 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
808
1051
|
* return fetch(url, init)
|
|
809
1052
|
* }
|
|
810
1053
|
* ```
|
|
1054
|
+
*
|
|
1055
|
+
* @public
|
|
811
1056
|
*/
|
|
812
1057
|
declare type FetchMethod = (url: string | URL, init: RequestInit) => Promise<Response>;
|
|
813
1058
|
|
|
814
1059
|
/**
|
|
815
1060
|
* Options passed to callback functions invoked by fetch wrappers.
|
|
816
1061
|
*
|
|
817
|
-
* @public
|
|
818
|
-
*
|
|
819
1062
|
* @remarks
|
|
820
1063
|
* Not all fields are guaranteed to be present in all callback scenarios.
|
|
1064
|
+
*
|
|
1065
|
+
* @public
|
|
821
1066
|
*/
|
|
822
1067
|
declare interface FetchMethodCallbackOptions {
|
|
823
1068
|
/**
|
|
@@ -848,9 +1093,10 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
848
1093
|
/**
|
|
849
1094
|
* Arguments for constructing identify events.
|
|
850
1095
|
*
|
|
851
|
-
* @public
|
|
852
1096
|
* @remarks
|
|
853
1097
|
* Traits are merged by the API; only specified properties may be overwritten.
|
|
1098
|
+
*
|
|
1099
|
+
* @public
|
|
854
1100
|
*/
|
|
855
1101
|
export declare type IdentifyBuilderArgs = z.infer<typeof IdentifyBuilderArgs_2>;
|
|
856
1102
|
|
|
@@ -896,9 +1142,10 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
896
1142
|
/**
|
|
897
1143
|
* Arguments for constructing identify events.
|
|
898
1144
|
*
|
|
899
|
-
* @public
|
|
900
1145
|
* @remarks
|
|
901
1146
|
* Traits are merged by the API; only specified properties may be overwritten.
|
|
1147
|
+
*
|
|
1148
|
+
* @public
|
|
902
1149
|
*/
|
|
903
1150
|
declare type IdentifyBuilderArgs = z.infer<typeof IdentifyBuilderArgs_2>;
|
|
904
1151
|
|
|
@@ -912,8 +1159,6 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
912
1159
|
/**
|
|
913
1160
|
* Client for sending analytics and insights events to the Ninetailed Insights API.
|
|
914
1161
|
*
|
|
915
|
-
* @public
|
|
916
|
-
*
|
|
917
1162
|
* @remarks
|
|
918
1163
|
* This client is optimized for sending batched events, optionally using a
|
|
919
1164
|
* custom beacon-like handler when available.
|
|
@@ -923,7 +1168,6 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
923
1168
|
* const insightsClient = new InsightsApiClient({
|
|
924
1169
|
* clientId: 'org-id',
|
|
925
1170
|
* environment: 'main',
|
|
926
|
-
* preview: false,
|
|
927
1171
|
* })
|
|
928
1172
|
*
|
|
929
1173
|
* await insightsClient.sendBatchEvents([
|
|
@@ -939,6 +1183,10 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
939
1183
|
* }
|
|
940
1184
|
* ])
|
|
941
1185
|
* ```
|
|
1186
|
+
*
|
|
1187
|
+
* @see {@link ApiClientBase}
|
|
1188
|
+
*
|
|
1189
|
+
* @public
|
|
942
1190
|
*/
|
|
943
1191
|
declare class InsightsApiClient extends ApiClientBase {
|
|
944
1192
|
/**
|
|
@@ -971,7 +1219,8 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
971
1219
|
*
|
|
972
1220
|
* @param batches - Array of event batches to send.
|
|
973
1221
|
* @param options - Optional request options, including a per-call `beaconHandler`.
|
|
974
|
-
* @returns
|
|
1222
|
+
* @returns `true` when the event batch is successfully queued by the beacon
|
|
1223
|
+
* handler or a direct request is successfully sent, `false` otherwise.
|
|
975
1224
|
*
|
|
976
1225
|
* @remarks
|
|
977
1226
|
* If a `beaconHandler` is provided (either in the method call or in the
|
|
@@ -982,9 +1231,6 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
982
1231
|
* If the handler is missing or returns `false`, the events are emitted
|
|
983
1232
|
* immediately via `fetch`.
|
|
984
1233
|
*
|
|
985
|
-
* @returns A boolean value that is true when either the event batch is successfully
|
|
986
|
-
* queued by the beacon handler or a direct request is successfully sent.
|
|
987
|
-
*
|
|
988
1234
|
* @example
|
|
989
1235
|
* ```ts
|
|
990
1236
|
* const success = await insightsClient.sendBatchEvents(batches)
|
|
@@ -1014,10 +1260,11 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
1014
1260
|
/**
|
|
1015
1261
|
* Arguments for constructing page view events.
|
|
1016
1262
|
*
|
|
1017
|
-
* @public
|
|
1018
1263
|
* @remarks
|
|
1019
1264
|
* Any properties passed here are merged with the base page properties from
|
|
1020
1265
|
* {@link EventBuilderConfig.getPageProperties}.
|
|
1266
|
+
*
|
|
1267
|
+
* @public
|
|
1021
1268
|
*/
|
|
1022
1269
|
export declare type PageViewBuilderArgs = z.infer<typeof PageViewBuilderArgs_2>;
|
|
1023
1270
|
|
|
@@ -1069,21 +1316,29 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
1069
1316
|
/**
|
|
1070
1317
|
* Arguments for constructing page view events.
|
|
1071
1318
|
*
|
|
1072
|
-
* @public
|
|
1073
1319
|
* @remarks
|
|
1074
1320
|
* Any properties passed here are merged with the base page properties from
|
|
1075
1321
|
* {@link EventBuilderConfig.getPageProperties}.
|
|
1322
|
+
*
|
|
1323
|
+
* @public
|
|
1076
1324
|
*/
|
|
1077
1325
|
declare type PageViewBuilderArgs = z.infer<typeof PageViewBuilderArgs_2>;
|
|
1078
1326
|
|
|
1079
1327
|
/**
|
|
1080
1328
|
* Options for {@link createProtectedFetchMethod}, combining timeout and retry behavior.
|
|
1329
|
+
*
|
|
1330
|
+
* @see {@link RetryFetchMethodOptions}
|
|
1331
|
+
* @see {@link TimeoutFetchMethodOptions}
|
|
1332
|
+
*
|
|
1333
|
+
* @public
|
|
1081
1334
|
*/
|
|
1082
1335
|
declare interface ProtectedFetchMethodOptions extends RetryFetchMethodOptions, TimeoutFetchMethodOptions {
|
|
1083
1336
|
}
|
|
1084
1337
|
|
|
1085
1338
|
/**
|
|
1086
1339
|
* Options that control how requests to the Experience API are handled.
|
|
1340
|
+
*
|
|
1341
|
+
* @internal
|
|
1087
1342
|
*/
|
|
1088
1343
|
declare interface RequestOptions {
|
|
1089
1344
|
/**
|
|
@@ -1129,7 +1384,7 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
1129
1384
|
/**
|
|
1130
1385
|
* Options that control how Insights events are sent.
|
|
1131
1386
|
*
|
|
1132
|
-
* @
|
|
1387
|
+
* @internal
|
|
1133
1388
|
*/
|
|
1134
1389
|
declare interface RequestOptions_2 {
|
|
1135
1390
|
/**
|
|
@@ -1149,13 +1404,14 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
1149
1404
|
|
|
1150
1405
|
/**
|
|
1151
1406
|
* Configuration options for {@link createRetryFetchMethod}.
|
|
1407
|
+
*
|
|
1408
|
+
* @public
|
|
1152
1409
|
*/
|
|
1153
1410
|
declare interface RetryFetchMethodOptions extends BaseFetchMethodOptions {
|
|
1154
1411
|
/**
|
|
1155
1412
|
* Delay (in milliseconds) between retry attempts.
|
|
1156
1413
|
*
|
|
1157
|
-
* @
|
|
1158
|
-
* Defaults to {@link DEFAULT_INTERVAL_TIMEOUT}.
|
|
1414
|
+
* @defaultValue `0`
|
|
1159
1415
|
*/
|
|
1160
1416
|
intervalTimeout?: number;
|
|
1161
1417
|
/**
|
|
@@ -1171,8 +1427,7 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
1171
1427
|
/**
|
|
1172
1428
|
* Maximum number of retry attempts.
|
|
1173
1429
|
*
|
|
1174
|
-
* @
|
|
1175
|
-
* Defaults to {@link DEFAULT_RETRY_COUNT}.
|
|
1430
|
+
* @defaultValue `1`
|
|
1176
1431
|
*/
|
|
1177
1432
|
retries?: number;
|
|
1178
1433
|
}
|
|
@@ -1180,10 +1435,11 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
1180
1435
|
/**
|
|
1181
1436
|
* Arguments for constructing screen view events.
|
|
1182
1437
|
*
|
|
1183
|
-
* @public
|
|
1184
1438
|
* @remarks
|
|
1185
1439
|
* Any properties passed here are merged with the base screen properties from
|
|
1186
1440
|
* {@link EventBuilderConfig.getScreenProperties}.
|
|
1441
|
+
*
|
|
1442
|
+
* @public
|
|
1187
1443
|
*/
|
|
1188
1444
|
export declare type ScreenViewBuilderArgs = z.infer<typeof ScreenViewBuilderArgs_2>;
|
|
1189
1445
|
|
|
@@ -1229,15 +1485,18 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
1229
1485
|
/**
|
|
1230
1486
|
* Arguments for constructing screen view events.
|
|
1231
1487
|
*
|
|
1232
|
-
* @public
|
|
1233
1488
|
* @remarks
|
|
1234
1489
|
* Any properties passed here are merged with the base screen properties from
|
|
1235
1490
|
* {@link EventBuilderConfig.getScreenProperties}.
|
|
1491
|
+
*
|
|
1492
|
+
* @public
|
|
1236
1493
|
*/
|
|
1237
1494
|
declare type ScreenViewBuilderArgs = z.infer<typeof ScreenViewBuilderArgs_2>;
|
|
1238
1495
|
|
|
1239
1496
|
/**
|
|
1240
1497
|
* Configuration options for {@link createTimeoutFetchMethod}.
|
|
1498
|
+
*
|
|
1499
|
+
* @public
|
|
1241
1500
|
*/
|
|
1242
1501
|
declare interface TimeoutFetchMethodOptions extends BaseFetchMethodOptions {
|
|
1243
1502
|
/**
|
|
@@ -1254,8 +1513,7 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
1254
1513
|
/**
|
|
1255
1514
|
* Maximum time (in milliseconds) to wait for a response before aborting the request.
|
|
1256
1515
|
*
|
|
1257
|
-
* @
|
|
1258
|
-
* Defaults to {@link DEFAULT_REQUEST_TIMEOUT}.
|
|
1516
|
+
* @defaultValue `3000`
|
|
1259
1517
|
*/
|
|
1260
1518
|
requestTimeout?: number;
|
|
1261
1519
|
}
|
|
@@ -1366,6 +1624,8 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
1366
1624
|
|
|
1367
1625
|
/**
|
|
1368
1626
|
* Parameters used when updating an existing profile.
|
|
1627
|
+
*
|
|
1628
|
+
* @internal
|
|
1369
1629
|
*/
|
|
1370
1630
|
declare interface UpdateProfileParams extends CreateProfileParams {
|
|
1371
1631
|
/**
|
|
@@ -1376,6 +1636,8 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
1376
1636
|
|
|
1377
1637
|
/**
|
|
1378
1638
|
* Parameters used when creating or updating a profile.
|
|
1639
|
+
*
|
|
1640
|
+
* @internal
|
|
1379
1641
|
*/
|
|
1380
1642
|
declare interface UpsertProfileParams extends CreateProfileParams {
|
|
1381
1643
|
/**
|
|
@@ -1384,7 +1646,4 @@ declare class ExperienceApiClient extends ApiClientBase {
|
|
|
1384
1646
|
profileId?: string;
|
|
1385
1647
|
}
|
|
1386
1648
|
|
|
1387
|
-
|
|
1388
|
-
export * from "@contentful/optimization-api-schemas";
|
|
1389
|
-
|
|
1390
1649
|
export { }
|