From ffda23b19fdac767b6fca03f8fac80322d7e5476 Mon Sep 17 00:00:00 2001 From: Denis Rossati Date: Thu, 5 Jun 2025 16:26:23 -0300 Subject: [PATCH 1/4] Replace event occurred fields --- api.ts | 279 +++++++++++++++++++++++++++------------------------------ 1 file changed, 134 insertions(+), 145 deletions(-) diff --git a/api.ts b/api.ts index 099848c..d67129f 100644 --- a/api.ts +++ b/api.ts @@ -24,7 +24,7 @@ import type { RequestArgs } from './base'; import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; /** - * + * * @export * @interface ApiProblem */ @@ -32,19 +32,19 @@ export interface ApiProblem { [key: string]: any; /** - * + * * @type {string} * @memberof ApiProblem */ 'title': string; /** - * + * * @type {string} * @memberof ApiProblem */ 'type': string; /** - * + * * @type {string} * @memberof ApiProblem */ @@ -69,7 +69,7 @@ export interface Browser { */ 'version': string | null; /** - * + * * @type {BrowserType} * @memberof Browser */ @@ -95,7 +95,7 @@ export type BrowserType = typeof BrowserType[keyof typeof BrowserType]; /** - * + * * @export * @interface Campaign */ @@ -211,7 +211,7 @@ export interface CartItem { */ 'index': number; /** - * + * * @type {ProductDetails} * @memberof CartItem */ @@ -248,7 +248,7 @@ export interface CartItem { */ export interface CartModified extends EventPayload { /** - * + * * @type {Cart} * @memberof CartModified */ @@ -261,7 +261,7 @@ export interface CartModified extends EventPayload { */ export interface CartViewed extends EventPayload { /** - * + * * @type {Cart} * @memberof CartViewed */ @@ -274,7 +274,7 @@ export interface CartViewed extends EventPayload { */ export interface CheckoutStarted extends EventPayload { /** - * + * * @type {Cart} * @memberof CheckoutStarted */ @@ -293,7 +293,7 @@ export interface CheckoutStarted extends EventPayload { */ export interface ClientDetected extends EventPayload { /** - * + * * @type {WebClient} * @memberof ClientDetected */ @@ -318,13 +318,13 @@ export interface Device { */ 'vendor': string | null; /** - * + * * @type {DeviceCategory} * @memberof Device */ 'category': DeviceCategory; /** - * + * * @type {OperatingSystem} * @memberof Device */ @@ -351,7 +351,7 @@ export type DeviceCategory = typeof DeviceCategory[keyof typeof DeviceCategory]; /** - * + * * @export * @interface Event */ @@ -375,13 +375,13 @@ export interface Event { */ 'timestamp': number; /** - * + * * @type {EventContext} * @memberof Event */ 'context': EventContext | null; /** - * + * * @type {EventPayload} * @memberof Event */ @@ -394,13 +394,13 @@ export interface Event { */ export interface EventContext { /** - * + * * @type {string} * @memberof EventContext */ 'type': string; /** - * + * * @type {{ [key: string]: string | undefined; }} * @memberof EventContext */ @@ -419,34 +419,23 @@ export interface EventOccurred extends EventPayload { */ 'name': string; /** - * The ID of the personalization associated with the event. - * @type {string} - * @memberof EventOccurred - */ - 'personalizationId': string | null; - /** - * The name of the audience associated with the event. + * The label of the event. For example, "upsell-cta-button" or "hero-banner" * @type {string} - * @memberof EventOccurred + * @memberOf EventOccurred */ - 'audience': string | null; + 'label': string | null; /** - * The ID of the test associated with the event. + * The action of the event. For example, "click" or "view" * @type {string} - * @memberof EventOccurred + * @memberOf EventOccurred */ - 'testId': string | null; + 'action': string | null; /** - * The ID of the test group associated with the event, also known as \"variant\". + * The category of the event. For example, "user-interaction" or "content" * @type {string} - * @memberof EventOccurred - */ - 'groupId': string | null; - /** - * The details about the event. - * @type {object} - * @memberof EventOccurred + * @memberOf EventOccurred */ + 'category': string | null; 'details': object; } /** @@ -456,82 +445,82 @@ export interface EventOccurred extends EventPayload { */ export interface EventPayload { /** - * + * * @type {string} * @memberof EventPayload */ '@type': string; } /** - * + * * @export * @interface EventResponse */ export interface EventResponse { /** - * + * * @type {Array} * @memberof EventResponse */ 'items': Array; /** - * + * * @type {EventResponseMetadata} * @memberof EventResponse */ 'metadata': EventResponseMetadata; /** - * + * * @type {string} * @memberof EventResponse */ 'nextCursor': string; } /** - * + * * @export * @interface EventResponseMetadata */ export interface EventResponseMetadata { /** - * + * * @type {string} * @memberof EventResponseMetadata */ 'organizationName': string; /** - * + * * @type {string} * @memberof EventResponseMetadata */ 'organizationSlug': string; /** - * + * * @type {string} * @memberof EventResponseMetadata */ 'workspaceName': string; /** - * + * * @type {string} * @memberof EventResponseMetadata */ 'workspaceSlug': string; /** - * + * * @type {string} * @memberof EventResponseMetadata */ 'applicationName': string; /** - * + * * @type {string} * @memberof EventResponseMetadata */ 'applicationSlug': string; } /** - * + * * @export * @enum {string} */ @@ -613,7 +602,7 @@ export interface GoalCompleted extends EventPayload { */ export interface Location { /** - * + * * @type {LocationContinent} * @memberof Location */ @@ -625,7 +614,7 @@ export interface Location { */ 'country': string | null; /** - * + * * @type {Region} * @memberof Location */ @@ -649,13 +638,13 @@ export interface Location { */ 'timezone': string | null; /** - * + * * @type {GeoPoint} * @memberof Location */ 'coordinates': GeoPoint | null; /** - * + * * @type {LocationSource} * @memberof Location */ @@ -689,7 +678,7 @@ export type LocationContinent = typeof LocationContinent[keyof typeof LocationCo */ export interface LocationDetected extends EventPayload { /** - * + * * @type {Location} * @memberof LocationDetected */ @@ -823,7 +812,7 @@ export interface Order { */ 'installments': number | null; /** - * + * * @type {OrderStatus} * @memberof Order */ @@ -844,7 +833,7 @@ export interface OrderItem { */ 'index': number; /** - * + * * @type {ProductDetails} * @memberof OrderItem */ @@ -881,7 +870,7 @@ export interface OrderItem { */ export interface OrderPlaced extends EventPayload { /** - * + * * @type {Order} * @memberof OrderPlaced */ @@ -1032,7 +1021,7 @@ export interface ProductDetails { */ export interface ProductViewed extends EventPayload { /** - * + * * @type {ProductDetails} * @memberof ProductViewed */ @@ -1058,7 +1047,7 @@ export interface Region { 'code': string | null; } /** - * + * * @export * @interface Session */ @@ -1088,7 +1077,7 @@ export interface Session { */ 'isAnonymous'?: boolean; /** - * + * * @type {SessionWindow} * @memberof Session */ @@ -1112,19 +1101,19 @@ export interface Session { */ 'landingPageUrl'?: string | null; /** - * + * * @type {Campaign} * @memberof Session */ 'campaign'?: Campaign; /** - * + * * @type {Location} * @memberof Session */ 'location'?: Location; /** - * + * * @type {WebClient} * @memberof Session */ @@ -1136,26 +1125,26 @@ export interface Session { */ 'attributes'?: { [key: string]: any | undefined | null; }; /** - * + * * @type {SessionStatistics} * @memberof Session */ 'statistics'?: SessionStatistics; } /** - * + * * @export * @interface SessionResponse */ export interface SessionResponse { /** - * + * * @type {Array} * @memberof SessionResponse */ 'items': Array; /** - * + * * @type {string} * @memberof SessionResponse */ @@ -1193,13 +1182,13 @@ export interface SessionStatistics { */ export interface SessionWindow { /** - * + * * @type {number} * @memberof SessionWindow */ 'start'?: number; /** - * + * * @type {number} * @memberof SessionWindow */ @@ -1218,13 +1207,13 @@ export interface SlotPersonalized { */ '@type': string; /** - * + * * @type {SlotPersonalizedPersonalization} * @memberof SlotPersonalized */ 'personalization': SlotPersonalizedPersonalization; /** - * + * * @type {SlotPersonalizedMetadata} * @memberof SlotPersonalized */ @@ -1280,7 +1269,7 @@ export interface SlotPersonalizedMetadata { 'variantName': string | null; } /** - * + * * @export * @interface SlotPersonalizedPersonalization */ @@ -1310,14 +1299,14 @@ export interface SlotPersonalizedPersonalization { */ 'contentId': string; /** - * + * * @type {SlotPersonalizedPersonalizationAssignedVariant} * @memberof SlotPersonalizedPersonalization */ 'assignedVariant': SlotPersonalizedPersonalizationAssignedVariant | null; } /** - * + * * @export * @interface SlotPersonalizedPersonalizationAssignedVariant */ @@ -1394,7 +1383,7 @@ export interface TabVisibilityChanged extends EventPayload { */ 'tabId': string; /** - * + * * @type {TabVisibility} * @memberof TabVisibilityChanged */ @@ -1420,7 +1409,7 @@ export interface TestGroupAssigned extends EventPayload { 'groupId': string; } /** - * + * * @export * @interface User */ @@ -1486,7 +1475,7 @@ export interface User { */ 'alternatePhone'?: string | null; /** - * + * * @type {UserAddress} * @memberof User */ @@ -1540,7 +1529,7 @@ export interface User { */ 'lastModifiedTime'?: number; /** - * + * * @type {UserStatistics} * @memberof User */ @@ -1553,56 +1542,56 @@ export interface User { */ export interface UserAddress { /** - * + * * @type {string} * @memberof UserAddress */ 'street'?: string | null; /** - * + * * @type {string} * @memberof UserAddress */ 'district'?: string | null; /** - * + * * @type {string} * @memberof UserAddress */ 'city'?: string | null; /** - * + * * @type {string} * @memberof UserAddress */ 'region'?: string | null; /** - * + * * @type {string} * @memberof UserAddress */ 'country'?: string | null; /** - * + * * @type {string} * @memberof UserAddress */ 'postalCode'?: string | null; } /** - * + * * @export * @interface UserResponse */ export interface UserResponse { /** - * + * * @type {Array} * @memberof UserResponse */ 'items': Array; /** - * + * * @type {string} * @memberof UserResponse */ @@ -1673,13 +1662,13 @@ export interface UserStatistics { */ export interface WebClient { /** - * + * * @type {Browser} * @memberof WebClient */ 'browser': Browser; /** - * + * * @type {Device} * @memberof WebClient */ @@ -1712,12 +1701,12 @@ export interface WebContext extends EventContext { export const ExportApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * - * @param {number} [start] - * @param {number} [end] - * @param {number} [pageSize] - * @param {string} [cursor] - * @param {Array} [events] + * + * @param {number} [start] + * @param {number} [end] + * @param {number} [pageSize] + * @param {string} [cursor] + * @param {Array} [events] * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1758,7 +1747,7 @@ export const ExportApiAxiosParamCreator = function (configuration?: Configuratio } - + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -1769,11 +1758,11 @@ export const ExportApiAxiosParamCreator = function (configuration?: Configuratio }; }, /** - * - * @param {number} [start] - * @param {number} [end] - * @param {number} [pageSize] - * @param {string} [cursor] + * + * @param {number} [start] + * @param {number} [end] + * @param {number} [pageSize] + * @param {string} [cursor] * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1810,7 +1799,7 @@ export const ExportApiAxiosParamCreator = function (configuration?: Configuratio } - + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -1821,11 +1810,11 @@ export const ExportApiAxiosParamCreator = function (configuration?: Configuratio }; }, /** - * - * @param {number} [start] - * @param {number} [end] - * @param {number} [pageSize] - * @param {string} [cursor] + * + * @param {number} [start] + * @param {number} [end] + * @param {number} [pageSize] + * @param {string} [cursor] * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1862,7 +1851,7 @@ export const ExportApiAxiosParamCreator = function (configuration?: Configuratio } - + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -1883,12 +1872,12 @@ export const ExportApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ExportApiAxiosParamCreator(configuration) return { /** - * - * @param {number} [start] - * @param {number} [end] - * @param {number} [pageSize] - * @param {string} [cursor] - * @param {Array} [events] + * + * @param {number} [start] + * @param {number} [end] + * @param {number} [pageSize] + * @param {string} [cursor] + * @param {Array} [events] * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1899,11 +1888,11 @@ export const ExportApiFp = function(configuration?: Configuration) { return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * - * @param {number} [start] - * @param {number} [end] - * @param {number} [pageSize] - * @param {string} [cursor] + * + * @param {number} [start] + * @param {number} [end] + * @param {number} [pageSize] + * @param {string} [cursor] * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1914,11 +1903,11 @@ export const ExportApiFp = function(configuration?: Configuration) { return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * - * @param {number} [start] - * @param {number} [end] - * @param {number} [pageSize] - * @param {string} [cursor] + * + * @param {number} [start] + * @param {number} [end] + * @param {number} [pageSize] + * @param {string} [cursor] * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1939,7 +1928,7 @@ export const ExportApiFactory = function (configuration?: Configuration, basePat const localVarFp = ExportApiFp(configuration) return { /** - * + * * @param {ExportApiExportEventsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1948,7 +1937,7 @@ export const ExportApiFactory = function (configuration?: Configuration, basePat return localVarFp.exportEvents(requestParameters.start, requestParameters.end, requestParameters.pageSize, requestParameters.cursor, requestParameters.events, options).then((request) => request(axios, basePath)); }, /** - * + * * @param {ExportApiExportSessionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1957,7 +1946,7 @@ export const ExportApiFactory = function (configuration?: Configuration, basePat return localVarFp.exportSessions(requestParameters.start, requestParameters.end, requestParameters.pageSize, requestParameters.cursor, options).then((request) => request(axios, basePath)); }, /** - * + * * @param {ExportApiExportUsersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1975,35 +1964,35 @@ export const ExportApiFactory = function (configuration?: Configuration, basePat */ export interface ExportApiExportEventsRequest { /** - * + * * @type {number} * @memberof ExportApiExportEvents */ readonly start?: number /** - * + * * @type {number} * @memberof ExportApiExportEvents */ readonly end?: number /** - * + * * @type {number} * @memberof ExportApiExportEvents */ readonly pageSize?: number /** - * + * * @type {string} * @memberof ExportApiExportEvents */ readonly cursor?: string /** - * + * * @type {Array} * @memberof ExportApiExportEvents */ @@ -2017,28 +2006,28 @@ export interface ExportApiExportEventsRequest { */ export interface ExportApiExportSessionsRequest { /** - * + * * @type {number} * @memberof ExportApiExportSessions */ readonly start?: number /** - * + * * @type {number} * @memberof ExportApiExportSessions */ readonly end?: number /** - * + * * @type {number} * @memberof ExportApiExportSessions */ readonly pageSize?: number /** - * + * * @type {string} * @memberof ExportApiExportSessions */ @@ -2052,28 +2041,28 @@ export interface ExportApiExportSessionsRequest { */ export interface ExportApiExportUsersRequest { /** - * + * * @type {number} * @memberof ExportApiExportUsers */ readonly start?: number /** - * + * * @type {number} * @memberof ExportApiExportUsers */ readonly end?: number /** - * + * * @type {number} * @memberof ExportApiExportUsers */ readonly pageSize?: number /** - * + * * @type {string} * @memberof ExportApiExportUsers */ @@ -2088,7 +2077,7 @@ export interface ExportApiExportUsersRequest { */ export class ExportApi extends BaseAPI { /** - * + * * @param {ExportApiExportEventsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -2099,7 +2088,7 @@ export class ExportApi extends BaseAPI { } /** - * + * * @param {ExportApiExportSessionsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -2110,7 +2099,7 @@ export class ExportApi extends BaseAPI { } /** - * + * * @param {ExportApiExportUsersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} From 3a6493fbf963d539ce2a79fdf7f28acf82d9d6f3 Mon Sep 17 00:00:00 2001 From: Denis Rossati Date: Thu, 5 Jun 2025 16:28:16 -0300 Subject: [PATCH 2/4] Add cart abandoned event --- README.md | 1 + api.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index ed3370a..aa9e0b3 100644 --- a/README.md +++ b/README.md @@ -301,6 +301,7 @@ The list possible event types are: | `pageOpened` | 1.0.0 | | `pageLoaded` | 1.0.0 | | `productViewed` | 1.0.0 | +| `cartAbandoned` | 1.0.0 | | `cartViewed` | 1.0.0 | | `cartModified` | 1.0.0 | | `checkoutStarted` | 1.0.0 | diff --git a/api.ts b/api.ts index d67129f..ad48037 100644 --- a/api.ts +++ b/api.ts @@ -254,6 +254,20 @@ export interface CartModified extends EventPayload { */ 'cart': Cart; } + +/** + * An event recording that a shopping cart was abandoned. + * @export + * @interface CartAbandoned + */ +export interface CartAbandoned extends EventPayload { + /** + * + * @type {Cart} + * @memberof CartAbanoned + */ + 'cart': Cart; +} /** * An event recording that a shopping cart was viewed. * @export @@ -537,6 +551,7 @@ export const EventType = { PAGE_OPENED: 'pageOpened', PAGE_LOADED: 'pageLoaded', PRODUCT_VIEWED: 'productViewed', + CART_ABANDONED: 'cartAbandoned', CART_VIEWED: 'cartViewed', CART_MODIFIED: 'cartModified', CHECKOUT_STARTED: 'checkoutStarted', From 871f4a9976440f1ac4da38260f76d1591be48974 Mon Sep 17 00:00:00 2001 From: Denis Rossati Date: Thu, 5 Jun 2025 16:29:59 -0300 Subject: [PATCH 3/4] Add product abandoned event --- README.md | 1 + api.ts | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/README.md b/README.md index aa9e0b3..b5f3a69 100644 --- a/README.md +++ b/README.md @@ -300,6 +300,7 @@ The list possible event types are: | `clientDetected` | 1.0.0 | | `pageOpened` | 1.0.0 | | `pageLoaded` | 1.0.0 | +| `productAbandoned` | 1.0.0 | | `productViewed` | 1.0.0 | | `cartAbandoned` | 1.0.0 | | `cartViewed` | 1.0.0 | diff --git a/api.ts b/api.ts index ad48037..e08d924 100644 --- a/api.ts +++ b/api.ts @@ -550,6 +550,7 @@ export const EventType = { CLIENT_DETECTED: 'clientDetected', PAGE_OPENED: 'pageOpened', PAGE_LOADED: 'pageLoaded', + PRODUCT_ABANDONED: 'productAbandoned', PRODUCT_VIEWED: 'productViewed', CART_ABANDONED: 'cartAbandoned', CART_VIEWED: 'cartViewed', @@ -1029,6 +1030,25 @@ export interface ProductDetails { */ 'imageUrl': string | null; } +/** + * An event recording that a shopping cart item was abandoned. + * @export + * @interface ProductAbandoned + */ +export interface ProductAbandoned extends EventPayload { + /** + * + * @type {Cart} + * @memberof ProductAbandoned + */ + 'cart': Cart; + /** + * + * @type {CartItem} + * @memberof ProductAbandoned + */ + 'cartItem': CartItem; +} /** * An event recording that a shopping cart was modified. * @export From 51ae9c1458a78c77853bffec09d58826c0768f9d Mon Sep 17 00:00:00 2001 From: Denis Rossati Date: Thu, 5 Jun 2025 16:31:44 -0300 Subject: [PATCH 4/4] Remove breakline --- api.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/api.ts b/api.ts index e08d924..8136343 100644 --- a/api.ts +++ b/api.ts @@ -254,7 +254,6 @@ export interface CartModified extends EventPayload { */ 'cart': Cart; } - /** * An event recording that a shopping cart was abandoned. * @export