lib/export/jhipster_entity_exporter.js
function exportEntitiesInApplications(passedConfiguration) {
  if (!passedConfiguration || !passedConfiguration.entities) {
    throw new Error('Entities have to be passed to be exported.');
  }
  let exportedEntities = [];
  Object.keys(passedConfiguration.applications).forEach(applicationName => {
    const application = passedConfiguration.applications[applicationName];
    const entitiesToExport = getEntitiesToExport(application.entityNames, passedConfiguration.entities);
    exportedEntities = exportedEntities.concat(
      exportEntities({
        entities: entitiesToExport,
        forceNoFiltering: passedConfiguration.forceNoFiltering,
        application: {
          forSeveralApplications: Object.keys(passedConfiguration.applications).length !== 1,
          name: application.config.baseName,
          type: application.config.applicationType
        }
      })
    );
  });
  return exportedEntities;
}
function exportEntitiesInApplications(passedConfiguration) {
  if (!passedConfiguration || !passedConfiguration.entities) {
    throw new Error('Entities have to be passed to be exported.');
  }
  let exportedEntities = [];
  Object.keys(passedConfiguration.applications).forEach(applicationName => {
    const application = passedConfiguration.applications[applicationName];
    const entitiesToExport = getEntitiesToExport(application.entityNames, passedConfiguration.entities);
    exportedEntities = exportedEntities.concat(
      exportEntities({
        entities: entitiesToExport,
        forceNoFiltering: passedConfiguration.forceNoFiltering,
        application: {
          forSeveralApplications: Object.keys(passedConfiguration.applications).length !== 1,
          name: application.config.baseName,
          type: application.config.applicationType
        }
      })
    );
  });
  return exportedEntities;
}
function exportEntitiesInApplications ( passedConfiguration ) { if ( ! passedConfiguration || ! passedConfiguration . entities ) { throw new Error ( 'Entities have to be passed to be exported.' ) ; } let exportedEntities = [ ] ; Object . keys ( passedConfiguration . applications ) . forEach ( applicationName => { const application = passedConfiguration . applications [ applicationName ] ; const entitiesToExport = getEntitiesToExport ( application . entityNames , passedConfiguration . entities ) ; exportedEntities = exportedEntities . concat ( exportEntities ( { entities : entitiesToExport , forceNoFiltering : passedConfiguration . forceNoFiltering , application : { forSeveralApplications : Object . keys ( passedConfiguration . applications ) . length !== 1 , name : application . config . baseName , type : application . config . applicationType } } ) ) ; } ) ; return exportedEntities ; }
Exports the passed entities to JSON in the applications.
@param passedConfiguration the object having the keys:
- entities: the entities to export,
- forceNoFiltering: whether to filter out unchanged entities,
- applications: the application iterable containing some or all the entities
@return the exported entities per application name.
Exports the passed entities to JSON in the applications .