1.11.9 • Published 3 days ago

@sap-ux/axios-extension v1.11.9

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 days ago

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/servicessrc/abap/adt-catalog/services.

Take link:./src/abap/adt-catalog/services/ato-service.tsAtoService 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.tsAdtService.

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.tsAdtCatalogService and link:./src/abap/adt-catalog/adt-schema-store.tsAdtSchemaStore 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

1.11.9

3 days ago

1.11.8

6 days ago

1.11.7

16 days ago

1.11.6

27 days ago

1.11.5

29 days ago

1.11.4

2 months ago

1.11.3

2 months ago

1.11.2

2 months ago

1.11.1

3 months ago

1.11.0

3 months ago

1.10.2

3 months ago

1.10.1

3 months ago

1.9.0

3 months ago

1.10.0

3 months ago

1.8.1

4 months ago

1.8.0

4 months ago

1.4.6

8 months ago

1.4.5

8 months ago

1.4.4

8 months ago

1.6.1

7 months ago

1.4.3

8 months ago

1.6.0

7 months ago

1.4.2

9 months ago

1.4.1

9 months ago

1.4.0

10 months ago

1.7.3

6 months ago

1.7.2

6 months ago

1.3.6

10 months ago

1.7.1

7 months ago

1.3.5

10 months ago

1.7.0

7 months ago

1.3.4

10 months ago

1.5.1

7 months ago

1.5.0

7 months ago

1.4.8

8 months ago

1.4.7

8 months ago

1.3.3

11 months ago

1.3.2

11 months ago

1.3.1

11 months ago

1.2.8

11 months ago

1.2.7

11 months ago

1.2.6

11 months ago

1.2.5

11 months ago

1.2.4

12 months ago

1.2.3

12 months ago

1.3.0

11 months ago

1.2.0

1 year ago

1.1.0

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.14.1

1 year ago

0.14.0

1 year ago

0.13.1

1 year ago

0.13.2

1 year ago

0.13.3

1 year ago

0.13.4

1 year ago

0.11.0

2 years ago

0.10.1

2 years ago

0.12.0

1 year ago

0.11.1

2 years ago

0.10.2

2 years ago

0.13.0

1 year ago

0.10.3

2 years ago

0.10.0

2 years ago

0.9.8

2 years ago

0.9.7

2 years ago

0.9.4

2 years ago

0.9.3

2 years ago

0.9.6

2 years ago

0.9.5

2 years ago

0.9.0

2 years ago

0.8.1

2 years ago

0.7.2

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.7.0

2 years ago

0.5.0

2 years ago

0.5.2

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.4.0

2 years ago