datera 0.2.0 → 0.3.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/CHANGELOG.md +16 -0
- package/README.md +1 -0
- package/dist/api/clean.d.ts +7 -0
- package/dist/api/clean.js +16 -0
- package/dist/api/files.d.ts +10 -0
- package/dist/api/files.js +145 -0
- package/dist/api/formats.d.ts +4 -0
- package/dist/api/formats.js +5 -1
- package/dist/api/index.d.ts +8 -3
- package/dist/api/index.js +12 -1
- package/dist/api/rows.d.ts +13 -0
- package/dist/api/rows.js +82 -2
- package/dist/cli.d.ts +32 -0
- package/dist/cli.js +69 -9
- package/dist/commands.js +88 -14
- package/dist/config/ioSchema.d.ts +4 -0
- package/dist/config/ioSchema.js +6 -0
- package/dist/config/prepareSchema.d.ts +4 -0
- package/dist/config/prepareSchema.js +8 -1
- package/dist/config/schema.d.ts +8 -0
- package/dist/config/schema.js +8 -0
- package/dist/filters/align.d.ts +11 -0
- package/dist/filters/align.js +102 -0
- package/dist/io/excel/excelSource.d.ts +3 -1
- package/dist/io/excel/excelSource.js +40 -22
- package/dist/io/factory.js +4 -1
- package/dist/io/safety.js +3 -0
- package/dist/io/sheets/client.d.ts +1 -0
- package/dist/io/sheets/client.js +9 -3
- package/dist/io/sheets/sheetsSource.d.ts +4 -1
- package/dist/io/sheets/sheetsSource.js +46 -23
- package/dist/io/tabs.d.ts +11 -0
- package/dist/io/tabs.js +23 -0
- package/dist/io/types.d.ts +2 -0
- package/dist/pipeline/steps.js +8 -0
- package/package.json +2 -2
package/dist/io/tabs.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_SHEET_COLUMN = void 0;
|
|
4
|
+
exports.joinTabs = joinTabs;
|
|
5
|
+
const cells_1 = require("../cells");
|
|
6
|
+
exports.DEFAULT_SHEET_COLUMN = "aba";
|
|
7
|
+
function joinTabs(tabs, column, where) {
|
|
8
|
+
const joined = [];
|
|
9
|
+
for (const tab of tabs) {
|
|
10
|
+
for (const row of tab.rows) {
|
|
11
|
+
if ((0, cells_1.hasCell)(row, column)) {
|
|
12
|
+
throw new Error(`A aba "${tab.sheet}" de ${where} já tem uma coluna "${column}". Escolha outro nome pra coluna que guarda a aba (sheetColumn, ou --sheet-column no terminal).`);
|
|
13
|
+
}
|
|
14
|
+
const next = {};
|
|
15
|
+
(0, cells_1.setCell)(next, column, tab.sheet);
|
|
16
|
+
for (const [name, value] of Object.entries(row)) {
|
|
17
|
+
(0, cells_1.setCell)(next, name, value);
|
|
18
|
+
}
|
|
19
|
+
joined.push(next);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return joined;
|
|
23
|
+
}
|
package/dist/io/types.d.ts
CHANGED
package/dist/pipeline/steps.js
CHANGED
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildSteps = buildSteps;
|
|
4
4
|
const fillEmpty_1 = require("../filters/fillEmpty");
|
|
5
|
+
const align_1 = require("../filters/align");
|
|
5
6
|
const combine_1 = require("../filters/combine");
|
|
6
7
|
const validate_1 = require("../filters/validate");
|
|
7
8
|
const modes_1 = require("./modes");
|
|
8
9
|
function buildSteps(config, mode) {
|
|
9
10
|
const steps = [];
|
|
11
|
+
const align = (0, align_1.alignOptionsOf)(config.alignColumns);
|
|
12
|
+
if (align) {
|
|
13
|
+
steps.push({
|
|
14
|
+
name: "alignColumns",
|
|
15
|
+
run: (rows) => ({ rows: (0, align_1.alignRows)(rows, align) }),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
10
18
|
if (config.fillEmpty) {
|
|
11
19
|
const filter = new fillEmpty_1.FillEmptyFilter(config.fillEmpty);
|
|
12
20
|
steps.push({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "datera",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Limpa, unifica e organiza dados bagunçados de bancos de dados, planilhas, CSV, JSON, XML e Parquet, e grava em bancos de dados, Google Sheets, Excel, CSV, JSON, XML ou Parquet.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"commander": "^15.0.0",
|
|
86
|
-
"dotenv": "^
|
|
86
|
+
"dotenv": "^18.0.4",
|
|
87
87
|
"zod": "^4.6.5"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|