@rh-support/api
Advanced tools
Comparing version 0.1.33 to 0.1.34
@@ -117,1 +117,10 @@ export interface IRecommendationsBody { | ||
export declare function searchSolutions(max_rows: number, highlighted_fragment_size: number, abortSignal?: AbortSignal, additionalFilters?: IRecommendationAdditionalFilters): Promise<IRecommendationResponse>; | ||
/** | ||
* Fetching Master ID on the basis of Product and Version | ||
* @param {Partial<IGetTopContentParams>} body Params to be sent with the get request | ||
* @param {AbortSignal} abortSignal | ||
* @returns {Promise<ITCMasterResponse[]>} an array with the response, status if fails. | ||
*/ | ||
export declare function getTopContentMaster(body: Partial<any>): Promise<any>; | ||
export declare function postTopContentMaster(body: Partial<any>): Promise<any>; | ||
export declare function patchTopContentMaster(body: Partial<any>): Promise<any>; |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -69,1 +80,35 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.searchSolutions = searchSolutions; | ||
// export interface IUpdateTopContentMaster { | ||
// productId: string; | ||
// version: string; | ||
// contentTitle: string; | ||
// contentUrl: string; | ||
// } | ||
// export type ICreateTopContentMaster = IUpdateTopContentMaster; | ||
// TODO: USE HYDRAJS WHEN THESE ENDPOINTS HAVE BEEN MERGED IN!!!!! | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
/** | ||
* Fetching Master ID on the basis of Product and Version | ||
* @param {Partial<IGetTopContentParams>} body Params to be sent with the get request | ||
* @param {AbortSignal} abortSignal | ||
* @returns {Promise<ITCMasterResponse[]>} an array with the response, status if fails. | ||
*/ | ||
function getTopContentMaster(body) { | ||
var uri = env_1.default.apiHostName.clone().setPath(env_1.default.hydraPathPrefix + "/se/topcontent/master"); | ||
fetch_1.addQueryParamsToUri(uri, __assign({}, body)); | ||
return fetch_1.getUri(uri); | ||
} | ||
exports.getTopContentMaster = getTopContentMaster; | ||
function postTopContentMaster(body) { | ||
var uri = env_1.default.apiHostName.clone().setPath(env_1.default.hydraPathPrefix + "/se/topcontent/master"); | ||
// addQueryParamsToUri(uri, { topContentMasters: JSON.stringify(body) }); | ||
return fetch_1.postUri(uri, { topContentMasters: body }); | ||
} | ||
exports.postTopContentMaster = postTopContentMaster; | ||
function patchTopContentMaster(body) { | ||
var uri = env_1.default.apiHostName.clone().setPath(env_1.default.hydraPathPrefix + "/se/topcontent/master"); | ||
// addQueryParamsToUri(uri, { ...body }); | ||
return fetch_1.patchUri(uri, { topContentMasters: body }); | ||
} | ||
exports.patchTopContentMaster = patchTopContentMaster; | ||
/////////////////////////////////////////////////////////////////////////////////////////// |
@@ -50,3 +50,2 @@ export interface IStrataUserRight { | ||
sso_username: string; | ||
isInternalWithSFDCUser: boolean; | ||
} | ||
@@ -53,0 +52,0 @@ export interface BookmarkedAccountlist { |
@@ -117,1 +117,10 @@ export interface IRecommendationsBody { | ||
export declare function searchSolutions(max_rows: number, highlighted_fragment_size: number, abortSignal?: AbortSignal, additionalFilters?: IRecommendationAdditionalFilters): Promise<IRecommendationResponse>; | ||
/** | ||
* Fetching Master ID on the basis of Product and Version | ||
* @param {Partial<IGetTopContentParams>} body Params to be sent with the get request | ||
* @param {AbortSignal} abortSignal | ||
* @returns {Promise<ITCMasterResponse[]>} an array with the response, status if fails. | ||
*/ | ||
export declare function getTopContentMaster(body: Partial<any>): Promise<any>; | ||
export declare function postTopContentMaster(body: Partial<any>): Promise<any>; | ||
export declare function patchTopContentMaster(body: Partial<any>): Promise<any>; |
import Env from '../utils/env'; | ||
import { addQueryParamsToUri, postUri, getUri } from '../utils/fetch'; | ||
import { addQueryParamsToUri, postUri, getUri, patchUri } from '../utils/fetch'; | ||
import { addSolrQueryParamsToUri, addFiltersToFieldQueries } from '../utils/solrUtils'; | ||
@@ -59,1 +59,32 @@ const documentKindToInclude = `documentKind:("Solution" OR "Video" OR "CertifiedSoftware" OR "CertifiedCloudPartner" OR "Article" OR "Errata" OR "Vulnerability" OR "CertifiedHardware" OR "Cve" OR "LabInfo")`; | ||
} | ||
// export interface IUpdateTopContentMaster { | ||
// productId: string; | ||
// version: string; | ||
// contentTitle: string; | ||
// contentUrl: string; | ||
// } | ||
// export type ICreateTopContentMaster = IUpdateTopContentMaster; | ||
// TODO: USE HYDRAJS WHEN THESE ENDPOINTS HAVE BEEN MERGED IN!!!!! | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
/** | ||
* Fetching Master ID on the basis of Product and Version | ||
* @param {Partial<IGetTopContentParams>} body Params to be sent with the get request | ||
* @param {AbortSignal} abortSignal | ||
* @returns {Promise<ITCMasterResponse[]>} an array with the response, status if fails. | ||
*/ | ||
export function getTopContentMaster(body) { | ||
const uri = Env.apiHostName.clone().setPath(`${Env.hydraPathPrefix}/se/topcontent/master`); | ||
addQueryParamsToUri(uri, Object.assign({}, body)); | ||
return getUri(uri); | ||
} | ||
export function postTopContentMaster(body) { | ||
const uri = Env.apiHostName.clone().setPath(`${Env.hydraPathPrefix}/se/topcontent/master`); | ||
// addQueryParamsToUri(uri, { topContentMasters: JSON.stringify(body) }); | ||
return postUri(uri, { topContentMasters: body }); | ||
} | ||
export function patchTopContentMaster(body) { | ||
const uri = Env.apiHostName.clone().setPath(`${Env.hydraPathPrefix}/se/topcontent/master`); | ||
// addQueryParamsToUri(uri, { ...body }); | ||
return patchUri(uri, { topContentMasters: body }); | ||
} | ||
/////////////////////////////////////////////////////////////////////////////////////////// |
@@ -50,3 +50,2 @@ export interface IStrataUserRight { | ||
sso_username: string; | ||
isInternalWithSFDCUser: boolean; | ||
} | ||
@@ -53,0 +52,0 @@ export interface BookmarkedAccountlist { |
{ | ||
"name": "@rh-support/api", | ||
"version": "0.1.33", | ||
"version": "0.1.34", | ||
"description": "Contains all the backend API calls", | ||
@@ -52,3 +52,3 @@ "author": "Vikas Rathee <vrathee@redhat.com>", | ||
}, | ||
"gitHead": "5d9b3f8331fdc64b078111a415c3c1f4c905e6cd" | ||
"gitHead": "da97d83bf12bedeb569998569d0bf368fb2a1887" | ||
} |
195259
5037