UNPKG

@sap/ams-dev

Version:

NodesJS AMS development environment

24 lines (19 loc) 953 B
const cds = require("@sap/cds"); class CapAmsDevEnv { constructor(cdsEnv = {}) { this.amsEnv = cdsEnv.requires?.auth?.ams || {} } /** Indicates if automatic upload of DCL bundle to AMS Server in CAP hybrid mode is activated. */ get autoDeployDcl() { return this.amsEnv.autodeploydcl ?? this.amsEnv.autopushdcl ?? this.amsEnv.autoDeployDcl ?? this.amsEnv.autoPushDcl; } /** Returns the path to the DCL files based on the cds env. A default value for *dclRoot* is supplied to cds env via the package.json. */ get dclRoot() { return process.env.AMS_DCL_ROOT ?? this.amsEnv.dclroot ?? this.amsEnv.dclfolder ?? this.amsEnv.dclRoot ?? this.amsEnv.dclFolder; } /** Returns the path to the local DCN files based on the cds env. A default value for *dcnRoot* is supplied to cds env via the package.json of @sap/ams-dev. */ get dcnRoot() { return this.amsEnv.dcnroot || this.amsEnv.dcnRoot; } } module.exports = new CapAmsDevEnv(cds.env);