Skip to content

Commit

Permalink
Removed unused readline dependency for use in browser.
Browse files Browse the repository at this point in the history
  • Loading branch information
T99 committed Jul 14, 2019
1 parent dfb7743 commit f042060
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 65 deletions.
2 changes: 1 addition & 1 deletion js/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/main.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 2 additions & 20 deletions js/s2-api-response.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/s2-api-response.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@subscribeto/ts-api",
"version": "0.1.1",
"version": "0.1.2",
"description": "A collection of utility classes for accessing the sub.scribe.to API.",
"publishConfig": {
"access": "public"
Expand Down
42 changes: 1 addition & 41 deletions ts/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
* @since v0.1.0
*/

import readline from "readline";
import { S2UserSignUpEndpoint } from "./raw-access/s2-user-endpoint";
import { S2APIResponse } from "./s2-api-response";
import { S2TokenResponseStructure } from "./interfaces/s2-token-response-structure";

export { S2API } from "./s2-api";
export { S2APIResponse } from "./s2-api-response"
export { S2Endpoint } from "./raw-access/s2-endpoint"
Expand All @@ -26,39 +21,4 @@ export {
S2UserAuthenticationEndpoint,
S2UserSignUpEndpoint,
S2UserSignInEndpoint
} from "./raw-access/s2-user-endpoint";

const main: () => Promise<void> = async (): Promise<void> => {

let response1: S2APIResponse<S2TokenResponseStructure> = await S2UserSignUpEndpoint.signUp("trevorsears.main@gmail.com", "alpine");
let emailCode: string = await prompt("What is the email code? ");
let response2: S2APIResponse<S2TokenResponseStructure> = await S2UserSignUpEndpoint.finalize(response1.getBody().token, emailCode);
let sessionToken: string = response2.getBody().token;

console.log("Session token: " + sessionToken);

};

const prompt: (question: string) => Promise<string> = async (question: string): Promise<string> => {

return new Promise<string>((resolve: (response: string) => any, reject: () => any): void => {

let readlineInstance = readline.createInterface({

input: process.stdin,
output: process.stdout

});

readlineInstance.question(question, (response: string): void => {

resolve(response);
readlineInstance.close();

});

});

};

main();
} from "./raw-access/s2-user-endpoint";

0 comments on commit f042060

Please sign in to comment.