Skip to content

Commit

Permalink
chore: add file
Browse files Browse the repository at this point in the history
  • Loading branch information
Caele committed Nov 24, 2020
1 parent c0113d1 commit 9d48237
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions apis/conversion/src/exportFormat.js
@@ -0,0 +1,46 @@
/**
* Used for exporting and importing properties between backend models. An object that exports to
* ExportFormat should put dimensions and measures inside one data group. If an object has two hypercubes
* each of the cubes should export dimensions and measures in two separate data groups.
* An object that imports from this structure is responsible for putting the existing properties where they should be
* in the new model.
* @interface ExportFormat
* @ignore
* @property {(ExportDataDef[])=} data
* @property {object=} properties
*/

/**
* @ignore
* @interface ExportDataDef
* @property {qae.NxDimension[]} dimensions
* @property {qae.NxMeasure[]} measures
* @property {qae.NxDimension[]} excludedDimensions
* @property {qae.NxMeasure[]} excludedMeasures
* @property {number[]} interColumnSortOrder
*/

/**
* @ignore
* @param {number} nDataGroups
* @return {ExportFormat}
*/
function createExportFormat(nDataGroups = 1) {
const exportFormat = {
data: [],
properties: {},
};

for (let i = 0; i < nDataGroups; ++i) {
exportFormat.data.push({
dimensions: [],
measures: [],
excludedDimensions: [],
excludedMeasures: [],
interColumnSortOrder: [],
});
}
return exportFormat;
}

export default createExportFormat;

0 comments on commit 9d48237

Please sign in to comment.