-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support new expiresAt/expiresIn/token/passed fields with trackOnce({ fraud: true }) and trackVerified() #159
Changes from 7 commits
34fa1eb
59b890d
a562e6e
d7e0fb2
7c5af93
88a48de
518d9f9
eab72d6
b04ab32
7759979
0b2387b
fab26fb
1e37c3d
669cec0
65779eb
081dcf4
7a3979a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,19 +23,19 @@ export class RadarLocationError extends RadarError { | |
} | ||
} | ||
|
||
export class RadarLocationPermissionsError extends RadarError { | ||
export class RadarPermissionsError extends RadarError { | ||
constructor(message: string) { | ||
super(message); | ||
this.name = 'RadarLocationPermissionsError'; | ||
this.name = 'RadarPermissionsError'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To match mobile SDKs |
||
this.status = 'ERROR_PERMISSIONS'; | ||
} | ||
} | ||
|
||
export class RadarDesktopAppError extends RadarError { | ||
export class RadarVerifyAppError extends RadarError { | ||
constructor() { | ||
super('Desktop app not running.'); | ||
this.name = 'RadarDesktopAppError'; | ||
this.status = 'ERROR_DESKTOP_APP'; | ||
super('Radar Verify app not running.'); | ||
this.name = 'RadarVerifyAppError'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To account for Radar Verify desktop AND mobile apps |
||
this.status = 'ERROR_VERIFY_APP'; | ||
} | ||
} | ||
|
||
|
@@ -131,11 +131,11 @@ export class RadarServerError extends RadarError { | |
} | ||
} | ||
|
||
export class RadarTimeoutError extends RadarError { | ||
export class RadarNetworkError extends RadarError { | ||
constructor() { | ||
super('Request timed out.'); | ||
this.name = 'RadarTimeoutError'; | ||
this.status = 'ERROR_TIMED_OUT'; | ||
this.name = 'RadarNetworkError'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To match mobile SDKs |
||
this.status = 'ERROR_NETWORK'; | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,10 +148,6 @@ class Radar { | |
return VerifyAPI.trackVerified(params); | ||
} | ||
|
||
public static trackVerifiedToken(params: RadarTrackParams = {}) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we don't want this to be a breaking change, could we potentially pass the Could also include a deprecation notice: Logger.warn('DEPRECATED - trackVerifiedToken will be removed in a future release.'); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nobody uses this in prod yet (except for our demo page), so I think we're fine to skip this |
||
return VerifyAPI.trackVerified(params, true); | ||
} | ||
|
||
public static getContext(params: Location) { | ||
return ContextAPI.getContext(params); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,7 +108,8 @@ export type RadarEventType = | |
| 'user.updated_trip' | ||
| 'user.approaching_trip_destination' | ||
| 'user.arrived_at_trip_destination' | ||
| 'user.stopped_trip'; | ||
| 'user.stopped_trip' | ||
| 'user.failed_fraud'; | ||
|
||
export interface RadarGeofence { | ||
_id: string; | ||
|
@@ -212,8 +213,11 @@ export interface RadarTrackResponse extends RadarResponse { | |
events?: RadarEvent[]; | ||
} | ||
|
||
export interface RadarTrackTokenResponse extends RadarResponse { | ||
export interface RadarTrackVerifiedResponse extends RadarTrackResponse { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could also be a separate interface instead of extending |
||
token?: String; | ||
expiresAt?: Date; | ||
expiresIn?: number; | ||
passed?: boolean; | ||
} | ||
|
||
export interface RadarContextResponse extends RadarResponse { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export default '4.1.18'; | ||
export default '4.2.0-beta.0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we shipping these changes as
4.2
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing
trackVerifiedToken()
and renaming the error codes are breaking changes, so should prob be4.2.x
instead of4.1.x