Skip to content

Commit

Permalink
202202.1 Version
Browse files Browse the repository at this point in the history
  • Loading branch information
jung-thomas committed Feb 4, 2022
1 parent 4d2effc commit 761f1f2
Show file tree
Hide file tree
Showing 16 changed files with 9,674 additions and 21,473 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[
{
"date": "2022-02-04",
"version": "3.202202.1",
"Changed": [
"Update @sap/cds to Feb 2022 release - 5.8.0",
"inspectTable and inspectView now support graphQL output (CDS Experimental Option)",
"systemInfo new output options - env (display environment connection as JSON) or dbx (display connection details ready to input in the new Database Explorer VSCode Extension)"
]
},
{
"date": "2022-01-25",
"version": "3.202201.1",
Expand All @@ -10,7 +19,7 @@
"date": "2022-01-11",
"version": "2.202201.9",
"Changed": [
"Update the Web UI Web Asssistant feature to work with the experimental SAP Horizon theme",
"Update the Web UI Web Assistant feature to work with the experimental SAP Horizon theme",
"GraphQL option of cds command now fully works and cross references entity name in the exit correctly"
]
},
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.

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

## [3.202202.1] - 2022-02-04

**Changed**

- Update @sap/cds to Feb 2022 release - 5.8.0
- inspectTable and inspectView now support graphQL output (CDS Experimental Option)
- systemInfo new output options - env (display environment connection as JSON) or dbx (display connection details ready to input in the new Database Explorer VSCode Extension)

## [3.202201.1] - 2022-01-25

**Changed**
Expand All @@ -14,7 +22,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).

**Changed**

- Update the Web UI Web Asssistant feature to work with the experimental SAP Horizon theme
- Update the Web UI Web Assistant feature to work with the experimental SAP Horizon theme
- GraphQL option of cds command now fully works and cross references entity name in the exit correctly

