Skip to content

Commit

Permalink
Fix Issue #117
Browse files Browse the repository at this point in the history
  • Loading branch information
jung-thomas committed Dec 11, 2023
1 parent b8e3396 commit 1557f5b
Show file tree
Hide file tree
Showing 9 changed files with 695 additions and 2,474 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
[
{
"date": "2023-12-11",
"version": "3.202312.1",
"Changed": [
"[CAP version 7.4.0](https://cap.cloud.sap/docs/releases/nov23)",
"Restore openapi export with fix for CAP 7.x",
"Remove node-xlsx and corresponding Export to Excel because this module is causing install issues on Business Application Studio"
]
},
{
"date": "2023-11-16",
"version": "3.202311.1",
"Changed": [
"[CAP version 7.4.0](https://cap.cloud.sap/docs/releases/sep23)",
"[CAP version 7.3.0](https://cap.cloud.sap/docs/releases/sep23)",
"Major upgrade to Marked for conversion from Markdown in the documentation commands",
"Update to SAPUI5 1.120.1",
"Fix Issue #115 and #116 around the btp-cli commands"
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/).

## [3.202312.1] - 2023-12-11

**Changed**

- [CAP version 7.4.0](https://cap.cloud.sap/docs/releases/nov23)
- Restore openapi export with fix for CAP 7.x
- Remove node-xlsx and corresponding Export to Excel because this module is causing install issues on Business Application Studio

## [3.202311.1] - 2023-11-16

**Changed**

- [CAP version 7.4.0](https://cap.cloud.sap/docs/releases/sep23)
- [CAP version 7.3.0](https://cap.cloud.sap/docs/releases/sep23)
- Major upgrade to Marked for conversion from Markdown in the documentation commands
- Update to SAPUI5 1.120.1
- Fix Issue #115 and #116 around the btp-cli commands
Expand Down
7 changes: 4 additions & 3 deletions bin/cds.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,19 +354,20 @@ async function cdsServerSetup(prompts, cdsSource) {
Object.defineProperty(cds.compile.to, 'openapi', { configurable: true, get: () => base.require('@sap/cds-dk/lib/compile/openapi') })
try {
// @ts-ignore
/* let metadata = await cds.compile.to.openapi(cds.parse(cdsSource), {
let metadata = await cds.compile.to.openapi(cds.parse(cdsSource), {
service: 'HanaCli',
servicePath: '/odata/v4/opensap.hana.CatalogService/',
'openapi:url': '/odata/v4/opensap.hana.CatalogService/',
'openapi:diagram': true
'openapi:diagram': true,
to: 'openapi'
})

let serveOptions = {
explorer: true
}
const swaggerUi = await import('swagger-ui-express')
app.use('/api/api-docs', swaggerUi.serve, swaggerUi.setup(metadata, serveOptions))
*/

app.get('/', (_, res) => res.send(getIndex(odataURL, entity)))
app.get('/fiori.html', (_, res) => {
const manifest = _manifest(odataURL, entity, prompts.table)
Expand Down
6 changes: 4 additions & 2 deletions bin/inspectTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ export async function tableInspect(prompts) {
service: 'HanaCli',
servicePath: '/odata/v4/opensap.hana.CatalogService/',
'openapi:url': '/odata/v4/opensap.hana.CatalogService/',
'openapi:diagram': true
'openapi:diagram': true,
to: 'openapi'
})
console.log(highlight(JSON.stringify(metadata, null, 2)))
break
Expand All @@ -288,7 +289,8 @@ export async function tableInspect(prompts) {
service: 'HanaCli',
servicePath: '/odata/v4/opensap.hana.CatalogService/',
'openapi:url': '/odata/v4/opensap.hana.CatalogService/',
'openapi:diagram': true
'openapi:diagram': true,
to: 'openapi'
})

let data = YAML.stringify(metadata)
Expand Down
6 changes: 4 additions & 2 deletions bin/inspectView.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ export async function viewInspect(prompts) {
service: 'HanaCli',
servicePath: '/odata/v4/opensap.hana.CatalogService/',
'openapi:url': '/odata/v4/opensap.hana.CatalogService/',
'openapi:diagram': true
'openapi:diagram': true,
to: 'openapi'
})
console.log(highlight(JSON.stringify(metadata, null, 2)))
break
Expand All @@ -284,7 +285,8 @@ export async function viewInspect(prompts) {
service: 'HanaCli',
servicePath: '/odata/v4/opensap.hana.CatalogService/',
'openapi:url': '/odata/v4/opensap.hana.CatalogService/',
'openapi:diagram': true
'openapi:diagram': true,
to: 'openapi'
})
let data = YAML.stringify(metadata)
var lines = data.split('\n')
Expand Down
11 changes: 6 additions & 5 deletions bin/querySimple.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ export function removeNewlineCharacter(dataRow) {

export async function dbQuery(prompts) {
base.debug('dbQuery')
const [{ highlight }, { AsyncParser }, { default: excel }, { default: Table }] = await Promise.all([
const [{ highlight }, { AsyncParser }, { default: Table }]= await Promise.all([ //, { default: excel }, { default: Table }] = await Promise.all([
import('cli-highlight'),
import('@json2csv/node'),
import('node-xlsx'),
// import('node-xlsx'),
import('easy-table')
])

Expand Down Expand Up @@ -128,11 +128,12 @@ export async function dbQuery(prompts) {
out.push(innerItem)
}
// @ts-ignore
let excelOutput = excel.build([{
/* let excelOutput = excel.build([{
name: "Query Results",
data: out
}])
await toFile(prompts.folder, prompts.filename, 'xlsx', excelOutput)
}]) */
throw new Error(`Excel Export temporarily disabled due to issue with install of required module in Business Application Studio`)
//await toFile(prompts.folder, prompts.filename, 'xlsx', excelOutput)
} else {
base.error(base.bundle.getText("errExcel"))
dbClient.disconnect()
Expand Down
Loading

0 comments on commit 1557f5b

Please sign in to comment.