Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sap-ux/axios-extension

Package Overview
Dependencies
Maintainers
3
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap-ux/axios-extension - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

dist/abap/adt-catalog/index.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

2

dist/abap/app-index-service.d.ts

@@ -8,3 +8,3 @@ import type { Service } from '../base/service-provider';

}
export declare type AppIndex = Partial<App>[];
export type AppIndex = Partial<App>[];
/**

@@ -11,0 +11,0 @@ * A class respresenting the app index service allowing to search applications deployed on an ABAP system.

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -8,3 +8,3 @@ import type { Service } from '../base/service-provider';

*/
export declare type NamespaceObject = {
export type NamespaceObject = {
/**

@@ -22,3 +22,3 @@ * variant id

*/
export declare type Namespace = NamespaceObject | string;
export type Namespace = NamespaceObject | string;
/**

@@ -25,0 +25,0 @@ * Required configuration to deploy an adaptation project.

@@ -55,3 +55,3 @@ "use strict";

catch (error) {
if (odata_request_error_1.isAxiosError(error) && ((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 404) {
if ((0, odata_request_error_1.isAxiosError)(error) && ((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 404) {
return error.response;

@@ -75,3 +75,3 @@ }

return __awaiter(this, void 0, void 0, function* () {
const archive = fs_1.readFileSync(archivePath);
const archive = (0, fs_1.readFileSync)(archivePath);
const checkResponse = yield this.isExistingVariant(config.namespace);

@@ -78,0 +78,0 @@ const params = {

@@ -12,5 +12,5 @@ /**

}
export declare type AdtCategoryTerm = string;
export declare type AdtWorkspaceTitle = string;
export declare type AdtCategoryId = string;
export type AdtCategoryTerm = string;
export type AdtWorkspaceTitle = string;
export type AdtCategoryId = string;
/**

@@ -46,3 +46,3 @@ * AdtWorkspace groups ADT services based on their

}
export declare type AdtAcceptContentType = string[] | string;
export type AdtAcceptContentType = string[] | string;
/**

@@ -73,3 +73,3 @@ * Uniquely identifies a ADT service. Provide an AdtCategory

*/
export declare type OperationsType = 'C' | 'P';
export type OperationsType = 'C' | 'P';
export interface AtoSettings {

@@ -83,4 +83,4 @@ developmentPackage?: string;

}
export declare type AdtTransportStatus = 'S' | 'E';
export type AdtTransportStatus = 'S' | 'E';
export declare const LocalPackageText: string[];
//# sourceMappingURL=adt-types.d.ts.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

/// <reference types="node" />
/// <reference types="node" />
import type { AxiosResponse, AxiosRequestConfig } from 'axios';

@@ -3,0 +4,0 @@ import { ODataService } from '../base/odata-service';

@@ -94,3 +94,3 @@ "use strict";

if ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a['sap-message']) {
message_1.prettyPrintMessage({ msg: response.headers['sap-message'], log: this.log, host: frontendUrl });
(0, message_1.prettyPrintMessage)({ msg: response.headers['sap-message'], log: this.log, host: frontendUrl });
}

@@ -129,3 +129,3 @@ // log url of created/updated app

if ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a['sap-message']) {
message_1.prettyPrintMessage({ msg: response.headers['sap-message'], log: this.log, host });
(0, message_1.prettyPrintMessage)({ msg: response.headers['sap-message'], log: this.log, host });
}

@@ -312,5 +312,5 @@ return response;

