-
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
expose trackVerified() #107
Conversation
I tested this out with Radar Verify, and it worked well. |
src/index.ts
Outdated
try { | ||
return VerifyAPI.trackVerified(params); | ||
} finally { | ||
ConfigAPI.getConfig(params); // call with updated permissions |
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.
It doesn't seem like trackVerified is making any calls that would modify permissions
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.
Agreed, will simplify
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.
Done
src/http.ts
Outdated
}: { | ||
method: HttpMethod; | ||
path: string; | ||
data?: any; | ||
host?: string | undefined; |
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.
I think this can just be host?: string;
, then you don't need the default argument above.
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.
Done
src/http.ts
Outdated
@@ -129,7 +132,11 @@ class Http { | |||
} | |||
|
|||
xhr.onerror = function() { | |||
reject(new RadarServerError()); | |||
if (host && host.includes('localhost')) { |
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.
We should include the port here, it's possible that localhost can be a valid host (ie. developing against dashboard locally)
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.
Good call, done
Exposes
trackVerified()
, which callsPOST /track
on desktop agent running onlocalhost:52516
. Need to add error handling (e.g., case where desktop agent not installed or not running)