@rh-support/api
Advanced tools
Comparing version 0.0.69 to 0.0.70
import Env from '../utils/env'; | ||
import { addQueryParamsToUri, postUri, getUri } from '../utils/fetch'; | ||
import { addSolrQueryParamsToUri, addFiltersToFieldQueries } from '../utils/solrUtils'; | ||
const documentKindToInclude = `documentKind:("Solution" OR "Video" OR "CertifiedSoftware" OR "CertifiedCloudPartner" OR "Article" OR "Errata" OR "Vulnerability" OR "CertifiedHardware" OR "Cve" OR "LabInfo")`; | ||
// fragment_size = 0 -> highligthed fragment is equal to field size | ||
@@ -8,3 +9,3 @@ export function getRecommendations(body, max_rows, highlighted_fragment_size, seQueryFields = false, additionalFilters = {}, abortSignal) { | ||
q: '*:*', | ||
fq: ['documentKind:(Solution OR Article OR LabInfo OR Cve OR Vulnerability)', '-internalTags:helper_solution'], | ||
fq: [documentKindToInclude, '-internalTags:helper_solution', '-documentKind:Documentation'], | ||
start: 0, | ||
@@ -36,3 +37,3 @@ rows: max_rows, | ||
q: '*:*', | ||
fq: ['documentKind:(Solution OR Article OR LabInfo OR Cve OR Vulnerability)'], | ||
fq: [documentKindToInclude, '-internalTags:helper_solution', '-documentKind:Documentation'], | ||
start: 0, | ||
@@ -39,0 +40,0 @@ rows: max_rows, |
export interface IStrataUserRight { | ||
name: string; | ||
has_access: boolean; | ||
description: string; | ||
description?: string; | ||
} | ||
@@ -55,2 +55,3 @@ export interface IStrataUserRights { | ||
export declare function getStrataUser(userId: string): Promise<IStrataUser>; | ||
export declare function getStrataUserBySSO(ssoUserName: string): Promise<IStrataUser>; | ||
export declare function getUserChatSession(): Promise<string>; |
import Env from '../utils/env'; | ||
import { addQueryParamsToUri, getUri, postUri } from '../utils/fetch'; | ||
export function getStrataUser(userId) { | ||
const uri = Env.apiHostName.clone().setPath(`/rs/users/${userId}`); | ||
const uri = Env.apiHostName.clone().setPath(`${Env.securedSupport.pathPrefix}/rs/users/${userId}`); | ||
addQueryParamsToUri(uri, Env.strataHeaders); | ||
@@ -13,6 +13,12 @@ const extraParam = { | ||
} | ||
export function getStrataUserBySSO(ssoUserName) { | ||
const uri = Env.apiHostName.clone().setPath(`${Env.securedSupport.pathPrefix}/rs/users`); | ||
addQueryParamsToUri(uri, Env.strataHeaders); | ||
uri.addQueryParam('ssoUserName', ssoUserName); | ||
return getUri(uri); | ||
} | ||
export function getUserChatSession() { | ||
const uri = Env.apiHostName.clone().setPath(`/rs/users/current/chatSession`); | ||
const uri = Env.apiHostName.clone().setPath(`${Env.securedSupport.pathPrefix}/rs/users/current/chatSession`); | ||
addQueryParamsToUri(uri, Env.strataHeaders); | ||
return postUri(uri); | ||
} |
@@ -98,3 +98,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function forceTokenRefresh() { | ||
const session = get(window, 'portal.session'); | ||
const session = get(window, 'portal.session') || get(window, 'sessionjs'); | ||
if (!session) { | ||
@@ -107,3 +107,4 @@ return; | ||
// updateToken(true) forces the token to update by passing -1 to keycloak.updateToken | ||
session.updateToken(true).success((refreshed) => { | ||
let updateTokenCall = session.updateToken(true); | ||
let callbackFn = (refreshed) => { | ||
if (refreshed) { | ||
@@ -118,5 +119,7 @@ resolve(true); | ||
} | ||
}).error((e) => { | ||
reject(e); | ||
}); | ||
}; | ||
if (updateTokenCall.success) | ||
updateTokenCall.success(callbackFn).error((e) => { reject(e); }); | ||
else | ||
updateTokenCall.then(callbackFn).catch((e) => { reject(e); }); | ||
}); | ||
@@ -123,0 +126,0 @@ } |
{ | ||
"name": "@rh-support/api", | ||
"version": "0.0.69", | ||
"version": "0.0.70", | ||
"description": "Contains all the backend API calls", | ||
@@ -46,3 +46,3 @@ "author": "Vikas Rathee <vrathee@redhat.com>", | ||
"dependencies": { | ||
"@rh-support/types": "^0.0.69", | ||
"@rh-support/types": "^0.0.70", | ||
"btoa-lite": "^1.0.0", | ||
@@ -53,3 +53,3 @@ "hydrajs": "git+https://gitlab.cee.redhat.com/redhataccess/hydrajs.git#2.0.37", | ||
}, | ||
"gitHead": "30cf3b47b006ba25f823ba64ce81ed0e493dfbb2" | ||
"gitHead": "5229e4dc33a693fc21e87ac594d597a742b65d2e" | ||
} |
Sorry, the diff of this file is too big to display
205326
5627
+ Added@rh-support/types@0.0.70(transitive)
- Removed@rh-support/types@0.0.69(transitive)
Updated@rh-support/types@^0.0.70