this.log.error(error.message);
if (odata_request_error_1.isAxiosError(error) && ((_a = error.response) === null || _a === void 0 ? void 0 : _a.data)) {
if ((0, odata_request_error_1.isAxiosError)(error) && ((_a = error.response) === null || _a === void 0 ? void 0 : _a.data)) {
if (error.response.data['error']) {
message_1.prettyPrintError({ error: error.response.data['error'], host, log: this.log });
(0, message_1.prettyPrintError)({ error: error.response.data['error'], host, log: this.log });
}

@@ -317,0 +317,0 @@ else {

@@ -127,3 +127,3 @@ "use strict";

// Try to infer it from the data
return (_b = (_a = detect_content_type_1.default(Buffer.from(responseData))) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : '';
return (_b = (_a = (0, detect_content_type_1.default)(Buffer.from(responseData))) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : '';
}

@@ -130,0 +130,0 @@ else {

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -90,3 +94,3 @@ if (k2 === undefined) k2 = k;

var _a;
const { reentranceTicket, apiUrl } = yield reentrance_ticket_1.getReentranceTicket({
const { reentranceTicket, apiUrl } = yield (0, reentrance_ticket_1.getReentranceTicket)({
backendUrl: provider.defaults.baseURL,

@@ -93,0 +97,0 @@ logger: provider.log

@@ -35,3 +35,3 @@ "use strict";

// Start local server to listen to redirect call, with timeout
const { server, redirectUrl } = redirect_1.setupRedirectHandling({ resolve, reject, timeout, backend, logger });
const { server, redirectUrl } = (0, redirect_1.setupRedirectHandling)({ resolve, reject, timeout, backend, logger });
server.listen();

@@ -38,0 +38,0 @@ const redirectPort = server.address().port;

@@ -27,3 +27,3 @@ "use strict";

server === null || server === void 0 ? void 0 : server.close();
reject(new error_1.TimeoutError(`Timeout. Did not get a response within ${message_1.prettyPrintTimeInMs(timeout)}`));
reject(new error_1.TimeoutError(`Timeout. Did not get a response within ${(0, message_1.prettyPrintTimeInMs)(timeout)}`));
};

@@ -42,3 +42,3 @@ const timer = setTimeout(handleTimeout, timeout);

res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(Buffer.from(static_1.redirectSuccessHtml(backend.logoffUrl())));
res.end(Buffer.from((0, static_1.redirectSuccessHtml)(backend.logoffUrl())));
server.close();

@@ -51,3 +51,3 @@ resolve({ reentranceTicket, apiUrl: backend.apiHostname() });

res.writeHead(500, { 'Content-Type': 'text/html' });
res.end(Buffer.from(static_1.redirectErrorHtml()));
res.end(Buffer.from((0, static_1.redirectErrorHtml)()));
server.close();

@@ -54,0 +54,0 @@ reject(new error_1.ConnectionError('Error getting reentrance ticket'));

@@ -5,3 +5,3 @@ import type { AxiosRequestConfig } from 'axios';

import { Redirect } from './redirect';
export declare type RefreshTokenChanged = (refreshToken?: string) => void | Promise<void>;
export type RefreshTokenChanged = (refreshToken?: string) => void | Promise<void>;
/**

@@ -8,0 +8,0 @@ * A class representing interactions with an SAP BTP UAA service

@@ -185,3 +185,3 @@ "use strict";

server === null || server === void 0 ? void 0 : server.close();
reject(new error_1.UAATimeoutError(`Timeout. Did not get a response within ${message_1.prettyPrintTimeInMs(timeout)}`));
reject(new error_1.UAATimeoutError(`Timeout. Did not get a response within ${(0, message_1.prettyPrintTimeInMs)(timeout)}`));
};

@@ -193,3 +193,3 @@ const timer = setTimeout(handleTimeout, timeout);

res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(Buffer.from(static_1.redirectSuccessHtml(this.logoutUrl, this.systemId)));
res.end(Buffer.from((0, static_1.redirectSuccessHtml)(this.logoutUrl, this.systemId)));
this.log.info('Got authCode');

@@ -196,0 +196,0 @@ resolve({ authCode: reqUrl.searchParams.get('code') + '', redirect });

@@ -6,3 +6,3 @@ import type { AxiosRequestConfig } from 'axios';

import { Cookies } from '../auth';
export declare type Service = Axios & {
export type Service = Axios & {
log: Logger;

@@ -9,0 +9,0 @@ };

@@ -46,3 +46,3 @@ import type { AxiosRequestConfig } from 'axios';

/** Discriminated union of supported environments - {@link AbapCloudStandaloneOptions} and {@link AbapEmbeddedSteampunkOptions} */
declare type AbapCloudOptions = AbapCloudStandaloneOptions | AbapEmbeddedSteampunkOptions;
type AbapCloudOptions = AbapCloudStandaloneOptions | AbapEmbeddedSteampunkOptions;
/**

@@ -58,3 +58,3 @@ * Create an instance of an ABAP service provider for a Cloud ABAP system.

*/
export declare type MinimalDestinationConfig = Pick<Destination, 'Name'> & Partial<Destination>;
export type MinimalDestinationConfig = Pick<Destination, 'Name'> & Partial<Destination>;
/**

@@ -61,0 +61,0 @@ * Create an instance of a service provider for the given destination.

@@ -43,3 +43,3 @@ "use strict";

var _a, _b;
const providerConfig = cloneDeep_1.default(config);
const providerConfig = (0, cloneDeep_1.default)(config);
providerConfig.httpsAgent = new https_1.Agent({

@@ -67,5 +67,5 @@ rejectUnauthorized: !providerConfig.ignoreCertErrors

};
auth_1.attachConnectionHandler(instance);
(0, auth_1.attachConnectionHandler)(instance);
if ((_b = providerConfig.auth) === null || _b === void 0 ? void 0 : _b.password) {
auth_1.attachBasicAuthInterceptor(instance);
(0, auth_1.attachBasicAuthInterceptor)(instance);
}

@@ -125,3 +125,3 @@ if (config.cookies) {

if (!cookies) {
auth_1.attachUaaAuthInterceptor(provider, service, refreshToken, refreshTokenChangedCb);
(0, auth_1.attachUaaAuthInterceptor)(provider, service, refreshToken, refreshTokenChangedCb);
}

@@ -134,3 +134,3 @@ break;

if (!cookies) {
auth_1.attachReentranceTicketAuthInterceptor({ provider });
(0, auth_1.attachReentranceTicketAuthInterceptor)({ provider });
}

@@ -141,3 +141,3 @@ break;

const opts = options;
throw new Error(`Unknown environment type supplied: ${util_1.inspect(opts)}`);
throw new Error(`Unknown environment type supplied: ${(0, util_1.inspect)(opts)}`);
}

@@ -158,3 +158,3 @@ return provider;

const { cookies } = options, config = __rest(options, ["cookies"]);
const providerConfig = Object.assign(Object.assign({}, config), { baseURL: btp_utils_1.getDestinationUrlForAppStudio(destination.Name, destination.Host ? new URL(destination.Host).pathname : undefined), cookies: cookies });
const providerConfig = Object.assign(Object.assign({}, config), { baseURL: (0, btp_utils_1.getDestinationUrlForAppStudio)(destination.Name, destination.Host ? new URL(destination.Host).pathname : undefined), cookies: cookies });
// SAML in AppStudio is not yet supported

@@ -164,3 +164,3 @@ providerConfig.params = (_a = providerConfig.params) !== null && _a !== void 0 ? _a : {};

let provider;
if (btp_utils_1.isAbapSystem(destination)) {
if ((0, btp_utils_1.isAbapSystem)(destination)) {
provider = createInstance(abap_1.AbapServiceProvider, providerConfig);

@@ -174,3 +174,3 @@ }

const oneTimeReqInterceptorId = provider.interceptors.request.use((request) => __awaiter(this, void 0, void 0, function* () {
const credentials = yield btp_utils_1.getCredentialsForDestinationService(destinationServiceInstance);
const credentials = yield (0, btp_utils_1.getCredentialsForDestinationService)(destinationServiceInstance);
provider.defaults.headers.common[btp_utils_1.BAS_DEST_INSTANCE_CRED_HEADER] = credentials;

@@ -177,0 +177,0 @@ provider.interceptors.request.eject(oneTimeReqInterceptorId);

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

{
"name": "@sap-ux/axios-extension",
"version": "1.0.0",
"version": "1.0.1",
"description": "Extension of the Axios module adding convinience methods to interact with SAP systems especially with OData services.",

@@ -17,4 +17,4 @@ "repository": {

"dependencies": {
"@sap-ux/btp-utils": "0.11.4",
"@sap-ux/logger": "0.3.4",
"@sap-ux/btp-utils": "0.11.5",
"@sap-ux/logger": "0.3.5",
"axios": "0.24.0",

@@ -21,0 +21,0 @@ "detect-content-type": "1.2.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc