@microsoft/connected-workbooks 1.0.0 → 2.1.16-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -57
- package/dist/GridParser.d.ts +6 -0
- package/dist/GridParser.js +55 -0
- package/dist/TableDataParserFactory.d.ts +4 -0
- package/dist/TableDataParserFactory.js +15 -0
- package/dist/constants.d.ts +121 -0
- package/dist/constants.js +131 -0
- package/dist/generators.d.ts +3 -0
- package/dist/generators.js +14 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +7 -4
- package/dist/mashupDocumentParser.d.ts +7 -4
- package/dist/mashupDocumentParser.js +169 -72
- package/dist/types.d.ts +55 -0
- package/dist/types.js +29 -0
- package/dist/utils/arrayUtils.d.ts +16 -0
- package/dist/{arrayUtils.js → utils/arrayUtils.js} +12 -10
- package/dist/utils/constants.d.ts +121 -0
- package/dist/utils/constants.js +131 -0
- package/dist/utils/documentUtils.d.ts +15 -0
- package/dist/utils/documentUtils.js +101 -0
- package/dist/utils/htmlUtils.d.ts +1 -0
- package/dist/utils/htmlUtils.js +25 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +20 -0
- package/dist/utils/mashupDocumentParser.d.ts +7 -0
- package/dist/utils/mashupDocumentParser.js +166 -0
- package/dist/utils/pqUtils.d.ts +15 -0
- package/dist/utils/pqUtils.js +101 -0
- package/dist/utils/tableUtils.d.ts +10 -0
- package/dist/utils/tableUtils.js +146 -0
- package/dist/utils/xmlInnerPartsUtils.d.ts +24 -0
- package/dist/utils/xmlInnerPartsUtils.js +198 -0
- package/dist/utils/xmlPartsUtils.d.ts +8 -0
- package/dist/utils/xmlPartsUtils.js +62 -0
- package/dist/workbookManager.d.ts +8 -13
- package/dist/workbookManager.js +78 -133
- package/dist/workbookTemplate.d.ts +2 -1
- package/dist/workbookTemplate.js +2 -2
- package/package.json +21 -8
- package/dist/arrayUtils.d.ts +0 -10
- package/dist/arrayUtils.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mashupDocumentParser.js.map +0 -1
- package/dist/workbookManager.js.map +0 -1
- package/dist/workbookTemplate.js.map +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import JSZip from "jszip";
|
|
2
|
+
import { DataTypes } from "../types";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
createOrUpdateProperty: (doc: Document, parent: Element, property: string, value?: string | null | undefined) => void;
|
|
5
|
+
getDocPropsProperties: (zip: JSZip) => Promise<{
|
|
6
|
+
doc: Document;
|
|
7
|
+
properties: Element;
|
|
8
|
+
}>;
|
|
9
|
+
getCellReferenceRelative: (col: number, row: number) => string;
|
|
10
|
+
getCellReferenceAbsolute: (col: number, row: number) => string;
|
|
11
|
+
createCell: (doc: Document, colIndex: number, rowIndex: number, dataType: DataTypes, data: string) => Element;
|
|
12
|
+
getTableReference: (numberOfCols: number, numberOfRows: number) => string;
|
|
13
|
+
resolveType: (originalDataType: DataTypes, originalData: string | number | boolean) => DataTypes;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const constants_1 = require("./constants");
|
|
15
|
+
const types_1 = require("../types");
|
|
16
|
+
const createOrUpdateProperty = (doc, parent, property, value) => {
|
|
17
|
+
if (value === undefined) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const elements = parent.getElementsByTagName(property);
|
|
21
|
+
if ((elements === null || elements === void 0 ? void 0 : elements.length) === 0) {
|
|
22
|
+
const newElement = doc.createElement(property);
|
|
23
|
+
newElement.textContent = value;
|
|
24
|
+
parent.appendChild(newElement);
|
|
25
|
+
}
|
|
26
|
+
else if (elements.length > 1) {
|
|
27
|
+
throw new Error(`Invalid DocProps core.xml, multiple ${property} elements`);
|
|
28
|
+
}
|
|
29
|
+
else if ((elements === null || elements === void 0 ? void 0 : elements.length) > 0) {
|
|
30
|
+
elements[0].textContent = value;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const getDocPropsProperties = (zip) => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
var _a;
|
|
35
|
+
const docPropsCoreXmlString = yield ((_a = zip.file(constants_1.docPropsCoreXmlPath)) === null || _a === void 0 ? void 0 : _a.async(constants_1.textResultType));
|
|
36
|
+
if (docPropsCoreXmlString === undefined) {
|
|
37
|
+
throw new Error("DocProps core.xml was not found in template");
|
|
38
|
+
}
|
|
39
|
+
const parser = new DOMParser();
|
|
40
|
+
const doc = parser.parseFromString(docPropsCoreXmlString, constants_1.xmlTextResultType);
|
|
41
|
+
const properties = doc.getElementsByTagName(constants_1.docPropsRootElement).item(0);
|
|
42
|
+
if (properties === null) {
|
|
43
|
+
throw new Error("Invalid DocProps core.xml");
|
|
44
|
+
}
|
|
45
|
+
return { doc, properties };
|
|
46
|
+
});
|
|
47
|
+
const getCellReferenceAbsolute = (col, row) => {
|
|
48
|
+
// 65 is the ascii value of first column 'A'
|
|
49
|
+
return "$" + String.fromCharCode(col + 65) + "$" + row.toString();
|
|
50
|
+
};
|
|
51
|
+
const getCellReferenceRelative = (col, row) => {
|
|
52
|
+
// 65 is the ascii value of first column 'A'
|
|
53
|
+
return String.fromCharCode(col + 65) + row.toString();
|
|
54
|
+
};
|
|
55
|
+
const getTableReference = (numberOfCols, numberOfRows) => {
|
|
56
|
+
return `A1:${getCellReferenceRelative(numberOfCols, numberOfRows)}`;
|
|
57
|
+
};
|
|
58
|
+
const createCellElement = (doc, colIndex, rowIndex, dataType, data) => {
|
|
59
|
+
const cell = doc.createElementNS(doc.documentElement.namespaceURI, constants_1.element.kindCell);
|
|
60
|
+
cell.setAttribute(constants_1.elementAttributes.row, getCellReferenceRelative(colIndex, rowIndex + 1));
|
|
61
|
+
const cellData = doc.createElementNS(doc.documentElement.namespaceURI, constants_1.element.cellValue);
|
|
62
|
+
updateCellData(dataType, data, cell, cellData);
|
|
63
|
+
cell.appendChild(cellData);
|
|
64
|
+
return cell;
|
|
65
|
+
};
|
|
66
|
+
const updateCellData = (dataType, data, cell, cellData) => {
|
|
67
|
+
switch (resolveType(dataType, data)) {
|
|
68
|
+
case types_1.DataTypes.string:
|
|
69
|
+
cell.setAttribute(constants_1.element.text, constants_1.dataTypeKind.string);
|
|
70
|
+
break;
|
|
71
|
+
case types_1.DataTypes.number:
|
|
72
|
+
cell.setAttribute(constants_1.element.text, constants_1.dataTypeKind.number);
|
|
73
|
+
break;
|
|
74
|
+
case types_1.DataTypes.boolean:
|
|
75
|
+
cell.setAttribute(constants_1.element.text, constants_1.dataTypeKind.boolean);
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
cellData.textContent = data;
|
|
79
|
+
};
|
|
80
|
+
const resolveType = (originalDataType, originalData) => {
|
|
81
|
+
if (originalDataType !== types_1.DataTypes.autodetect) {
|
|
82
|
+
return originalDataType;
|
|
83
|
+
}
|
|
84
|
+
const data = originalData;
|
|
85
|
+
let dataType = isNaN(Number(data)) ? types_1.DataTypes.string : types_1.DataTypes.number;
|
|
86
|
+
if (dataType == types_1.DataTypes.string) {
|
|
87
|
+
if (data.toLowerCase().trim() == constants_1.trueStr || data.toLowerCase().trim() == constants_1.falseStr) {
|
|
88
|
+
dataType = types_1.DataTypes.boolean;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return dataType;
|
|
92
|
+
};
|
|
93
|
+
exports.default = {
|
|
94
|
+
createOrUpdateProperty,
|
|
95
|
+
getDocPropsProperties,
|
|
96
|
+
getCellReferenceRelative,
|
|
97
|
+
getCellReferenceAbsolute,
|
|
98
|
+
createCell: createCellElement,
|
|
99
|
+
getTableReference,
|
|
100
|
+
resolveType,
|
|
101
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const extractTableValues: (table: HTMLTableElement) => [string[], string[][]];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractTableValues = void 0;
|
|
4
|
+
const extractTableValues = (table) => {
|
|
5
|
+
const headers = [];
|
|
6
|
+
const rows = [];
|
|
7
|
+
// Extract headers
|
|
8
|
+
const headerRow = table.rows[0];
|
|
9
|
+
for (let i = 0; i < headerRow.cells.length; i++) {
|
|
10
|
+
const cell = headerRow.cells[i];
|
|
11
|
+
headers.push(cell.textContent || "");
|
|
12
|
+
}
|
|
13
|
+
// Extract values from each row
|
|
14
|
+
for (let i = 1; i < table.rows.length; i++) {
|
|
15
|
+
const row = table.rows[i];
|
|
16
|
+
const rowData = [];
|
|
17
|
+
for (let j = 0; j < row.cells.length; j++) {
|
|
18
|
+
const cell = row.cells[j];
|
|
19
|
+
rowData.push(cell.textContent || "");
|
|
20
|
+
}
|
|
21
|
+
rows.push(rowData);
|
|
22
|
+
}
|
|
23
|
+
return [headers, rows];
|
|
24
|
+
};
|
|
25
|
+
exports.extractTableValues = extractTableValues;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as pqUtils } from "./pqUtils";
|
|
2
|
+
export { default as arrayUtils } from "./arrayUtils";
|
|
3
|
+
export { default as documentUtils } from "./documentUtils";
|
|
4
|
+
export { default as xmlPartsUtils } from "./xmlPartsUtils";
|
|
5
|
+
export { default as xmlInnerPartsUtils } from "./xmlInnerPartsUtils";
|
|
6
|
+
export { default as tableUtils } from "./tableUtils";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.tableUtils = exports.xmlInnerPartsUtils = exports.xmlPartsUtils = exports.documentUtils = exports.arrayUtils = exports.pqUtils = void 0;
|
|
9
|
+
var pqUtils_1 = require("./pqUtils");
|
|
10
|
+
Object.defineProperty(exports, "pqUtils", { enumerable: true, get: function () { return __importDefault(pqUtils_1).default; } });
|
|
11
|
+
var arrayUtils_1 = require("./arrayUtils");
|
|
12
|
+
Object.defineProperty(exports, "arrayUtils", { enumerable: true, get: function () { return __importDefault(arrayUtils_1).default; } });
|
|
13
|
+
var documentUtils_1 = require("./documentUtils");
|
|
14
|
+
Object.defineProperty(exports, "documentUtils", { enumerable: true, get: function () { return __importDefault(documentUtils_1).default; } });
|
|
15
|
+
var xmlPartsUtils_1 = require("./xmlPartsUtils");
|
|
16
|
+
Object.defineProperty(exports, "xmlPartsUtils", { enumerable: true, get: function () { return __importDefault(xmlPartsUtils_1).default; } });
|
|
17
|
+
var xmlInnerPartsUtils_1 = require("./xmlInnerPartsUtils");
|
|
18
|
+
Object.defineProperty(exports, "xmlInnerPartsUtils", { enumerable: true, get: function () { return __importDefault(xmlInnerPartsUtils_1).default; } });
|
|
19
|
+
var tableUtils_1 = require("./tableUtils");
|
|
20
|
+
Object.defineProperty(exports, "tableUtils", { enumerable: true, get: function () { return __importDefault(tableUtils_1).default; } });
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7
|
+
}) : (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
o[k2] = m[k];
|
|
10
|
+
}));
|
|
11
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
12
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
13
|
+
}) : function(o, v) {
|
|
14
|
+
o["default"] = v;
|
|
15
|
+
});
|
|
16
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
17
|
+
if (mod && mod.__esModule) return mod;
|
|
18
|
+
var result = {};
|
|
19
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
20
|
+
__setModuleDefault(result, mod);
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
24
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
25
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
26
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
27
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
28
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
29
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
33
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
|
+
};
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const base64 = __importStar(require("base64-js"));
|
|
37
|
+
const jszip_1 = __importDefault(require("jszip"));
|
|
38
|
+
const constants_1 = require("./constants");
|
|
39
|
+
const _1 = require(".");
|
|
40
|
+
class MashupHandler {
|
|
41
|
+
constructor() {
|
|
42
|
+
this.setSection1m = (queryMashupDoc, zip) => {
|
|
43
|
+
var _a;
|
|
44
|
+
if (!((_a = zip.file(constants_1.section1mPath)) === null || _a === void 0 ? void 0 : _a.async(constants_1.textResultType))) {
|
|
45
|
+
throw new Error(constants_1.formulaSectionNotFoundErr);
|
|
46
|
+
}
|
|
47
|
+
const newSection1m = queryMashupDoc;
|
|
48
|
+
zip.file(constants_1.section1mPath, newSection1m, {
|
|
49
|
+
compression: constants_1.emptyValue,
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
this.editSingleQueryMetadata = (metadataArray, metadata) => {
|
|
53
|
+
var _a;
|
|
54
|
+
//extract metadataXml
|
|
55
|
+
const mashupArray = new _1.arrayUtils.ArrayReader(metadataArray.buffer);
|
|
56
|
+
const metadataVersion = mashupArray.getBytes(4);
|
|
57
|
+
const metadataXmlSize = mashupArray.getInt32();
|
|
58
|
+
const metadataXml = mashupArray.getBytes(metadataXmlSize);
|
|
59
|
+
const endBuffer = mashupArray.getBytes();
|
|
60
|
+
//parse metdataXml
|
|
61
|
+
const textDecoder = new TextDecoder();
|
|
62
|
+
const metadataString = textDecoder.decode(metadataXml);
|
|
63
|
+
const parser = new DOMParser();
|
|
64
|
+
const serializer = new XMLSerializer();
|
|
65
|
+
const parsedMetadata = parser.parseFromString(metadataString, constants_1.xmlTextResultType);
|
|
66
|
+
// Update InfoPaths to new QueryName
|
|
67
|
+
const itemPaths = parsedMetadata.getElementsByTagName(constants_1.element.itemPath);
|
|
68
|
+
if (itemPaths && itemPaths.length) {
|
|
69
|
+
for (let i = 0; i < itemPaths.length; i++) {
|
|
70
|
+
const itemPath = itemPaths[i];
|
|
71
|
+
const content = itemPath.innerHTML;
|
|
72
|
+
if (content.includes(constants_1.section1PathPrefix)) {
|
|
73
|
+
const strArr = content.split(constants_1.divider);
|
|
74
|
+
strArr[1] = metadata.queryName;
|
|
75
|
+
const newContent = strArr.join(constants_1.divider);
|
|
76
|
+
itemPath.textContent = newContent;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const entries = parsedMetadata.getElementsByTagName(constants_1.element.entry);
|
|
81
|
+
if (entries && entries.length) {
|
|
82
|
+
for (let i = 0; i < entries.length; i++) {
|
|
83
|
+
const entry = entries[i];
|
|
84
|
+
const entryAttributes = entry.attributes;
|
|
85
|
+
const entryAttributesArr = [...entryAttributes];
|
|
86
|
+
const entryProp = entryAttributesArr.find((prop) => {
|
|
87
|
+
return (prop === null || prop === void 0 ? void 0 : prop.name) === constants_1.elementAttributes.type;
|
|
88
|
+
});
|
|
89
|
+
if ((entryProp === null || entryProp === void 0 ? void 0 : entryProp.nodeValue) == constants_1.elementAttributes.relationshipInfo) {
|
|
90
|
+
const newValue = (_a = entry
|
|
91
|
+
.getAttribute(constants_1.elementAttributes.value)) === null || _a === void 0 ? void 0 : _a.replace(/Query1/g, metadata.queryName);
|
|
92
|
+
if (newValue) {
|
|
93
|
+
entry.setAttribute(constants_1.elementAttributes.value, newValue);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if ((entryProp === null || entryProp === void 0 ? void 0 : entryProp.nodeValue) == constants_1.elementAttributes.resultType) {
|
|
97
|
+
entry.setAttribute(constants_1.elementAttributes.value, constants_1.elementAttributesValues.tableResultType());
|
|
98
|
+
}
|
|
99
|
+
if ((entryProp === null || entryProp === void 0 ? void 0 : entryProp.nodeValue) == constants_1.elementAttributes.fillColumnNames) {
|
|
100
|
+
const oldValue = entry.getAttribute(constants_1.elementAttributes.value);
|
|
101
|
+
if (oldValue) {
|
|
102
|
+
entry.setAttribute(constants_1.elementAttributes.value, oldValue.replace(constants_1.defaults.queryName, metadata.queryName));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if ((entryProp === null || entryProp === void 0 ? void 0 : entryProp.nodeValue) == constants_1.elementAttributes.fillTarget) {
|
|
106
|
+
const oldValue = entry.getAttribute(constants_1.elementAttributes.value);
|
|
107
|
+
if (oldValue) {
|
|
108
|
+
entry.setAttribute(constants_1.elementAttributes.value, oldValue.replace(constants_1.defaults.queryName, metadata.queryName));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if ((entryProp === null || entryProp === void 0 ? void 0 : entryProp.nodeValue) == constants_1.elementAttributes.fillLastUpdated) {
|
|
112
|
+
const nowTime = new Date().toISOString();
|
|
113
|
+
entry.setAttribute(constants_1.elementAttributes.value, (constants_1.elementAttributes.day + nowTime).replace(/Z/, "0000Z"));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// Convert new metadataXml to Uint8Array
|
|
118
|
+
const newMetadataString = serializer.serializeToString(parsedMetadata);
|
|
119
|
+
const encoder = new TextEncoder();
|
|
120
|
+
const newMetadataXml = encoder.encode(newMetadataString);
|
|
121
|
+
const newMetadataXmlSize = _1.arrayUtils.getInt32Buffer(newMetadataXml.byteLength);
|
|
122
|
+
const newMetadataArray = _1.arrayUtils.concatArrays(metadataVersion, newMetadataXmlSize, newMetadataXml, endBuffer);
|
|
123
|
+
return newMetadataArray;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
ReplaceSingleQuery(base64Str, queryName, queryMashupDoc) {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
const { version, packageOPC, permissionsSize, permissions, metadata, endBuffer } = this.getPackageComponents(base64Str);
|
|
129
|
+
const newPackageBuffer = yield this.editSingleQueryPackage(packageOPC, queryMashupDoc);
|
|
130
|
+
const packageSizeBuffer = _1.arrayUtils.getInt32Buffer(newPackageBuffer.byteLength);
|
|
131
|
+
const permissionsSizeBuffer = _1.arrayUtils.getInt32Buffer(permissionsSize);
|
|
132
|
+
const newMetadataBuffer = this.editSingleQueryMetadata(metadata, { queryName });
|
|
133
|
+
const metadataSizeBuffer = _1.arrayUtils.getInt32Buffer(newMetadataBuffer.byteLength);
|
|
134
|
+
const newMashup = _1.arrayUtils.concatArrays(version, packageSizeBuffer, newPackageBuffer, permissionsSizeBuffer, permissions, metadataSizeBuffer, newMetadataBuffer, endBuffer);
|
|
135
|
+
return base64.fromByteArray(newMashup);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
getPackageComponents(base64Str) {
|
|
139
|
+
const buffer = base64.toByteArray(base64Str).buffer;
|
|
140
|
+
const mashupArray = new _1.arrayUtils.ArrayReader(buffer);
|
|
141
|
+
const version = mashupArray.getBytes(4);
|
|
142
|
+
const packageSize = mashupArray.getInt32();
|
|
143
|
+
const packageOPC = mashupArray.getBytes(packageSize);
|
|
144
|
+
const permissionsSize = mashupArray.getInt32();
|
|
145
|
+
const permissions = mashupArray.getBytes(permissionsSize);
|
|
146
|
+
const metadataSize = mashupArray.getInt32();
|
|
147
|
+
const metadata = mashupArray.getBytes(metadataSize);
|
|
148
|
+
const endBuffer = mashupArray.getBytes();
|
|
149
|
+
return {
|
|
150
|
+
version,
|
|
151
|
+
packageOPC,
|
|
152
|
+
permissionsSize,
|
|
153
|
+
permissions,
|
|
154
|
+
metadata,
|
|
155
|
+
endBuffer,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
editSingleQueryPackage(packageOPC, queryMashupDoc) {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
const packageZip = yield jszip_1.default.loadAsync(packageOPC);
|
|
161
|
+
this.setSection1m(queryMashupDoc, packageZip);
|
|
162
|
+
return yield packageZip.generateAsync({ type: constants_1.uint8ArrayType });
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
exports.default = MashupHandler;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import JSZip from "jszip";
|
|
2
|
+
declare type CustomXmlFile = {
|
|
3
|
+
found: boolean;
|
|
4
|
+
path: string;
|
|
5
|
+
xmlString: string | undefined;
|
|
6
|
+
value: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: {
|
|
9
|
+
getBase64: (zip: JSZip) => Promise<string | undefined>;
|
|
10
|
+
setBase64: (zip: JSZip, base64: string) => Promise<void>;
|
|
11
|
+
getCustomXmlFile: (zip: JSZip, url: string, encoding?: string) => Promise<CustomXmlFile>;
|
|
12
|
+
getDataMashupFile: (zip: JSZip) => Promise<CustomXmlFile>;
|
|
13
|
+
validateQueryName: (queryName: string) => void;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const iconv_lite_1 = __importDefault(require("iconv-lite"));
|
|
18
|
+
const constants_1 = require("./constants");
|
|
19
|
+
const generators_1 = require("../generators");
|
|
20
|
+
const getBase64 = (zip) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
const mashup = yield getDataMashupFile(zip);
|
|
22
|
+
return mashup.value;
|
|
23
|
+
});
|
|
24
|
+
const setBase64 = (zip, base64) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
+
const newXml = generators_1.generateMashupXMLTemplate(base64);
|
|
26
|
+
const encoded = iconv_lite_1.default.encode(newXml, "UCS2", { addBOM: true });
|
|
27
|
+
const mashup = yield getDataMashupFile(zip);
|
|
28
|
+
zip.file(mashup === null || mashup === void 0 ? void 0 : mashup.path, encoded);
|
|
29
|
+
});
|
|
30
|
+
const getDataMashupFile = (zip) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
let mashup;
|
|
32
|
+
for (const url of constants_1.URLS.PQ) {
|
|
33
|
+
const item = yield getCustomXmlFile(zip, url);
|
|
34
|
+
if (item.found) {
|
|
35
|
+
mashup = item;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (!mashup) {
|
|
40
|
+
throw new Error("DataMashup XML is not found");
|
|
41
|
+
}
|
|
42
|
+
return mashup;
|
|
43
|
+
});
|
|
44
|
+
const getCustomXmlFile = (zip, url, encoding = "UTF-16") => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
const parser = new DOMParser();
|
|
47
|
+
const itemsArray = yield zip.file(/customXml\/item\d.xml/);
|
|
48
|
+
if (!itemsArray || itemsArray.length === 0) {
|
|
49
|
+
throw new Error("No customXml files were found!");
|
|
50
|
+
}
|
|
51
|
+
let found = false;
|
|
52
|
+
let path;
|
|
53
|
+
let xmlString;
|
|
54
|
+
let value;
|
|
55
|
+
for (let i = 1; i <= itemsArray.length; i++) {
|
|
56
|
+
path = generators_1.generateCustomXmlFilePath(i);
|
|
57
|
+
const xmlValue = yield ((_a = zip.file(path)) === null || _a === void 0 ? void 0 : _a.async("uint8array"));
|
|
58
|
+
if (xmlValue === undefined) {
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
xmlString = iconv_lite_1.default.decode(xmlValue.buffer, encoding);
|
|
62
|
+
const doc = parser.parseFromString(xmlString, "text/xml");
|
|
63
|
+
found = ((_b = doc === null || doc === void 0 ? void 0 : doc.documentElement) === null || _b === void 0 ? void 0 : _b.namespaceURI) === url;
|
|
64
|
+
if (found) {
|
|
65
|
+
value = doc.documentElement.innerHTML;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return { found, path: path, xmlString: xmlString, value };
|
|
70
|
+
});
|
|
71
|
+
const queryNameHasInvalidChars = (queryName) => {
|
|
72
|
+
const invalidQueryNameChars = ['"', "."];
|
|
73
|
+
// Control characters as defined in Unicode
|
|
74
|
+
for (let c = 0; c <= 0x001f; ++c) {
|
|
75
|
+
invalidQueryNameChars.push(String.fromCharCode(c));
|
|
76
|
+
}
|
|
77
|
+
for (let c = 0x007f; c <= 0x009f; ++c) {
|
|
78
|
+
invalidQueryNameChars.push(String.fromCharCode(c));
|
|
79
|
+
}
|
|
80
|
+
return queryName.split("").some((ch) => invalidQueryNameChars.indexOf(ch) !== -1);
|
|
81
|
+
};
|
|
82
|
+
const validateQueryName = (queryName) => {
|
|
83
|
+
if (queryName) {
|
|
84
|
+
if (queryName.length > constants_1.maxQueryLength) {
|
|
85
|
+
throw new Error(constants_1.QueryNameMaxLengthErr);
|
|
86
|
+
}
|
|
87
|
+
if (queryNameHasInvalidChars(queryName)) {
|
|
88
|
+
throw new Error(constants_1.QueryNameMaxLengthErr);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (!queryName.trim()) {
|
|
92
|
+
throw new Error(constants_1.EmptyQueryNameErr);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.default = {
|
|
96
|
+
getBase64,
|
|
97
|
+
setBase64,
|
|
98
|
+
getCustomXmlFile,
|
|
99
|
+
getDataMashupFile,
|
|
100
|
+
validateQueryName,
|
|
101
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import JSZip from "jszip";
|
|
2
|
+
import { TableData } from "../types";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
updateTableInitialDataIfNeeded: (zip: JSZip, tableData?: TableData | undefined, updateQueryTable?: boolean | undefined) => Promise<void>;
|
|
5
|
+
updateSheetsInitialData: (sheetsXmlString: string, tableData: TableData) => Promise<string>;
|
|
6
|
+
updateWorkbookInitialData: (workbookXmlString: string, tableData: TableData, queryName?: string | undefined) => Promise<string>;
|
|
7
|
+
updateTablesInitialData: (tableXmlString: string, tableData: TableData, updateQueryTable?: boolean) => Promise<string>;
|
|
8
|
+
updateQueryTablesInitialData: (queryTableXmlString: string, tableData: TableData) => Promise<string>;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const types_1 = require("../types");
|
|
16
|
+
const constants_1 = require("./constants");
|
|
17
|
+
const documentUtils_1 = __importDefault(require("./documentUtils"));
|
|
18
|
+
const uuid_1 = require("uuid");
|
|
19
|
+
const updateTableInitialDataIfNeeded = (zip, tableData, updateQueryTable) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
var _a, _b, _c, _d;
|
|
21
|
+
if (!tableData) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const sheetsXmlString = yield ((_a = zip.file(constants_1.sheetsXmlPath)) === null || _a === void 0 ? void 0 : _a.async(constants_1.textResultType));
|
|
25
|
+
if (sheetsXmlString === undefined) {
|
|
26
|
+
throw new Error(constants_1.sheetsNotFoundErr);
|
|
27
|
+
}
|
|
28
|
+
const newSheet = yield updateSheetsInitialData(sheetsXmlString, tableData);
|
|
29
|
+
zip.file(constants_1.sheetsXmlPath, newSheet);
|
|
30
|
+
if (updateQueryTable) {
|
|
31
|
+
const queryTableXmlString = yield ((_b = zip.file(constants_1.queryTableXmlPath)) === null || _b === void 0 ? void 0 : _b.async(constants_1.textResultType));
|
|
32
|
+
if (queryTableXmlString === undefined) {
|
|
33
|
+
throw new Error(constants_1.queryTableNotFoundErr);
|
|
34
|
+
}
|
|
35
|
+
const newQueryTable = yield updateQueryTablesInitialData(queryTableXmlString, tableData);
|
|
36
|
+
zip.file(constants_1.queryTableXmlPath, newQueryTable);
|
|
37
|
+
// update defined name
|
|
38
|
+
const workbookXmlString = yield ((_c = zip.file(constants_1.workbookXmlPath)) === null || _c === void 0 ? void 0 : _c.async(constants_1.textResultType));
|
|
39
|
+
if (workbookXmlString === undefined) {
|
|
40
|
+
throw new Error(constants_1.sheetsNotFoundErr);
|
|
41
|
+
}
|
|
42
|
+
const newWorkbook = yield updateWorkbookInitialData(workbookXmlString, tableData);
|
|
43
|
+
zip.file(constants_1.workbookXmlPath, newWorkbook);
|
|
44
|
+
}
|
|
45
|
+
const tableXmlString = yield ((_d = zip.file(constants_1.tableXmlPath)) === null || _d === void 0 ? void 0 : _d.async(constants_1.textResultType));
|
|
46
|
+
if (tableXmlString === undefined) {
|
|
47
|
+
throw new Error(constants_1.tableNotFoundErr);
|
|
48
|
+
}
|
|
49
|
+
const newTable = yield updateTablesInitialData(tableXmlString, tableData, updateQueryTable);
|
|
50
|
+
zip.file(constants_1.tableXmlPath, newTable);
|
|
51
|
+
});
|
|
52
|
+
const updateTablesInitialData = (tableXmlString, tableData, updateQueryTable = false) => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
+
const parser = new DOMParser();
|
|
54
|
+
const serializer = new XMLSerializer();
|
|
55
|
+
const tableDoc = parser.parseFromString(tableXmlString, constants_1.xmlTextResultType);
|
|
56
|
+
const tableColumns = tableDoc.getElementsByTagName(constants_1.element.tableColumns)[0];
|
|
57
|
+
tableColumns.textContent = "";
|
|
58
|
+
tableData.columnMetadata.forEach((col, columnIndex) => {
|
|
59
|
+
const tableColumn = tableDoc.createElementNS(tableDoc.documentElement.namespaceURI, constants_1.element.tableColumn);
|
|
60
|
+
tableColumn.setAttribute(constants_1.elementAttributes.id, (columnIndex + 1).toString());
|
|
61
|
+
tableColumn.setAttribute(constants_1.elementAttributes.name, col.name);
|
|
62
|
+
tableColumns.appendChild(tableColumn);
|
|
63
|
+
tableColumn.setAttribute(constants_1.elementAttributes.xr3uid, "{" + uuid_1.v4().toUpperCase() + "}");
|
|
64
|
+
if (updateQueryTable) {
|
|
65
|
+
tableColumn.setAttribute(constants_1.elementAttributes.uniqueName, (columnIndex + 1).toString());
|
|
66
|
+
tableColumn.setAttribute(constants_1.elementAttributes.queryTableFieldId, (columnIndex + 1).toString());
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
tableColumns.setAttribute(constants_1.elementAttributes.count, tableData.columnMetadata.length.toString());
|
|
70
|
+
tableDoc
|
|
71
|
+
.getElementsByTagName(constants_1.element.table)[0]
|
|
72
|
+
.setAttribute(constants_1.elementAttributes.reference, `A1:${documentUtils_1.default.getCellReferenceRelative(tableData.columnMetadata.length - 1, tableData.rows.length + 1)}`);
|
|
73
|
+
tableDoc
|
|
74
|
+
.getElementsByTagName(constants_1.element.autoFilter)[0]
|
|
75
|
+
.setAttribute(constants_1.elementAttributes.reference, `A1:${documentUtils_1.default.getCellReferenceRelative(tableData.columnMetadata.length - 1, tableData.rows.length + 1)}`);
|
|
76
|
+
return serializer.serializeToString(tableDoc);
|
|
77
|
+
});
|
|
78
|
+
const updateWorkbookInitialData = (workbookXmlString, tableData, queryName) => __awaiter(void 0, void 0, void 0, function* () {
|
|
79
|
+
const newParser = new DOMParser();
|
|
80
|
+
const newSerializer = new XMLSerializer();
|
|
81
|
+
const workbookDoc = newParser.parseFromString(workbookXmlString, constants_1.xmlTextResultType);
|
|
82
|
+
const definedName = workbookDoc.getElementsByTagName(constants_1.element.definedName)[0];
|
|
83
|
+
const prefix = queryName === undefined ? constants_1.defaults.queryName : queryName;
|
|
84
|
+
definedName.textContent =
|
|
85
|
+
prefix +
|
|
86
|
+
`!$A$1:${documentUtils_1.default.getCellReferenceAbsolute(tableData.columnMetadata.length - 1, tableData.rows.length + 1)}`;
|
|
87
|
+
return newSerializer.serializeToString(workbookDoc);
|
|
88
|
+
});
|
|
89
|
+
const updateQueryTablesInitialData = (queryTableXmlString, tableData) => __awaiter(void 0, void 0, void 0, function* () {
|
|
90
|
+
const parser = new DOMParser();
|
|
91
|
+
const serializer = new XMLSerializer();
|
|
92
|
+
const queryTableDoc = parser.parseFromString(queryTableXmlString, constants_1.xmlTextResultType);
|
|
93
|
+
const queryTableFields = queryTableDoc.getElementsByTagName(constants_1.element.queryTableFields)[0];
|
|
94
|
+
queryTableFields.textContent = "";
|
|
95
|
+
tableData.columnMetadata.forEach((col, columnIndex) => {
|
|
96
|
+
const queryTableField = queryTableDoc.createElementNS(queryTableDoc.documentElement.namespaceURI, constants_1.element.queryTableField);
|
|
97
|
+
queryTableField.setAttribute(constants_1.elementAttributes.id, (columnIndex + 1).toString());
|
|
98
|
+
queryTableField.setAttribute(constants_1.elementAttributes.name, col.name);
|
|
99
|
+
queryTableField.setAttribute(constants_1.elementAttributes.tableColumnId, (columnIndex + 1).toString());
|
|
100
|
+
queryTableFields.appendChild(queryTableField);
|
|
101
|
+
});
|
|
102
|
+
queryTableFields.setAttribute(constants_1.elementAttributes.count, tableData.columnMetadata.length.toString());
|
|
103
|
+
queryTableDoc
|
|
104
|
+
.getElementsByTagName(constants_1.element.queryTableRefresh)[0]
|
|
105
|
+
.setAttribute(constants_1.elementAttributes.nextId, (tableData.columnMetadata.length + 1).toString());
|
|
106
|
+
return serializer.serializeToString(queryTableDoc);
|
|
107
|
+
});
|
|
108
|
+
const updateSheetsInitialData = (sheetsXmlString, tableData) => __awaiter(void 0, void 0, void 0, function* () {
|
|
109
|
+
const parser = new DOMParser();
|
|
110
|
+
const serializer = new XMLSerializer();
|
|
111
|
+
const sheetsDoc = parser.parseFromString(sheetsXmlString, constants_1.xmlTextResultType);
|
|
112
|
+
const sheetData = sheetsDoc.getElementsByTagName(constants_1.element.sheetData)[0];
|
|
113
|
+
sheetData.textContent = "";
|
|
114
|
+
let rowIndex = 0;
|
|
115
|
+
const columnRow = sheetsDoc.createElementNS(sheetsDoc.documentElement.namespaceURI, constants_1.element.row);
|
|
116
|
+
columnRow.setAttribute(constants_1.elementAttributes.row, (rowIndex + 1).toString());
|
|
117
|
+
columnRow.setAttribute(constants_1.elementAttributes.spans, "1:" + tableData.columnMetadata.length);
|
|
118
|
+
columnRow.setAttribute(constants_1.elementAttributes.x14acDyDescent, "0.3");
|
|
119
|
+
tableData.columnMetadata.forEach((col, colIndex) => {
|
|
120
|
+
columnRow.appendChild(documentUtils_1.default.createCell(sheetsDoc, colIndex, rowIndex, types_1.DataTypes.string, col.name));
|
|
121
|
+
});
|
|
122
|
+
sheetData.appendChild(columnRow);
|
|
123
|
+
rowIndex++;
|
|
124
|
+
tableData.rows.forEach((row) => {
|
|
125
|
+
const newRow = sheetsDoc.createElementNS(sheetsDoc.documentElement.namespaceURI, constants_1.element.row);
|
|
126
|
+
newRow.setAttribute(constants_1.elementAttributes.row, (rowIndex + 1).toString());
|
|
127
|
+
newRow.setAttribute(constants_1.elementAttributes.spans, "1:" + row.length);
|
|
128
|
+
newRow.setAttribute(constants_1.elementAttributes.x14acDyDescent, "0.3");
|
|
129
|
+
row.forEach((cellContent, colIndex) => {
|
|
130
|
+
newRow.appendChild(documentUtils_1.default.createCell(sheetsDoc, colIndex, rowIndex, tableData.columnMetadata[colIndex].type, cellContent));
|
|
131
|
+
});
|
|
132
|
+
sheetData.appendChild(newRow);
|
|
133
|
+
rowIndex++;
|
|
134
|
+
});
|
|
135
|
+
sheetsDoc
|
|
136
|
+
.getElementsByTagName(constants_1.element.dimension)[0]
|
|
137
|
+
.setAttribute(constants_1.elementAttributes.reference, documentUtils_1.default.getTableReference(tableData.rows[0].length - 1, tableData.rows.length));
|
|
138
|
+
return serializer.serializeToString(sheetsDoc);
|
|
139
|
+
});
|
|
140
|
+
exports.default = {
|
|
141
|
+
updateTableInitialDataIfNeeded,
|
|
142
|
+
updateSheetsInitialData,
|
|
143
|
+
updateWorkbookInitialData,
|
|
144
|
+
updateTablesInitialData,
|
|
145
|
+
updateQueryTablesInitialData,
|
|
146
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import JSZip from "jszip";
|
|
2
|
+
import { DocProps } from "../types";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
updateDocProps: (zip: JSZip, docProps?: DocProps) => Promise<void>;
|
|
5
|
+
updateConnections: (connectionsXmlString: string, queryName: string, refreshOnOpen: boolean) => Promise<{
|
|
6
|
+
connectionId: string | undefined;
|
|
7
|
+
connectionXmlFileString: string;
|
|
8
|
+
}>;
|
|
9
|
+
updateSharedStrings: (sharedStringsXmlString: string, queryName: string) => Promise<{
|
|
10
|
+
sharedStringIndex: number;
|
|
11
|
+
newSharedStrings: string;
|
|
12
|
+
}>;
|
|
13
|
+
updateWorksheet: (sheetsXmlString: string, sharedStringIndex: string) => Promise<string>;
|
|
14
|
+
updatePivotTablesandQueryTables: (zip: JSZip, queryName: string, refreshOnOpen: boolean, connectionId: string) => Promise<void>;
|
|
15
|
+
updateQueryTable: (tableXmlString: string, connectionId: string, refreshOnOpen: boolean) => {
|
|
16
|
+
isQueryTableUpdated: boolean;
|
|
17
|
+
newQueryTable: string;
|
|
18
|
+
};
|
|
19
|
+
updatePivotTable: (tableXmlString: string, connectionId: string, refreshOnOpen: boolean) => {
|
|
20
|
+
isPivotTableUpdated: boolean;
|
|
21
|
+
newPivotTable: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|