Skip to content

Commit

Permalink
Add RFC 3339 date fields and add sessionToken to registerFeedback
Browse files Browse the repository at this point in the history
  • Loading branch information
figueredo committed Jul 18, 2024
1 parent ee797ee commit c5abe89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,14 @@ export type RegisterFeedbackBodyProps = {
event: string
accountId?: string
installationId?: string
sessionToken?: string
loginId?: string
paymentId?: string
signupId?: string
/** @deprecated use occurredAt instead */
timestamp?: number
occurredAt?: Date
expiresAt?: Date
[x: string]: any
}

Expand All @@ -130,7 +134,9 @@ export type RegisterTransactionProps = (
type TransactionLocation = {
latitude: number
longitude: number
/** @deprecated use collectedAt instead */
timestamp?: number
collectedAt?: Date
}

type AddressCoordinates = {
Expand Down
6 changes: 4 additions & 2 deletions test/formatting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ describe('convertObjectToSnakeCase', () => {
convertObjectToSnakeCase({
keyName: { nestedKey: 2 },
a: [{ nestedInArray: 'black_rice' }],
keyNameWithNumber60d: 3
keyNameWithNumber60d: 3,
keyValueIsDate: new Date('2024-07-17T01:02:03Z')
})
).toEqual({
key_name: { nested_key: 2 },
a: [{ nested_in_array: 'black_rice' }],
key_name_with_number_60d: 3
key_name_with_number_60d: 3,
key_value_is_date: '2024-07-17T01:02:03.000Z'
})
})
})
Expand Down

0 comments on commit c5abe89

Please sign in to comment.