Skip to content

Commit

Permalink
Merge pull request #151 from rudderlabs/release/2.0.10
Browse files Browse the repository at this point in the history
chore(release): pulling release/2.0.10 into master
  • Loading branch information
MoumitaM authored Sep 9, 2024
2 parents a5d6b08 + 020cc61 commit 93809fa
Show file tree
Hide file tree
Showing 5 changed files with 501 additions and 405 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [2.0.10](https://github.com/rudderlabs/rudder-sdk-node/compare/v2.0.9...v2.0.10) (2024-09-06)

### [2.0.9](https://github.com/rudderlabs/rudder-sdk-node/compare/v2.0.8...v2.0.9) (2024-08-14)

### [2.0.8](https://github.com/rudderlabs/rudder-sdk-node/compare/v2.0.7...v2.0.8) (2024-08-14)
Expand Down
128 changes: 57 additions & 71 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,57 @@ export interface constructorOptions {
export type apiCallback = () => void;
export type FlushCallback = (error?: Error, data?: any) => void;

type IdentityOptions =
| { userId: string; anonymousId?: string }
| { userId?: string; anonymousId: string };

export type IdentifyParams = {
context?: apiObject;
traits?: apiObject;
integrations?: integrationOptions;
timestamp?: Date;
} & IdentityOptions;

export type PageParams = {
name: string;
context?: apiObject;
properties?: apiObject;
integrations?: integrationOptions;
timestamp?: Date;
} & IdentityOptions;

export type TrackParams = {
event: string;
context?: apiObject;
properties?: apiObject;
integrations?: integrationOptions;
timestamp?: Date;
} & IdentityOptions;

export type GroupParams = {
groupId: string;
context?: apiObject;
traits?: apiObject;
integrations?: integrationOptions;
timestamp?: Date;
} & IdentityOptions;

export type ScreenParams = {
name: string;
context?: apiObject;
properties?: apiObject;
integrations?: integrationOptions;
timestamp?: Date;
} & IdentityOptions;

export type AliasParams = {
previousId: string;
context?: apiObject;
properties?: apiObject;
integrations?: integrationOptions;
timestamp?: Date;
} & IdentityOptions;

declare class Analytics {
/**
* Initialize a new `Analytics` with your RudderStack project's `writeKey` and an
Expand Down Expand Up @@ -145,17 +196,7 @@ declare class Analytics {
* @param {Function=} callback (optional)
* @return {Analytics}
*/
identify(
message: {
userId?: string;
anonymousId?: string;
context?: apiObject;
traits?: apiObject;
integrations?: integrationOptions;
timestamp?: Date;
},
callback?: apiCallback,
): Analytics;
identify(message: IdentifyParams, callback?: apiCallback): Analytics;
/**
* Send a group `message`.
*
Expand All @@ -170,18 +211,7 @@ declare class Analytics {
* @param {Function=} callback (optional)
* @return {Analytics}
*/
group(
message: {
groupId: string;
userId?: string;
anonymousId?: string;
context?: apiObject;
traits?: apiObject;
integrations?: integrationOptions;
timestamp?: Date;
},
callback?: apiCallback,
): Analytics;
group(message: GroupParams, callback?: apiCallback): Analytics;
/**
* Send a track `message`.
*
Expand All @@ -196,18 +226,7 @@ declare class Analytics {
* @param {Function=} callback (optional)
* @return {Analytics}
*/
track(
message: {
event: string;
userId?: string;
anonymousId?: string;
context?: apiObject;
properties?: apiObject;
integrations?: integrationOptions;
timestamp?: Date;
},
callback?: apiCallback,
): Analytics;
track(message: TrackParams, callback?: apiCallback): Analytics;

/**
* Send a page `message`.
Expand All @@ -223,18 +242,7 @@ declare class Analytics {
* @param {Function=} callback (optional)
* @return {Analytics}
*/
page(
message: {
name: string;
userId?: string;
anonymousId?: string;
context?: apiObject;
properties?: apiObject;
integrations?: integrationOptions;
timestamp?: Date;
},
callback?: apiCallback,
): Analytics;
page(message: PageParams, callback?: apiCallback): Analytics;

/**
* Send a screen `message`.
Expand All @@ -250,18 +258,7 @@ declare class Analytics {
* @param {Function=} callback (optional)
* @return {Analytics}
*/
screen(
message: {
name: string;
userId?: string;
anonymousId?: string;
context?: apiObject;
properties?: apiObject;
integrations?: integrationOptions;
timestamp?: Date;
},
callback?: apiCallback,
): Analytics;
screen(message: ScreenParams, callback?: apiCallback): Analytics;

/**
* Send an alias `message`.
Expand All @@ -277,18 +274,7 @@ declare class Analytics {
* @param {Function=} callback (optional)
* @return {Analytics}
*/
alias(
message: {
previousId: string;
userId?: string;
anonymousId?: string;
context?: apiObject;
properties?: apiObject;
integrations?: integrationOptions;
timestamp?: Date;
},
callback?: apiCallback,
): Analytics;
alias(message: AliasParams, callback?: apiCallback): Analytics;

/**
* Flush the current queue
Expand Down
Loading

0 comments on commit 93809fa

Please sign in to comment.