@sap-ux/axios-extension
Advanced tools
Comparing version 0.10.0 to 0.10.1
@@ -41,2 +41,5 @@ import { ServiceProvider } from '../base/service-provider'; | ||
isS4Cloud(): Promise<boolean>; | ||
/** | ||
* @returns AdtCatalogService | ||
*/ | ||
private getAdtCatalogService; | ||
@@ -72,3 +75,3 @@ /** | ||
* @param appName Fiori project name for deployment. A new project that has not been deployed before is also allowed | ||
* @returns | ||
* @returns array of transports id's | ||
*/ | ||
@@ -75,0 +78,0 @@ getTransportRequests(packageName: string, appName: string): Promise<TransportRequest[]>; |
@@ -103,2 +103,5 @@ "use strict"; | ||
} | ||
/** | ||
* @returns AdtCatalogService | ||
*/ | ||
getAdtCatalogService() { | ||
@@ -173,3 +176,3 @@ if (!this.services[adt_catalog_service_1.AdtCatalogService.ADT_DISCOVERY_SERVICE_PATH]) { | ||
* @param appName Fiori project name for deployment. A new project that has not been deployed before is also allowed | ||
* @returns | ||
* @returns array of transports id's | ||
*/ | ||
@@ -176,0 +179,0 @@ getTransportRequests(packageName, appName) { |
@@ -22,2 +22,8 @@ import type { Logger } from '@sap-ux/logger'; | ||
getServiceDefinition(adtCategory: AdtCategory): Promise<AdtCollection>; | ||
/** | ||
* | ||
* @param adtCategory adtCategory | ||
* @param serviceSchema serviceSchema | ||
* @returns boolean boolean result of schema validity | ||
*/ | ||
private validateServiceSchema; | ||
@@ -27,3 +33,4 @@ /** | ||
* calling discover service request. | ||
* @returns | ||
* | ||
* @returns Promise<void> | ||
*/ | ||
@@ -30,0 +37,0 @@ private checkOrLoadAdtDiscoverySchema; |
@@ -50,2 +50,8 @@ "use strict"; | ||
} | ||
/** | ||
* | ||
* @param adtCategory adtCategory | ||
* @param serviceSchema serviceSchema | ||
* @returns boolean boolean result of schema validity | ||
*/ | ||
validateServiceSchema(adtCategory, serviceSchema) { | ||
@@ -67,3 +73,4 @@ if (!serviceSchema) { | ||
* calling discover service request. | ||
* @returns | ||
* | ||
* @returns Promise<void> | ||
*/ | ||
@@ -70,0 +77,0 @@ checkOrLoadAdtDiscoverySchema() { |
@@ -12,2 +12,3 @@ import type { AdtCategory, AdtCollection, AdtSchemaData } from '../types'; | ||
* Given the ID of a particular ADT service, return the schema of this service. | ||
* | ||
* @param adtCategory ADT service serves as unique id of a service schema | ||
@@ -21,2 +22,3 @@ * @returns Schema of an ADT service | ||
* key-value map for fast access. | ||
* | ||
* @param schemaData Raw ADT schema data structure that matches the XML schema | ||
@@ -28,7 +30,13 @@ * received from backend | ||
* Check if an schema has been loaded and cached. | ||
* @returns | ||
* | ||
* @returns boolean isAdtSchemaEmpty | ||
*/ | ||
isAdtSchemaEmpty(): boolean; | ||
/** | ||
* | ||
* @param adtCategory adtCategory | ||
* @returns string serializeAdtCategory | ||
*/ | ||
private serializeAdtCategory; | ||
} | ||
//# sourceMappingURL=adt-schema-store.d.ts.map |
@@ -10,2 +10,3 @@ "use strict"; | ||
* Given the ID of a particular ADT service, return the schema of this service. | ||
* | ||
* @param adtCategory ADT service serves as unique id of a service schema | ||
@@ -25,2 +26,3 @@ * @returns Schema of an ADT service | ||
* key-value map for fast access. | ||
* | ||
* @param schemaData Raw ADT schema data structure that matches the XML schema | ||
@@ -54,3 +56,4 @@ * received from backend | ||
* Check if an schema has been loaded and cached. | ||
* @returns | ||
* | ||
* @returns boolean isAdtSchemaEmpty | ||
*/ | ||
@@ -60,2 +63,7 @@ isAdtSchemaEmpty() { | ||
} | ||
/** | ||
* | ||
* @param adtCategory adtCategory | ||
* @returns string serializeAdtCategory | ||
*/ | ||
serializeAdtCategory(adtCategory) { | ||
@@ -62,0 +70,0 @@ return `${adtCategory.scheme},${adtCategory.term}`; |
@@ -60,3 +60,3 @@ "use strict"; | ||
* | ||
* @param doc | ||
* @param doc document | ||
* @returns | ||
@@ -88,4 +88,4 @@ * - For local package, return []. | ||
* | ||
* @param doc | ||
* @returns | ||
* @param doc document | ||
* @returns transport numbers | ||
*/ | ||
@@ -109,4 +109,4 @@ function getTransportListForNewProject(doc) { | ||
* | ||
* @param doc | ||
* @returns | ||
* @param doc document | ||
* @returns transport numbers | ||
*/ | ||
@@ -113,0 +113,0 @@ function getLockedTransport(doc) { |
@@ -39,3 +39,3 @@ import type { Logger } from '@sap-ux/logger'; | ||
* | ||
* @param options | ||
* @param options options | ||
* @param options.msg message returned from gateway | ||
@@ -53,3 +53,3 @@ * @param options.log logger to be used | ||
* | ||
* @param options | ||
* @param options options | ||
* @param options.error error message returned from gateway | ||
@@ -56,0 +56,0 @@ * @param options.log logger to be used |
@@ -8,3 +8,3 @@ "use strict"; | ||
* | ||
* @param options | ||
* @param options options | ||
* @param options.msg message returned from gateway | ||
@@ -25,6 +25,6 @@ * @param options.log logger to be used | ||
/** | ||
* @param root0 | ||
* @param root0.host | ||
* @param root0.path | ||
* @param root0.log | ||
* @param root0 root0 | ||
* @param root0.host hostname | ||
* @param root0.path path | ||
* @param root0.log log | ||
*/ | ||
@@ -43,3 +43,3 @@ function logFullURL({ host, path, log }) { | ||
* | ||
* @param options | ||
* @param options options | ||
* @param options.error error message returned from gateway | ||
@@ -46,0 +46,0 @@ * @param options.log logger to be used |
@@ -101,4 +101,4 @@ import type { AxiosResponse, AxiosRequestConfig, AxiosError } from 'axios'; | ||
* @param e error thrown by Axios after sending a request | ||
* @param e.error | ||
* @param e.host | ||
* @param e.error error from Axios | ||
* @param e.host hostname | ||
*/ | ||
@@ -105,0 +105,0 @@ protected logError({ error, host }: { |
@@ -32,3 +32,3 @@ "use strict"; | ||
* | ||
* @param xmlValue | ||
* @param xmlValue xml string | ||
* @returns escaped xml value | ||
@@ -271,4 +271,4 @@ */ | ||
* @param e error thrown by Axios after sending a request | ||
* @param e.error | ||
* @param e.host | ||
* @param e.error error from Axios | ||
* @param e.host hostname | ||
*/ | ||
@@ -275,0 +275,0 @@ logError({ error, host }) { |
@@ -102,3 +102,3 @@ "use strict"; | ||
/** | ||
* @param response | ||
* @param response AxiosResponse | ||
* @returns true if the contents are determined to be HTML | ||
@@ -110,3 +110,3 @@ */ | ||
/** | ||
* @param response | ||
* @param response AxiosResponse | ||
* @returns true if we get an HTML login form | ||
@@ -118,4 +118,4 @@ */ | ||
/** | ||
* @param contentTypeHeader | ||
* @param responseData | ||
* @param contentTypeHeader contents of Content-Type header (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) | ||
* @param responseData data receievd in HTTP response. This is used to infer the Content-Type, if the header is missing or ambiguous | ||
* @returns content type | ||
@@ -156,19 +156,16 @@ */ | ||
} | ||
// if a redirect to a SAML login page happened try again with disable saml param | ||
else if (isSamlLogonNeeded(response) && ((_a = provider.defaults.params) === null || _a === void 0 ? void 0 : _a.saml2) !== 'disabled') { | ||
provider.defaults.params = (_b = provider.defaults.params) !== null && _b !== void 0 ? _b : {}; | ||
provider.defaults.params.saml2 = 'disabled'; | ||
return provider.request(response.config); | ||
} | ||
else { | ||
// if a redirect to a SAML login page happened try again with disable saml param | ||
if (isSamlLogonNeeded(response) && ((_a = provider.defaults.params) === null || _a === void 0 ? void 0 : _a.saml2) !== 'disabled') { | ||
provider.defaults.params = (_b = provider.defaults.params) !== null && _b !== void 0 ? _b : {}; | ||
provider.defaults.params.saml2 = 'disabled'; | ||
return provider.request(response.config); | ||
throwIfHtmlLoginForm(response); | ||
// remember xsrf token | ||
if ((_c = response.headers) === null || _c === void 0 ? void 0 : _c[CSRF.ResponseHeaderName]) { | ||
provider.defaults.headers.common[CSRF.RequestHeaderName] = response.headers[CSRF.ResponseHeaderName]; | ||
} | ||
else { | ||
throwIfHtmlLoginForm(response); | ||
// remember xsrf token | ||
if ((_c = response.headers) === null || _c === void 0 ? void 0 : _c[CSRF.ResponseHeaderName]) { | ||
provider.defaults.headers.common[CSRF.RequestHeaderName] = | ||
response.headers[CSRF.ResponseHeaderName]; | ||
} | ||
provider.interceptors.response.eject(oneTimeRespInterceptorId); | ||
return response; | ||
} | ||
provider.interceptors.response.eject(oneTimeRespInterceptorId); | ||
return response; | ||
} | ||
@@ -175,0 +172,0 @@ }); |
@@ -10,10 +10,10 @@ import { ServiceInfo } from '@sap-ux/btp-utils'; | ||
/** | ||
* @param provider | ||
* @param provider Basic Auth Provider | ||
*/ | ||
export declare function attachBasicAuthInterceptor(provider: Axios): void; | ||
/** | ||
* @param provider | ||
* @param service | ||
* @param refreshToken | ||
* @param refreshTokenUpdateCb | ||
* @param provider Abap Service Provider | ||
* @param service Service Information | ||
* @param refreshToken refreshToken | ||
* @param refreshTokenUpdateCb refreshTokenUpdate callback function | ||
*/ | ||
@@ -24,3 +24,3 @@ export declare function attachUaaAuthInterceptor(provider: AbapServiceProvider, service: ServiceInfo, refreshToken?: string, refreshTokenUpdateCb?: RefreshTokenChanged): void; | ||
* | ||
* @param options | ||
* @param options options | ||
* @param options.provider an instance of an ABAP service provider | ||
@@ -34,5 +34,5 @@ */ | ||
* | ||
* @param options | ||
* @param options options | ||
* @param options.provider an instance of an ABAP service provider | ||
* @param options.ejectCallback | ||
* @param options.ejectCallback eject Callback Function | ||
* @returns the interceptor function to fetch and use reentrace tickets | ||
@@ -39,0 +39,0 @@ */ |
@@ -29,3 +29,3 @@ "use strict"; | ||
/** | ||
* @param provider | ||
* @param provider Basic Auth Provider | ||
*/ | ||
@@ -41,6 +41,6 @@ function attachBasicAuthInterceptor(provider) { | ||
/** | ||
* @param provider | ||
* @param service | ||
* @param refreshToken | ||
* @param refreshTokenUpdateCb | ||
* @param provider Abap Service Provider | ||
* @param service Service Information | ||
* @param refreshToken refreshToken | ||
* @param refreshTokenUpdateCb refreshTokenUpdate callback function | ||
*/ | ||
@@ -70,3 +70,3 @@ function attachUaaAuthInterceptor(provider, service, refreshToken, refreshTokenUpdateCb) { | ||
* | ||
* @param options | ||
* @param options options | ||
* @param options.provider an instance of an ABAP service provider | ||
@@ -85,5 +85,5 @@ */ | ||
* | ||
* @param options | ||
* @param options options | ||
* @param options.provider an instance of an ABAP service provider | ||
* @param options.ejectCallback | ||
* @param options.ejectCallback eject Callback Function | ||
* @returns the interceptor function to fetch and use reentrace tickets | ||
@@ -90,0 +90,0 @@ */ |
@@ -10,3 +10,3 @@ /** | ||
* | ||
* @param backendUrl | ||
* @param backendUrl backend Url | ||
*/ | ||
@@ -13,0 +13,0 @@ constructor(backendUrl: string); |
@@ -10,3 +10,3 @@ "use strict"; | ||
* | ||
* @param backendUrl | ||
* @param backendUrl backend Url | ||
*/ | ||
@@ -13,0 +13,0 @@ constructor(backendUrl) { |
@@ -5,6 +5,6 @@ import type { Logger } from '@sap-ux/logger'; | ||
* | ||
* @param options | ||
* @param options.backendUrl | ||
* @param options.logger | ||
* @param options.timeout | ||
* @param options options | ||
* @param options.backendUrl backend Url | ||
* @param options.logger logger | ||
* @param options.timeout timeout in milliseconds | ||
*/ | ||
@@ -11,0 +11,0 @@ export declare function getReentranceTicket({ backendUrl, logger, timeout }: { |
@@ -25,6 +25,6 @@ "use strict"; | ||
* | ||
* @param options | ||
* @param options.backendUrl | ||
* @param options.logger | ||
* @param options.timeout | ||
* @param options options | ||
* @param options.backendUrl backend Url | ||
* @param options.logger logger | ||
* @param options.timeout timeout in milliseconds | ||
*/ | ||
@@ -31,0 +31,0 @@ function getReentranceTicket({ backendUrl, logger, timeout = connection_1.defaultTimeout }) { |
@@ -18,8 +18,8 @@ /// <reference types="node" /> | ||
* | ||
* @param root0 | ||
* @param root0.resolve | ||
* @param root0.reject | ||
* @param root0.timeout | ||
* @param root0.backend | ||
* @param root0.logger | ||
* @param options options object | ||
* @param options.resolve Callback for when redirect is successful | ||
* @param options.reject Callback for when redirect fails | ||
* @param options.timeout timeout in milliseconds | ||
* @param options.backend backend ABAP System | ||
* @param options.logger logger | ||
* @returns a `Redirect` object | ||
@@ -26,0 +26,0 @@ */ |
@@ -13,8 +13,8 @@ "use strict"; | ||
* | ||
* @param root0 | ||
* @param root0.resolve | ||
* @param root0.reject | ||
* @param root0.timeout | ||
* @param root0.backend | ||
* @param root0.logger | ||
* @param options options object | ||
* @param options.resolve Callback for when redirect is successful | ||
* @param options.reject Callback for when redirect fails | ||
* @param options.timeout timeout in milliseconds | ||
* @param options.backend backend ABAP System | ||
* @param options.logger logger | ||
* @returns a `Redirect` object | ||
@@ -21,0 +21,0 @@ */ |
@@ -18,2 +18,9 @@ "use strict"; | ||
exports.redirectErrorHtml = redirectErrorHtml; | ||
/** | ||
* | ||
* @param options options object | ||
* @param options.title Page title | ||
* @param options.content Page content | ||
* @returns string | ||
*/ | ||
function redirectHtml({ title, content }) { | ||
@@ -20,0 +27,0 @@ return ` |
@@ -13,9 +13,9 @@ import type { AxiosRequestConfig } from 'axios'; | ||
/** | ||
* @param serviceInfo | ||
* @param log | ||
* @param serviceInfo service Information | ||
* @param log logger | ||
*/ | ||
constructor(serviceInfo: ServiceInfo, log: Logger); | ||
/** | ||
* @param property | ||
* @param errMsg | ||
* @param property property | ||
* @param errMsg error message | ||
*/ | ||
@@ -92,3 +92,3 @@ protected validatePropertyExists(property: string, errMsg: string): void; | ||
* | ||
* @param timeout | ||
* @param timeout timeout | ||
* @returns an object containing an authentication code and a redirect object | ||
@@ -101,4 +101,4 @@ */ | ||
/** | ||
* @param refreshToken | ||
* @param refreshTokenChangedCb | ||
* @param refreshToken refreshToken | ||
* @param refreshTokenChangedCb refreshTokenChanged callback function | ||
* @returns an access token. | ||
@@ -105,0 +105,0 @@ */ |
@@ -30,4 +30,4 @@ "use strict"; | ||
/** | ||
* @param serviceInfo | ||
* @param log | ||
* @param serviceInfo service Information | ||
* @param log logger | ||
*/ | ||
@@ -42,4 +42,4 @@ constructor(serviceInfo, log) { | ||
/** | ||
* @param property | ||
* @param errMsg | ||
* @param property property | ||
* @param errMsg error message | ||
*/ | ||
@@ -175,3 +175,3 @@ validatePropertyExists(property, errMsg) { | ||
* | ||
* @param timeout | ||
* @param timeout timeout | ||
* @returns an object containing an authentication code and a redirect object | ||
@@ -213,4 +213,4 @@ */ | ||
/** | ||
* @param refreshToken | ||
* @param refreshTokenChangedCb | ||
* @param refreshToken refreshToken | ||
* @param refreshTokenChangedCb refreshTokenChanged callback function | ||
* @returns an access token. | ||
@@ -217,0 +217,0 @@ */ |
@@ -13,5 +13,14 @@ /** | ||
export declare class ODataRequestError extends Error { | ||
/** | ||
* | ||
* @param odata odata object | ||
* @returns boolean | ||
*/ | ||
static containsError(odata: unknown): boolean; | ||
/** | ||
* | ||
* @param responseData response Data | ||
*/ | ||
constructor(responseData: unknown); | ||
} | ||
//# sourceMappingURL=odata-request-error.d.ts.map |
@@ -8,2 +8,7 @@ "use strict"; | ||
class ODataRequestError extends Error { | ||
/** | ||
* | ||
* @param odata odata object | ||
* @returns boolean | ||
*/ | ||
static containsError(odata) { | ||
@@ -17,2 +22,6 @@ if (odata === null || odata === void 0 ? void 0 : odata['error']) { | ||
} | ||
/** | ||
* | ||
* @param responseData response Data | ||
*/ | ||
constructor(responseData) { | ||
@@ -19,0 +28,0 @@ const error = responseData['error']; |
@@ -27,3 +27,3 @@ "use strict"; | ||
exports.createServiceForUrl = exports.createForDestination = exports.createForAbapOnCloud = exports.AbapCloudEnvironment = exports.createForAbap = exports.create = void 0; | ||
const lodash_clonedeep_1 = __importDefault(require("lodash.clonedeep")); | ||
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep")); | ||
const btp_utils_1 = require("@sap-ux/btp-utils"); | ||
@@ -44,3 +44,3 @@ const https_1 = require("https"); | ||
var _a, _b; | ||
const providerConfig = lodash_clonedeep_1.default(config); | ||
const providerConfig = cloneDeep_1.default(config); | ||
providerConfig.httpsAgent = new https_1.Agent({ | ||
@@ -54,4 +54,3 @@ rejectUnauthorized: !providerConfig.ignoreCertErrors | ||
common: {}, | ||
// eslint-disable-next-line quote-props | ||
delete: {}, | ||
'delete': {}, | ||
put: {}, | ||
@@ -58,0 +57,0 @@ get: {}, |
{ | ||
"name": "@sap-ux/axios-extension", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "Extension of the Axios module adding convinience methods to interact with SAP systems especially with OData services.", | ||
@@ -17,8 +17,8 @@ "repository": { | ||
"dependencies": { | ||
"@sap-ux/btp-utils": "0.11.1", | ||
"@sap-ux/logger": "0.3.0", | ||
"@sap-ux/btp-utils": "0.11.2", | ||
"@sap-ux/logger": "0.3.1", | ||
"axios": "0.24.0", | ||
"detect-content-type": "1.2.0", | ||
"fast-xml-parser": "3.12.20", | ||
"lodash.clonedeep": "4.5.0", | ||
"lodash": "4.17.21", | ||
"open": "7.0.3", | ||
@@ -30,3 +30,3 @@ "qs": "6.7.0", | ||
"devDependencies": { | ||
"@types/lodash.clonedeep": "4.5.6", | ||
"@types/lodash": "4.14.176", | ||
"nock": "13.2.1", | ||
@@ -46,3 +46,3 @@ "supertest": "6.2.2" | ||
"scripts": { | ||
"build": "pnpm clean && tsc", | ||
"build": "pnpm clean && tsc -p tsconfig-build.json", | ||
"watch": "tsc --watch", | ||
@@ -49,0 +49,0 @@ "clean": "rimraf dist coverage", |
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
184959
4132
+ Addedlodash@4.17.21
+ Added@sap-ux/btp-utils@0.11.2(transitive)
+ Added@sap-ux/logger@0.3.1(transitive)
- Removedlodash.clonedeep@4.5.0
- Removed@sap-ux/btp-utils@0.11.1(transitive)
- Removed@sap-ux/logger@0.3.0(transitive)
- Removedlodash.clonedeep@4.5.0(transitive)
Updated@sap-ux/btp-utils@0.11.2
Updated@sap-ux/logger@0.3.1