Skip to content

Commit

Permalink
chore: provide flexibility for an optional rudderMessage schema
Browse files Browse the repository at this point in the history
Signed-off-by: Sai Sankeerth <[email protected]>
  • Loading branch information
Sai Sankeerth committed Nov 7, 2023
1 parent 0f44408 commit 4bcc8db
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,37 @@ type Destination = {
type UserTransformationLibrary = {
VersionID: string;
};

type RudderTimestamp = Date | string;
type RudderMessageType =
| 'identify'
| 'track'
| 'page'
| 'screen'
| 'group'
| 'alias'
| 'audiencelist';

type RudderMessageSchema = Partial<{
userId: string;
anonymousId: string;
type: RudderMessageType;
channel: string;
context: object;
originalTimestamp: RudderTimestamp;
sentAt: RudderTimestamp;
timestamp: RudderTimestamp;
event: string;
integrations: object;
messageId: string;
properties: object;
traits: object;
[key: string]: FixMe;
}>;

type RouterTransformationRequestData = {
request?: object;
message: RudderMessage;
message: RudderMessageSchema;
metadata: Metadata;
destination: Destination;
};
Expand Down Expand Up @@ -241,4 +269,5 @@ export {
UserDeletionResponse,
Destination,
ComparatorInput,
RudderMessageSchema,
};

0 comments on commit 4bcc8db

Please sign in to comment.