Skip to content
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

Changes to config #24

Merged
merged 3 commits into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/build/cookieAndHeaders.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export declare class CookieConfig {
cookieSecure: boolean;
cookieSameSite: "strict" | "lax" | "none";
constructor(accessTokenPath: string, refreshTokenPath: string, cookieDomain: string | undefined, cookieSecure: boolean, cookieSameSite: "strict" | "lax" | "none");
static init(accessTokenPath?: string, refreshTokenPath?: string, cookieDomain?: string, cookieSecure?: boolean, cookieSameSite?: "strict" | "lax" | "none"): void;
static init(accessTokenPath: string, apiBasePath: string, cookieDomain: string | undefined, cookieSecure: boolean, cookieSameSite: "strict" | "lax" | "none"): void;
static reset(): void;
static getInstanceOrThrowError(): CookieConfig;
}
Expand Down
14 changes: 5 additions & 9 deletions lib/build/cookieAndHeaders.js

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

11 changes: 7 additions & 4 deletions lib/build/express.js

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

2 changes: 1 addition & 1 deletion lib/build/handshakeInfo.js

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

4 changes: 2 additions & 2 deletions lib/build/querier.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export declare class Querier {
getAPIVersion: () => Promise<string>;
static reset(): void;
getHostsAliveForTesting: () => Set<string>;
static getInstance(): Querier;
static initInstance(hosts?: string, apiKey?: string): void;
static getInstanceOrThrowError(): Querier;
static initInstance(hosts: string, apiKey?: string): void;
sendPostRequest: (path: string, body: any) => Promise<any>;
sendDeleteRequest: (path: string, body: any) => Promise<any>;
sendGetRequest: (path: string, params: any) => Promise<any>;
Expand Down
13 changes: 7 additions & 6 deletions lib/build/querier.js

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

2 changes: 1 addition & 1 deletion lib/build/session.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export declare class SessionConfig {
private static instance;
sessionExpiredStatusCode: number;
constructor(sessionExpiredStatusCode: number);
static init(sessionExpiredStatusCode?: number): void;
static init(sessionExpiredStatusCode: number): void;
static reset(): void;
static getInstanceOrThrowError(): SessionConfig;
}
Expand Down
42 changes: 21 additions & 21 deletions lib/build/session.js

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

12 changes: 11 additions & 1 deletion lib/build/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,23 @@ export declare type TypeAuthError = {
export declare type TypeInput = {
hosts?: string;
accessTokenPath?: string;
refreshTokenPath?: string;
apiBasePath?: string;
cookieDomain?: string;
cookieSameSite?: "strict" | "lax" | "none";
cookieSecure?: boolean;
apiKey?: string;
sessionExpiredStatusCode?: number;
};
export declare type TypeNormalisedInput = {
hosts: string;
accessTokenPath: string;
apiBasePath: string;
cookieDomain: string | undefined;
cookieSameSite: "strict" | "lax" | "none";
cookieSecure: boolean;
apiKey?: string;
sessionExpiredStatusCode: number;
};
export interface SessionRequest extends Request {
session: Session;
}
Expand Down
8 changes: 6 additions & 2 deletions lib/build/utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { CreateOrRefreshAPIResponse } from "./types";
import { CreateOrRefreshAPIResponse, TypeInput, TypeNormalisedInput } from "./types";
import * as express from "express";
export declare function validateAndNormaliseCookieSameSite(sameSite: string): "strict" | "lax" | "none";
export declare function normaliseURLPathOrThrowError(input: string): string;
export declare function normaliseURLDomainOrThrowError(input: string): string;
export declare function normaliseSessionScopeOrThrowError(sessionScope: string): string;
export declare function validateAndNormaliseUserInput(config: TypeInput): TypeNormalisedInput;
export declare function normaliseSameSiteOrThrowError(sameSite: string): "strict" | "lax" | "none";
export declare function attachCreateOrRefreshSessionResponseToExpressRes(res: express.Response, response: CreateOrRefreshAPIResponse): void;
export declare function getLargestVersionFromIntersection(v1: string[], v2: string[]): string | undefined;
export declare function maxVersion(version1: string, version2: string): string;
Loading