Skip to content

Commit

Permalink
v0.1.0 commit - user endpoint partially finished.
Browse files Browse the repository at this point in the history
  • Loading branch information
T99 committed Jul 13, 2019
1 parent d39d367 commit 7c6924d
Show file tree
Hide file tree
Showing 70 changed files with 11,987 additions and 192 deletions.
4 changes: 4 additions & 0 deletions .d.ts/interfaces/s2-token-response-structure.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface S2TokenResponseStructure {
readonly token: string;
readonly type: string;
}
4 changes: 4 additions & 0 deletions .d.ts/main.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { S2API } from "./s2-api";
export { S2APIResponse } from "./s2-api-response";
export { S2Endpoint } from "./raw-access/s2-endpoint";
export { S2UserEndpoint, S2UserAuthenticationEndpoint, S2UserSignUpEndpoint, S2UserSignInEndpoint } from "./raw-access/s2-user-endpoint";
3 changes: 3 additions & 0 deletions .d.ts/raw-access/s2-endpoint.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export declare class S2Endpoint {
static getEndpointURL(append?: string): string;
}
17 changes: 17 additions & 0 deletions .d.ts/raw-access/s2-user-endpoint.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { S2APIResponse } from "../s2-api-response";
import { S2TokenResponseStructure } from "../interfaces/s2-token-response-structure";
import { S2Endpoint } from "./s2-endpoint";
export declare class S2UserEndpoint extends S2Endpoint {
static getEndpointURL(append?: string): string;
}
export declare class S2UserAuthenticationEndpoint extends S2UserEndpoint {
static getEndpointURL(append?: string): string;
}
export declare class S2UserSignUpEndpoint extends S2UserAuthenticationEndpoint {
static getEndpointURL(append?: string): string;
static signUp(email: string, password: string): Promise<S2APIResponse<S2TokenResponseStructure>>;
static finalize(token: string, code: string): Promise<S2APIResponse<S2TokenResponseStructure>>;
}
export declare class S2UserSignInEndpoint extends S2UserAuthenticationEndpoint {
static getEndpointURL(append?: string): string;
}
1 change: 0 additions & 1 deletion .d.ts/readme.md

This file was deleted.

9 changes: 9 additions & 0 deletions .d.ts/s2-api-response.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export declare class S2APIResponse<R> {
private readonly rawXHR;
private isVerified;
constructor(response: XMLHttpRequest, lazyInitialization?: boolean);
verify(): boolean;
getBody(): R;
getStatusCode(): number;
getRawXHR(): XMLHttpRequest;
}
11 changes: 11 additions & 0 deletions .d.ts/s2-api.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { S2APIResponse } from "./s2-api-response";
declare type HTTPMethod = "GET" | "POST" | "PUT" | "DELETE";
declare type APIRequestMethod = <R>(requestMethod: HTTPMethod, endpoint: string, body?: any, token?: string) => Promise<S2APIResponse<R>>;
export declare class S2API {
static readonly BASE_URL: string;
private static apiRequestMethod;
protected static setNetworkImplementation(implementation: APIRequestMethod): void;
static makeRequest<R>(requestMethod: HTTPMethod, endpoint: string, body?: any, token?: string): Promise<S2APIResponse<R>>;
static isJSON(content: any): boolean;
}
export {};
1 change: 1 addition & 0 deletions .d.ts/tests/raw-access.test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ObjectTypeDefinition, Type } from "typit";
export declare class S2TypitTokenResponseStructure implements ObjectTypeDefinition {
[property: string]: Type | ObjectTypeDefinition;
readonly token: Type;
readonly type: Type;
}
4 changes: 0 additions & 4 deletions .gitignore

This file was deleted.

8 changes: 5 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*/

const gulp = require("gulp");
const typescript = require("gulp-typescript");
const typescript = require("gulp-typescript/release/main");
const sourcemaps = require("gulp-sourcemaps");
const uglify = require("gulp-uglify-es").default;
const del = require("del");
const uglify = require("gulp-uglify-es/lib/index").default;
const del = require("del/index");

const paths = {

Expand Down Expand Up @@ -120,7 +120,9 @@ function compileTypeScript(done) {
function uglifyJavaScript(done) {

return gulp.src(paths.javascript.allFiles)
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(uglify())
.pipe(sourcemaps.write("."))
.pipe(gulp.dest(paths.javascript.dir));

}
Expand Down
19 changes: 0 additions & 19 deletions init.sh

This file was deleted.

2 changes: 2 additions & 0 deletions js/interfaces/s2-token-response-structure.js

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

1 change: 1 addition & 0 deletions js/interfaces/s2-token-response-structure.js.map

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

2 changes: 2 additions & 0 deletions js/main.js

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

1 change: 1 addition & 0 deletions js/main.js.map

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

2 changes: 2 additions & 0 deletions js/raw-access/s2-endpoint.js

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

1 change: 1 addition & 0 deletions js/raw-access/s2-endpoint.js.map

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

2 changes: 2 additions & 0 deletions js/raw-access/s2-user-endpoint.js

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

1 change: 1 addition & 0 deletions js/raw-access/s2-user-endpoint.js.map

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

1 change: 0 additions & 1 deletion js/readme.md

This file was deleted.

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

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

Loading

0 comments on commit 7c6924d

Please sign in to comment.