Comparing version 1.11.3 to 2.0.0
@@ -21,3 +21,2 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const settings = system_1.default.getSettings(); | ||
if (process.env.NODE_ENV === 'test') { | ||
@@ -38,6 +37,2 @@ return {}; | ||
}; | ||
if (settings.client.getBearerToken) { | ||
const token = yield settings.client.getBearerToken(); | ||
cachedAuthHeaders.Authorization = `Berer ${token}`; | ||
} | ||
return cachedAuthHeaders; | ||
@@ -44,0 +39,0 @@ }); |
@@ -8,4 +8,3 @@ import { IModuleLink, IOrganization, IUser, IUserEntity } from 'bf-types'; | ||
getOrganizationDoc(): Promise<IOrganization>; | ||
getBearerToken?(): Promise<string>; | ||
logOut(): void; | ||
} |
@@ -10,8 +10,6 @@ import { DomainModule, EnumLiteralsOf } from 'bf-types'; | ||
readonly BROWSER: "BROWSER"; | ||
readonly CONSOLE: "CONSOLE"; | ||
readonly NODE: "NODE"; | ||
}>; | ||
export declare type ClientConfig = { | ||
type: ClientType; | ||
apiKey?: string; | ||
getBearerToken?: () => Promise<string>; | ||
}; | ||
@@ -18,0 +16,0 @@ export declare type ConnectionType = EnumLiteralsOf<typeof ConnectionType>; |
@@ -7,3 +7,3 @@ "use strict"; | ||
BROWSER: 'BROWSER', | ||
CONSOLE: 'CONSOLE', | ||
NODE: 'NODE', | ||
}); | ||
@@ -10,0 +10,0 @@ // tslint:disable-next-line: variable-name |
@@ -91,5 +91,2 @@ "use strict"; | ||
} | ||
const getSettings = () => { | ||
return settings; | ||
}; | ||
log('debug', 'beginning to initialize all system lib modules'); | ||
@@ -108,3 +105,2 @@ libModuleMap.set(Types_2.LibModule.AUTH, require('../auth/Auth').default); | ||
liveSyncOptions, | ||
getSettings, | ||
nexus, | ||
@@ -111,0 +107,0 @@ }; |
@@ -31,2 +31,3 @@ import { EnumLiteralsOf, IUserEntity } from 'bf-types'; | ||
export interface SystemInstance { | ||
nexus: Nexus; | ||
getHttpHeaders(): Record<string, string>; | ||
@@ -37,4 +38,2 @@ setHttpHeader(key: string, value: string): void; | ||
liveSyncOptions: () => Nullable<LiveSyncConnectionOptions>; | ||
nexus: Nexus; | ||
getSettings: () => InitSettings; | ||
} | ||
@@ -41,0 +40,0 @@ export declare type System = SystemInstance & SystemWrapper; |
{ | ||
"name": "bf-lib", | ||
"version": "1.11.3", | ||
"version": "2.0.0", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "the standard client library for block-5 software", |
81571
1856