-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from raphckrman/dev
feat(Account): Add requestNewPassword for password reset request
- Loading branch information
Showing
7 changed files
with
7,769 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const TurboSelf = require('turboself-api') | ||
|
||
async function main() { | ||
let newPasswordRequest = await TurboSelf.requestNewPassword("your_email"); | ||
console.log(newPasswordRequest); | ||
} | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { RequestNewPasswordResult } from "../interfaces/Account"; | ||
import { SEND_PASSWORD_RESET_REQUEST } from "../utils/endpoints"; | ||
import { TurboselfFetcher } from "../utils/fetcher"; | ||
|
||
export const requestNewPassword = async (email: string): Promise<RequestNewPasswordResult> => { | ||
const response = await TurboselfFetcher("https://api-rest-prod.incb.fr" + SEND_PASSWORD_RESET_REQUEST(email), { | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/json" | ||
} | ||
}); | ||
|
||
return await response.json() as RequestNewPasswordResult; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export interface RequestNewPasswordResult { | ||
/** List of email addresses that were accepted */ | ||
accepted: string[]; | ||
/** List of email addresses that were rejected */ | ||
rejected: string[]; | ||
/** Time it took to send the envelope */ | ||
envelopeTime: number; | ||
/** Time it took to send the message */ | ||
messageTime: number; | ||
/** Size of the message in bytes */ | ||
messageSize: number; | ||
/** Response from the server */ | ||
response: string; | ||
/** Envelope information */ | ||
envelope: { | ||
from: string; | ||
to: string[]; | ||
}; | ||
/** Message identifier */ | ||
messageId: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.