## [2.202201.8] - 2022-01-10
Expand Down
9 changes: 9 additions & 0 deletions _i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,12 @@ hc.running=Running
hc.stopped=Stopped
hc.unknown=Unknown
hc.error=No HANA Cloud Instances Found. Are you logged into CF cli?
dbx.dbType=Database Type
dbx.hostPort=Host / Port
dbx.user=User
dbx.password=Password
dbx.hdiUser=HDI User
dbx.hdiPassword=HDI Password
dbx.cert=Validate the Certificate
dbx.cert2=Cert. Details
dbx.secure=Connect to database securely using TLS/SSL
10 changes: 8 additions & 2 deletions app/appconfig/fioriSandboxConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,16 @@
},
"bootstrapPlugins": {
"RuntimeAuthoringPlugin": {
"component": "sap.ushell.plugins.rta"
"component": "sap.ushell.plugins.rta",
"config": {
"validateAppVersion": false
}
},
"PersonalizePlugin": {
"component": "sap.ushell.plugins.rta-personalize"
"component": "sap.ushell.plugins.rta-personalize",
"config": {
"validateAppVersion": false
}
},
"BootstrapXrayPlugin": {
"component": "sap.dfa.help.utils.adapters.fiori",
Expand Down
6 changes: 4 additions & 2 deletions app/resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>hana-cli LaunchPad</title>
<script src="https://sapui5.hana.ondemand.com/1.97.1/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
<script src="https://sapui5.hana.ondemand.com/1.98.0/test-resources/sap/ushell/bootstrap/sandbox.js"></script>

<script src="https://sapui5.hana.ondemand.com/1.97.1/resources/sap-ui-core.js"
<script src="https://sapui5.hana.ondemand.com/1.98.0/resources/sap-ui-core.js"
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout, sap.ui.rta, sap.dfa.help,sap.uxap"
data-sap-ui-compatVersion="edge" data-sap-ui-theme="sap_horizon"
data-sap-ui-async="true"
Expand All @@ -36,6 +36,8 @@
}
sap.ui.getCore().attachInit(() => {
sap.ushell.Container.createRenderer().placeAt("content")
sap.ui.getCore().getConfiguration()
.setFlexibilityServices([{ connector: "SessionStorageConnector" }])
})
</script>

Expand Down
2 changes: 1 addition & 1 deletion app/resources/inspect/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"sap.hanacli.common": "../common",
"sap.hanacli.tables": "../tables"
},
"flexEnabled": false,
"flexEnabled": true,
"dependencies": {
"minUI5Version": "1.91.0",
"libs": {
Expand Down
2 changes: 1 addition & 1 deletion app/resources/massConvert/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"resourceRoots": {
"sap.hanacli.common": "../common"
},
"flexEnabled": false,
"flexEnabled": true,
"rootView": {
"viewName": "sap.hanacli.massConvert.view.App",
"type": "XML",
Expand Down
2 changes: 1 addition & 1 deletion app/resources/systemInfo/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"resourceRoots": {
"sap.hanacli.common": "../common"
},
"flexEnabled": false,
"flexEnabled": true,
"rootView": {
"viewName": "sap.hanacli.systemInfo.view.App",
"type": "XML",
Expand Down
2 changes: 1 addition & 1 deletion app/resources/tables/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"resourceRoots": {
"sap.hanacli.common": "../common"
},
"flexEnabled": false,
"flexEnabled": true,
"dependencies": {
"minUI5Version": "1.91.0",
"libs": {
Expand Down
2 changes: 1 addition & 1 deletion bin/cds.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ export function _manifest(odataURL, entity, table) {

export function fiori(manifest, odataURL, entity,) {
base.debug(`fiori ${odataURL} ${entity}`)
let ui5Version = '1.97.1' //= cds.env.preview && cds.env.preview.ui5 && cds.env.preview.ui5.version
let ui5Version = '1.98.0' //= cds.env.preview && cds.env.preview.ui5 && cds.env.preview.ui5.version
ui5Version = ui5Version ? ui5Version + '/' : ''
base.debug(`SAPUI5 Version ${ui5Version}`)
return `
Expand Down
9 changes: 8 additions & 1 deletion bin/inspectTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const builder = base.getBuilder({
},
output: {
alias: ['o', 'Output'],
choices: ["tbl", "sql", "sqlite", "cds", "json", "yaml", "cdl", "annos", "edm", "edmx", "swgr", "openapi", "hdbtable", "hdbmigrationtable", "hdbcds", "jsdoc"],
choices: ["tbl", "sql", "sqlite", "cds", "json", "yaml", "cdl", "annos", "edm", "edmx", "swgr", "openapi", "hdbtable", "hdbmigrationtable", "hdbcds", "jsdoc", "graphql"],
default: "tbl",
type: 'string',
desc: base.bundle.getText("outputType")
Expand Down Expand Up @@ -171,6 +171,13 @@ export async function tableInspect(prompts) {
console.log(highlight(cds.compile.to.cdl(cds.parse(cdsSource))))
break
}
case 'graphql': {
let cdsSource = await dbInspect.formatCDS(db, object, fields, constraints, "table", null)
cdsSource = `service HanaCli { ${cdsSource} } `
// @ts-ignore
console.log(highlight(cds.compile.to.gql(cds.parse(cdsSource))))
break
}
case 'edmx': {
let cdsSource = await dbInspect.formatCDS(db, object, fields, constraints, "table", null)
cdsSource = `service HanaCli { ${cdsSource} } `
Expand Down
9 changes: 8 additions & 1 deletion bin/inspectView.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const builder = base.getBuilder({
},
output: {
alias: ['o', 'Output'],
choices: ["tbl", "sql", "sqlite", "cds", "json", "yaml", "cdl", "annos", "edm", "edmx", "swgr", "openapi", "hdbview", "hdbcds", "jsdoc"],
choices: ["tbl", "sql", "sqlite", "cds", "json", "yaml", "cdl", "annos", "edm", "edmx", "swgr", "openapi", "hdbview", "hdbcds", "jsdoc", "graphql"],
default: "tbl",
type: 'string',
desc: base.bundle.getText("outputType")
Expand Down Expand Up @@ -143,6 +143,13 @@ export async function viewInspect(prompts) {
console.log(highlight(cds.compile.to.cdl(cds.parse(cdsSource))))
break
}
case 'graphql': {
let cdsSource = await dbInspect.formatCDS(db, object, fields, null, "view")
cdsSource = `service HanaCli { ${cdsSource} } `
// @ts-ignore
console.log(highlight(cds.compile.to.gql(cds.parse(cdsSource))))
break
}
case 'edmx': {
let cdsSource = await dbInspect.formatCDS(db, object, fields, null, "view")
cdsSource = `service HanaCli { ${cdsSource} } `
Expand Down
115 changes: 105 additions & 10 deletions bin/systemInfo.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,125 @@
// @ts-check
import * as base from '../utils/base.js'
import * as dbInspect from '../utils/dbInspect.js'
import * as conn from '../utils/connections.js'
const colors = base.colors

const OUTPUTS = {
BASIC: "basic",
ENV: "env",
DBX: "dbx"
}
export const command = 'systemInfo'
export const aliases = ['sys', 'sysinfo', 'sysInfo', 'systeminfo']
export const describe = base.bundle.getText("systemInfo")
export const builder = base.getBuilder({})
export function handler (argv) {
base.promptHandler(argv, sysInfo, {})
export const builder = base.getBuilder({
output: {
alias: ['o', 'Output'],
choices: [OUTPUTS.BASIC, OUTPUTS.ENV, OUTPUTS.DBX],
default: "basic",
type: 'string',
desc: base.bundle.getText("outputType")
}
})

export let inputPrompts = {
output: {
description: base.bundle.getText("outputType"),
type: 'string',
required: true
}
}
export function handler(argv) {
base.promptHandler(argv, sysInfo, inputPrompts)
}


export async function sysInfo(prompts) {
base.debug('sysInfo')
try {
base.setPrompts(prompts)
const dbStatus = await base.createDBConnection()

base.outputTable(await dbInspect.getHANAVersion(dbStatus))
switch (prompts.output) {
case OUTPUTS.BASIC: {
await basicOutput()
break
}

let results = await dbStatus.execSQL(`SELECT TOP 100 * FROM "M_SYSTEM_OVERVIEW"`)
base.outputTable(results)
case OUTPUTS.ENV: {
environmentOutput(prompts)
break
}
case OUTPUTS.DBX: {
await dbxOutput(prompts)
break
}
default: {
throw base.bundle.getText("unsupportedFormat")
}
}

results = await dbStatus.execSQL(`SELECT TOP 100 * FROM "M_SERVICES"`)
base.outputTable(results)
return base.end()
} catch (error) {
base.error(error)
}
}

export async function basicOutput() {
const dbStatus = await base.createDBConnection()
base.outputTable(await dbInspect.getHANAVersion(dbStatus))

let results = await dbStatus.execSQL(`SELECT TOP 100 * FROM "M_SYSTEM_OVERVIEW"`)
base.outputTable(results)

results = await dbStatus.execSQL(`SELECT TOP 100 * FROM "M_SERVICES"`)
base.outputTable(results)
}

export function environmentOutput(prompts) {
prompts.disableVerbose = true
console.log(conn.getConnOptions(prompts))
}

export async function dbxOutput(prompts) {
prompts.disableVerbose = true
let connDetails = conn.getConnOptions(prompts)
const dbStatus = await base.createDBConnection()
const dbVersion = await dbInspect.getHANAVersion(dbStatus)
const unknown = base.bundle.getText("hc.unknown")

if (dbVersion.versionMajor > 2) {
console.log(`${base.bundle.getText("dbx.dbType")}:${colors.red('*')} ${colors.red(`SAP HANA Cloud`)}`)
} else {
console.log(`${base.bundle.getText("dbx.dbType")}:${colors.red('*')} ${colors.red(`SAP HANA`)}`)
}
console.log(` ${base.bundle.getText("dbx.hostPort")}:${colors.red('*')} ${colors.red(connDetails.hana?.host ?? unknown)} - ${colors.red(connDetails.hana?.port ?? unknown)}`)
console.log(` ${base.bundle.getText("dbx.user")}:${colors.red('*')} ${colors.red(connDetails.hana?.user ?? unknown)}`)
console.log(` ${base.bundle.getText("dbx.password")}:${colors.red('*')} ${colors.red(connDetails.hana?.password ?? unknown)}`)

if (connDetails.hana?.hdi_user) {
console.log(``)
console.log(` ${base.bundle.getText("dbx.hdiUser")}: ${colors.green(connDetails.hana?.hdi_user ?? unknown)}`)
console.log(` ${base.bundle.getText("dbx.hdiPassword")}: ${colors.green(connDetails.hana?.hdi_password ?? unknown)}`)
console.log(``)
}

if (connDetails.hana?.encrypt) {
console.log(` ${colors.green(`✅`)} ${base.bundle.getText("dbx.secure")}`)
}else {
console.log(` ${colors.green(`🔳`)} ${base.bundle.getText("dbx.secure")}`)
}

if (connDetails.hana?.sslValidateCertificate) {
console.log(` ${colors.green(`✅`)} ${base.bundle.getText("dbx.cert")}`)
}else {
console.log(` ${colors.green(`🔳`)} ${base.bundle.getText("dbx.cert")}`)
}

if (connDetails.hana?.certificate){
console.log(`${base.bundle.getText("dbx.cert2")}:`)
let cert = connDetails.hana?.certificate.replace(`-----BEGIN CERTIFICATE-----\n`, '')
cert = cert.replace(`-----END CERTIFICATE-----`, '')
console.log(colors.blue(cert))
}
return null

}
Loading

0 comments on commit 761f1f2

Please sign in to comment.