@obelisk/client
Advanced tools
Comparing version 2.7.4 to 2.7.5
@@ -0,0 +0,0 @@ import { Observable } from 'rxjs'; |
@@ -8,2 +8,6 @@ "use strict"; | ||
class Endpoint { | ||
constructor(client, uri, apiVersion = 'v1') { | ||
this.client = client; | ||
this._url = util_1.InternalUtils.norm(client, uri, apiVersion); | ||
} | ||
/** | ||
@@ -22,6 +26,2 @@ * Absolute url to use in requests | ||
} | ||
constructor(client, uri, apiVersion = 'v1') { | ||
this.client = client; | ||
this._url = util_1.InternalUtils.norm(client, uri, apiVersion); | ||
} | ||
/** | ||
@@ -28,0 +28,0 @@ * Perform an ajax get request and handle any auth errors. |
@@ -0,0 +0,0 @@ import { Observable } from 'rxjs'; |
@@ -10,2 +10,6 @@ "use strict"; | ||
class GraphQLEndpoint { | ||
constructor(client) { | ||
this.client = client; | ||
this._url = this.client.options.host + '/api/graphql'; | ||
} | ||
/** | ||
@@ -24,6 +28,2 @@ * Absolute url to use in requests | ||
} | ||
constructor(client) { | ||
this.client = client; | ||
this._url = this.client.options.host + '/api/graphql'; | ||
} | ||
/** | ||
@@ -30,0 +30,0 @@ * Execute a GraphQLQuery |
@@ -0,0 +0,0 @@ export * from './endpoint'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { Observable } from 'rxjs'; |
@@ -12,2 +12,6 @@ "use strict"; | ||
class StreamEndpoint { | ||
constructor(client, uri, apiVersion = 'v1') { | ||
this.client = client; | ||
this._url = util_1.InternalUtils.norm(client, uri, apiVersion); | ||
} | ||
/** | ||
@@ -27,6 +31,2 @@ * Absolute url to use in requests | ||
} | ||
constructor(client, uri, apiVersion = 'v1') { | ||
this.client = client; | ||
this._url = util_1.InternalUtils.norm(client, uri, apiVersion); | ||
} | ||
/** | ||
@@ -33,0 +33,0 @@ * Connects with this endpoint as an eventsource. |
@@ -0,0 +0,0 @@ import { Observable } from 'rxjs'; |
@@ -11,2 +11,6 @@ "use strict"; | ||
class TPageEndpoint { | ||
constructor(client, uri, apiVersion = 'v1') { | ||
this.client = client; | ||
this._url = util_1.InternalUtils.norm(client, uri, apiVersion); | ||
} | ||
/** | ||
@@ -25,6 +29,2 @@ * Absolute url to use in requests | ||
} | ||
constructor(client, uri, apiVersion = 'v1') { | ||
this.client = client; | ||
this._url = util_1.InternalUtils.norm(client, uri, apiVersion); | ||
} | ||
get(uri) { | ||
@@ -31,0 +31,0 @@ util_1.Logger.debug(uri, 'AJAX'); |
@@ -0,0 +0,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
export * from './token-response'; | ||
export * from './tokens'; | ||
export * from './uma2-config'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export interface Tokens { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,0 +0,0 @@ export * from './api'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { Observable } from "rxjs"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
export * from './client'; | ||
export * from './events'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { Observable, Observer } from 'rxjs'; |
@@ -60,3 +60,4 @@ "use strict"; | ||
// If scope includes offline_access and refresh_expires_in=== 0 (store in localstorage to skip login next time) | ||
if (!offlineLoginHandling && authResponse.scope.split(' ').includes('offline_access') && authResponse.refresh_expires_in === 0) { | ||
// if (!offlineLoginHandling && authResponse.scope.split(' ').includes('offline_access') && authResponse.refresh_expires_in <= 0) { | ||
if (authResponse.scope.split(' ').includes('offline_access') && authResponse.refresh_expires_in <= 0) { | ||
// this._storage!.add('logInfo', { authenticated: true, expires: -1, offline_token: patRefresh.getToken() }); | ||
@@ -102,3 +103,3 @@ // console.log({token: patRefresh.getToken()}); | ||
} | ||
return this._config$.pipe(operators_1.map(cfg => (Object.assign({}, this.defaultOptions, cfg)))); | ||
return this._config$.pipe(operators_1.map(cfg => (Object.assign(Object.assign({}, this.defaultOptions), cfg)))); | ||
} | ||
@@ -329,6 +330,5 @@ /** | ||
else { | ||
// console.log('try offline'); | ||
console.debug('offline token, trying refresh login'); | ||
const offline = this._storage.get('offline'); | ||
if (offline && offline.token) { | ||
console.debug('offline token, trying refresh login'); | ||
// console.debug('--trying offline_token login'); | ||
@@ -341,4 +341,3 @@ const url = this._uma2Config.token_endpoint; | ||
const params = `client_id=${clientId}&grant_type=refresh_token&refresh_token=${offline.token}`; | ||
return ajax_1.ajax.post(url, params, headers).pipe( | ||
// tap(console.log, console.log), // IN ERROR STREAM | ||
return ajax_1.ajax.post(url, params, headers).pipe(operators_1.tap(console.log, console.log), // IN ERROR STREAM | ||
operators_1.flatMap(resp => this.storeTokens(resp, null, true))); | ||
@@ -345,0 +344,0 @@ } |
@@ -0,0 +0,0 @@ /** |
@@ -9,2 +9,3 @@ "use strict"; | ||
} | ||
exports.Config = Config; | ||
/** | ||
@@ -15,2 +16,1 @@ * Show debug output in console.debug | ||
Config.debug = false; | ||
exports.Config = Config; |
@@ -0,0 +0,0 @@ export * from './config'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { Observable, OperatorFunction } from "rxjs"; |
@@ -17,3 +17,3 @@ "use strict"; | ||
let link = { link: InternalUtils.parseLinkHeader(linkHeaderValue) }; | ||
result = Object.assign({}, result, link); | ||
result = Object.assign(Object.assign({}, result), link); | ||
} | ||
@@ -26,3 +26,3 @@ return result; | ||
} | ||
cfg.headers = Object.assign({}, cfg.headers, { 'Authorization': 'Bearer ' + (client.tokens.rpt ? client.tokens.rpt.getToken() : '<no rpt present>') }); | ||
cfg.headers = Object.assign(Object.assign({}, cfg.headers), { 'Authorization': 'Bearer ' + (client.tokens.rpt ? client.tokens.rpt.getToken() : '<no rpt present>') }); | ||
return cfg; | ||
@@ -175,2 +175,3 @@ } | ||
} | ||
exports.InternalUtils = InternalUtils; | ||
InternalUtils.regex = new RegExp('(\/events|\/stats|\/anonymous-events|\/latest|\/\d{8}|\/\d{8}\/\d{1,2}|\/\d{8}\/\d{1,2}\/\d{1,2})'); | ||
@@ -200,2 +201,1 @@ /** | ||
}; | ||
exports.InternalUtils = InternalUtils; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ClientOptions } from "../interfaces"; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "@obelisk/client", | ||
"version": "2.7.4", | ||
"version": "2.7.5", | ||
"description": "Typescript client to interact with Obelisk on a higher level than the regular ReST API calls.", | ||
@@ -38,3 +38,3 @@ "keywords": [ | ||
"typedoc": "^0.14.2", | ||
"typescript": "^3.3.1" | ||
"typescript": "^3.6.2" | ||
}, | ||
@@ -41,0 +41,0 @@ "dependencies": { |
@@ -0,0 +0,0 @@ # Obelisk Client |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86133
42
2240