npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sap-ux/axios-extension

v1.12.3

Published

Extension of the Axios module adding convenience methods to interact with SAP systems especially with OData services.

Downloads

330,404

Readme

Axios Extension

The @sap-ux/axios-extension module is an extension of the link:https://github.com/axios/axios[axios] framework adding convenience methods to interact with SAP systems especially with OData services..

Features

Factories

The module offers factory functions allowing to generate ServiceProvider instances.

Service Provider

The base service provider extends the class Axios abstracting whether it is running in SAP Business Application Studio or locally.

It offers convenience methods to simplify the handling of:

  • different versions of S/4 HANA systems
  • different authentication methods in the SAP ecosystem.
  • running locally or in SAP Business Application Studio

It exposes the service(path) method that creates a new Axios instance for the requested service. It will reuse authentication details and cookies from the provider.

ABAP Service Provider

Another extension of the base provider handling specifics for ABAP based backend systems. It offers simplified access to the catalog services as well as the UI5 ABAP repository service.

Services

The generic OData service simplifies the access to the service metadata as well as the access to response data. It is used as base class for

Catalog Service

Simplified consumption of the SAP catalog service useful for fetching annotations.

ABAP UI5 Repository Service

Allows deployment of applications to the UI5 ABAP Repository as well as checking deployed applications.

App Index Service

A class representing the app index service allowing to search applications deployed on an ABAP system.

Layered Repository Service

Allows deployment of adaptation projects.

Usage:

import { createForAbap } from '@sap-ux/axios-extension';

const provider = createForAbap({
    baseURL: 'https://sap.example',
    params: { 'sap-client': client }
});
const service = provider.getLayeredRepository();
await service.deploy('./dist/my-variant-webapp.zip', {
    namespace: 'apps/my.base.app/appVariants/customer.variant/',
    package: 'MY_PACKAGE',
    transport: 'ABC123'
});

ADT Service

Services that supports Fiori project deployment configuration. The following example shows the usage of loading ADT service TransportRequestService for creating a new transport request number.

Usage:

import { createForAbap } from '@sap-ux/axios-extension';

const provider = createForAbap({
    baseURL: 'https://sap.example',
    params: { 'sap-client': client }
});
const transportRequestService = provider.getAdtService<TransportRequestService>(TransportRequestService);
const newTrNumber = await transportRequestService.createTransportRequest({
    packageName: 'Z_PACKAGE',
    ui5AppName: 'zappname',
    description: 'A new transport request number for deployment'
});

ADT Service Implementation

Supported ADT services are implemented in link:./src/abap/adt-catalog/services[src/abap/adt-catalog/services].

Take link:./src/abap/adt-catalog/services/ato-service.ts[AtoService] as an example to illustrate how to implement an ADT service. A specific ADT service implementation like AtoService is implemented as a subclass of link:./src/abap/adt-catalog/services/adt-service.ts[AdtService].

export class AtoService extends AdtService {
    // ...
}

As a subclass of AdtService, AtoService implements the getAdtCatagory() static method to provide the AdtCatagory properties. AdtCatagory properties is used as unique ID to obtain service schema from ADT discovery schema. See link:./src/abap/adt-catalog/adt-catalog-service.ts[AdtCatalogService] and link:./src/abap/adt-catalog/adt-schema-store.ts[AdtSchemaStore] for details.

Finally, AtoService implements the request for fetching ATO settings and the parsing of response data. See getAtoInfo() and parseAtoResponse(xml: string) in AtoService implementation.

Installation

Npm

npm install --save @sap-ux/axios-extension

Yarn

yarn add @sap-ux/axios-extension

Pnpm

pnpm add @sap-ux/axios-extension

Usage

import { createForAbap } from '@sap-ux/axios-extension';

const provider = createForAbap({
    baseURL: 'https://sap.example',
    params: { 'sap-client': client }
});
const service = provider.service('/ns/my_service');
const metadata = await service.metadata();

See more examples in link:./test/factory.test.ts[/test/factory.test.ts]