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/apihub-enterprise-service-provider

v1.0.8

Published

Provide service consumption of services from SAP API Business Hub

Downloads

78

Readme

The apihub-enterprise-service-provider Repository

Overview

apihub-enterprise-service-provider is an npm package that provides the APIs necessary for exposing API Business Hub Enterprise destination systems, products and services. This package also exposes an interface for actions and queries related to the user's registration and subscription.

Usage

To add this package as a dependency in your package.json file, under the "dependencies" section, add the following dependency: "@sap/apihub-enterprise-service-provider": [Version]

Public APIs

ApiHubEntProviderRepository

getDestinations

Description: Provides a list of 'API Business Hub Enterprise' destination systems
Signature:

async getDestinations(filter?: Filter)

Input:
    filter (optional): For additional filters on the destination list to be received
Output: A list of API Business Hub Enterprise Destination Systems

getServiceRetriever

Description: Retrieves an instance of the API Business Hub Enterprise's implementation of the ServiceRetriever interface
Signature:

getServiceRetriever(): ApiHubEntServiceRetrieverInterface

Input: none
Output: An instance that implements the ApiHubEntServiceRetrieverInterface

ApiHubEntDestinationSystem

getProducts

Description: Provides a list of 'API Business Hub Enterprise' product systems
Signature:

getProducts(options?: Record<string, any>): Promise<ApiHubEntProductSystem[]>

Input:
    options (optional): Accepts the following optional parameters:
         credentials: For services that require authentication
Output: A list of API Business Hub Enterprise Product Systems

ApiHubEntProductSystem

getServices

Description: Provides a list of 'API Business Hub Enterprise' services
Signature:

async getServices(options?: Record<string, any>): Promise<Service[]>

Input:
    options (optional): Accepts the following optional parameters:
         credentials: For services that require authentication
Output: A list of services

getMetadata

Description: Provides the metadata of a 'API Business Hub Enterprise' service
Signature:

async getMetadata(
      service: Service, 
      encoding: EncodingMode, 
      options?: Record<string, any>, 
      _relativeUrl?: string, 
      credentials?: Authentication): Promise<ServiceMetadata>

Input:
    service: The details of the service we want to get the metadata for
    encoding: For metadata it should always be EncodingMode.XML
    options: Accepts the following parameters:
         apiHubKey: API Business Hub Enterprise authentication methods
    credentials (optional): For services that require authentication
Output: An object that contains the metadata XML string of the service

getJsonLiveData

Description: Provides live data from the 'API Business Hub Enterprise' service
Signature:

async getJsonLiveData(
      service: Service, 
      _relativeServiceUrl: string, 
      entityName: string, 
      options?: Record<string, any>): Promise<ServiceCommon>

Input:
    service: The details of the service we want to get the metadata for
    entityName: The name of the entity in the service we want the live data for
    options: Accepts the following parameters:
         apiHubKey: API Business Hub Enterprise authentication methods
        filter (optional): For additional query parameters to pass to the service. For example: new Filter(new Map([[ServiceRequestKey.TopRows, "2""]]))
Output: An object that contains a JSON string with live data from the service

getServiceSwagger

Description: Provides Swagger from the 'API Business Hub Enterprise' service
Signature:

async getServiceSwagger(serviceId: string): Promise<string | undefined>

Input:
    serviceId: The ID of the service that we want to get the Swagger for
Output: A JSON string with Swagger data of the service

AdministrationManager

getSubscriptions

Description: A static method that retrieves the user's subscriptions
Signature:

static async getSubscriptions(
    destinationName:string, 
    userName: string, 
    productName?: string, 
    options?: Record<string, any>)
    : Promise<ApiHubEntSubscription[]>

Input:
    destinationName: The name of the destination system
    userName: The name of the current user
    productName (optional): Product's name in order to get the subscription list for only that specific product
    options (optional): Accepts the following optional parameters:
         credentials: For services that require authentication
Output: A list of the user's subscriptions in this destination system

getRegistrationData

Description: A static method that retrieves the user's registration information
Signature:

  static async getRegistrationData(
    destinationName:string, 
    userName: string, 
    options?: Record<string, any>)
    : Promise<RegistrationData | undefined>

Input:
    destinationName: The name of the destination system
    userName: The name of the current user
    options (optional): Accepts the following optional parameters:
         credentials: For services that require authentication
Output: A RegistrationData object

registerUser

Description: A static method that registers the user
Signature:

  static async registerUser(
    registrationParams: RegistrationParams, 
    options?: Record<string, any>)
    : Promise<RegistrationData>

Input:
    RegistrationParams: An input object with all the parameters for the registration request
    options (optional): Accepts the following optional parameters:
         credentials: For services that require authentication
Output: A RegistrationData object

subscribeUser

Description: A static method that subscribes the user's app
Signature:

static async subscribeUser(
  subscriptionParams: SubscriptionParams, 
  options?: Record<string, any>)
  : Promise<SubscribeResponse>

Input:
    SubscriptionParams: An input object with all the parameters for the subscription request
    options (optional): Accepts the following optional parameters:
         credentials: For services that require authentication
Output: A SubscribeResponse object with the response to the registration request

getAdministrationRaw

Description: Retrieves an instance of the API Business Hub Enterprise's implementation of the ServiceRetriever interface
Signature:

  static getAdministrationRaw() :AdministrationManagerRawInterface

Input: none
Output: An instance that implements the AdministrationManagerRawInterface

Types

API Business Hub Enterprise Subscription

productId: string
appName: string
id: string
title: string
description: string
appKey: string
creationDate: string
isSubscribed: boolean

Registration Parameters

destinationName (string): API Business Hub Enterprise destination provider system
userId (string): The current user's username
firstName (string): The current user's first name
lastName (string): The current user's last name
emailId (string): The current user's email address
country (string): The current user's country
roles (AccessRole[]): The list of roles associated with the user

Access Role

role (SubscriptionRole): System role
status (SubscriptionStatus, optional): The current user's first name
requestReason (string, optional): The current user's last name

Registration Data

accessRoles: AccessRole[]

Subscription Parameters

destinationName (string): API Business Hub Enterprise destination provider system
username (string): The current user's username
productName (string): The product name to register to
appName (string): The user's application name to register

Subscribe Response

[key: string]: unknown

Example Flow

Can be found at test\flow\testFlow.ts