Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@sap/subaccount-destination-service-provider
Advanced tools
Provide service consumption of SAP subaccount services
subaccount-destination-service-provider is an npm package that provides the APIs necessary for exposing subaccount destination systems and services.
To add this package as a dependency in your package.json file, under the "dependencies" section, add the following dependency: "@sap/subaccount-destination-service-provider": [Version]
This repository exposes APIs for the exploration of SAP systems and services that are consumed from the Business Application Studio (BAS) subaccount.
This API initializes a provider repository representing a given subaccount.
async init(): Promise<void>
throws ServiceProviderError: If there is an error, this throws a "ServiceProviderError" error message.
INTERNAL_ERROR: This error is displayed for any other exception.
This API retrieves systems exposed by the subaccount.
async getSystems(filter?: Filter): Promise<ProviderSystem[]>
filter (this is optional): Only retrieves systems that comply with the given filter.
throws ServiceProviderError: If there is an error, this throws a "ServiceProviderError" error message.
RETRIEVE_DATA: This error is displayed if data cannot be retrieved from the system.
INTERNAL_ERROR: This error is displayed for any other exception.
This API retrieves services exposed by a specific system.
async getServices(options?: Record<string, any>): Promise<Service[]>
options (this is optional): The following parameters are optional:
credentials (this is optional): for services that require authentication.
filter (this is optional): Used to filter for relevant services.
throws ServiceProviderError: If there is an error, this throws a "ServiceProviderError" error message.
RETRIEVE_DATA: This error is displayed if data cannot be retrieved from the system.
INTERNAL_ERROR: This error is displayed for any other exception.
This API retrieves metadata exposed by a specific system.
async getMetadata( service: Service, encoding: EncodingMode, options?: Record<string, any> ): Promise<ServiceMetadata>
service: Defines the service from which the metadata will be retrieved.
encoding: Defines the required encoding requested by the consumer.
options (this is optional): The following parameters are optional:
credentials (this is optional): for services that require authentication.
filter (this is optional): Used to filter for relevant services.
relativeUrl (this is optional)*: for a non-full URL - provides the relative URL to the service.
throws ServiceProviderError: If there is an error, this throws a "ServiceProviderError" error message.
RETRIEVE_DATA: This error is displayed if metadata cannot be retrieved from the service.
*INTERNAL_ERROR*: This error is displayed for any other exception.
This API retrieves an array of annotations exposed by a specific system.
async getAnnotations(service: Service, options?: Record<string, any>): Promise<Annotation[]
service: Defines the service from which the annotations will be retrieved.
options (this is optional): The following parameters are optional:
credentials (this is optional): for services that require authentication.
throws ServiceProviderError: If there is an error, this throws a "ServiceProviderError" error message.
RETRIEVE_DATA: This error is displayed if annotations cannot be retrieved from the service.
INTERNAL_ERROR: This error is displayed for any other exception.
Initialize repository
await saRepo.init();
List subaccount systems (destinations)
const saSystems = await saRepo.getSystems();
Create credentials object - Used to access a system or service that requires authentication.
const credentials = getCredentialsObject("username", "password");
Select a system and list the catalog services that it provides.
Note: Add credentials since the system needs authentication.
const saSelectedSystem = findByName(saSystems, "U1Y010_BASIC");
const saServices = await saSelectedSystem.getServices({credentials: credentials});
Create a filter object - Used to filter for required services.
const filter = getNewFilter("protocol", ["odatav2"]);
Select a service and consume the metadata and annotations that it provides.
Note: Add credentials since the system needs authentication.
const saSelectedService = findByName(saServices, "ZPAGE_BUILDER_CUST");
const saMetadata = await saSelectedSystem.getMetadata(saSelectedService, saProvider.EncodingMode.XML, {credentials: credentials, filter: filter});
const saAnnotations = await saSelectedSystem.getAnnotations(saSelectedService, {credentials: credentials});
credentials: An object that enables you to add credentials to your system request.
USER: system username
PSW: system password
Credentials can be built as follows:*
credentials = new Authentication(, );
filter: An object that enables you to filter for systems that you want to receive.
FILTER_KEY: (string) A key used to filter the list of systems.
FILTER_VALUES: (array of strings) accepted values of the filter key, separated by commas.
Filters can be built as follows:
filter = new Filter(new Map([[<FILTER_KEY>, <FILTER_VALUES>]]));
Open Git Bash, go to the local repository directory, and sync with the remote repository.
Develop in a Local branch.
git checkout -b my-local-branch-name
git branch -m my-local-branch-name
.git fetch; git merge
.npm install
to install dependencies.npm run test
to compile the TypeScript code to JavaScript and run tests.git push origin my-local-branch-name
commit amend
. You should create a new commit and push to the same feature branch again. This will add an extra commit to your pull request and retrigger the voters.npm run test
to run the unit tests written in Mocha and the coverage test.Bump the version in the "package.json" GitHub file.
Notes: Make sure to follow this versioning concept:
FAQs
Provide service consumption of SAP subaccount services
We found that @sap/subaccount-destination-service-provider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.