Skip to content

Commit 5d22fac

Browse files
authored
feat: add optional messageId field for NodeJS (#285)
1 parent d967f8c commit 5d22fac

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

src/__tests__/commands/__snapshots__/build.test.ts.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6679,6 +6679,11 @@ export type TrackMessage<PropertiesType> = Options & Record<string, any> & Ident
66796679
* a timestamp.
66806680
*/
66816681
timestamp?: Date
6682+
/**
6683+
* MessageId which can be optionally set to override the default one generated by the library.
6684+
* This is useful when you want to deduplicate messages.
6685+
*/
6686+
messageId?: string
66826687
}
66836688

66846689
/** The callback exposed by analytics-node. */
@@ -8248,6 +8253,11 @@ export type TrackMessage<PropertiesType> = Options & Record<string, any> & Ident
82488253
* a timestamp.
82498254
*/
82508255
timestamp?: Date
8256+
/**
8257+
* MessageId which can be optionally set to override the default one generated by the library.
8258+
* This is useful when you want to deduplicate messages.
8259+
*/
8260+
messageId?: string
82518261
}
82528262

82538263
/** The callback exposed by analytics-node. */
@@ -9778,6 +9788,11 @@ export type TrackMessage<PropertiesType> = Options & Record<string, any> & Ident
97789788
* a timestamp.
97799789
*/
97809790
timestamp?: Date
9791+
/**
9792+
* MessageId which can be optionally set to override the default one generated by the library.
9793+
* This is useful when you want to deduplicate messages.
9794+
*/
9795+
messageId?: string
97819796
}
97829797

97839798
/** The callback exposed by analytics-node. */

src/__tests__/commands/__snapshots__/production.test.ts.snap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,6 +2125,11 @@ export type TrackMessage<PropertiesType> = Options & Record<string, any> & Ident
21252125
* a timestamp.
21262126
*/
21272127
timestamp?: Date
2128+
/**
2129+
* MessageId which can be optionally set to override the default one generated by the library.
2130+
* This is useful when you want to deduplicate messages.
2131+
*/
2132+
messageId?: string
21282133
}
21292134
21302135
/** The callback exposed by analytics-node. */

src/languages/templates/typescript/node.hbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ export type TrackMessage<PropertiesType> = Options & Record<string, any> & Ident
3030
* a timestamp.
3131
*/
3232
timestamp?: Date
33+
/**
34+
* MessageId which can be optionally set to override the default one generated by the library.
35+
* This is useful when you want to deduplicate messages.
36+
*/
37+
messageId?: string
3338
}
3439

3540
/** The callback exposed by analytics-node. */

0 commit comments

Comments
 (0)