Skip to content

Commit

Permalink
profile: rename eventData to eventAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-roland committed Sep 6, 2024
1 parent 3acf794 commit 92215fc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions __tests__/profileTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/batchStub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 92215fc

Please sign in to comment.