Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
oklemenz2 committed Feb 19, 2025
1 parent 2fd6adb commit df5d582
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
## About this Project

[SAP Advanced Financial Closing SDK for CDS](https://www.npmjs.com/package/@cap-js-community/sap-afc-sdk)
Provides an SDK for SAP Advanced Financial Closing to be consumed with SAP Cloud Application Programming Model (Node.js).
Provides an SDK for [SAP Advanced Financial Closing](https://help.sap.com/docs/advanced-financial-closing) to
be consumed with [SAP Cloud Application Programming Model (Node.js)](https://www.npmjs.com/package/@sap/cds).

## Table of Contents

Expand All @@ -31,8 +32,8 @@ Provides an SDK for SAP Advanced Financial Closing to be consumed with SAP Cloud

To develop and test applications build with this SDK you will need:

- Access to a working instance of [SAP Advanced Financial Closing](https://help.sap.com/docs/advanced-financial-closing)
- A working Node.js runtime environment
- Access to an instance of [SAP Advanced Financial Closing](https://help.sap.com/docs/advanced-financial-closing)
- A [CAP Node.js](https://www.npmjs.com/package/@sap/cds) project

## Getting Started

Expand Down
21 changes: 18 additions & 3 deletions bin/commands/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,26 @@ function manageKey(isNew, password) {
return;
}
const broker = require(brokerPath);
const name = Object.keys(broker.SBF_SERVICE_CONFIG)[0];
if (!name) {
const serviceName = Object.keys(broker.SBF_SERVICE_CONFIG)[0];
if (!serviceName) {
console.log(`No service found in broker configuration. Call 'afc add broker'`);
}
// TODO
const mtaPath = path.join(process.cwd(), "mta.yaml");
if (!fs.existsSync(brokerPath)) {
console.log(`mta.yaml not found at '$mtaPath}'. Call 'cds add mta'`);
}
const mta = fs.readFileSync(mtaPath, "utf8");
const appName = /- name: (.*)\n\s*type: nodejs\n\s*path: gen\/srv/s.exec(mta)?.[1];
const result = shelljs.exec(`cf app ${appName}`, { silent: true }).stdout;
const route = /routes:\s*(.*)/.exec(result)?.[1];
if (!password) {
// prompt for password
}
console.log(
`cf create-service-broker ${serviceName}-broker broker-user '${password}' https://${route}/broker --space-scoped`,
);
shelljs.exec(
`cf create-service-broker ${name}-broker broker-user '${password}' https://${isNew}.cfapps.sap.hana.ondemand.com/broker --space-scoped`,
`cf create-service-broker ${serviceName}-broker broker-user '${password}' https://${route}/broker --space-scoped`,
);
}

0 comments on commit df5d582

Please sign in to comment.