Password Policy/App rename/PM Scheduling Improvements
This commit is contained in:
@@ -14,7 +14,7 @@ async function rowsFromImport(format, buffer) {
|
||||
}
|
||||
if (format === 'xml') {
|
||||
const parsed = new XMLParser({ ignoreAttributes: false }).parse(text);
|
||||
const assets = parsed.assets?.asset || parsed.MixedAssets?.assets?.asset || [];
|
||||
const assets = parsed.assets?.asset || parsed.DepreCore?.assets?.asset || [];
|
||||
return Array.isArray(assets) ? assets : [assets];
|
||||
}
|
||||
if (format === 'xlsx' || format === 'xls') {
|
||||
@@ -30,7 +30,7 @@ async function assetExport(format) {
|
||||
if (format === 'csv') {
|
||||
return {
|
||||
contentType: 'text/csv',
|
||||
filename: 'mixedassets-assets.csv',
|
||||
filename: 'deprecore-assets.csv',
|
||||
body: Papa.unparse(rows)
|
||||
};
|
||||
}
|
||||
@@ -51,20 +51,20 @@ async function assetExport(format) {
|
||||
];
|
||||
return {
|
||||
contentType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
filename: 'mixedassets-assets.xlsx',
|
||||
filename: 'deprecore-assets.xlsx',
|
||||
body: await writeXlsxFile(sheetData).toBuffer()
|
||||
};
|
||||
}
|
||||
if (format === 'xml') {
|
||||
return {
|
||||
contentType: 'application/xml',
|
||||
filename: 'mixedassets-assets.xml',
|
||||
filename: 'deprecore-assets.xml',
|
||||
body: new XMLBuilder({ format: true }).build({ assets: { asset: rows } })
|
||||
};
|
||||
}
|
||||
return {
|
||||
contentType: 'application/json',
|
||||
filename: 'mixedassets-assets.json',
|
||||
filename: 'deprecore-assets.json',
|
||||
body: JSON.stringify({ exportedAt: now(), assets: rows })
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user