@wbg-mde/repository
Version:
Managing all common method for file system CRUD operations.
122 lines (121 loc) • 4.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const path = require('path');
const os = require('os');
class App_Repository_Constants {
static get userDataPaths() { return userDataPaths; }
static get masterDataPaths() { return masterDataPaths; }
static get schemaTypes() { return schemaTypes; }
static get templateType() { return templateType; }
static get projectHeader() { return projectHeader; }
static get appSectionMappingTypes() { return appSectionMappingTypes; }
static get appTemplateTypes() { return appTemplateTypes; }
static get defaultLanguage() { return defaultLanguage; }
static get configFile() { return configFile; }
static get nesstarExporterExe() { return nesstarExporterExe; }
static get assetDirectories() { return assetDirectories; }
static get generalDataTypeIcon() { return generalDataTypeIcon; }
static get fileExtention() { return fileExtention; }
static get tempFolder() { return tempFolder; }
static get variableRepositoryFiles() { return variableRepositoryFiles; }
static get modelMappingPath() { return modelMappingPath; }
static get metadataHeader() { return metadataHeader; }
static get dbName() { return db_name; }
}
exports.App_Repository_Constants = App_Repository_Constants;
const defaultLanguage = "en";
const configFile = "app.config.json";
const nesstarExporterExe = "NesstarExporter.exe";
const generalDataTypeIcon = "grid-document.png";
const userDataPaths = {
cur_user: os.userInfo().username || 'guest',
schema_path: 'schema',
template_path: 'template',
user_template: 'custom',
template_db: 'templatelist',
resource_path: "Resources",
customTemplate_path: 'custom_template',
customTemplate_db: 'custom_templatelist',
nesstarExporter: 'nesstar-exporter',
custom_icons: 'icons',
wbm_repository: "wbm-files",
local_variable_repositoy: "variable-repository"
};
const modelMappingPath = 'model-mapping';
const masterDataPaths = {
schema_path: 'schema',
template_path: 'template',
section_mapping: 'section-mapping',
r_script: 'r-script',
r_scripts: 'r-scripts',
i18n: 'i18n'
};
const appSectionMappingTypes = {
editor: "editor",
template: "template"
};
const appTemplateTypes = {
base: "base",
default: "default"
};
const schemaTypes = {
ddi: 'DDI',
survey: 'Survey',
geospatial: 'GeoSpatial',
timeseries: 'TimeSeries',
dbln_core: 'DublinCore',
editor_mapping: 'editor_section_mapping',
template_mapping: 'template_section_mapping',
custom_schema_prefix: 'schema_'
};
const templateType = {
ddi: 'default_template_ddi',
geospatial: 'default_template_geospatial',
timeseries: 'default_template_timeseries',
dublincore: 'default_template_dublincore',
ddibase: "base_template_ddi",
custom_default_prefix: "default_template",
custom_base_prefix: "base_template"
};
const projectHeader = {
version: 'http://wb.mde.schema/projects/1.0',
temp_name_format: 'new study ',
base_folder: 'project',
db_name: 'projectlist',
csv_path: "CSV Data"
};
const metadataHeader = {
db_name: 'metadata'
};
const db_name = 'MDE';
const assetDirectories = {
dataTypeIcons: "temp-types",
rootIconDir: "icon"
};
const fileExtention = {
db: ".db",
study: ".wbm",
xml: ".xml",
txt: ".txt",
csv: ".csv",
rdf: ".rdf",
log: ".log"
};
const variableRepositoryFiles = {
local: "LocalVariableRespository.json",
global: "GlobalVariableRespository.json"
};
const tempFolder = {
root: "metadata-editor-temp",
importI18n: "i18n-import",
exportI18n: "i18n-export",
importNesstar: "nesstar-import",
exportPackage: "project-export-zip",
exportPackageTemplate: "templates",
exportPackageI18n: "i18n",
exportPackageInfoFile: "projectinfo.json",
exportPackageMetadataFile: "projectmetadata.json",
importPackage: "project-import-unzip",
appLogRoot: "application-log",
publishStdy: "publish-study"
};