From ebaaaee61bd756499dd886714d7162d55430464a Mon Sep 17 00:00:00 2001 From: Denis Rossati Date: Fri, 16 Aug 2024 12:22:14 -0300 Subject: [PATCH] Remove event occurred properties (#414) --- src/schema/eventSchemas.ts | 16 ---------- src/trackingEvents.ts | 4 --- test/facade/trackerFacade.test.ts | 4 --- test/schemas/eventSchemas.test.ts | 52 ------------------------------- test/tracker.test.ts | 4 --- 5 files changed, 80 deletions(-) diff --git a/src/schema/eventSchemas.ts b/src/schema/eventSchemas.ts index fcc7f50c..64f0d0f5 100644 --- a/src/schema/eventSchemas.ts +++ b/src/schema/eventSchemas.ts @@ -114,22 +114,6 @@ export const eventOccurred = new ObjectType({ minLength: 1, maxLength: 50, }), - testId: new StringType({ - minLength: 1, - maxLength: 50, - }), - groupId: new StringType({ - minLength: 1, - maxLength: 50, - }), - personalizationId: new StringType({ - minLength: 1, - maxLength: 50, - }), - audience: new StringType({ - minLength: 1, - maxLength: 50, - }), details: new ObjectType({ additionalProperties: new UnionType( new NullType(), diff --git a/src/trackingEvents.ts b/src/trackingEvents.ts index 302e75bc..9a59c2a4 100644 --- a/src/trackingEvents.ts +++ b/src/trackingEvents.ts @@ -325,10 +325,6 @@ export interface PostViewed extends BaseEvent { export interface EventOccurred extends BaseEvent { type: 'eventOccurred'; name: string; - testId?: string; - groupId?: string; - personalizationId?: string; - audience?: string; details?: {[key: string]: string|number|boolean|null}; } diff --git a/test/facade/trackerFacade.test.ts b/test/facade/trackerFacade.test.ts index 5756c931..3e388465 100644 --- a/test/facade/trackerFacade.test.ts +++ b/test/facade/trackerFacade.test.ts @@ -232,10 +232,6 @@ describe('A tracker facade', () => { { type: 'eventOccurred', name: 'event-name', - personalizationId: 'foo', - audience: 'bar', - testId: 'baz', - groupId: 'barbaz', details: { foo: 'bar', }, diff --git a/test/schemas/eventSchemas.test.ts b/test/schemas/eventSchemas.test.ts index 3cc92f4e..9a4097fb 100644 --- a/test/schemas/eventSchemas.test.ts +++ b/test/schemas/eventSchemas.test.ts @@ -215,10 +215,6 @@ describe('The "eventOccurred" payload schema', () => { }], [{ name: 'event-name', - personalizationId: 'foo', - audience: 'bar', - testId: 'baz', - groupId: 'barbaz', details: { number: 10, null: null, @@ -251,54 +247,6 @@ describe('The "eventOccurred" payload schema', () => { {name: null}, 'Expected value of type string at path \'/name\', actual null.', ], - [ - {name: 'foo', personalizationId: ''}, - 'Expected at least 1 character at path \'/personalizationId\', actual 0.', - ], - [ - {name: 'foo', personalizationId: 'x'.repeat(51)}, - 'Expected at most 50 characters at path \'/personalizationId\', actual 51.', - ], - [ - {name: 'foo', personalizationId: null}, - 'Expected value of type string at path \'/personalizationId\', actual null.', - ], - [ - {name: 'foo', audience: ''}, - 'Expected at least 1 character at path \'/audience\', actual 0.', - ], - [ - {name: 'foo', audience: 'x'.repeat(51)}, - 'Expected at most 50 characters at path \'/audience\', actual 51.', - ], - [ - {name: 'foo', audience: null}, - 'Expected value of type string at path \'/audience\', actual null.', - ], - [ - {name: 'foo', testId: ''}, - 'Expected at least 1 character at path \'/testId\', actual 0.', - ], - [ - {name: 'foo', testId: 'x'.repeat(51)}, - 'Expected at most 50 characters at path \'/testId\', actual 51.', - ], - [ - {name: 'foo', testId: null}, - 'Expected value of type string at path \'/testId\', actual null.', - ], - [ - {name: 'foo', groupId: ''}, - 'Expected at least 1 character at path \'/groupId\', actual 0.', - ], - [ - {name: 'foo', groupId: 'x'.repeat(51)}, - 'Expected at most 50 characters at path \'/groupId\', actual 51.', - ], - [ - {name: 'foo', groupId: null}, - 'Expected value of type string at path \'/groupId\', actual null.', - ], [ {name: 'foo', details: null}, 'Expected value of type object at path \'/details\', actual null.', diff --git a/test/tracker.test.ts b/test/tracker.test.ts index 37ca3ca9..ee64fbc2 100644 --- a/test/tracker.test.ts +++ b/test/tracker.test.ts @@ -1204,10 +1204,6 @@ describe('A tracker', () => { { type: 'eventOccurred', name: 'event-name', - personalizationId: 'foo', - audience: 'bar', - testId: 'baz', - groupId: 'barbaz', details: { foo: 'bar', },