-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface S2TokenResponseStructure { | ||
readonly token: string; | ||
readonly type: string; | ||
} |
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"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export declare class S2Endpoint { | ||
static getEndpointURL(append?: string): string; | ||
} |
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; | ||
} |
This file was deleted.
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; | ||
} |
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 {}; |
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; | ||
} |
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.