@noeva/etl-core 1.0.1 → 1.1.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 +128 -0
- package/README.md +6 -11
- package/dist/{ai-BoTwcmUg.d.ts → ai-DyDIf-hQ.d.ts} +1 -1
- package/dist/{ambiente-della-pipeline-BoymQ6uN.d.ts → ambiente-della-pipeline-BhWsyLUR.d.ts} +2 -2
- package/dist/chunk-47NVGHUY.js +2 -0
- package/dist/chunk-5OE6F2MK.js +2 -0
- package/dist/{chunk-NZR6TZ42.js → chunk-5XVANFXO.js} +1 -1
- package/dist/chunk-672L5BGQ.js +1 -0
- package/dist/{chunk-4NPSBPBY.js → chunk-6QVYBDIS.js} +1 -1
- package/dist/{chunk-PE2QKU34.js → chunk-CEAMQIRO.js} +1 -1
- package/dist/chunk-DHQ3YOPX.js +5 -0
- package/dist/chunk-FBSNZG34.js +1 -0
- package/dist/{chunk-J3PBMWSP.js → chunk-GZWYRO3V.js} +1 -1
- package/dist/chunk-IODXIHU2.js +1 -0
- package/dist/{chunk-P6B2KLNJ.js → chunk-KEFIGSRS.js} +2 -2
- package/dist/chunk-KGWA46Y6.js +2 -0
- package/dist/chunk-L25W2QNS.js +1 -0
- package/dist/{chunk-JLPK6MMQ.js → chunk-OK3XRTGA.js} +1 -1
- package/dist/chunk-UHGHK6NP.js +1 -0
- package/dist/chunk-VL7DZWWO.js +2 -0
- package/dist/chunk-VVXT66DC.js +1 -0
- package/dist/chunk-ZKDCUSM2.js +6 -0
- package/dist/cli.js +2 -2
- package/dist/{client-DYA3wIyb.d.ts → client-BC_mLuT2.d.ts} +2 -2
- package/dist/config-BSdGSRPG.d.ts +37 -0
- package/dist/{config-BSUwK4p_.d.ts → config-DMafsY4H.d.ts} +3 -3
- package/dist/connector-kit.d.ts +14 -9
- package/dist/connector-kit.js +1 -1
- package/dist/connectors/excel.d.ts +391 -0
- package/dist/connectors/excel.js +10 -0
- package/dist/connectors/file.d.ts +12 -5
- package/dist/connectors/file.js +1 -1
- package/dist/connectors/http.d.ts +7 -7
- package/dist/connectors/http.js +1 -1
- package/dist/connectors/imap.d.ts +6 -6
- package/dist/connectors/imap.js +1 -1
- package/dist/connectors/jira.d.ts +6 -6
- package/dist/connectors/jira.js +2 -2
- package/dist/connectors/mail.d.ts +7 -7
- package/dist/connectors/mail.js +1 -1
- package/dist/connectors/mysql.d.ts +238 -0
- package/dist/connectors/mysql.js +2 -0
- package/dist/connectors/noeva.d.ts +6 -6
- package/dist/connectors/noeva.js +1 -1
- package/dist/connectors/oauth.d.ts +5 -5
- package/dist/connectors/oauth.js +1 -1
- package/dist/connectors/odoo.d.ts +309 -0
- package/dist/connectors/odoo.js +3 -0
- package/dist/connectors/postgres.d.ts +7 -6
- package/dist/connectors/postgres.js +1 -1
- package/dist/connectors/process.d.ts +1 -1
- package/dist/connectors/process.js +1 -1
- package/dist/connectors/sendgrid.d.ts +7 -7
- package/dist/connectors/sendgrid.js +1 -1
- package/dist/connectors/smtp.d.ts +8 -8
- package/dist/connectors/smtp.js +1 -1
- package/dist/connectors/sqlserver.d.ts +7 -6
- package/dist/connectors/sqlserver.js +1 -1
- package/dist/connectors/zoho.d.ts +6 -6
- package/dist/connectors/zoho.js +1 -1
- package/dist/contract.d.ts +2 -2
- package/dist/{credenziali-posta-f7HB2cYW.d.ts → credenziali-posta-C0az04uV.d.ts} +2 -2
- package/dist/{errors-bgSO6lGO.d.ts → errors-CRq1uNYZ.d.ts} +8 -1
- package/dist/etl.config.js +3 -3
- package/dist/guida/404.html +2 -2
- package/dist/guida/GUIDA_SVILUPPO.html +7 -7
- package/dist/guida/TECHNICAL_OVERVIEW.html +7 -7
- package/dist/guida/assets/{GUIDA_SVILUPPO.md.CrN52ZDN.js → GUIDA_SVILUPPO.md.Bvr7RKHN.js} +2 -2
- package/dist/guida/assets/TECHNICAL_OVERVIEW.md.C6HYc5_h.js +10 -0
- package/dist/guida/assets/{app.DeVEBaIz.js → app.zL1wgTBx.js} +1 -1
- package/dist/guida/assets/chunks/@localSearchIndexroot.B5GjWddx.js +1 -0
- package/dist/guida/assets/chunks/{VPLocalSearchBox.CsTQzJUK.js → VPLocalSearchBox.BSMd0tSF.js} +1 -1
- package/dist/guida/assets/chunks/{theme.Dfy0C_Zf.js → theme.CRpFq7vp.js} +2 -2
- package/dist/guida/assets/connectors_README.md.B5QWzWUK.js +1 -0
- package/dist/guida/assets/connectors_README.md.B5QWzWUK.lean.js +1 -0
- package/dist/guida/assets/connectors_excel.md.CqGtwEB4.js +92 -0
- package/dist/guida/assets/connectors_excel.md.CqGtwEB4.lean.js +1 -0
- package/dist/guida/assets/{connectors_file.md.B1NJe0VJ.js → connectors_file.md.Dbofo9W5.js} +3 -3
- package/dist/guida/assets/{connectors_file.md.B1NJe0VJ.lean.js → connectors_file.md.Dbofo9W5.lean.js} +1 -1
- package/dist/guida/assets/connectors_mysql.md.fVCxQWUW.js +34 -0
- package/dist/guida/assets/connectors_mysql.md.fVCxQWUW.lean.js +1 -0
- package/dist/guida/assets/connectors_odoo.md.DprabV5e.js +19 -0
- package/dist/guida/assets/connectors_odoo.md.DprabV5e.lean.js +1 -0
- package/dist/guida/assets/{conventions_node-descriptor.md.MQaGlm8a.js → conventions_node-descriptor.md.C19dB-Tb.js} +4 -4
- package/dist/guida/assets/conventions_node-descriptor.md.C19dB-Tb.lean.js +1 -0
- package/dist/guida/assets/{conventions_run-report.md.D_pG07VG.js → conventions_run-report.md.iVSN9fNV.js} +1 -1
- package/dist/guida/assets/{conventions_versioni-di-pipeline.md.cy5nsizS.js → conventions_versioni-di-pipeline.md.DJPSthZ8.js} +1 -1
- package/dist/guida/assets/{conventions_versioni-di-pipeline.md.cy5nsizS.lean.js → conventions_versioni-di-pipeline.md.DJPSthZ8.lean.js} +1 -1
- package/dist/guida/assets/{nodes_README.md.CHGy_go6.js → nodes_README.md.BNAiSoJJ.js} +2 -2
- package/dist/guida/assets/{nodes_README.md.CHGy_go6.lean.js → nodes_README.md.BNAiSoJJ.lean.js} +1 -1
- package/dist/guida/assets/{nodes_lookup.md.BI8tgBIq.js → nodes_lookup.md.DrJFsfOJ.js} +1 -1
- package/dist/guida/assets/{nodes_sink.md.yAf_z4wO.js → nodes_sink.md.C1S-lAh2.js} +2 -2
- package/dist/guida/assets/{nodes_source.md.DP2i3GFv.js → nodes_source.md.BitUNtug.js} +2 -2
- package/dist/guida/assets/{nodes_task.md.Dk6VB7as.js → nodes_task.md.CejEQZcD.js} +2 -2
- package/dist/guida/assets/{nodes_task.md.Dk6VB7as.lean.js → nodes_task.md.CejEQZcD.lean.js} +1 -1
- package/dist/guida/assets/{nodes_transform.md.Bv5fg2Xx.js → nodes_transform.md.Ciycywnb.js} +1 -1
- package/dist/guida/assets/{runbooks_deployment.md.CwG77qGO.js → runbooks_deployment.md.BV8Izw4I.js} +1 -1
- package/dist/guida/assets/runbooks_excel-operazioni-distruttive.md.CEygSROg.js +16 -0
- package/dist/guida/assets/runbooks_excel-operazioni-distruttive.md.CEygSROg.lean.js +1 -0
- package/dist/guida/assets/{runbooks_sql-task-truncate-swap.md.C8viT-fp.js → runbooks_sql-task-truncate-swap.md.DAz41942.js} +5 -3
- package/dist/guida/assets/{runbooks_sql-task-truncate-swap.md.C8viT-fp.lean.js → runbooks_sql-task-truncate-swap.md.DAz41942.lean.js} +1 -1
- package/dist/guida/connectors/README.html +5 -5
- package/dist/guida/connectors/excel.html +118 -0
- package/dist/guida/connectors/file.html +7 -7
- package/dist/guida/connectors/http.html +4 -4
- package/dist/guida/connectors/imap.html +4 -4
- package/dist/guida/connectors/jira.html +5 -5
- package/dist/guida/connectors/mysql.html +60 -0
- package/dist/guida/connectors/noeva.html +5 -5
- package/dist/guida/connectors/oauth.html +5 -5
- package/dist/guida/connectors/odoo.html +45 -0
- package/dist/guida/connectors/postgres.html +5 -5
- package/dist/guida/connectors/process.html +4 -4
- package/dist/guida/connectors/sendgrid.html +4 -4
- package/dist/guida/connectors/smtp.html +4 -4
- package/dist/guida/connectors/sqlserver.html +4 -4
- package/dist/guida/connectors/zoho.html +4 -4
- package/dist/guida/conventions/node-columns.html +4 -4
- package/dist/guida/conventions/node-descriptor.html +8 -8
- package/dist/guida/conventions/run-report.html +6 -6
- package/dist/guida/conventions/run-trace.html +4 -4
- package/dist/guida/conventions/variabili-del-core.html +4 -4
- package/dist/guida/conventions/versioni-di-pipeline.html +6 -6
- package/dist/guida/guide/claude-code/index.html +4 -4
- package/dist/guida/guide/claude-code/prompt.html +5 -5
- package/dist/guida/guide/claude-code/strumenti.html +4 -4
- package/dist/guida/guide/grafo.html +4 -4
- package/dist/guida/guide/usare/app-desktop.html +4 -4
- package/dist/guida/guide/usare/esito-di-una-run.html +4 -4
- package/dist/guida/guide/usare/index.html +4 -4
- package/dist/guida/hashmap.json +1 -1
- package/dist/guida/index.html +4 -4
- package/dist/guida/nodes/README.html +5 -5
- package/dist/guida/nodes/action.html +4 -4
- package/dist/guida/nodes/ai.html +4 -4
- package/dist/guida/nodes/join.html +4 -4
- package/dist/guida/nodes/lookup.html +6 -6
- package/dist/guida/nodes/pipeline.html +4 -4
- package/dist/guida/nodes/route.html +4 -4
- package/dist/guida/nodes/sink.html +7 -7
- package/dist/guida/nodes/source.html +7 -7
- package/dist/guida/nodes/task.html +6 -6
- package/dist/guida/nodes/transform.html +6 -6
- package/dist/guida/nodes/try-catch.html +4 -4
- package/dist/guida/nodes/union.html +4 -4
- package/dist/guida/pagine.json +4 -0
- package/dist/guida/pipelines/README.html +4 -4
- package/dist/guida/pipelines/crm-leads-sync.html +4 -4
- package/dist/guida/pipelines/cross-workspace-csv-merge.html +4 -4
- package/dist/guida/pipelines/movimenti-per-conto.html +4 -4
- package/dist/guida/pipelines/orders-enriched-daily.html +4 -4
- package/dist/guida/pipelines/test-posta.html +4 -4
- package/dist/guida/runbooks/aggiornamento-pm2.html +4 -4
- package/dist/guida/runbooks/deploy-ecr.html +4 -4
- package/dist/guida/runbooks/deployment.html +6 -6
- package/dist/guida/runbooks/etl-worker.html +5 -5
- package/dist/guida/runbooks/excel-operazioni-distruttive.html +42 -0
- package/dist/guida/runbooks/graph-server.html +5 -5
- package/dist/guida/runbooks/mask-key.html +4 -4
- package/dist/guida/runbooks/oauth-google-posta.html +4 -4
- package/dist/guida/runbooks/rollback-di-pipeline.html +4 -4
- package/dist/guida/runbooks/scd2-rehash.html +4 -4
- package/dist/guida/runbooks/sql-task-truncate-swap.html +8 -6
- package/dist/guida/runbooks/stato-incrementale.html +4 -4
- package/dist/guida/sub-pipelines/README.html +4 -4
- package/dist/guida/sub-pipelines/riepilogo-ordini.html +4 -4
- package/dist/index.d.ts +9 -9
- package/dist/index.js +1 -1
- package/dist/{invio-Dwz3J7sP.d.ts → invio-9Ubb_cdR.d.ts} +3 -3
- package/dist/{istanza-per-il-piano-CucqUF7b.d.ts → istanza-per-il-piano-74NYhIHc.d.ts} +1 -1
- package/dist/{manifest-variabili-U1UfPDfF.d.ts → manifest-variabili-DRWUzmxU.d.ts} +1 -1
- package/dist/pipelines.d.ts +3 -3
- package/dist/pipelines.js +1 -1
- package/dist/{runnable-pipeline-CArkLzfv.d.ts → runnable-pipeline-CWgPwi6w.d.ts} +2 -2
- package/dist/{config-DIthC7n7.d.ts → sql-watermark-CQVvxhPZ.d.ts} +9 -40
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +1 -1
- package/dist/{trasporto-DpPLCEQ1.d.ts → trasporto-BaRdP6Wl.d.ts} +4 -4
- package/dist/{types-BVA7BIou.d.ts → types-_3rgLhje.d.ts} +21 -2
- package/dist/{variabili-dichiarate-DmfcxsT9.d.ts → variabili-dichiarate-CS-eC53K.d.ts} +1 -1
- package/kit/skills/etl-graph/SKILL.md +6 -3
- package/kit/skills/etl-graph/references/data-patterns.md +1 -1
- package/kit/skills/etl-graph/references/error-handling.md +3 -3
- package/kit/skills/etl-graph/references/wiring.md +10 -10
- package/kit/skills/new-connector/SKILL.md +2 -2
- package/package.json +16 -1
- package/dist/chunk-BVUOUBLW.js +0 -1
- package/dist/chunk-CRR3Q2C7.js +0 -2
- package/dist/chunk-LJ7DVP5F.js +0 -2
- package/dist/chunk-PKBSETMV.js +0 -2
- package/dist/chunk-QPJC4GWR.js +0 -1
- package/dist/chunk-RCRMQPFH.js +0 -5
- package/dist/chunk-RS5SGDUU.js +0 -1
- package/dist/chunk-RWPHH4E2.js +0 -1
- package/dist/chunk-SRFFKE5W.js +0 -6
- package/dist/chunk-WVODQB6Z.js +0 -1
- package/dist/chunk-XZMCC6VQ.js +0 -1
- package/dist/chunk-ZCYGHS7P.js +0 -2
- package/dist/guida/assets/TECHNICAL_OVERVIEW.md.DTIhkkg9.js +0 -10
- package/dist/guida/assets/chunks/@localSearchIndexroot.NgfCNDyz.js +0 -1
- package/dist/guida/assets/connectors_README.md.BqI2RLCu.js +0 -1
- package/dist/guida/assets/connectors_README.md.BqI2RLCu.lean.js +0 -1
- package/dist/guida/assets/conventions_node-descriptor.md.MQaGlm8a.lean.js +0 -1
- /package/dist/guida/assets/{GUIDA_SVILUPPO.md.CrN52ZDN.lean.js → GUIDA_SVILUPPO.md.Bvr7RKHN.lean.js} +0 -0
- /package/dist/guida/assets/{TECHNICAL_OVERVIEW.md.DTIhkkg9.lean.js → TECHNICAL_OVERVIEW.md.C6HYc5_h.lean.js} +0 -0
- /package/dist/guida/assets/{conventions_run-report.md.D_pG07VG.lean.js → conventions_run-report.md.iVSN9fNV.lean.js} +0 -0
- /package/dist/guida/assets/{nodes_lookup.md.BI8tgBIq.lean.js → nodes_lookup.md.DrJFsfOJ.lean.js} +0 -0
- /package/dist/guida/assets/{nodes_sink.md.yAf_z4wO.lean.js → nodes_sink.md.C1S-lAh2.lean.js} +0 -0
- /package/dist/guida/assets/{nodes_source.md.DP2i3GFv.lean.js → nodes_source.md.BitUNtug.lean.js} +0 -0
- /package/dist/guida/assets/{nodes_transform.md.Bv5fg2Xx.lean.js → nodes_transform.md.Ciycywnb.lean.js} +0 -0
- /package/dist/guida/assets/{runbooks_deployment.md.CwG77qGO.lean.js → runbooks_deployment.md.BV8Izw4I.lean.js} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opzioni della modalità SCD tipo 2 di un sink SQL (ADR-0078), identiche su
|
|
3
|
+
* `postgresSink` e `mssqlSink`.
|
|
4
|
+
*/
|
|
5
|
+
interface Scd2Options<T> {
|
|
6
|
+
readonly mode: "scd2";
|
|
7
|
+
/**
|
|
8
|
+
* Colonne della chiave naturale, dentro `columns`. **L'ordine entra nella
|
|
9
|
+
* chiave di versione**: riordinarle cambia le chiavi, come `from` in
|
|
10
|
+
* `surrogateKey`.
|
|
11
|
+
*/
|
|
12
|
+
readonly naturalKey: ReadonlyArray<keyof T & string>;
|
|
13
|
+
/** Colonna dell'hash di riga, calcolato da `hashRow` a monte. Sta in `columns`. */
|
|
14
|
+
readonly hashColumn: keyof T & string;
|
|
15
|
+
/** Colonna dell'inizio di validità. La scrive il sink. */
|
|
16
|
+
readonly validFrom: string;
|
|
17
|
+
/** Colonna della fine di validità, esclusa. La scrive il sink. */
|
|
18
|
+
readonly validTo: string;
|
|
19
|
+
/** Colonna booleana «è la versione corrente». Se dichiarata, la mantiene il sink. */
|
|
20
|
+
readonly isCurrent?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Colonna della chiave di versione ed `entity` di ADR-0070. L'`entity` deve
|
|
23
|
+
* essere la stessa della `surrogateKey` a monte: il sink non può verificarlo.
|
|
24
|
+
*/
|
|
25
|
+
readonly versionKey: {
|
|
26
|
+
readonly column: string;
|
|
27
|
+
readonly entity: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Colonna con l'`executionId` dell'esecuzione che ha aperto o corretto la
|
|
31
|
+
* versione. La scrive il sink, e ci distingue un duplicato da una correzione
|
|
32
|
+
* in giornata.
|
|
33
|
+
*/
|
|
34
|
+
readonly executionIdColumn: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type { Scd2Options as S };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as ConfigError } from './errors-
|
|
2
|
-
import { V as VariabileRisolta, M as ManifestVariabili } from './manifest-variabili-
|
|
3
|
-
import { I as IstanzaDichiarata } from './ambiente-della-pipeline-
|
|
1
|
+
import { C as ConfigError } from './errors-CRq1uNYZ.js';
|
|
2
|
+
import { V as VariabileRisolta, M as ManifestVariabili } from './manifest-variabili-DRWUzmxU.js';
|
|
3
|
+
import { I as IstanzaDichiarata } from './ambiente-della-pipeline-BhWsyLUR.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Come il connettore si presenta all'API. Ogni variante porta solo i campi che
|
package/dist/connector-kit.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as ConnectorConnectionRef, f as ConnectorDetail, C as ConfigError, P as PlanVariable } from './errors-CRq1uNYZ.js';
|
|
2
2
|
export { A as AssertReadOnlyOptions, K as KEYS_PLACEHOLDER, a as KeysPlaceholderOptions, b as KeysShape, c as assertReadOnlyQuery, g as groupRowsByKey, n as normalizeKey, r as replaceKeysPlaceholder, d as rowsByRequestedKey, u as uniqueNormalizedKeys } from './sql-lookup-Bx2-TWsm.js';
|
|
3
3
|
export { C as ConnectorRegistry, a as ConnectorRegistryMeta, R as ResolveRegistryOptions, b as buildConnectorRegistry, r as resolveConnectorInstance, c as resolveConnectorRegistry } from './registry-tB3G64MU.js';
|
|
4
|
-
export { C as CredenzialiPosta, L as LetturaEnv, d as dettaglioCredenzialiPosta, l as letturaEnv, m as manifestCredenzialiPosta, p as parseBooleano, a as parseCredenzialiPosta, b as parsePorta, t as tokenOAuth2 } from './credenziali-posta-
|
|
5
|
-
import { V as VariabileRisolta } from './manifest-variabili-
|
|
6
|
-
export { A as AlternativaManifest, M as ManifestVariabili, O as Obbligatorieta, P as ProblemaConfigurazione, R as RisoluzioneVariabili, U as UnaFraManifest, a as ValoreRisolto, b as VariabileManifest, c as VariantiManifest, d as VoceManifest, e as VoceSemplice, r as richiediCompleta, f as risolviVariabili, v as valoreGarantito } from './manifest-variabili-
|
|
7
|
-
export { I as IstanzaPerIlPiano } from './istanza-per-il-piano-
|
|
8
|
-
export { A as AmbienteDichiarato, C as ConfigurazioneDichiarata, I as IstanzaDichiarata, a as ambienteDellaPipeline } from './ambiente-della-pipeline-
|
|
9
|
-
export { P as ProvenienzaVariabile, V as VariabileDichiarata } from './variabili-dichiarate-
|
|
10
|
-
export { C as ConnessioneSql, I as IstanzaSqlPerIlPianoOptions,
|
|
4
|
+
export { C as CredenzialiPosta, L as LetturaEnv, d as dettaglioCredenzialiPosta, l as letturaEnv, m as manifestCredenzialiPosta, p as parseBooleano, a as parseCredenzialiPosta, b as parsePorta, t as tokenOAuth2 } from './credenziali-posta-C0az04uV.js';
|
|
5
|
+
import { V as VariabileRisolta } from './manifest-variabili-DRWUzmxU.js';
|
|
6
|
+
export { A as AlternativaManifest, M as ManifestVariabili, O as Obbligatorieta, P as ProblemaConfigurazione, R as RisoluzioneVariabili, U as UnaFraManifest, a as ValoreRisolto, b as VariabileManifest, c as VariantiManifest, d as VoceManifest, e as VoceSemplice, r as richiediCompleta, f as risolviVariabili, v as valoreGarantito } from './manifest-variabili-DRWUzmxU.js';
|
|
7
|
+
export { I as IstanzaPerIlPiano } from './istanza-per-il-piano-74NYhIHc.js';
|
|
8
|
+
export { A as AmbienteDichiarato, C as ConfigurazioneDichiarata, I as IstanzaDichiarata, a as ambienteDellaPipeline } from './ambiente-della-pipeline-BhWsyLUR.js';
|
|
9
|
+
export { P as ProvenienzaVariabile, V as VariabileDichiarata } from './variabili-dichiarate-CS-eC53K.js';
|
|
10
|
+
export { C as ConnessioneSql, I as IstanzaSqlPerIlPianoOptions, c as IstanzaSqlRisolta, M as MANIFEST_CONNESSIONE_SQL, d as SqlStatement, b as SqlTask, e as SqlTaskDriver, a as SqlTaskOptions, f as SqlTaskParam, g as SqlTaskSession, h as SqlTaskValue, S as SqlWatermarkOptions, W as WATERMARK_PLACEHOLDER, i as assertWatermarkQuery, j as dettagliConnessioneSql, k as istanzaSqlPerIlPiano, m as mapCode, o as observeWatermark, p as plainWatermarkText, r as replaceParams, l as replaceWatermarkPlaceholder, n as requireIncremental, q as risolviIstanzaSql, s as sqlTask, t as statementParams, w as watermarkDetail } from './sql-watermark-CQVvxhPZ.js';
|
|
11
|
+
export { S as Scd2Options } from './config-BSdGSRPG.js';
|
|
11
12
|
import 'zod';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -176,6 +177,8 @@ declare function transientFlag(err: unknown): {
|
|
|
176
177
|
declare const PREFISSO_PG = "PG";
|
|
177
178
|
/** SQL Server: `MSSQL_HOST`, `MSSQL_<ID>_HOST`. */
|
|
178
179
|
declare const PREFISSO_MSSQL = "MSSQL_";
|
|
180
|
+
/** MySQL e MariaDB: `MYSQL_HOST`, `MYSQL_<ID>_HOST`. */
|
|
181
|
+
declare const PREFISSO_MYSQL = "MYSQL_";
|
|
179
182
|
/** Caselle IMAP. */
|
|
180
183
|
declare const PREFISSO_IMAP = "IMAP_";
|
|
181
184
|
/** Server SMTP. */
|
|
@@ -188,6 +191,8 @@ declare const PREFISSO_HTTP = "HTTP_";
|
|
|
188
191
|
declare const PREFISSO_JIRA = "JIRA_";
|
|
189
192
|
/** Organizzazioni Zoho CRM: `ZOHO_BASE_URL`, `ZOHO_<ID>_BASE_URL` (ADR-0106). */
|
|
190
193
|
declare const PREFISSO_ZOHO = "ZOHO_";
|
|
194
|
+
/** Database Odoo: `ODOO_URL`, `ODOO_<ID>_URL`. */
|
|
195
|
+
declare const PREFISSO_ODOO = "ODOO_";
|
|
191
196
|
/** Client Noeva dell'istanza ETL: `NOEVA_API_BASE_URL`, `NOEVA_WORKSPACE_ID`… */
|
|
192
197
|
declare const PREFISSO_NOEVA = "NOEVA_";
|
|
193
198
|
/** Identità OAuth2 condivise da IMAP, SMTP e Zoho CRM (ADR-0065). */
|
|
@@ -199,4 +204,4 @@ declare const PREFISSO_SFTP = "SFTP_";
|
|
|
199
204
|
/** Storage FTP. */
|
|
200
205
|
declare const PREFISSO_FTP = "FTP_";
|
|
201
206
|
|
|
202
|
-
export { DEFAULT_INSTANCE_ID, type DriverErrorCodes, type EsitoConfigurazione, PREFISSO_FTP, PREFISSO_HTTP, PREFISSO_IMAP, PREFISSO_JIRA, PREFISSO_MSSQL, PREFISSO_NOEVA, PREFISSO_OAUTH, PREFISSO_PG, PREFISSO_S3, PREFISSO_SENDGRID, PREFISSO_SFTP, PREFISSO_SMTP, PREFISSO_ZOHO, VariabileRisolta, connectionRef, dettaglioVariabile, driverErrorMatches, instanceEnvPrefix, isTransientDriverError, parseInstanceIds, redactCredentials, redactError, righeNonValida, tentaConfigurazione, transientFlag, unisciConfigError, variabileDelPiano, variabileDi, withoutCredentials };
|
|
207
|
+
export { DEFAULT_INSTANCE_ID, type DriverErrorCodes, type EsitoConfigurazione, PREFISSO_FTP, PREFISSO_HTTP, PREFISSO_IMAP, PREFISSO_JIRA, PREFISSO_MSSQL, PREFISSO_MYSQL, PREFISSO_NOEVA, PREFISSO_OAUTH, PREFISSO_ODOO, PREFISSO_PG, PREFISSO_S3, PREFISSO_SENDGRID, PREFISSO_SFTP, PREFISSO_SMTP, PREFISSO_ZOHO, VariabileRisolta, connectionRef, dettaglioVariabile, driverErrorMatches, instanceEnvPrefix, isTransientDriverError, parseInstanceIds, redactCredentials, redactError, righeNonValida, tentaConfigurazione, transientFlag, unisciConfigError, variabileDelPiano, variabileDi, withoutCredentials };
|
package/dist/connector-kit.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{l as DEFAULT_INSTANCE_ID,e as KEYS_PLACEHOLDER,
|
|
1
|
+
export{l as DEFAULT_INSTANCE_ID,e as KEYS_PLACEHOLDER,X as MANIFEST_CONNESSIONE_SQL,H as PREFISSO_FTP,z as PREFISSO_HTTP,w as PREFISSO_IMAP,A as PREFISSO_JIRA,u as PREFISSO_MSSQL,v as PREFISSO_MYSQL,D as PREFISSO_NOEVA,E as PREFISSO_OAUTH,C as PREFISSO_ODOO,t as PREFISSO_PG,F as PREFISSO_S3,y as PREFISSO_SENDGRID,G as PREFISSO_SFTP,x as PREFISSO_SMTP,B as PREFISSO_ZOHO,ga as WATERMARK_PLACEHOLDER,T as ambienteDellaPipeline,f as assertReadOnlyQuery,ha as assertWatermarkQuery,q as buildConnectorRegistry,a as connectionRef,Z as dettagliConnessioneSql,P as dettaglioCredenzialiPosta,J as dettaglioVariabile,$ as driverErrorMatches,k as groupRowsByKey,m as instanceEnvPrefix,aa as isTransientDriverError,_ as istanzaSqlPerIlPiano,W as letturaEnv,O as manifestCredenzialiPosta,ca as mapCode,h as normalizeKey,la as observeWatermark,U as parseBooleano,M as parseCredenzialiPosta,n as parseInstanceIds,V as parsePorta,ma as plainWatermarkText,c as redactCredentials,d as redactError,g as replaceKeysPlaceholder,ea as replaceParams,ia as replaceWatermarkPlaceholder,ka as requireIncremental,s as resolveConnectorInstance,r as resolveConnectorRegistry,R as richiediCompleta,L as righeNonValida,Y as risolviIstanzaSql,Q as risolviVariabili,j as rowsByRequestedKey,fa as sqlTask,da as statementParams,o as tentaConfigurazione,N as tokenOAuth2,ba as transientFlag,i as uniqueNormalizedKeys,p as unisciConfigError,S as valoreGarantito,K as variabileDelPiano,I as variabileDi,ja as watermarkDetail,b as withoutCredentials}from'./chunk-47NVGHUY.js';import'./chunk-CEAMQIRO.js';
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { S as Source, a as Sink, T as Task, b as Transform } from '../errors-CRq1uNYZ.js';
|
|
2
|
+
import { S as StorageProvider } from '../types-_3rgLhje.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
|
|
5
|
+
interface ExcelSourceOptions {
|
|
6
|
+
readonly name?: string;
|
|
7
|
+
/** Il workbook da leggere. In alternativa a `prefix`. */
|
|
8
|
+
readonly path?: string;
|
|
9
|
+
/** Legge tutti i workbook `.xlsx` e `.xlsm` sotto il prefisso, uno dopo l'altro. */
|
|
10
|
+
readonly prefix?: string;
|
|
11
|
+
/** Il foglio da leggere, per nome (senza distinguere maiuscole e minuscole). In alternativa a `sheets`. */
|
|
12
|
+
readonly sheet?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Più fogli: l'elenco dei nomi o `"all"` (tutti, nell'ordine del workbook).
|
|
15
|
+
* In alternativa a `sheet`. Con più fogli serve `sheetField`.
|
|
16
|
+
*/
|
|
17
|
+
readonly sheets?: readonly string[] | "all";
|
|
18
|
+
/**
|
|
19
|
+
* Il campo che in ogni record porta il nome del foglio d'origine, come lo
|
|
20
|
+
* scrive il workbook. Obbligatorio con più fogli (`sheets` con più di un nome
|
|
21
|
+
* o `"all"`); con un foglio solo è facoltativo.
|
|
22
|
+
*/
|
|
23
|
+
readonly sheetField?: string;
|
|
24
|
+
/** La riga d'intestazione, da 1 (default 1). Le righe sopra non sono dati. */
|
|
25
|
+
readonly headerRow?: number;
|
|
26
|
+
/**
|
|
27
|
+
* I titoli da leggere: il record contiene solo queste colonne, abbinate per
|
|
28
|
+
* titolo e non per posizione. Senza, ogni titolo dell'intestazione è una colonna.
|
|
29
|
+
*/
|
|
30
|
+
readonly columns?: readonly string[];
|
|
31
|
+
/**
|
|
32
|
+
* Un foglio che nel workbook non c'è: `error` (default) ferma la run,
|
|
33
|
+
* `skip` salta quel workbook. Saltare è una scelta esplicita.
|
|
34
|
+
*/
|
|
35
|
+
readonly onMissingSheet?: "error" | "skip";
|
|
36
|
+
/** Id dell'istanza storage (registry, ADR-0030), mostrato nel descriptor del nodo. */
|
|
37
|
+
readonly instanceId?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* {@link Source} che legge **un foglio** di un workbook Excel (`.xlsx`,
|
|
41
|
+
* `.xlsm`) in streaming, un record per riga. Le colonne si abbinano per
|
|
42
|
+
* **titolo** nella riga d'intestazione. Una cella vuota è `null`, una formula
|
|
43
|
+
* vale il valore che Excel ha salvato, una data è una `Date` UTC (base 1900 o
|
|
44
|
+
* 1904 come dice il file), le righe del tutto vuote si saltano e di una cella
|
|
45
|
+
* unita il valore sta solo nella cella master. Un errore di Excel è `null` e
|
|
46
|
+
* si conta in `<nome>:excel.errori-di-formula` su `ctx.metrics`.
|
|
47
|
+
*/
|
|
48
|
+
declare function excelSource<T extends Record<string, unknown> = Record<string, unknown>>(storage: StorageProvider, options: ExcelSourceOptions): Source<T>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* I formati di colonna che il sink sa dichiarare, e la loro traduzione nel
|
|
52
|
+
* codice di formato numerico di Excel. Puro: niente file.
|
|
53
|
+
*/
|
|
54
|
+
/**
|
|
55
|
+
* Come appare una colonna **creata dal connettore**: un formato con nome o un
|
|
56
|
+
* codice di formato di Excel (`{ code: "0.000" }`).
|
|
57
|
+
*/
|
|
58
|
+
type ExcelFormat = "text" | "number" | "integer" | "currency" | "percent" | "date" | "datetime" | {
|
|
59
|
+
readonly code: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** Il foglio di destinazione preso dal valore di un campo del record. */
|
|
63
|
+
interface ExcelSheetFromField {
|
|
64
|
+
readonly field: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Una colonna del foglio: il campo del record e, se diverso, il titolo in intestazione. */
|
|
68
|
+
interface ExcelColumn {
|
|
69
|
+
readonly field: string;
|
|
70
|
+
/** Il titolo nella riga d'intestazione. Default: il nome del campo. */
|
|
71
|
+
readonly title?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Come appare la colonna **se la crea il sink** (un foglio nuovo, o una colonna
|
|
74
|
+
* aggiunta a un foglio esistente). Una colonna già presente nel file non cambia.
|
|
75
|
+
*/
|
|
76
|
+
readonly format?: ExcelFormat;
|
|
77
|
+
/** Larghezza in caratteri (fino a 255), solo nei fogli creati dal sink. */
|
|
78
|
+
readonly width?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Una formula al posto del valore: la colonna non legge il campo, scrive questa
|
|
81
|
+
* formula **nelle righe nuove** (mai sulle aggiornate di un `upsert`). `{row}` è
|
|
82
|
+
* la riga della cella e `{prev}` quella sopra: `"=B{row}*C{row}"`. Nel file le
|
|
83
|
+
* funzioni si scrivono in inglese (`SUM`, non `SOMMA`). Excel la calcola
|
|
84
|
+
* all'apertura. Non si combina con `key`.
|
|
85
|
+
*/
|
|
86
|
+
readonly formula?: string;
|
|
87
|
+
}
|
|
88
|
+
/** Le opzioni comuni a tutte le modalità del sink. */
|
|
89
|
+
interface ExcelSinkBaseOptions {
|
|
90
|
+
readonly name?: string;
|
|
91
|
+
/** Il percorso del workbook, fisso. */
|
|
92
|
+
readonly path: string;
|
|
93
|
+
/**
|
|
94
|
+
* Il foglio di destinazione: un nome fisso o `{ field }`, il campo del record
|
|
95
|
+
* che lo dà (un foglio per valore). «Mario» e «mario» sono lo stesso foglio e si
|
|
96
|
+
* scrive con l'ortografia di quello che c'è. Il campo non è una colonna, a meno
|
|
97
|
+
* che non sia in `columns`.
|
|
98
|
+
*/
|
|
99
|
+
readonly sheet: string | ExcelSheetFromField;
|
|
100
|
+
/** Il foglio che manca in un workbook esistente: `create` (default) lo aggiunge, `error` ferma la run. */
|
|
101
|
+
readonly onMissingSheet?: "create" | "error";
|
|
102
|
+
/**
|
|
103
|
+
* Le colonne, nell'ordine in cui compaiono. Senza, sono i campi dei record
|
|
104
|
+
* nell'ordine in cui si incontrano. Un campo non dichiarato è un errore.
|
|
105
|
+
*/
|
|
106
|
+
readonly columns?: readonly ExcelColumn[];
|
|
107
|
+
/**
|
|
108
|
+
* Nelle righe nuove di un foglio esistente le colonne **non** dichiarate con
|
|
109
|
+
* `formula` ripetono, traslata, la formula della riga precedente (default
|
|
110
|
+
* `true`). Vale per riferimenti A1 relativi nello stesso foglio e per i
|
|
111
|
+
* riferimenti strutturati di tabella; una formula con un riferimento ad un altro
|
|
112
|
+
* foglio ferma la run nominando la cella. Con `false` quelle celle restano vuote.
|
|
113
|
+
*/
|
|
114
|
+
readonly repeatFormulas?: boolean;
|
|
115
|
+
/** La riga d'intestazione, da 1 (default 1). In un workbook nuovo le righe sopra restano vuote; in uno esistente restano come sono. */
|
|
116
|
+
readonly headerRow?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Intestazione in grassetto. Come `freezeHeader`, `autoFilter` e `table`
|
|
119
|
+
* vale **solo per i fogli che il sink crea**: su un foglio esistente decide
|
|
120
|
+
* l'utente.
|
|
121
|
+
*/
|
|
122
|
+
readonly boldHeader?: boolean;
|
|
123
|
+
/** Blocca le righe fino all'intestazione compresa, nei fogli creati. */
|
|
124
|
+
readonly freezeHeader?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Filtro automatico sull'intestazione, nei fogli creati. Con `table` sono i
|
|
127
|
+
* pulsanti di filtro della tabella (senza `autoFilter` la tabella non li ha).
|
|
128
|
+
*/
|
|
129
|
+
readonly autoFilter?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Il nome di una tabella Excel che copre intestazione e righe, nei fogli
|
|
132
|
+
* creati. Il nome è valido (lettere, cifre, `_` e `.`, senza spazi, non un
|
|
133
|
+
* riferimento di cella) e unico nel workbook. Non si combina con `sheet: { field }`:
|
|
134
|
+
* ogni foglio avrebbe lo stesso nome.
|
|
135
|
+
*/
|
|
136
|
+
readonly table?: string;
|
|
137
|
+
/** Il workbook che manca: `create` (default) lo crea, `error` ferma la run. */
|
|
138
|
+
readonly onMissingFile?: "create" | "error";
|
|
139
|
+
/**
|
|
140
|
+
* Se accanto al file c'è `~$nome.xlsx` (Excel lo tiene aperto): `error`
|
|
141
|
+
* (default) ferma la run con un errore transitorio, `ignore` scrive lo stesso.
|
|
142
|
+
*/
|
|
143
|
+
readonly onFileApertoInExcel?: "error" | "ignore";
|
|
144
|
+
/**
|
|
145
|
+
* Il tetto di memoria: byte **decompressi** del foglio che il sink accetta di
|
|
146
|
+
* riscrivere (default {@link DEFAULT_MAX_SHEET_BYTES}). Superato, la run si
|
|
147
|
+
* ferma senza toccare il file.
|
|
148
|
+
*/
|
|
149
|
+
readonly maxSheetBytes?: number;
|
|
150
|
+
/**
|
|
151
|
+
* Il file modello (`.xlsx` o `.xlsm`, nello stesso storage) che si copia al
|
|
152
|
+
* posto dello scheletro minimo quando il workbook manca: porta con sé grafici,
|
|
153
|
+
* pivot, macro e stili. Deve avere la stessa estensione di `path`. Un `.xlsm`
|
|
154
|
+
* nuovo nasce solo da un modello `.xlsm`.
|
|
155
|
+
*/
|
|
156
|
+
readonly template?: string;
|
|
157
|
+
/**
|
|
158
|
+
* Il foglio **del workbook** (di solito arrivato dal `template`) che si clona
|
|
159
|
+
* per ogni foglio nuovo: stili, larghezze, intestazione, formule e tabella con
|
|
160
|
+
* nome rigenerato. Errore se il modello ha grafici, pivot o disegni.
|
|
161
|
+
*/
|
|
162
|
+
readonly sheetTemplate?: string;
|
|
163
|
+
/** Id dell'istanza storage (registry, ADR-0030), mostrato nel descriptor del nodo. */
|
|
164
|
+
readonly instanceId?: string;
|
|
165
|
+
/**
|
|
166
|
+
* Dichiara che il nodo cancella dati (`replace`, o `cancellaQuando`): compare
|
|
167
|
+
* nel DAG e nel report, e `excelSink` rifiuta quei nodi se non è `true`. Un
|
|
168
|
+
* nodo che cancella vuole il suo runbook: `docs/runbooks/excel-operazioni-distruttive.md`.
|
|
169
|
+
*/
|
|
170
|
+
readonly destructive?: boolean;
|
|
171
|
+
}
|
|
172
|
+
/** La condizione che fa cancellare la riga: il campo del record e il valore che la attiva. */
|
|
173
|
+
interface ExcelCancellaQuando {
|
|
174
|
+
/** Il campo del record. Non è una colonna, a meno che non sia in `columns`. */
|
|
175
|
+
readonly field: string;
|
|
176
|
+
/** Il valore (confronto stretto) per cui il record cancella invece di scrivere. */
|
|
177
|
+
readonly equals: string | number | boolean;
|
|
178
|
+
}
|
|
179
|
+
/** Le opzioni del sink in modalità `append`: crea un workbook nuovo o aggiunge a uno esistente. */
|
|
180
|
+
interface ExcelSinkAppendOptions extends ExcelSinkBaseOptions {
|
|
181
|
+
/** La modalità: aggiunge righe in fondo al foglio. */
|
|
182
|
+
readonly mode: "append";
|
|
183
|
+
/** Solo `upsert` ha una chiave. */
|
|
184
|
+
readonly key?: never;
|
|
185
|
+
readonly cancellaQuando?: never;
|
|
186
|
+
readonly cancellaRighe?: never;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Le opzioni del sink in modalità `replace`: svuota il foglio di destinazione e
|
|
190
|
+
* lo riscrive. **Distruttiva**: vuole `destructive: true`. Intestazione e righe
|
|
191
|
+
* sopra l'intestazione restano; le righe sotto si tolgono tutte.
|
|
192
|
+
*/
|
|
193
|
+
interface ExcelSinkReplaceOptions extends ExcelSinkBaseOptions {
|
|
194
|
+
/** La modalità: sostituisce il contenuto del foglio. */
|
|
195
|
+
readonly mode: "replace";
|
|
196
|
+
readonly destructive: true;
|
|
197
|
+
readonly key?: never;
|
|
198
|
+
readonly cancellaQuando?: never;
|
|
199
|
+
readonly cancellaRighe?: never;
|
|
200
|
+
}
|
|
201
|
+
/** Le opzioni del sink in modalità `upsert`: aggiorna la riga che ha la stessa chiave, altrimenti la aggiunge in fondo. */
|
|
202
|
+
interface ExcelSinkUpsertOptions extends ExcelSinkBaseOptions {
|
|
203
|
+
/** La modalità: aggiorna o aggiunge, per chiave. */
|
|
204
|
+
readonly mode: "upsert";
|
|
205
|
+
/**
|
|
206
|
+
* I campi che fanno la chiave (uno o più, ciascuno in `columns` se dichiarate).
|
|
207
|
+
* La chiave si cerca solo nel foglio di destinazione. Il confronto è canonico:
|
|
208
|
+
* tutto a testo, spazi ai lati tolti, date in ISO, maiuscole distinte, quindi
|
|
209
|
+
* «42» e 42 sono la stessa chiave. Una parte assente, nulla o vuota rende il
|
|
210
|
+
* record invalido. Una cella nulla in un record che aggiorna non tocca quella del foglio.
|
|
211
|
+
*/
|
|
212
|
+
readonly key: readonly string[];
|
|
213
|
+
/**
|
|
214
|
+
* Il record che la soddisfa **cancella** la riga con la sua chiave invece di
|
|
215
|
+
* scriverla (se la riga non c'è, nessun effetto; vale l'ordine di arrivo).
|
|
216
|
+
* Vuole `destructive: true`.
|
|
217
|
+
*/
|
|
218
|
+
readonly cancellaQuando?: ExcelCancellaQuando;
|
|
219
|
+
/**
|
|
220
|
+
* Come si cancella. `"rimuovi"` (default) toglie la riga e fa salire quelle
|
|
221
|
+
* sotto, riscrivendo formule, tabelle, celle unite, formattazione condizionale,
|
|
222
|
+
* convalide e nomi definiti; dove il layer non sa riscrivere (grafici, pivot,
|
|
223
|
+
* commenti, formule condivise...) l'operazione fallisce **prima di scrivere**
|
|
224
|
+
* nominando cosa lo impedisce. `"svuota"` lascia un buco (celle vuote, stile
|
|
225
|
+
* mantenuto, nessuna riga spostata, nessun riferimento toccato) ed è la via
|
|
226
|
+
* d'uscita; il source salta le righe vuote.
|
|
227
|
+
*/
|
|
228
|
+
readonly cancellaRighe?: "svuota" | "rimuovi";
|
|
229
|
+
}
|
|
230
|
+
/** Le opzioni di {@link excelSink}, discriminate dalla modalità. */
|
|
231
|
+
type ExcelSinkOptions = ExcelSinkAppendOptions | ExcelSinkUpsertOptions | ExcelSinkReplaceOptions;
|
|
232
|
+
/**
|
|
233
|
+
* {@link Sink} che scrive un **workbook Excel**. La modalità `append` crea il
|
|
234
|
+
* workbook da uno scheletro minimo se non esiste (foglio, riga d'intestazione
|
|
235
|
+
* e una riga per record); se esiste, **aggiunge le righe in fondo al foglio**
|
|
236
|
+
* toccando solo foglio, tabella e `workbook.xml` e lasciando identico il resto
|
|
237
|
+
* del pacchetto (vedi `aggiungiRighe`). Valida **tutto il batch prima di toccare il file** e si ferma
|
|
238
|
+
* elencando i record invalidi; scrive con la sostituzione atomica dello
|
|
239
|
+
* storage, quindi non resta mai un file a metà. Rifiuta uno storage che non
|
|
240
|
+
* la offre. Non è `retrySafe`: un `append` ripetuto aggiungerebbe le righe due
|
|
241
|
+
* volte.
|
|
242
|
+
*/
|
|
243
|
+
declare function excelSink(storage: StorageProvider, options: ExcelSinkOptions): Sink<Record<string, unknown>>;
|
|
244
|
+
|
|
245
|
+
/** Porta in testa i fogli citati, nell'ordine dato; gli altri seguono nel loro ordine. */
|
|
246
|
+
interface ExcelReorderSheets {
|
|
247
|
+
readonly op: "reorderSheets";
|
|
248
|
+
/** I nomi dei fogli (senza badare alle maiuscole), senza ripetizioni. */
|
|
249
|
+
readonly order: readonly string[];
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Cambia il titolo di una colonna: la cella d'intestazione e, se la colonna sta
|
|
253
|
+
* in una tabella Excel, il nome della colonna nella tabella e le formule con
|
|
254
|
+
* riferimento strutturato che la citano. Altri riferimenti (celle `C:C`, nomi
|
|
255
|
+
* definiti su intervalli) non si riscrivono.
|
|
256
|
+
*/
|
|
257
|
+
interface ExcelRenameColumn {
|
|
258
|
+
readonly op: "renameColumn";
|
|
259
|
+
readonly sheet: string;
|
|
260
|
+
/** Il titolo attuale. Assente con `to` già presente: l'operazione è «già fatta». */
|
|
261
|
+
readonly from: string;
|
|
262
|
+
readonly to: string;
|
|
263
|
+
/** La riga d'intestazione, da 1 (default 1). */
|
|
264
|
+
readonly headerRow?: number;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Cambia il nome di un foglio e riscrive i riferimenti che lo citano: formule,
|
|
268
|
+
* nomi definiti, intervalli di formattazione condizionale e convalide, colonne
|
|
269
|
+
* calcolate e collegamenti interni di tutti i fogli. Un grafico, una tabella
|
|
270
|
+
* pivot o una forma che lo citano fanno rifiutare l'operazione.
|
|
271
|
+
*/
|
|
272
|
+
interface ExcelRenameSheet {
|
|
273
|
+
readonly op: "renameSheet";
|
|
274
|
+
/** Il nome attuale (senza badare alle maiuscole). Assente con `to` già presente: «già fatto». */
|
|
275
|
+
readonly from: string;
|
|
276
|
+
readonly to: string;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Cancella un foglio con ciò che gli appartiene (tabelle, disegni, commenti).
|
|
280
|
+
* **Distruttiva**: richiede `destructive: true` sul task. Rifiuta, elencandoli,
|
|
281
|
+
* i riferimenti che si romperebbero (`#REF!`), e se è l'unico foglio visibile.
|
|
282
|
+
*/
|
|
283
|
+
interface ExcelDeleteSheet {
|
|
284
|
+
readonly op: "deleteSheet";
|
|
285
|
+
readonly sheet: string;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Cancella le colonne con quei titoli (sulla riga d'intestazione), dati
|
|
289
|
+
* compresi: celle, colonne di tabella, formule, filtro, celle unite,
|
|
290
|
+
* formattazione condizionale, convalide e nomi si riscrivono (un riferimento che
|
|
291
|
+
* sparisce diventa `#REF!`). **Distruttiva**: richiede `destructive: true`.
|
|
292
|
+
*/
|
|
293
|
+
interface ExcelDeleteColumns {
|
|
294
|
+
readonly op: "deleteColumns";
|
|
295
|
+
readonly sheet: string;
|
|
296
|
+
/** I titoli da cancellare; quelli assenti sono «già assenti». */
|
|
297
|
+
readonly columns: readonly string[];
|
|
298
|
+
/** La riga d'intestazione, da 1 (default 1). */
|
|
299
|
+
readonly headerRow?: number;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Riordina le colonne: quelle citate prendono, **nell'ordine dato**, le
|
|
303
|
+
* posizioni che occupano (da sinistra a destra); le altre restano dove sono.
|
|
304
|
+
* Celle, colonne di tabella e riferimenti seguono; rifiuta ciò che non sa riscrivere.
|
|
305
|
+
*/
|
|
306
|
+
interface ExcelReorderColumns {
|
|
307
|
+
readonly op: "reorderColumns";
|
|
308
|
+
readonly sheet: string;
|
|
309
|
+
readonly order: readonly string[];
|
|
310
|
+
readonly headerRow?: number;
|
|
311
|
+
}
|
|
312
|
+
/** Inserisce colonne nuove, col loro titolo, subito a destra di un'altra (`after`). */
|
|
313
|
+
interface ExcelInsertColumns {
|
|
314
|
+
readonly op: "insertColumns";
|
|
315
|
+
readonly sheet: string;
|
|
316
|
+
/** In ordine: un `after` può essere una colonna inserita prima. Un titolo già presente è «già fatto». */
|
|
317
|
+
readonly columns: readonly {
|
|
318
|
+
readonly title: string;
|
|
319
|
+
readonly after: string;
|
|
320
|
+
}[];
|
|
321
|
+
readonly headerRow?: number;
|
|
322
|
+
}
|
|
323
|
+
/** Un'operazione dell'{@link excelTask}. */
|
|
324
|
+
type ExcelOperation = ExcelReorderSheets | ExcelRenameColumn | ExcelRenameSheet | ExcelDeleteSheet | ExcelDeleteColumns | ExcelReorderColumns | ExcelInsertColumns;
|
|
325
|
+
/** Le opzioni di {@link excelTask}. */
|
|
326
|
+
interface ExcelTaskOptions {
|
|
327
|
+
readonly name?: string;
|
|
328
|
+
/** Il percorso del workbook (`.xlsx` o `.xlsm`), che deve esistere. */
|
|
329
|
+
readonly path: string;
|
|
330
|
+
/** Le operazioni, applicate **nell'ordine dato** in una sola lettura e un solo salvataggio. */
|
|
331
|
+
readonly operations: readonly ExcelOperation[];
|
|
332
|
+
/** Come per `excelSink`: `error` (default) ferma la run se accanto al file c'è `~$nome.xlsx`. */
|
|
333
|
+
readonly onFileApertoInExcel?: "error" | "ignore";
|
|
334
|
+
/**
|
|
335
|
+
* Obbligatorio a `true` se un'operazione cancella dati (`deleteSheet`,
|
|
336
|
+
* `deleteColumns`): senza, la costruzione fallisce con `ConfigError`.
|
|
337
|
+
*/
|
|
338
|
+
readonly destructive?: boolean;
|
|
339
|
+
/** Il tetto di memoria dei fogli riscritti, in byte decompressi (default come `excelSink`). */
|
|
340
|
+
readonly maxSheetBytes?: number;
|
|
341
|
+
/** Id dell'istanza storage (registry, ADR-0030), mostrato nel descriptor del nodo. */
|
|
342
|
+
readonly instanceId?: string;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* {@link Task} che esegue **operazioni senza record** su un workbook Excel,
|
|
346
|
+
* avviato dagli edge di controllo (per esempio dopo il caricamento del sink sullo
|
|
347
|
+
* stesso file, ADR-0071). Legge il workbook **una volta**, applica tutte le
|
|
348
|
+
* operazioni **in ordine** e lo salva **una volta** con la sostituzione atomica
|
|
349
|
+
* dello storage: se un'operazione è rifiutata non si scrive nulla e il file resta
|
|
350
|
+
* com'era. Le parti che nessuna operazione tocca restano identiche byte per byte.
|
|
351
|
+
*
|
|
352
|
+
* Le operazioni sono idempotenti: riordinare un workbook già in ordine,
|
|
353
|
+
* rinominare con origine assente e destinazione presente o cancellare ciò che non
|
|
354
|
+
* c'è è «già fatto» (o «già assente») e non riscrive il file; quindi il task è
|
|
355
|
+
* `retrySafe`. Origine e destinazione entrambe assenti è invece un errore. Le
|
|
356
|
+
* operazioni che rinominano, cancellano o spostano riscrivono i riferimenti che
|
|
357
|
+
* sanno riscrivere e **rifiutano prima di scrivere**, nominando cosa lo
|
|
358
|
+
* impedisce, quelli che non sanno; la cancellazione di dati richiede
|
|
359
|
+
* `destructive: true`.
|
|
360
|
+
*
|
|
361
|
+
* Rifiuta con `ConfigError` uno storage senza `atomic-replace`.
|
|
362
|
+
*/
|
|
363
|
+
declare function excelTask(storage: StorageProvider, options: ExcelTaskOptions): Task;
|
|
364
|
+
|
|
365
|
+
/** Le opzioni di {@link excelValidate}. */
|
|
366
|
+
interface ExcelValidateOptions {
|
|
367
|
+
/**
|
|
368
|
+
* Le stesse `columns` del sink a valle. Con le colonne, un campo non
|
|
369
|
+
* dichiarato è un errore, come nel sink; senza, si controllano tutti i campi
|
|
370
|
+
* del record.
|
|
371
|
+
*/
|
|
372
|
+
readonly columns?: readonly Pick<ExcelColumn, "field">[];
|
|
373
|
+
/** Il foglio di destinazione, se fisso: un nome non valido è un errore di configurazione. */
|
|
374
|
+
readonly sheet?: string;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Transform che applica a **ogni record** le regole di validazione del sink
|
|
378
|
+
* Excel (`NaN`, `Infinity`, testi oltre 32.767 caratteri, date prima del
|
|
379
|
+
* 01/03/1900, campi non dichiarati, tipi che una cella non tiene), con la
|
|
380
|
+
* stessa funzione e gli stessi messaggi. Mettila prima di `excelSink` con un
|
|
381
|
+
* `deadLetter` sul nodo: i record invalidi vanno negli scarti e gli altri si
|
|
382
|
+
* scrivono, mentre il sink da solo rifiuta l'intero batch.
|
|
383
|
+
*
|
|
384
|
+
* Il record valido passa **invariato**. L'errore elenca tutti i motivi del
|
|
385
|
+
* record e non contiene mai i valori, che possono essere dati personali.
|
|
386
|
+
* Restano al sink i limiti del batch (righe e colonne del foglio): nessun
|
|
387
|
+
* record da solo li supera.
|
|
388
|
+
*/
|
|
389
|
+
declare function excelValidate<T extends Record<string, unknown>>(name: string, options?: ExcelValidateOptions): Transform<T, T>;
|
|
390
|
+
|
|
391
|
+
export { type ExcelCancellaQuando, type ExcelColumn, type ExcelDeleteColumns, type ExcelDeleteSheet, type ExcelFormat, type ExcelInsertColumns, type ExcelOperation, type ExcelRenameColumn, type ExcelRenameSheet, type ExcelReorderColumns, type ExcelReorderSheets, type ExcelSinkAppendOptions, type ExcelSinkOptions, type ExcelSinkReplaceOptions, type ExcelSinkUpsertOptions, type ExcelSourceOptions, type ExcelTaskOptions, type ExcelValidateOptions, excelSink, excelSource, excelTask, excelValidate };
|