@xapi-js/core 1.1.0 → 1.2.0
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 +200 -216
- package/dist/index.cjs +764 -747
- package/dist/index.d.cts +237 -233
- package/dist/index.d.ts +237 -233
- package/dist/index.js +724 -695
- package/package.json +4 -7
- package/dist/api-ISSD7HZ6.js +0 -134436
- package/dist/chunk-GI5RMYH6.js +0 -37
- package/dist/performance.test.js +0 -2485
package/dist/index.cjs
CHANGED
|
@@ -1,805 +1,822 @@
|
|
|
1
|
-
|
|
1
|
+
//#region rolldown:runtime
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
8
|
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var index_exports = {};
|
|
32
|
-
__export(index_exports, {
|
|
33
|
-
ColumnTypeError: () => ColumnTypeError,
|
|
34
|
-
Dataset: () => Dataset,
|
|
35
|
-
InvalidXmlError: () => InvalidXmlError,
|
|
36
|
-
NexaVersion: () => NexaVersion,
|
|
37
|
-
StringWritableStream: () => StringWritableStream,
|
|
38
|
-
XapiRoot: () => XapiRoot,
|
|
39
|
-
XplatformVersion: () => XplatformVersion,
|
|
40
|
-
_unescapeXml: () => _unescapeXml,
|
|
41
|
-
arrayBufferToString: () => arrayBufferToString,
|
|
42
|
-
base64ToUint8Array: () => base64ToUint8Array,
|
|
43
|
-
columnType: () => columnType,
|
|
44
|
-
convertToColumnType: () => convertToColumnType,
|
|
45
|
-
convertToString: () => convertToString,
|
|
46
|
-
dateToString: () => dateToString,
|
|
47
|
-
initXapi: () => initXapi,
|
|
48
|
-
makeParseEntities: () => makeParseEntities,
|
|
49
|
-
makeWriterEntities: () => makeWriterEntities,
|
|
50
|
-
parse: () => parse2,
|
|
51
|
-
rowType: () => rowType,
|
|
52
|
-
stringToDate: () => stringToDate,
|
|
53
|
-
stringToReadableStream: () => stringToReadableStream,
|
|
54
|
-
uint8ArrayToBase64: () => uint8ArrayToBase64,
|
|
55
|
-
write: () => write,
|
|
56
|
-
writeString: () => writeString
|
|
57
|
-
});
|
|
58
|
-
module.exports = __toCommonJS(index_exports);
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
59
22
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
23
|
+
//#endregion
|
|
24
|
+
let stax_xml = require("stax-xml");
|
|
25
|
+
stax_xml = __toESM(stax_xml);
|
|
26
|
+
let txml = require("txml");
|
|
27
|
+
txml = __toESM(txml);
|
|
63
28
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
29
|
+
//#region src/types.ts
|
|
30
|
+
/**
|
|
31
|
+
* Defines the possible types of rows in an X-API dataset (e.g., "insert", "update", "delete").
|
|
32
|
+
*/
|
|
33
|
+
const rowType = [
|
|
34
|
+
"insert",
|
|
35
|
+
"update",
|
|
36
|
+
"delete"
|
|
37
|
+
];
|
|
38
|
+
/**
|
|
39
|
+
* Defines the possible data types for columns in an X-API dataset.
|
|
40
|
+
*/
|
|
41
|
+
const columnType = [
|
|
42
|
+
"STRING",
|
|
43
|
+
"INT",
|
|
44
|
+
"FLOAT",
|
|
45
|
+
"DECIMAL",
|
|
46
|
+
"BIGDECIMAL",
|
|
47
|
+
"DATE",
|
|
48
|
+
"DATETIME",
|
|
49
|
+
"TIME",
|
|
50
|
+
"BLOB"
|
|
51
|
+
];
|
|
52
|
+
/**
|
|
53
|
+
* Xplatform version definition for X-API XML.
|
|
54
|
+
*/
|
|
55
|
+
const XplatformVersion = {
|
|
56
|
+
xmlns: "http://www.tobesoft.com/platform/Dataset",
|
|
57
|
+
version: "4000"
|
|
70
58
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Nexacro version definition for X-API XML.
|
|
61
|
+
*/
|
|
62
|
+
const NexaVersion = {
|
|
63
|
+
xmlns: "http://www.nexacroplatform.com/platform/dataset",
|
|
64
|
+
version: "4000"
|
|
74
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* Custom error class for column type related issues.
|
|
68
|
+
*/
|
|
75
69
|
var ColumnTypeError = class extends Error {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
constructor(message) {
|
|
71
|
+
super(message);
|
|
72
|
+
this.name = "ColumnTypeError";
|
|
73
|
+
}
|
|
80
74
|
};
|
|
81
75
|
var InvalidXmlError = class extends Error {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
constructor(message) {
|
|
77
|
+
super(message);
|
|
78
|
+
this.name = "InvalidXmlError";
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/xapi-data.ts
|
|
84
|
+
/**
|
|
85
|
+
* Represents the root of an X-API XML structure, containing datasets and parameters.
|
|
86
|
+
*/
|
|
87
|
+
var XapiRoot = class {
|
|
88
|
+
/** An array of datasets within the X-API root. */
|
|
89
|
+
datasets = [];
|
|
90
|
+
/** Parameters associated with the X-API root. */
|
|
91
|
+
parameters = { params: [] };
|
|
92
|
+
/**
|
|
93
|
+
* Creates an instance of XapiRoot.
|
|
94
|
+
* @param datasets - Initial array of datasets.
|
|
95
|
+
* @param parameters - Initial parameters.
|
|
96
|
+
*/
|
|
97
|
+
constructor(datasets = [], parameters = { params: [] }) {
|
|
98
|
+
this.datasets = datasets;
|
|
99
|
+
this.parameters = parameters;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Adds a dataset to the X-API root.
|
|
103
|
+
* @param dataset - The dataset to add.
|
|
104
|
+
*/
|
|
105
|
+
addDataset(dataset) {
|
|
106
|
+
this.datasets.push(dataset);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Retrieves a dataset by its ID.
|
|
110
|
+
* @param id - The ID of the dataset to retrieve.
|
|
111
|
+
* @returns The Dataset object, or undefined if not found.
|
|
112
|
+
*/
|
|
113
|
+
getDataset(id) {
|
|
114
|
+
return this.datasets.find((dataset) => dataset.id === id);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Adds a parameter to the X-API root.
|
|
118
|
+
* @param parameter - The parameter to add.
|
|
119
|
+
*/
|
|
120
|
+
addParameter(parameter) {
|
|
121
|
+
this.parameters.params.push(parameter);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Retrieves a parameter by its ID.
|
|
125
|
+
* @param id - The ID of the parameter to retrieve.
|
|
126
|
+
* @returns The Parameter object, or undefined if not found.
|
|
127
|
+
*/
|
|
128
|
+
getParameter(id) {
|
|
129
|
+
return this.parameters.params.find((param) => param.id === id);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Sets all parameters for the X-API root.
|
|
133
|
+
* @param parameters - The XapiParameters object to set.
|
|
134
|
+
*/
|
|
135
|
+
setParameters(parameters) {
|
|
136
|
+
this.parameters = parameters;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Sets the value of a specific parameter, or adds it if it doesn't exist.
|
|
140
|
+
* @param id - The ID of the parameter.
|
|
141
|
+
* @param value - The value to set for the parameter.
|
|
142
|
+
*/
|
|
143
|
+
setParameter(id, value) {
|
|
144
|
+
const param = this.parameters.params.find((p) => p.id === id);
|
|
145
|
+
if (param) param.value = value;
|
|
146
|
+
else this.addParameter({
|
|
147
|
+
id,
|
|
148
|
+
value
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Returns the number of parameters.
|
|
153
|
+
* @returns The count of parameters.
|
|
154
|
+
*/
|
|
155
|
+
parameterSize() {
|
|
156
|
+
return this.parameters.params.length;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Returns the number of datasets.
|
|
160
|
+
* @returns The count of datasets.
|
|
161
|
+
*/
|
|
162
|
+
datasetSize() {
|
|
163
|
+
return this.datasets.length;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Iterates over the parameters.
|
|
167
|
+
* @returns An IterableIterator for parameters.
|
|
168
|
+
*/
|
|
169
|
+
*iterParameters() {
|
|
170
|
+
for (const param of this.parameters.params) yield param;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Iterates over the datasets.
|
|
174
|
+
* @returns An IterableIterator for datasets.
|
|
175
|
+
*/
|
|
176
|
+
*iterDatasets() {
|
|
177
|
+
for (const dataset of this.datasets) yield dataset;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Represents a dataset within an X-API XML structure.
|
|
182
|
+
*/
|
|
183
|
+
var Dataset = class {
|
|
184
|
+
/** The ID of the dataset. */
|
|
185
|
+
id;
|
|
186
|
+
constColumns = [];
|
|
187
|
+
columns = [];
|
|
188
|
+
/** An array of rows in the dataset. */
|
|
189
|
+
rows = [];
|
|
190
|
+
_columnIndexMap = /* @__PURE__ */ new Map();
|
|
191
|
+
/**
|
|
192
|
+
* Creates an instance of Dataset.
|
|
193
|
+
* @param id - The ID of the dataset.
|
|
194
|
+
* @param constColumns - Initial array of constant columns.
|
|
195
|
+
* @param columns - Initial array of columns.
|
|
196
|
+
* @param rows - Initial array of rows.
|
|
197
|
+
*/
|
|
198
|
+
constructor(id, constColumns = [], columns = [], rows = []) {
|
|
199
|
+
this.id = id;
|
|
200
|
+
this.constColumns = constColumns;
|
|
201
|
+
this.columns = columns;
|
|
202
|
+
this.rows = rows;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Adds a column definition to the dataset.
|
|
206
|
+
* @param column - The column definition to add.
|
|
207
|
+
*/
|
|
208
|
+
addColumn(column) {
|
|
209
|
+
this.columns.push(column);
|
|
210
|
+
this._columnIndexMap.set(column.id, this.columns.length - 1);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Adds a constant column definition to the dataset.
|
|
214
|
+
* @param column - The constant column definition to add.
|
|
215
|
+
*/
|
|
216
|
+
addConstColumn(column) {
|
|
217
|
+
this.constColumns.push(column);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Creates a new empty row and adds it to the dataset.
|
|
221
|
+
* @returns The index of the newly created row.
|
|
222
|
+
*/
|
|
223
|
+
newRow() {
|
|
224
|
+
this.rows.push({ cols: [] });
|
|
225
|
+
return this.rows.length - 1;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Adds an existing row to the dataset.
|
|
229
|
+
* @param row - The row to add.
|
|
230
|
+
*/
|
|
231
|
+
addRow(row) {
|
|
232
|
+
this.rows.push(row);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Retrieves the index of a column by its ID.
|
|
236
|
+
* @param columnId - The ID of the column.
|
|
237
|
+
* @returns The index of the column, or undefined if not found.
|
|
238
|
+
*/
|
|
239
|
+
getColumnIndex(columnId) {
|
|
240
|
+
return this._columnIndexMap.get(columnId);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Retrieves the column definition by its ID.
|
|
244
|
+
* @param columnId - The ID of the column.
|
|
245
|
+
* @returns The Column object, or undefined if not found.
|
|
246
|
+
*/
|
|
247
|
+
getColumnInfo(columnId) {
|
|
248
|
+
const colIndex = this.getColumnIndex(columnId);
|
|
249
|
+
if (colIndex !== void 0) return this.columns[colIndex];
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Retrieves the constant column definition by its ID.
|
|
253
|
+
* @param columnId - The ID of the constant column.
|
|
254
|
+
* @returns The ConstColumn object, or undefined if not found.
|
|
255
|
+
*/
|
|
256
|
+
getConstColumnInfo(columnId) {
|
|
257
|
+
return this.constColumns.find((col) => col.id === columnId);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Retrieves the value of a column in a specific row.
|
|
261
|
+
* @param rowIdx - The index of the row.
|
|
262
|
+
* @param columnId - The ID of the column.
|
|
263
|
+
* @returns The value of the column, or undefined if the row or column is not found.
|
|
264
|
+
* @throws {Error} if the column ID is not found in the dataset.
|
|
265
|
+
*/
|
|
266
|
+
getColumn(rowIdx, columnId) {
|
|
267
|
+
if (rowIdx < this.rows.length) {
|
|
268
|
+
const colIndex = this.getColumnIndex(columnId);
|
|
269
|
+
if (colIndex === void 0) throw new Error(`Column with id ${columnId} not found in dataset ${this.id}`);
|
|
270
|
+
return this.rows[rowIdx].cols[colIndex]?.value;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Retrieves the original value of a column in a specific row (for OrgRow).
|
|
275
|
+
* @param rowIdx - The index of the row.
|
|
276
|
+
* @param columnId - The ID of the column.
|
|
277
|
+
* @returns The original value of the column, or undefined if the row or column is not found.
|
|
278
|
+
* @throws {Error} if the column ID is not found in the dataset.
|
|
279
|
+
*/
|
|
280
|
+
getOrgColumn(rowIdx, columnId) {
|
|
281
|
+
if (rowIdx < this.rows.length) {
|
|
282
|
+
const colIndex = this.getColumnIndex(columnId);
|
|
283
|
+
if (colIndex === void 0) throw new Error(`Column with id ${columnId} not found in dataset ${this.id}`);
|
|
284
|
+
return (this.rows[rowIdx].orgRow?.[colIndex])?.value;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Sets the value of a column in a specific row.
|
|
289
|
+
* @param rowIdx - The index of the row.
|
|
290
|
+
* @param columnId - The ID of the column.
|
|
291
|
+
* @param value - The value to set.
|
|
292
|
+
* @throws {Error} if the row index is out of bounds or the column ID is not found.
|
|
293
|
+
*/
|
|
294
|
+
setColumn(rowIdx, columnId, value) {
|
|
295
|
+
if (rowIdx < this.rows.length) {
|
|
296
|
+
const colIndex = this.getColumnIndex(columnId);
|
|
297
|
+
if (colIndex === void 0) throw new Error(`Column with id ${columnId} not found in dataset ${this.id}`);
|
|
298
|
+
this.rows[rowIdx].cols[colIndex] = {
|
|
299
|
+
id: columnId,
|
|
300
|
+
value
|
|
301
|
+
};
|
|
302
|
+
} else throw new Error(`Row index ${rowIdx} out of bounds in dataset ${this.id}`);
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Iterates over the constant column definitions.
|
|
306
|
+
* @returns An IterableIterator for constant columns.
|
|
307
|
+
*/
|
|
308
|
+
*iterConstColumns() {
|
|
309
|
+
for (const column of this.constColumns) yield column;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Iterates over the column definitions.
|
|
313
|
+
* @returns An IterableIterator for columns.
|
|
314
|
+
*/
|
|
315
|
+
*iterColumns() {
|
|
316
|
+
for (const column of this.columns) yield column;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Iterates over the rows in the dataset.
|
|
320
|
+
* @returns An IterableIterator for rows.
|
|
321
|
+
*/
|
|
322
|
+
*iterRows() {
|
|
323
|
+
for (const row of this.rows) yield row;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Returns the number of column definitions.
|
|
327
|
+
* @returns The count of columns.
|
|
328
|
+
*/
|
|
329
|
+
columnSize() {
|
|
330
|
+
return this.columns.length;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Returns the number of constant column definitions.
|
|
334
|
+
* @returns The count of constant columns.
|
|
335
|
+
*/
|
|
336
|
+
constColumnSize() {
|
|
337
|
+
return this.constColumns.length;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Returns the number of rows in the dataset.
|
|
341
|
+
* @returns The count of rows.
|
|
342
|
+
*/
|
|
343
|
+
rowSize() {
|
|
344
|
+
return this.rows.length;
|
|
345
|
+
}
|
|
86
346
|
};
|
|
87
347
|
|
|
88
|
-
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region src/utils.ts
|
|
89
350
|
function arrayBufferToString(buffer) {
|
|
90
|
-
|
|
91
|
-
return decoder.decode(buffer);
|
|
351
|
+
return new TextDecoder().decode(buffer);
|
|
92
352
|
}
|
|
353
|
+
/**
|
|
354
|
+
* Creates an array of entities for parsing XML, including control characters.
|
|
355
|
+
* @returns An array of objects, each with an `entity` (e.g., "") and its `value` (e.g., "\x01").
|
|
356
|
+
*/
|
|
93
357
|
function makeParseEntities() {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
358
|
+
const entities$1 = [];
|
|
359
|
+
for (let i = 1; i <= 32; i++) entities$1.push({
|
|
360
|
+
entity: `&#${i};`,
|
|
361
|
+
value: String.fromCharCode(i)
|
|
362
|
+
});
|
|
363
|
+
return entities$1;
|
|
99
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
* Creates an array of entities for writing XML, including control characters.
|
|
367
|
+
* @returns An array of objects, each with an `entity` (e.g., "") and its `value` (e.g., "\x01").
|
|
368
|
+
*/
|
|
100
369
|
function makeWriterEntities() {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
370
|
+
const entities$1 = [];
|
|
371
|
+
for (let i = 1; i <= 32; i++) entities$1.push({
|
|
372
|
+
entity: `&#${i};`,
|
|
373
|
+
value: String.fromCharCode(i)
|
|
374
|
+
});
|
|
375
|
+
return entities$1;
|
|
106
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* Converts a Base64 string to a Uint8Array.
|
|
379
|
+
* @param base64String - The Base64 string to convert.
|
|
380
|
+
* @returns A Uint8Array.
|
|
381
|
+
*/
|
|
107
382
|
function base64ToUint8Array(base64String) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
return bytes;
|
|
383
|
+
const binaryString = atob(base64String);
|
|
384
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
385
|
+
for (let i = 0; i < binaryString.length; i++) bytes[i] = binaryString.charCodeAt(i);
|
|
386
|
+
return bytes;
|
|
114
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* Converts a Uint8Array to a Base64 string.
|
|
390
|
+
* @param uint8Array - The Uint8Array to convert.
|
|
391
|
+
* @returns A Base64 string.
|
|
392
|
+
*/
|
|
115
393
|
function uint8ArrayToBase64(uint8Array) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
return btoa(binaryString);
|
|
394
|
+
let binaryString = "";
|
|
395
|
+
for (let i = 0; i < uint8Array.length; i++) binaryString += String.fromCharCode(uint8Array[i]);
|
|
396
|
+
return btoa(binaryString);
|
|
121
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* Converts a string representation of a date/time to a Date object.
|
|
400
|
+
* Supports "yyyyMMdd", "yyyyMMddHHmmss", "yyyyMMddHHmmssSSS", and "HHmmss" formats.
|
|
401
|
+
* @param value - The string to convert.
|
|
402
|
+
* @returns A Date object if the string is a valid date/time, otherwise undefined.
|
|
403
|
+
*/
|
|
122
404
|
function stringToDate(value) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
if (year < 1970 || year > 9999 || month < 0 || month > 11 || day < 1 || day > 31 || hours < 0 || hours > 23 || minutes < 0 || minutes > 59 || seconds < 0 || seconds > 59 || milliseconds < 0 || milliseconds > 999) {
|
|
156
|
-
return void 0;
|
|
157
|
-
}
|
|
158
|
-
const date = new Date(year, month, day, hours, minutes, seconds, milliseconds);
|
|
159
|
-
if (isNaN(date.getTime())) {
|
|
160
|
-
return void 0;
|
|
161
|
-
}
|
|
162
|
-
return date;
|
|
405
|
+
if (!value) return void 0;
|
|
406
|
+
let year;
|
|
407
|
+
let month;
|
|
408
|
+
let day;
|
|
409
|
+
let hours = 0;
|
|
410
|
+
let minutes = 0;
|
|
411
|
+
let seconds = 0;
|
|
412
|
+
let milliseconds = 0;
|
|
413
|
+
if (value.length < 6 || value.length > 16) return;
|
|
414
|
+
if (value.length >= 8) {
|
|
415
|
+
year = parseInt(value.substring(0, 4), 10);
|
|
416
|
+
month = parseInt(value.substring(4, 6), 10) - 1;
|
|
417
|
+
day = parseInt(value.substring(6, 8), 10);
|
|
418
|
+
} else {
|
|
419
|
+
year = 1970;
|
|
420
|
+
month = 0;
|
|
421
|
+
day = 1;
|
|
422
|
+
}
|
|
423
|
+
if (value.length === 6) {
|
|
424
|
+
hours = parseInt(value.substring(0, 2), 10);
|
|
425
|
+
minutes = parseInt(value.substring(2, 4), 10);
|
|
426
|
+
seconds = parseInt(value.substring(4, 6), 10);
|
|
427
|
+
} else if (value.length >= 10) {
|
|
428
|
+
hours = parseInt(value.substring(8, 10), 10);
|
|
429
|
+
minutes = parseInt(value.substring(10, 12), 10);
|
|
430
|
+
seconds = parseInt(value.substring(12, 14), 10);
|
|
431
|
+
}
|
|
432
|
+
if (value.length === 16) milliseconds = parseInt(value.substring(14, 16), 10);
|
|
433
|
+
if (year < 1970 || year > 9999 || month < 0 || month > 11 || day < 1 || day > 31 || hours < 0 || hours > 23 || minutes < 0 || minutes > 59 || seconds < 0 || seconds > 59 || milliseconds < 0 || milliseconds > 999) return;
|
|
434
|
+
const date = new Date(year, month, day, hours, minutes, seconds, milliseconds);
|
|
435
|
+
if (isNaN(date.getTime())) return;
|
|
436
|
+
return date;
|
|
163
437
|
}
|
|
438
|
+
/**
|
|
439
|
+
* Converts a Date object to a string representation based on the specified column type.
|
|
440
|
+
* @param date - The Date object to convert.
|
|
441
|
+
* @param type - The column type ("DATE", "DATETIME", or "TIME").
|
|
442
|
+
* @returns A string representation of the date/time.
|
|
443
|
+
*/
|
|
164
444
|
function dateToString(date, type) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return `${hours}${minutes}${seconds}`;
|
|
178
|
-
default:
|
|
179
|
-
return "";
|
|
180
|
-
}
|
|
445
|
+
const year = date.getFullYear().toString().padStart(4, "0");
|
|
446
|
+
const month = (date.getMonth() + 1).toString().padStart(2, "0");
|
|
447
|
+
const day = date.getDate().toString().padStart(2, "0");
|
|
448
|
+
const hours = date.getHours().toString().padStart(2, "0");
|
|
449
|
+
const minutes = date.getMinutes().toString().padStart(2, "0");
|
|
450
|
+
const seconds = date.getSeconds().toString().padStart(2, "0");
|
|
451
|
+
switch (type) {
|
|
452
|
+
case "DATE": return `${year}${month}${day}`;
|
|
453
|
+
case "DATETIME": return `${year}${month}${day}${hours}${minutes}${seconds}`;
|
|
454
|
+
case "TIME": return `${hours}${minutes}${seconds}`;
|
|
455
|
+
default: return "";
|
|
456
|
+
}
|
|
181
457
|
}
|
|
458
|
+
/**
|
|
459
|
+
* A WritableStream that collects all written Uint8Array chunks and provides them as a single string.
|
|
460
|
+
*/
|
|
182
461
|
var StringWritableStream = class extends WritableStream {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
462
|
+
result = "";
|
|
463
|
+
constructor() {
|
|
464
|
+
const decoder = new TextDecoder();
|
|
465
|
+
super({
|
|
466
|
+
write: (chunk) => {
|
|
467
|
+
this.result += decoder.decode(chunk, { stream: true });
|
|
468
|
+
},
|
|
469
|
+
close: () => {
|
|
470
|
+
this.result += decoder.decode();
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Returns the collected string result.
|
|
476
|
+
* @returns The concatenated string from all written chunks.
|
|
477
|
+
*/
|
|
478
|
+
getResult() {
|
|
479
|
+
return this.result;
|
|
480
|
+
}
|
|
202
481
|
};
|
|
482
|
+
/**
|
|
483
|
+
* Converts a string to a ReadableStream of Uint8Array.
|
|
484
|
+
* @param str - The string to convert.
|
|
485
|
+
* @returns A ReadableStream containing the string as Uint8Array.
|
|
486
|
+
*/
|
|
203
487
|
function stringToReadableStream(str) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
controller.close();
|
|
210
|
-
}
|
|
211
|
-
});
|
|
488
|
+
const bytes = new TextEncoder().encode(str);
|
|
489
|
+
return new ReadableStream({ start(controller) {
|
|
490
|
+
controller.enqueue(bytes);
|
|
491
|
+
controller.close();
|
|
492
|
+
} });
|
|
212
493
|
}
|
|
494
|
+
/**
|
|
495
|
+
* Converts a value to the specified ColumnType.
|
|
496
|
+
* @param value - The value to convert.
|
|
497
|
+
* @param type - The target ColumnType.
|
|
498
|
+
* @returns The converted value, or the original value if conversion fails or is not applicable.
|
|
499
|
+
* @throws {ColumnTypeError} if the column type is unsupported.
|
|
500
|
+
*/
|
|
213
501
|
function convertToColumnType(value, type) {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
return value;
|
|
237
|
-
default:
|
|
238
|
-
throw new ColumnTypeError(`Unsupported column type: ${type}`);
|
|
239
|
-
}
|
|
502
|
+
switch (type) {
|
|
503
|
+
case "INT":
|
|
504
|
+
case "BIGDECIMAL":
|
|
505
|
+
const intValue = parseInt(value, 10);
|
|
506
|
+
return isNaN(intValue) ? value : intValue;
|
|
507
|
+
case "FLOAT":
|
|
508
|
+
const floatValue = parseFloat(value);
|
|
509
|
+
return isNaN(floatValue) ? value : floatValue;
|
|
510
|
+
case "DECIMAL":
|
|
511
|
+
const decimalValue = parseFloat(value);
|
|
512
|
+
return isNaN(decimalValue) ? value : decimalValue;
|
|
513
|
+
case "DATE":
|
|
514
|
+
case "DATETIME":
|
|
515
|
+
case "TIME": return stringToDate(value) || value;
|
|
516
|
+
case "BLOB": try {
|
|
517
|
+
return base64ToUint8Array(value);
|
|
518
|
+
} catch {
|
|
519
|
+
return value;
|
|
520
|
+
}
|
|
521
|
+
case "STRING": return value;
|
|
522
|
+
default: throw new ColumnTypeError(`Unsupported column type: ${type}`);
|
|
523
|
+
}
|
|
240
524
|
}
|
|
525
|
+
/**
|
|
526
|
+
* Converts an XapiValueType to its string representation based on the specified ColumnType.
|
|
527
|
+
* @param value - The value to convert.
|
|
528
|
+
* @param type - The ColumnType to guide the conversion.
|
|
529
|
+
* @returns The string representation of the value.
|
|
530
|
+
*/
|
|
241
531
|
function convertToString(value, type) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
case "STRING":
|
|
255
|
-
return String(value);
|
|
256
|
-
default:
|
|
257
|
-
return String(value);
|
|
258
|
-
}
|
|
532
|
+
switch (type) {
|
|
533
|
+
case "INT":
|
|
534
|
+
case "BIGDECIMAL":
|
|
535
|
+
case "FLOAT":
|
|
536
|
+
case "DECIMAL": return String(value);
|
|
537
|
+
case "DATE":
|
|
538
|
+
case "DATETIME":
|
|
539
|
+
case "TIME": return dateToString(value, type);
|
|
540
|
+
case "BLOB": return uint8ArrayToBase64(value);
|
|
541
|
+
case "STRING": return String(value);
|
|
542
|
+
default: return String(value);
|
|
543
|
+
}
|
|
259
544
|
}
|
|
260
|
-
|
|
545
|
+
const entities = makeParseEntities();
|
|
261
546
|
function _unescapeXml(str) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
547
|
+
if (!str) return str;
|
|
548
|
+
const regex = new RegExp(entities.map((e) => e.entity).join("|"), "g");
|
|
549
|
+
return str.replace(regex, (match) => {
|
|
550
|
+
const entity = entities.find((e) => e.entity === match);
|
|
551
|
+
return entity ? entity.value : match;
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
function isXapiRoot(value) {
|
|
555
|
+
return value instanceof XapiRoot;
|
|
268
556
|
}
|
|
269
557
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
parameters = { params: [] };
|
|
276
|
-
/**
|
|
277
|
-
* Creates an instance of XapiRoot.
|
|
278
|
-
* @param datasets - Initial array of datasets.
|
|
279
|
-
* @param parameters - Initial parameters.
|
|
280
|
-
*/
|
|
281
|
-
constructor(datasets = [], parameters = { params: [] }) {
|
|
282
|
-
this.datasets = datasets;
|
|
283
|
-
this.parameters = parameters;
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Adds a dataset to the X-API root.
|
|
287
|
-
* @param dataset - The dataset to add.
|
|
288
|
-
*/
|
|
289
|
-
addDataset(dataset) {
|
|
290
|
-
this.datasets.push(dataset);
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Retrieves a dataset by its ID.
|
|
294
|
-
* @param id - The ID of the dataset to retrieve.
|
|
295
|
-
* @returns The Dataset object, or undefined if not found.
|
|
296
|
-
*/
|
|
297
|
-
getDataset(id) {
|
|
298
|
-
return this.datasets.find((dataset) => dataset.id === id);
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* Adds a parameter to the X-API root.
|
|
302
|
-
* @param parameter - The parameter to add.
|
|
303
|
-
*/
|
|
304
|
-
addParameter(parameter) {
|
|
305
|
-
this.parameters.params.push(parameter);
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* Retrieves a parameter by its ID.
|
|
309
|
-
* @param id - The ID of the parameter to retrieve.
|
|
310
|
-
* @returns The Parameter object, or undefined if not found.
|
|
311
|
-
*/
|
|
312
|
-
getParameter(id) {
|
|
313
|
-
return this.parameters.params.find((param) => param.id === id);
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Sets all parameters for the X-API root.
|
|
317
|
-
* @param parameters - The XapiParameters object to set.
|
|
318
|
-
*/
|
|
319
|
-
setParameters(parameters) {
|
|
320
|
-
this.parameters = parameters;
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Sets the value of a specific parameter, or adds it if it doesn't exist.
|
|
324
|
-
* @param id - The ID of the parameter.
|
|
325
|
-
* @param value - The value to set for the parameter.
|
|
326
|
-
*/
|
|
327
|
-
setParameter(id, value) {
|
|
328
|
-
const param = this.parameters.params.find((p) => p.id === id);
|
|
329
|
-
if (param) {
|
|
330
|
-
param.value = value;
|
|
331
|
-
} else {
|
|
332
|
-
this.addParameter({ id, value });
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* Returns the number of parameters.
|
|
337
|
-
* @returns The count of parameters.
|
|
338
|
-
*/
|
|
339
|
-
parameterSize() {
|
|
340
|
-
return this.parameters.params.length;
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* Returns the number of datasets.
|
|
344
|
-
* @returns The count of datasets.
|
|
345
|
-
*/
|
|
346
|
-
datasetSize() {
|
|
347
|
-
return this.datasets.length;
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Iterates over the parameters.
|
|
351
|
-
* @returns An IterableIterator for parameters.
|
|
352
|
-
*/
|
|
353
|
-
*iterParameters() {
|
|
354
|
-
for (const param of this.parameters.params) {
|
|
355
|
-
yield param;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Iterates over the datasets.
|
|
360
|
-
* @returns An IterableIterator for datasets.
|
|
361
|
-
*/
|
|
362
|
-
*iterDatasets() {
|
|
363
|
-
for (const dataset of this.datasets) {
|
|
364
|
-
yield dataset;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
var Dataset = class {
|
|
369
|
-
/** The ID of the dataset. */
|
|
370
|
-
id;
|
|
371
|
-
constColumns = [];
|
|
372
|
-
columns = [];
|
|
373
|
-
/** An array of rows in the dataset. */
|
|
374
|
-
rows = [];
|
|
375
|
-
_columnIndexMap = /* @__PURE__ */ new Map();
|
|
376
|
-
/**
|
|
377
|
-
* Creates an instance of Dataset.
|
|
378
|
-
* @param id - The ID of the dataset.
|
|
379
|
-
* @param constColumns - Initial array of constant columns.
|
|
380
|
-
* @param columns - Initial array of columns.
|
|
381
|
-
* @param rows - Initial array of rows.
|
|
382
|
-
*/
|
|
383
|
-
constructor(id, constColumns = [], columns = [], rows = []) {
|
|
384
|
-
this.id = id;
|
|
385
|
-
this.constColumns = constColumns;
|
|
386
|
-
this.columns = columns;
|
|
387
|
-
this.rows = rows;
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Adds a column definition to the dataset.
|
|
391
|
-
* @param column - The column definition to add.
|
|
392
|
-
*/
|
|
393
|
-
addColumn(column) {
|
|
394
|
-
this.columns.push(column);
|
|
395
|
-
this._columnIndexMap.set(column.id, this.columns.length - 1);
|
|
396
|
-
}
|
|
397
|
-
/**
|
|
398
|
-
* Adds a constant column definition to the dataset.
|
|
399
|
-
* @param column - The constant column definition to add.
|
|
400
|
-
*/
|
|
401
|
-
addConstColumn(column) {
|
|
402
|
-
this.constColumns.push(column);
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* Creates a new empty row and adds it to the dataset.
|
|
406
|
-
* @returns The index of the newly created row.
|
|
407
|
-
*/
|
|
408
|
-
newRow() {
|
|
409
|
-
this.rows.push({ cols: [] });
|
|
410
|
-
return this.rows.length - 1;
|
|
411
|
-
}
|
|
412
|
-
/**
|
|
413
|
-
* Adds an existing row to the dataset.
|
|
414
|
-
* @param row - The row to add.
|
|
415
|
-
*/
|
|
416
|
-
addRow(row) {
|
|
417
|
-
this.rows.push(row);
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Retrieves the index of a column by its ID.
|
|
421
|
-
* @param columnId - The ID of the column.
|
|
422
|
-
* @returns The index of the column, or undefined if not found.
|
|
423
|
-
*/
|
|
424
|
-
getColumnIndex(columnId) {
|
|
425
|
-
return this._columnIndexMap.get(columnId);
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Retrieves the column definition by its ID.
|
|
429
|
-
* @param columnId - The ID of the column.
|
|
430
|
-
* @returns The Column object, or undefined if not found.
|
|
431
|
-
*/
|
|
432
|
-
getColumnInfo(columnId) {
|
|
433
|
-
const colIndex = this.getColumnIndex(columnId);
|
|
434
|
-
if (colIndex !== void 0) {
|
|
435
|
-
return this.columns[colIndex];
|
|
436
|
-
}
|
|
437
|
-
return void 0;
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* Retrieves the constant column definition by its ID.
|
|
441
|
-
* @param columnId - The ID of the constant column.
|
|
442
|
-
* @returns The ConstColumn object, or undefined if not found.
|
|
443
|
-
*/
|
|
444
|
-
getConstColumnInfo(columnId) {
|
|
445
|
-
return this.constColumns.find((col) => col.id === columnId);
|
|
446
|
-
}
|
|
447
|
-
/**
|
|
448
|
-
* Retrieves the value of a column in a specific row.
|
|
449
|
-
* @param rowIdx - The index of the row.
|
|
450
|
-
* @param columnId - The ID of the column.
|
|
451
|
-
* @returns The value of the column, or undefined if the row or column is not found.
|
|
452
|
-
* @throws {Error} if the column ID is not found in the dataset.
|
|
453
|
-
*/
|
|
454
|
-
getColumn(rowIdx, columnId) {
|
|
455
|
-
if (rowIdx < this.rows.length) {
|
|
456
|
-
const colIndex = this.getColumnIndex(columnId);
|
|
457
|
-
if (colIndex === void 0) {
|
|
458
|
-
throw new Error(`Column with id ${columnId} not found in dataset ${this.id}`);
|
|
459
|
-
}
|
|
460
|
-
const col = this.rows[rowIdx].cols[colIndex];
|
|
461
|
-
return col?.value;
|
|
462
|
-
}
|
|
463
|
-
return void 0;
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* Retrieves the original value of a column in a specific row (for OrgRow).
|
|
467
|
-
* @param rowIdx - The index of the row.
|
|
468
|
-
* @param columnId - The ID of the column.
|
|
469
|
-
* @returns The original value of the column, or undefined if the row or column is not found.
|
|
470
|
-
* @throws {Error} if the column ID is not found in the dataset.
|
|
471
|
-
*/
|
|
472
|
-
getOrgColumn(rowIdx, columnId) {
|
|
473
|
-
if (rowIdx < this.rows.length) {
|
|
474
|
-
const colIndex = this.getColumnIndex(columnId);
|
|
475
|
-
if (colIndex === void 0) {
|
|
476
|
-
throw new Error(`Column with id ${columnId} not found in dataset ${this.id}`);
|
|
477
|
-
}
|
|
478
|
-
const col = this.rows[rowIdx].orgRow?.[colIndex];
|
|
479
|
-
return col?.value;
|
|
480
|
-
}
|
|
481
|
-
return void 0;
|
|
482
|
-
}
|
|
483
|
-
/**
|
|
484
|
-
* Sets the value of a column in a specific row.
|
|
485
|
-
* @param rowIdx - The index of the row.
|
|
486
|
-
* @param columnId - The ID of the column.
|
|
487
|
-
* @param value - The value to set.
|
|
488
|
-
* @throws {Error} if the row index is out of bounds or the column ID is not found.
|
|
489
|
-
*/
|
|
490
|
-
setColumn(rowIdx, columnId, value) {
|
|
491
|
-
if (rowIdx < this.rows.length) {
|
|
492
|
-
const colIndex = this.getColumnIndex(columnId);
|
|
493
|
-
if (colIndex === void 0) {
|
|
494
|
-
throw new Error(`Column with id ${columnId} not found in dataset ${this.id}`);
|
|
495
|
-
}
|
|
496
|
-
this.rows[rowIdx].cols[colIndex] = { id: columnId, value };
|
|
497
|
-
} else {
|
|
498
|
-
throw new Error(`Row index ${rowIdx} out of bounds in dataset ${this.id}`);
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
/**
|
|
502
|
-
* Iterates over the constant column definitions.
|
|
503
|
-
* @returns An IterableIterator for constant columns.
|
|
504
|
-
*/
|
|
505
|
-
*iterConstColumns() {
|
|
506
|
-
for (const column of this.constColumns) {
|
|
507
|
-
yield column;
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
/**
|
|
511
|
-
* Iterates over the column definitions.
|
|
512
|
-
* @returns An IterableIterator for columns.
|
|
513
|
-
*/
|
|
514
|
-
*iterColumns() {
|
|
515
|
-
for (const column of this.columns) {
|
|
516
|
-
yield column;
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
/**
|
|
520
|
-
* Iterates over the rows in the dataset.
|
|
521
|
-
* @returns An IterableIterator for rows.
|
|
522
|
-
*/
|
|
523
|
-
*iterRows() {
|
|
524
|
-
for (const row of this.rows) {
|
|
525
|
-
yield row;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
/**
|
|
529
|
-
* Returns the number of column definitions.
|
|
530
|
-
* @returns The count of columns.
|
|
531
|
-
*/
|
|
532
|
-
columnSize() {
|
|
533
|
-
return this.columns.length;
|
|
534
|
-
}
|
|
535
|
-
/**
|
|
536
|
-
* Returns the number of constant column definitions.
|
|
537
|
-
* @returns The count of constant columns.
|
|
538
|
-
*/
|
|
539
|
-
constColumnSize() {
|
|
540
|
-
return this.constColumns.length;
|
|
541
|
-
}
|
|
542
|
-
/**
|
|
543
|
-
* Returns the number of rows in the dataset.
|
|
544
|
-
* @returns The count of rows.
|
|
545
|
-
*/
|
|
546
|
-
rowSize() {
|
|
547
|
-
return this.rows.length;
|
|
548
|
-
}
|
|
549
|
-
};
|
|
550
|
-
|
|
551
|
-
// src/handler.ts
|
|
552
|
-
var defaultOptions = {
|
|
553
|
-
xapiVersion: NexaVersion,
|
|
554
|
-
parseToTypes: true
|
|
555
|
-
};
|
|
556
|
-
var _options = {
|
|
557
|
-
...defaultOptions
|
|
558
|
+
//#endregion
|
|
559
|
+
//#region src/handler.ts
|
|
560
|
+
let _options = {
|
|
561
|
+
xapiVersion: NexaVersion,
|
|
562
|
+
parseToTypes: true
|
|
558
563
|
};
|
|
564
|
+
/**
|
|
565
|
+
* Initializes the X-API handler with the provided options.
|
|
566
|
+
* @param options - The options to initialize the X-API handler.
|
|
567
|
+
* @returns void
|
|
568
|
+
*/
|
|
559
569
|
function initXapi(options) {
|
|
560
|
-
|
|
561
|
-
...options
|
|
562
|
-
};
|
|
570
|
+
_options = { ...options };
|
|
563
571
|
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
572
|
+
/**
|
|
573
|
+
* Parses an XML string into an XapiRoot object using txml.
|
|
574
|
+
* @param xml - The string containing the XML data.
|
|
575
|
+
* @returns A Promise that resolves to an XapiRoot object.
|
|
576
|
+
*/
|
|
577
|
+
function parse(xml) {
|
|
578
|
+
const parsedXml = txml.parse(xml);
|
|
579
|
+
const xapiRoot = new XapiRoot();
|
|
580
|
+
let rootElement;
|
|
581
|
+
for (let i = 0; i < parsedXml.length; i++) if (parsedXml[i].tagName === "Root") {
|
|
582
|
+
rootElement = parsedXml[i];
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
if (rootElement === void 0) return xapiRoot;
|
|
586
|
+
const rootChildren = rootElement.children;
|
|
587
|
+
if (rootChildren && rootChildren.length > 0) for (let i = 0; i < rootChildren.length; i++) {
|
|
588
|
+
const child = rootChildren[i];
|
|
589
|
+
const tagName = child.tagName;
|
|
590
|
+
if (tagName === "Parameters") parseParameters(child, xapiRoot);
|
|
591
|
+
else if (tagName === "Dataset") {
|
|
592
|
+
if (!child.attributes || !child.attributes.id) throw new InvalidXmlError("Dataset element must have an 'id' attribute");
|
|
593
|
+
const datasetId = child.attributes.id;
|
|
594
|
+
const dataset = new Dataset(datasetId);
|
|
595
|
+
xapiRoot.addDataset(dataset);
|
|
596
|
+
const datasetChildren = child.children;
|
|
597
|
+
let columnInfoElement;
|
|
598
|
+
let rowsElement;
|
|
599
|
+
if (datasetChildren) for (let j = 0; j < datasetChildren.length; j++) {
|
|
600
|
+
const datasetChild = datasetChildren[j];
|
|
601
|
+
const childTagName = datasetChild.tagName;
|
|
602
|
+
if (childTagName === "ColumnInfo") columnInfoElement = datasetChild;
|
|
603
|
+
else if (childTagName === "Rows") rowsElement = datasetChild;
|
|
604
|
+
if (columnInfoElement && rowsElement) break;
|
|
605
|
+
}
|
|
606
|
+
parseColumnInfo(columnInfoElement, dataset);
|
|
607
|
+
parseRows(rowsElement, dataset);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
return xapiRoot;
|
|
590
611
|
}
|
|
591
612
|
function parseValue(value, type = "STRING") {
|
|
592
|
-
|
|
593
|
-
|
|
613
|
+
value = _unescapeXml(value);
|
|
614
|
+
return _options.parseToTypes ? convertToColumnType(value, type) : value;
|
|
594
615
|
}
|
|
595
616
|
function parseColumnInfo(columnInfoElement, dataset) {
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
617
|
+
if (!columnInfoElement) throw new InvalidXmlError("ColumnInfo element is missing in the dataset");
|
|
618
|
+
const children = columnInfoElement.children;
|
|
619
|
+
if (!children) return;
|
|
620
|
+
for (let i = 0; i < children.length; i++) {
|
|
621
|
+
const colInfo = children[i];
|
|
622
|
+
const tagName = colInfo.tagName;
|
|
623
|
+
if (tagName === "ConstColumn") {
|
|
624
|
+
const attrs = colInfo.attributes;
|
|
625
|
+
const sizeStr = attrs?.size;
|
|
626
|
+
dataset.addConstColumn({
|
|
627
|
+
id: attrs?.id,
|
|
628
|
+
size: sizeStr ? parseInt(sizeStr, 10) : 0,
|
|
629
|
+
type: attrs?.type || "STRING",
|
|
630
|
+
value: parseValue(attrs?.value, attrs?.type)
|
|
631
|
+
});
|
|
632
|
+
} else if (tagName === "Column") {
|
|
633
|
+
const attrs = colInfo.attributes;
|
|
634
|
+
const sizeStr = attrs?.size;
|
|
635
|
+
dataset.addColumn({
|
|
636
|
+
id: attrs?.id,
|
|
637
|
+
size: sizeStr ? parseInt(sizeStr, 10) : 0,
|
|
638
|
+
type: attrs?.type || "STRING"
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
}
|
|
613
642
|
}
|
|
614
643
|
function parseRows(rowsElement, dataset) {
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
644
|
+
const rows = rowsElement?.children;
|
|
645
|
+
if (!rows) return;
|
|
646
|
+
const datasetRows = dataset.rows;
|
|
647
|
+
for (let i = 0; i < rows.length; i++) {
|
|
648
|
+
const r = rows[i];
|
|
649
|
+
const tagName = r.tagName;
|
|
650
|
+
if (tagName === "Row") {
|
|
651
|
+
const rowIndex = dataset.newRow();
|
|
652
|
+
const currentRow = datasetRows[rowIndex];
|
|
653
|
+
currentRow.type = r.attributes?.type || void 0;
|
|
654
|
+
const cols = r.children;
|
|
655
|
+
if (!cols) continue;
|
|
656
|
+
for (let j = 0; j < cols.length; j++) {
|
|
657
|
+
const col = cols[j];
|
|
658
|
+
const colTagName = col.tagName;
|
|
659
|
+
if (colTagName === "Col") {
|
|
660
|
+
const colId = col.attributes?.id;
|
|
661
|
+
const value = col.children?.[0];
|
|
662
|
+
const columnInfo = dataset.getColumnInfo(colId);
|
|
663
|
+
if (!columnInfo) throw new InvalidXmlError(`Column with id ${colId} not found in dataset ${dataset.id}`);
|
|
664
|
+
const castedValue = parseValue(value, columnInfo.type);
|
|
665
|
+
currentRow.cols.push({
|
|
666
|
+
id: colId,
|
|
667
|
+
value: castedValue
|
|
668
|
+
});
|
|
669
|
+
} else if (colTagName === "OrgRow") {
|
|
670
|
+
const orgRow = [];
|
|
671
|
+
currentRow.orgRow = orgRow;
|
|
672
|
+
const orgCols = col.children;
|
|
673
|
+
if (!orgCols) continue;
|
|
674
|
+
for (let k = 0; k < orgCols.length; k++) {
|
|
675
|
+
const orgCol = orgCols[k];
|
|
676
|
+
if (orgCol.tagName === "Col") {
|
|
677
|
+
const colId = orgCol.attributes?.id;
|
|
678
|
+
const value = orgCol.children?.[0];
|
|
679
|
+
const columnInfo = dataset.getColumnInfo(colId);
|
|
680
|
+
const castedValue = parseValue(value, columnInfo.type);
|
|
681
|
+
orgRow.push({
|
|
682
|
+
id: colId,
|
|
683
|
+
value: castedValue
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
} else if (tagName === "Col") throw new InvalidXmlError("Row must be defined before Col");
|
|
690
|
+
else if (tagName === "OrgRow") throw new InvalidXmlError("Row must be defined before OrgRow");
|
|
691
|
+
}
|
|
648
692
|
}
|
|
649
693
|
function parseParameters(parametersElement, xapiRoot) {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
694
|
+
if (!parametersElement) return;
|
|
695
|
+
const children = parametersElement.children;
|
|
696
|
+
if (!children) return;
|
|
697
|
+
for (let i = 0; i < children.length; i++) {
|
|
698
|
+
const p = children[i];
|
|
699
|
+
if (p.tagName === "Parameter") {
|
|
700
|
+
const attrs = p.attributes;
|
|
701
|
+
const id = attrs?.id;
|
|
702
|
+
const type = attrs?.type || "STRING";
|
|
703
|
+
const value = p.children?.[0];
|
|
704
|
+
xapiRoot.addParameter({
|
|
705
|
+
id,
|
|
706
|
+
type,
|
|
707
|
+
value: parseValue(value, type)
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
}
|
|
663
711
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
712
|
+
function write(root) {
|
|
713
|
+
const writer = new stax_xml.StaxXmlWriterSync({
|
|
714
|
+
addEntities: makeWriterEntities(),
|
|
715
|
+
encoding: "UTF-8",
|
|
716
|
+
indentString: " ",
|
|
717
|
+
prettyPrint: true
|
|
718
|
+
});
|
|
719
|
+
writer.writeStartDocument("1.0", "UTF-8");
|
|
720
|
+
writer.writeStartElement("Root", { attributes: {
|
|
721
|
+
xmlns: _options.xapiVersion?.xmlns || NexaVersion.xmlns,
|
|
722
|
+
version: _options.xapiVersion?.version || NexaVersion.version
|
|
723
|
+
} });
|
|
724
|
+
if (root.parameterSize() > 0) writeParameters(writer, root.iterParameters());
|
|
725
|
+
if (root.datasetSize() > 0) {
|
|
726
|
+
writer.writeStartElement("Datasets");
|
|
727
|
+
for (const dataset of root.iterDatasets()) writeDataset(writer, dataset);
|
|
728
|
+
writer.writeEndElement();
|
|
729
|
+
}
|
|
730
|
+
writer.writeEndElement();
|
|
731
|
+
return writer.getXmlString();
|
|
668
732
|
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
});
|
|
684
|
-
if (root.parameterSize() > 0) {
|
|
685
|
-
await writeParameters(writer, root.iterParameters());
|
|
686
|
-
}
|
|
687
|
-
if (root.datasetSize() > 0) {
|
|
688
|
-
await writer.writeStartElement("Datasets");
|
|
689
|
-
for (const dataset of root.iterDatasets()) {
|
|
690
|
-
await writeDataset(writer, dataset);
|
|
691
|
-
}
|
|
692
|
-
await writer.writeEndElement();
|
|
693
|
-
}
|
|
694
|
-
await writer.writeEndElement();
|
|
733
|
+
function writeParameters(writer, iterator) {
|
|
734
|
+
if (iterator) {
|
|
735
|
+
writer.writeStartElement("Parameters");
|
|
736
|
+
for (const parameter of iterator) {
|
|
737
|
+
writer.writeStartElement("Parameter", { attributes: { id: parameter.id } });
|
|
738
|
+
if (parameter.type !== void 0) writer.writeAttribute("type", parameter.type);
|
|
739
|
+
if (parameter.value !== void 0) if (typeof parameter.value === "string") writer.writeAttribute("value", parameter.value);
|
|
740
|
+
else if (parameter.value instanceof Date) writer.writeAttribute("value", dateToString(parameter.value, parameter.type));
|
|
741
|
+
else if (parameter.value instanceof Uint8Array) writer.writeAttribute("value", uint8ArrayToBase64(parameter.value));
|
|
742
|
+
else writer.writeAttribute("value", String(parameter.value));
|
|
743
|
+
writer.writeEndElement();
|
|
744
|
+
}
|
|
745
|
+
writer.writeEndElement();
|
|
746
|
+
}
|
|
695
747
|
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
748
|
+
function writeDataset(writer, dataset) {
|
|
749
|
+
writer.writeStartElement("Dataset", { attributes: { id: dataset.id } });
|
|
750
|
+
if (dataset.constColumnSize() > 0 || dataset.columnSize() > 0) {
|
|
751
|
+
writer.writeStartElement("ColumnInfo");
|
|
752
|
+
for (const constCol of dataset.iterConstColumns()) writer.writeStartElement("ConstColumn", {
|
|
753
|
+
attributes: {
|
|
754
|
+
id: constCol.id,
|
|
755
|
+
size: String(constCol.size),
|
|
756
|
+
type: constCol.type,
|
|
757
|
+
value: constCol.value !== void 0 ? String(constCol.value) : ""
|
|
758
|
+
},
|
|
759
|
+
selfClosing: true
|
|
760
|
+
});
|
|
761
|
+
for (const col of dataset.iterColumns()) writer.writeStartElement("Column", {
|
|
762
|
+
attributes: {
|
|
763
|
+
id: col.id,
|
|
764
|
+
size: String(col.size),
|
|
765
|
+
type: col.type
|
|
766
|
+
},
|
|
767
|
+
selfClosing: true
|
|
768
|
+
});
|
|
769
|
+
writer.writeEndElement();
|
|
770
|
+
}
|
|
771
|
+
writer.writeStartElement("Rows");
|
|
772
|
+
for (const row of dataset.iterRows()) {
|
|
773
|
+
if (row.type) writer.writeStartElement("Row", { attributes: { type: row.type } });
|
|
774
|
+
else writer.writeStartElement("Row");
|
|
775
|
+
for (const col of row.cols) writeColumn(writer, dataset, col);
|
|
776
|
+
if (row.orgRow && row.orgRow.length > 0) {
|
|
777
|
+
writer.writeStartElement("OrgRow");
|
|
778
|
+
for (const orgCol of row.orgRow) writeColumn(writer, dataset, orgCol);
|
|
779
|
+
writer.writeEndElement();
|
|
780
|
+
}
|
|
781
|
+
writer.writeEndElement();
|
|
782
|
+
}
|
|
783
|
+
writer.writeEndElement();
|
|
784
|
+
writer.writeEndElement();
|
|
719
785
|
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
value: constCol.value !== void 0 ? String(constCol.value) : ""
|
|
731
|
-
},
|
|
732
|
-
selfClosing: true
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
for (const col of dataset.iterColumns()) {
|
|
736
|
-
await writer.writeStartElement("Column", {
|
|
737
|
-
attributes: {
|
|
738
|
-
id: col.id,
|
|
739
|
-
size: String(col.size),
|
|
740
|
-
type: col.type
|
|
741
|
-
},
|
|
742
|
-
selfClosing: true
|
|
743
|
-
});
|
|
744
|
-
}
|
|
745
|
-
await writer.writeEndElement();
|
|
746
|
-
}
|
|
747
|
-
await writer.writeStartElement("Rows");
|
|
748
|
-
for (const row of dataset.iterRows()) {
|
|
749
|
-
if (row.type) {
|
|
750
|
-
await writer.writeStartElement("Row", { attributes: { type: row.type } });
|
|
751
|
-
} else {
|
|
752
|
-
await writer.writeStartElement("Row");
|
|
753
|
-
}
|
|
754
|
-
for (const col of row.cols) {
|
|
755
|
-
await writeColumn(writer, dataset, col);
|
|
756
|
-
}
|
|
757
|
-
if (row.orgRow && row.orgRow.length > 0) {
|
|
758
|
-
await writer.writeStartElement("OrgRow");
|
|
759
|
-
for (const orgCol of row.orgRow) {
|
|
760
|
-
await writeColumn(writer, dataset, orgCol);
|
|
761
|
-
}
|
|
762
|
-
await writer.writeEndElement();
|
|
763
|
-
}
|
|
764
|
-
await writer.writeEndElement();
|
|
765
|
-
}
|
|
766
|
-
await writer.writeEndElement();
|
|
767
|
-
await writer.writeEndElement();
|
|
786
|
+
function writeColumn(writer, dataset, col) {
|
|
787
|
+
if (col.value !== void 0 && col.value !== null) {
|
|
788
|
+
const colInfo = dataset.getColumnInfo(col.id);
|
|
789
|
+
writer.writeStartElement("Col", { attributes: { id: col.id } });
|
|
790
|
+
writer.writeCharacters(convertToString(col.value, colInfo.type));
|
|
791
|
+
writer.writeEndElement();
|
|
792
|
+
} else writer.writeStartElement("Col", {
|
|
793
|
+
attributes: { id: col.id },
|
|
794
|
+
selfClosing: true
|
|
795
|
+
});
|
|
768
796
|
}
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
initXapi,
|
|
796
|
-
makeParseEntities,
|
|
797
|
-
makeWriterEntities,
|
|
798
|
-
parse,
|
|
799
|
-
rowType,
|
|
800
|
-
stringToDate,
|
|
801
|
-
stringToReadableStream,
|
|
802
|
-
uint8ArrayToBase64,
|
|
803
|
-
write,
|
|
804
|
-
writeString
|
|
805
|
-
});
|
|
797
|
+
|
|
798
|
+
//#endregion
|
|
799
|
+
exports.ColumnTypeError = ColumnTypeError;
|
|
800
|
+
exports.Dataset = Dataset;
|
|
801
|
+
exports.InvalidXmlError = InvalidXmlError;
|
|
802
|
+
exports.NexaVersion = NexaVersion;
|
|
803
|
+
exports.StringWritableStream = StringWritableStream;
|
|
804
|
+
exports.XapiRoot = XapiRoot;
|
|
805
|
+
exports.XplatformVersion = XplatformVersion;
|
|
806
|
+
exports._unescapeXml = _unescapeXml;
|
|
807
|
+
exports.arrayBufferToString = arrayBufferToString;
|
|
808
|
+
exports.base64ToUint8Array = base64ToUint8Array;
|
|
809
|
+
exports.columnType = columnType;
|
|
810
|
+
exports.convertToColumnType = convertToColumnType;
|
|
811
|
+
exports.convertToString = convertToString;
|
|
812
|
+
exports.dateToString = dateToString;
|
|
813
|
+
exports.initXapi = initXapi;
|
|
814
|
+
exports.isXapiRoot = isXapiRoot;
|
|
815
|
+
exports.makeParseEntities = makeParseEntities;
|
|
816
|
+
exports.makeWriterEntities = makeWriterEntities;
|
|
817
|
+
exports.parse = parse;
|
|
818
|
+
exports.rowType = rowType;
|
|
819
|
+
exports.stringToDate = stringToDate;
|
|
820
|
+
exports.stringToReadableStream = stringToReadableStream;
|
|
821
|
+
exports.uint8ArrayToBase64 = uint8ArrayToBase64;
|
|
822
|
+
exports.write = write;
|