From 92215fc08575ac411f368f0bbc6cf183be5133f3 Mon Sep 17 00:00:00 2001 From: Arnaud Roland Date: Wed, 4 Sep 2024 17:46:09 +0200 Subject: [PATCH] profile: rename eventData to eventAttributes --- __tests__/profileTests.ts | 8 ++++---- src/batchStub.ts | 4 ++-- src/modules/profile.ts | 4 ++-- types/index.d.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/__tests__/profileTests.ts b/__tests__/profileTests.ts index ca060ab..5d27240 100644 --- a/__tests__/profileTests.ts +++ b/__tests__/profileTests.ts @@ -64,9 +64,9 @@ afterEach(() => { test("it tracks events", () => { const profileModule = new ProfileModule(); profileModule.trackEvent("foo"); - profileModule.trackEvent("foo_2", new profileModule.eventData().put("$label","fooBAR")); + profileModule.trackEvent("foo_2", new profileModule.eventAttributes().put("$label","fooBAR")); - const eventData = new profileModule.eventData(); + const eventData = new profileModule.eventAttributes(); eventData .put("$tags", ["foo", "bar"]) .put("foo", "bar") @@ -75,8 +75,8 @@ test("it tracks events", () => { .put("int", 2) .put("date", new Date(1520352788000)) .put("url", new URL("https://batch.com")) - .put("object", new profileModule.eventData().put("foo","bar")) - .put("object_array", [new profileModule.eventData().put("foo","bar"), new profileModule.eventData().put("foo","bar") ]); + .put("object", new profileModule.eventAttributes().put("foo","bar")) + .put("object_array", [new profileModule.eventAttributes().put("foo","bar"), new profileModule.eventAttributes().put("foo","bar") ]); profileModule.trackEvent("foo_3", eventData); expect(mockedTrackEvent.mock.calls.length).toBe(3); diff --git a/src/batchStub.ts b/src/batchStub.ts index 05ec67d..a3c2ea0 100644 --- a/src/batchStub.ts +++ b/src/batchStub.ts @@ -34,10 +34,10 @@ class PushStub implements BatchSDK.PushModule { } class ProfileStub implements BatchSDK.ProfileModule { - public eventData: typeof BatchSDK.BatchEventAttributes; + public eventAttributes: typeof BatchSDK.BatchEventAttributes; constructor() { - this.eventData = BatchEventDataStub; + this.eventAttributes = BatchEventDataStub; } public getEditor(): BatchSDK.BatchProfileAttributeEditor { diff --git a/src/modules/profile.ts b/src/modules/profile.ts index 87093d9..f645d7e 100644 --- a/src/modules/profile.ts +++ b/src/modules/profile.ts @@ -6,10 +6,10 @@ import { BatchProfileAttributeEditor } from "./profile/profileAttributeEditor"; import { BatchSDK } from "../../types"; export class ProfileModule implements BatchSDK.ProfileModule { - public eventData: typeof BatchSDK.BatchEventAttributes; + public eventAttributes: typeof BatchSDK.BatchEventAttributes; constructor() { - this.eventData = BatchEventAttributes; + this.eventAttributes = BatchEventAttributes; } identify(identifier: string | null): void { diff --git a/types/index.d.ts b/types/index.d.ts index 9a8806d..5acf331 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -272,7 +272,7 @@ export declare namespace BatchSDK { * Batch's profile module */ interface ProfileModule { - eventData: typeof BatchEventAttributes; + eventAttributes: typeof BatchEventAttributes; /** * Identifies this device with a profile using a Custom User ID.