Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (this.jhipsterAppConfig.buildTool === 'maven' && (this.jhipsterAppConfig.clientFramework === 'angularX' || this.jhipsterAppConfig.clientFramework === 'angular2')) {
var fs = require('fs');
// read config from .yo-rc.json
this.baseName = this.jhipsterAppConfig.baseName;
this.packageName = this.jhipsterAppConfig.packageName;
this.packageFolder = this.jhipsterAppConfig.packageFolder;
this.clientFramework = this.jhipsterAppConfig.clientFramework;
this.clientPackageManager = this.jhipsterAppConfig.clientPackageManager;
this.buildTool = this.jhipsterAppConfig.buildTool;
// use function in generator-base.js from generator-jhipster
this.angularAppName = this.getAngularAppName();
// use constants from generator-constants.js
const javaDir = `${jhipsterConstants.SERVER_MAIN_SRC_DIR + this.packageFolder}/`;
const javaTestDir = `${jhipsterConstants.SERVER_TEST_SRC_DIR + this.packageFolder}/`;
const resourceDir = jhipsterConstants.SERVER_MAIN_RES_DIR;
const webappDir = jhipsterConstants.CLIENT_MAIN_SRC_DIR;
// variable from questions
this.pubStripeKey = this.props.pubStripeKey;
this.priStripeKey = this.props.priStripeKey
//******************************************
//
// Adding a new payment entity
//
//******************************************
var shell = require('shelljs');
//adding ngx-stripe dependency
if (shell.exec('npm install ngx-stripe').code !== 0) {
shell.echo('Error: ngx-stripe installation failed');
writeFiles: function () {
if (!this.grpcService) {
return;
}
// function to use directly template
this.template = function (source, destination, context) {
this.fs.copyTpl(
this.templatePath(source),
this.destinationPath(destination),
this,
context
);
};
const grpcEntityDir = jhipsterConstants.SERVER_MAIN_SRC_DIR + this.packageFolder + '/grpc/entity/' + this.entityUnderscoredName ;
const grpcEntityTestDir = jhipsterConstants.SERVER_TEST_SRC_DIR + this.packageFolder + '/grpc/entity/' + this.entityUnderscoredName ;
this.log(grpcEntityDir);
this.template('_entity.proto', 'src/main/proto/' + this.packageFolder + '/entity/' + this.entityUnderscoredName + '.proto');
this.template('_entityProtoMapper.java', grpcEntityDir + '/'+ this.entityClass + 'ProtoMapper.java');
this.template('_entityGrpcService.java', grpcEntityDir + '/'+ this.entityClass + 'GrpcService.java');
this.template('_entityGrpcServiceIntTest.java', grpcEntityTestDir + '/'+ this.entityClass + 'GrpcServiceIntTest.java', { context: { randexp, _, chalkRed: chalk.red, fs, SERVER_TEST_SRC_DIR: grpcEntityTestDir } });
},
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const mkdirp = require('mkdirp');
const cleanup = require('generator-jhipster/generators/cleanup');
const constants = require('generator-jhipster/generators/generator-constants');
const baseServerFiles = require('generator-jhipster/generators/server/files').serverFiles;
/* Constants use throughout */
const INTERPOLATE_REGEX = constants.INTERPOLATE_REGEX;
const SERVER_MAIN_SRC_DIR = constants.SERVER_MAIN_SRC_DIR;
const SERVER_MAIN_RES_DIR = constants.SERVER_MAIN_RES_DIR;
const SERVER_TEST_SRC_DIR = constants.SERVER_TEST_SRC_DIR;
const SERVER_TEST_RES_DIR = constants.SERVER_TEST_RES_DIR;
/* TODO: Do a PR in the parent JHipster project to export and re-use here as well in order to have a single source of truth!!!
const TEST_DIR = constants.TEST_DIR;
const shouldSkipUserManagement = generator =>
generator.skipUserManagement && (generator.applicationType !== 'monolith' || generator.authenticationType !== 'oauth2');
*/
/**
* The default is to use a file path string. It implies use of the template method.
* For any other config an object { file:.., method:.., template:.. } can be used
*/
const serverFiles = {
...baseServerFiles,
serverResource: [
{
this.packageName = this.jhipsterAppConfig.packageName;
this.applicationType = this.jhipsterAppConfig.applicationType;
this.authenticationType = this.jhipsterAppConfig.authenticationType;
this.databaseType = this.jhipsterAppConfig.databaseType;
this.searchEngine = this.jhipsterAppConfig.searchEngine;
this.skipUserManagement = this.jhipsterAppConfig.skipUserManagement;
if (this.applicationType === 'gateway' && this.authenticationType === 'uaa') {
this.skipUserManagement = true;
}
this.buildTool = this.jhipsterAppConfig.buildTool;
this.cacheManagerIsAvailable = ['ehcache', 'caffeine', 'hazelcast', 'infinispan', 'memcached', 'redis'].includes(this.jhipsterAppConfig.cacheProvider) || this.applicationType === 'gateway';
this.cacheProvider = this.jhipsterAppConfig.cacheProvider || this.jhipsterAppConfig.hibernateCache || 'no';
this.messageBroker = this.jhipsterAppConfig.messageBroker;
const javaDir = `${jhipsterConstants.SERVER_MAIN_SRC_DIR + this.packageFolder}/`;
const testDir = `${jhipsterConstants.SERVER_TEST_SRC_DIR + this.packageFolder}/`;
const protoDir = jhipsterConstants.MAIN_DIR + 'proto/';
const protoPackageDir = protoDir + this.packageFolder + '/';
if (this.databaseType === 'sql' && this.authenticationType !== 'oauth2') {
this.idProtoType = 'int64';
this.idProtoWrappedType = 'Int64Value';
} else {
this.idProtoType = 'string';
this.idProtoWrappedType = 'StringValue';
}
this.template('_date.proto', protoDir + 'util/date.proto');
this.template('_decimal.proto', protoDir + 'util/decimal.proto');
this.template('_pagination.proto', protoDir + 'util/pagination.proto');
this.template('_queryfilters.proto', protoDir + 'util/queryfilters.proto');