ffc-pay-etl-framework 0.0.11 → 0.1.12

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.
Files changed (56) hide show
  1. package/dist/cjs/destinations/postgresDestination.js +1 -1
  2. package/dist/cjs/transformers/index.js +2 -0
  3. package/dist/cjs/transformers/stringReplaceTransformer.js +27 -0
  4. package/dist/cjs/types/destinations/consoleDestination.d.ts.map +1 -1
  5. package/dist/cjs/types/destinations/csvFileDestination.d.ts.map +1 -1
  6. package/dist/cjs/types/destinations/postgresDestination.d.ts.map +1 -1
  7. package/dist/cjs/types/destinations/sqlFileDestination.d.ts +2 -2
  8. package/dist/cjs/types/destinations/sqlFileDestination.d.ts.map +1 -1
  9. package/dist/cjs/types/lib/index.d.ts +5 -5
  10. package/dist/cjs/types/lib/index.d.ts.map +1 -1
  11. package/dist/cjs/types/loaders/csvloader.d.ts +1 -0
  12. package/dist/cjs/types/loaders/csvloader.d.ts.map +1 -1
  13. package/dist/cjs/types/transformers/fakerTransformer.d.ts.map +1 -1
  14. package/dist/cjs/types/transformers/index.d.ts +2 -1
  15. package/dist/cjs/types/transformers/stringReplaceTransformer.d.ts +25 -0
  16. package/dist/cjs/types/transformers/stringReplaceTransformer.d.ts.map +1 -0
  17. package/dist/cjs/types/transformers/toUpperCaseTransformer.d.ts.map +1 -1
  18. package/dist/cjs/types/validators/multiToolValidator.d.ts.map +1 -1
  19. package/dist/cjs/types/validators/requiredValidator.d.ts.map +1 -1
  20. package/dist/cjs/types/validators/uniqueValidator.d.ts.map +1 -1
  21. package/dist/esm/destinations/consoleDestination.js +1 -0
  22. package/dist/esm/destinations/csvFileDestination.js +1 -0
  23. package/dist/esm/destinations/index.js +1 -0
  24. package/dist/esm/destinations/postgresDestination.js +2 -1
  25. package/dist/esm/destinations/sqlFileDestination.js +1 -0
  26. package/dist/esm/index.mjs +1 -0
  27. package/dist/esm/lib/index.js +1 -0
  28. package/dist/esm/lib/rowMetaData.js +1 -0
  29. package/dist/esm/loaders/csvloader.js +1 -0
  30. package/dist/esm/loaders/index.js +1 -0
  31. package/dist/esm/transformers/fakerTransformer.js +1 -0
  32. package/dist/esm/transformers/index.js +3 -0
  33. package/dist/esm/transformers/stringReplaceTransformer.js +29 -0
  34. package/dist/esm/transformers/toUpperCaseTransformer.js +1 -0
  35. package/dist/esm/types/destinations/consoleDestination.d.ts.map +1 -1
  36. package/dist/esm/types/destinations/csvFileDestination.d.ts.map +1 -1
  37. package/dist/esm/types/destinations/postgresDestination.d.ts.map +1 -1
  38. package/dist/esm/types/destinations/sqlFileDestination.d.ts +2 -2
  39. package/dist/esm/types/destinations/sqlFileDestination.d.ts.map +1 -1
  40. package/dist/esm/types/lib/index.d.ts +5 -5
  41. package/dist/esm/types/lib/index.d.ts.map +1 -1
  42. package/dist/esm/types/loaders/csvloader.d.ts +1 -0
  43. package/dist/esm/types/loaders/csvloader.d.ts.map +1 -1
  44. package/dist/esm/types/transformers/fakerTransformer.d.ts.map +1 -1
  45. package/dist/esm/types/transformers/index.d.ts +2 -1
  46. package/dist/esm/types/transformers/stringReplaceTransformer.d.ts +25 -0
  47. package/dist/esm/types/transformers/stringReplaceTransformer.d.ts.map +1 -0
  48. package/dist/esm/types/transformers/toUpperCaseTransformer.d.ts.map +1 -1
  49. package/dist/esm/types/validators/multiToolValidator.d.ts.map +1 -1
  50. package/dist/esm/types/validators/requiredValidator.d.ts.map +1 -1
  51. package/dist/esm/types/validators/uniqueValidator.d.ts.map +1 -1
  52. package/dist/esm/validators/index.js +1 -0
  53. package/dist/esm/validators/multiToolValidator.js +1 -0
  54. package/dist/esm/validators/requiredValidator.js +1 -0
  55. package/dist/esm/validators/uniqueValidator.js +1 -0
  56. package/package.json +32 -3
@@ -103,7 +103,7 @@ function PostgresDestination(options) {
103
103
  chunk.errors.push(error);
104
104
  lastChunk = chunk;
105
105
  // @ts-ignore
106
- callback(null, chunk);
106
+ callback(error, chunk);
107
107
  });
108
108
  }
109
109
  else {
@@ -1,6 +1,8 @@
1
1
  const { ToUpperCaseTransformer } = require("./toUpperCaseTransformer");
2
2
  const { FakerTransformer } = require("./fakerTransformer");
3
+ const { StringReplaceTransformer } = require("./stringReplaceTransformer");
3
4
  module.exports = {
5
+ StringReplaceTransformer,
4
6
  ToUpperCaseTransformer,
5
7
  FakerTransformer
6
8
  };
@@ -0,0 +1,27 @@
1
+ const { Transform } = require("node:stream");
2
+ /**
3
+ *
4
+ * @param {Object} options
5
+ * @param {String} options.column
6
+ * @returns Writable
7
+ */
8
+ function StringReplaceTransformer(options) {
9
+ let self = this;
10
+ self.replacements = options;
11
+ return new Transform({
12
+ readableObjectMode: true,
13
+ writableObjectMode: true,
14
+ transform(chunk, _, callback) {
15
+ const { _columns } = chunk;
16
+ // @ts-ignore
17
+ self.replacements.forEach(r => {
18
+ const colIndex = _columns.indexOf(r.column);
19
+ chunk[colIndex] = chunk[colIndex].replace(r.find, r.replace);
20
+ });
21
+ callback(null, chunk);
22
+ }
23
+ });
24
+ }
25
+ module.exports = {
26
+ StringReplaceTransformer
27
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"consoleDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/consoleDestination.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,4CAHG;IAAwB,aAAa;CACrC,YAYF"}
1
+ {"version":3,"file":"consoleDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/consoleDestination.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH;IAH2B,aAAa;aAavC"}
@@ -1 +1 @@
1
- {"version":3,"file":"csvFileDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/csvFileDestination.js"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,4CANG;IAAwB,QAAQ;IACP,OAAO;IACP,aAAa;IACb,cAAc;CACvC,YAwCF"}
1
+ {"version":3,"file":"csvFileDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/csvFileDestination.js"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH;IAN2B,QAAQ;IACP,OAAO;IACP,aAAa;IACb,cAAc;aAyCzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"postgresDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/postgresDestination.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;GAYG;AACH,6CAVG;IAAwB,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,aAAa;CACrC,aAoGF"}
1
+ {"version":3,"file":"postgresDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/postgresDestination.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;GAYG;AACH;IAV2B,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,aAAa;cAqGvC"}
@@ -17,8 +17,8 @@ export function SQLFileDestination(options: {
17
17
  }): Writable;
18
18
  export type SQL_MODE = number;
19
19
  export namespace SQL_MODE {
20
- let INSERT_MODE: number;
21
- let UPDATE_MODE: number;
20
+ const INSERT_MODE: number;
21
+ const UPDATE_MODE: number;
22
22
  }
23
23
  import { Writable } from "stream";
24
24
  //# sourceMappingURL=sqlFileDestination.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sqlFileDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/sqlFileDestination.js"],"names":[],"mappings":"AAWA;;;;;;;;;GASG;AACH,4CAPG;IAAwB,QAAQ;IACN,IAAI,EAAtB,QAAQ;IACQ,KAAK;IACN,OAAO;IACL,aAAa;CACtC,YA4CF;uBA3DS,MAAM"}
1
+ {"version":3,"file":"sqlFileDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/sqlFileDestination.js"],"names":[],"mappings":"AAWA;;;;;;;;;GASG;AACH;IAP2B,QAAQ;IACN,IAAI,EAAtB,QAAQ;IACQ,KAAK;IACN,OAAO;IACL,aAAa;aA6CxC;uBA3DS,MAAM"}
@@ -16,10 +16,10 @@ export class Etl {
16
16
  validatorList: any[];
17
17
  transformationList: any[];
18
18
  destinationList: any[];
19
- loader: (loader: any) => this;
20
- pump: () => this;
21
- validator: (validator: any) => this;
22
- destination: (destination: any) => this;
23
- transform: (transform: any) => this;
19
+ loader: (loader: any) => Etl;
20
+ pump: () => Etl;
21
+ validator: (validator: any) => Etl;
22
+ destination: (destination: any) => Etl;
23
+ transform: (transform: any) => Etl;
24
24
  }
25
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/index.js"],"names":[],"mappings":";AAMA;;;;;;;GAOG;AAEH;;;GAGG;AACH,4BA2CC;;IAxCG,qBAAuB;IACvB,0BAA4B;IAC5B,uBAAyB;IAEzB,8BAGC;IAED,iBAaC;IAED,oCAGC;IAED,wCAGC;IAED,oCAGC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/index.js"],"names":[],"mappings":";AAMA;;;;;;;GAOG;AAEH;;;GAGG;AACH,4BA2CC;;IAxCG,qBAAuB;IACvB,0BAA4B;IAC5B,uBAAyB;IAEzB,6BAGC;IAED,gBAaC;IAED,mCAGC;IAED,uCAGC;IAED,mCAGC"}
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  /**
2
3
  *
3
4
  * @param {Object} options
@@ -1 +1 @@
1
- {"version":3,"file":"csvloader.d.ts","sourceRoot":"","sources":["../../../../src/loaders/csvloader.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,mCAHG;IAAwB,IAAI;CAC5B,iBAuBF"}
1
+ {"version":3,"file":"csvloader.d.ts","sourceRoot":"","sources":["../../../../src/loaders/csvloader.js"],"names":[],"mappings":";AAMA;;;;;GAKG;AACH;IAH2B,IAAI;kBAwB9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"fakerTransformer.d.ts","sourceRoot":"","sources":["../../../../src/transformers/fakerTransformer.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,0CAXG;IAAuB,OAAO;IAQN,MAAM;CAC9B,aA6BF;;IAzCD;;;;;;;;;;;;;OAaG;IACH,qBAXG;QAAuB,OAAO;QAQN,MAAM;KAC9B,EA6BF;IAzBG,eAA8B"}
1
+ {"version":3,"file":"fakerTransformer.d.ts","sourceRoot":"","sources":["../../../../src/transformers/fakerTransformer.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH;IAX0B,OAAO;IAQN,MAAM;cA8BhC;;IAzCD;;;;;;;;;;;;;OAaG;IACH;QAX0B,OAAO;QAQN,MAAM;OA8BhC;IAzBG,eAA8B"}
@@ -1,4 +1,5 @@
1
+ import { StringReplaceTransformer } from "./stringReplaceTransformer";
1
2
  import { ToUpperCaseTransformer } from "./toUpperCaseTransformer";
2
3
  import { FakerTransformer } from "./fakerTransformer";
3
- export { ToUpperCaseTransformer, FakerTransformer };
4
+ export { StringReplaceTransformer, ToUpperCaseTransformer, FakerTransformer };
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ *
3
+ * @param {Object} options
4
+ * @param {String} options.column
5
+ * @returns Writable
6
+ */
7
+ export function StringReplaceTransformer(options: {
8
+ column: string;
9
+ }): Transform;
10
+ export class StringReplaceTransformer {
11
+ /**
12
+ *
13
+ * @param {Object} options
14
+ * @param {String} options.column
15
+ * @returns Writable
16
+ */
17
+ constructor(options: {
18
+ column: string;
19
+ });
20
+ replacements: {
21
+ column: string;
22
+ };
23
+ }
24
+ import { Transform } from "stream";
25
+ //# sourceMappingURL=stringReplaceTransformer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringReplaceTransformer.d.ts","sourceRoot":"","sources":["../../../../src/transformers/stringReplaceTransformer.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH;IAH2B,MAAM;cAqBhC;;IAxBD;;;;;OAKG;IACH;QAH2B,MAAM;OAqBhC;IAhBG;;MAA2B"}
@@ -1 +1 @@
1
- {"version":3,"file":"toUpperCaseTransformer.d.ts","sourceRoot":"","sources":["../../../../src/transformers/toUpperCaseTransformer.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,gDAHG;IAAwB,MAAM;CAC9B,aAgBF;;IApBD;;;;;OAKG;IACH,qBAHG;QAAwB,MAAM;KAC9B,EAgBF;IAZG,eAA4B"}
1
+ {"version":3,"file":"toUpperCaseTransformer.d.ts","sourceRoot":"","sources":["../../../../src/transformers/toUpperCaseTransformer.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH;IAH2B,MAAM;cAiBhC;;IApBD;;;;;OAKG;IACH;QAH2B,MAAM;OAiBhC;IAZG,eAA4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"multiToolValidator.d.ts","sourceRoot":"","sources":["../../../../src/validators/multiToolValidator.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,4CAfG;IAAuB,OAAO;CAa9B,aAyBF"}
1
+ {"version":3,"file":"multiToolValidator.d.ts","sourceRoot":"","sources":["../../../../src/validators/multiToolValidator.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH;IAf0B,OAAO;cAsChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"requiredValidator.d.ts","sourceRoot":"","sources":["../../../../src/validators/requiredValidator.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,2CAJG;IAAwB,OAAO;IACR,OAAO;CAC9B,aAsBF"}
1
+ {"version":3,"file":"requiredValidator.d.ts","sourceRoot":"","sources":["../../../../src/validators/requiredValidator.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH;IAJ2B,OAAO;IACR,OAAO;cAuBhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"uniqueValidator.d.ts","sourceRoot":"","sources":["../../../../src/validators/uniqueValidator.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,yCAJG;IAAwB,OAAO;IACP,MAAM;CAC9B,aA6BF;;IAlCD;;;;;;OAMG;IACH,qBAJG;QAAwB,OAAO;QACP,MAAM;KAC9B,EA6BF;IAzBG,eAA4B;IAC5B,gBAAwF;IACxF,wBAA0B"}
1
+ {"version":3,"file":"uniqueValidator.d.ts","sourceRoot":"","sources":["../../../../src/validators/uniqueValidator.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH;IAJ2B,OAAO;IACP,MAAM;cA8BhC;;IAlCD;;;;;;OAMG;IACH;QAJ2B,OAAO;QACP,MAAM;OA8BhC;IAzBG,eAA4B;IAC5B,gBAAwF;IACxF,wBAA0B"}
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const { Writable } = require("node:stream");
3
4
  /**
4
5
  *
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const EventEmitter = require('node:events');
3
4
  const util = require('node:util');
4
5
  const { Writable } = require("node:stream");
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const { ConsoleDestination } = require("./consoleDestination");
3
4
  const { SQLFileDestination, SQL_MODE } = require("./sqlFileDestination");
4
5
  const { CSVFileDestination } = require("./csvFileDestination");
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const EventEmitter = require('node:events');
3
4
  const util = require('node:util');
4
5
  const { Transform } = require('node:stream');
@@ -104,7 +105,7 @@ function PostgresDestination(options) {
104
105
  chunk.errors.push(error);
105
106
  lastChunk = chunk;
106
107
  // @ts-ignore
107
- callback(null, chunk);
108
+ callback(error, chunk);
108
109
  });
109
110
  }
110
111
  else {
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const { Writable } = require("node:stream");
3
4
  const fs = require("fs");
4
5
  /**
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const Validators = require("./validators");
3
4
  const Transformers = require("./transformers");
4
5
  const Loaders = require("./loaders");
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  // @ts-nocheck
3
4
  const EventEmitter = require('node:events');
4
5
  const util = require('node:util');
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  // @ts-nocheck
3
4
  const { Transform } = require("stream");
4
5
  const util = require("util");
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  // @ts-nocheck
3
4
  const fs = require("fs");
4
5
  const { Transform } = require("stream");
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const { CSVLoader } = require("./csvloader");
3
4
  module.exports = {
4
5
  CSVLoader
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const { Transform } = require("node:stream");
3
4
  /**
4
5
  *
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const { ToUpperCaseTransformer } = require("./toUpperCaseTransformer");
3
4
  const { FakerTransformer } = require("./fakerTransformer");
5
+ const { StringReplaceTransformer } = require("./stringReplaceTransformer");
4
6
  module.exports = {
7
+ StringReplaceTransformer,
5
8
  ToUpperCaseTransformer,
6
9
  FakerTransformer
7
10
  };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const { Transform } = require("node:stream");
4
+ /**
5
+ *
6
+ * @param {Object} options
7
+ * @param {String} options.column
8
+ * @returns Writable
9
+ */
10
+ function StringReplaceTransformer(options) {
11
+ let self = this;
12
+ self.replacements = options;
13
+ return new Transform({
14
+ readableObjectMode: true,
15
+ writableObjectMode: true,
16
+ transform(chunk, _, callback) {
17
+ const { _columns } = chunk;
18
+ // @ts-ignore
19
+ self.replacements.forEach(r => {
20
+ const colIndex = _columns.indexOf(r.column);
21
+ chunk[colIndex] = chunk[colIndex].replace(r.find, r.replace);
22
+ });
23
+ callback(null, chunk);
24
+ }
25
+ });
26
+ }
27
+ module.exports = {
28
+ StringReplaceTransformer
29
+ };
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const { Transform } = require("node:stream");
3
4
  /**
4
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"consoleDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/consoleDestination.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,4CAHG;IAAwB,aAAa;CACrC,YAYF"}
1
+ {"version":3,"file":"consoleDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/consoleDestination.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH;IAH2B,aAAa;aAavC"}
@@ -1 +1 @@
1
- {"version":3,"file":"csvFileDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/csvFileDestination.js"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,4CANG;IAAwB,QAAQ;IACP,OAAO;IACP,aAAa;IACb,cAAc;CACvC,YAwCF"}
1
+ {"version":3,"file":"csvFileDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/csvFileDestination.js"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH;IAN2B,QAAQ;IACP,OAAO;IACP,aAAa;IACb,cAAc;aAyCzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"postgresDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/postgresDestination.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;GAYG;AACH,6CAVG;IAAwB,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,aAAa;CACrC,aAoGF"}
1
+ {"version":3,"file":"postgresDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/postgresDestination.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;GAYG;AACH;IAV2B,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,aAAa;cAqGvC"}
@@ -17,8 +17,8 @@ export function SQLFileDestination(options: {
17
17
  }): Writable;
18
18
  export type SQL_MODE = number;
19
19
  export namespace SQL_MODE {
20
- let INSERT_MODE: number;
21
- let UPDATE_MODE: number;
20
+ const INSERT_MODE: number;
21
+ const UPDATE_MODE: number;
22
22
  }
23
23
  import { Writable } from "stream";
24
24
  //# sourceMappingURL=sqlFileDestination.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sqlFileDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/sqlFileDestination.js"],"names":[],"mappings":"AAWA;;;;;;;;;GASG;AACH,4CAPG;IAAwB,QAAQ;IACN,IAAI,EAAtB,QAAQ;IACQ,KAAK;IACN,OAAO;IACL,aAAa;CACtC,YA4CF;uBA3DS,MAAM"}
1
+ {"version":3,"file":"sqlFileDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/sqlFileDestination.js"],"names":[],"mappings":"AAWA;;;;;;;;;GASG;AACH;IAP2B,QAAQ;IACN,IAAI,EAAtB,QAAQ;IACQ,KAAK;IACN,OAAO;IACL,aAAa;aA6CxC;uBA3DS,MAAM"}
@@ -16,10 +16,10 @@ export class Etl {
16
16
  validatorList: any[];
17
17
  transformationList: any[];
18
18
  destinationList: any[];
19
- loader: (loader: any) => this;
20
- pump: () => this;
21
- validator: (validator: any) => this;
22
- destination: (destination: any) => this;
23
- transform: (transform: any) => this;
19
+ loader: (loader: any) => Etl;
20
+ pump: () => Etl;
21
+ validator: (validator: any) => Etl;
22
+ destination: (destination: any) => Etl;
23
+ transform: (transform: any) => Etl;
24
24
  }
25
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/index.js"],"names":[],"mappings":";AAMA;;;;;;;GAOG;AAEH;;;GAGG;AACH,4BA2CC;;IAxCG,qBAAuB;IACvB,0BAA4B;IAC5B,uBAAyB;IAEzB,8BAGC;IAED,iBAaC;IAED,oCAGC;IAED,wCAGC;IAED,oCAGC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/index.js"],"names":[],"mappings":";AAMA;;;;;;;GAOG;AAEH;;;GAGG;AACH,4BA2CC;;IAxCG,qBAAuB;IACvB,0BAA4B;IAC5B,uBAAyB;IAEzB,6BAGC;IAED,gBAaC;IAED,mCAGC;IAED,uCAGC;IAED,mCAGC"}
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  /**
2
3
  *
3
4
  * @param {Object} options
@@ -1 +1 @@
1
- {"version":3,"file":"csvloader.d.ts","sourceRoot":"","sources":["../../../../src/loaders/csvloader.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,mCAHG;IAAwB,IAAI;CAC5B,iBAuBF"}
1
+ {"version":3,"file":"csvloader.d.ts","sourceRoot":"","sources":["../../../../src/loaders/csvloader.js"],"names":[],"mappings":";AAMA;;;;;GAKG;AACH;IAH2B,IAAI;kBAwB9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"fakerTransformer.d.ts","sourceRoot":"","sources":["../../../../src/transformers/fakerTransformer.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,0CAXG;IAAuB,OAAO;IAQN,MAAM;CAC9B,aA6BF;;IAzCD;;;;;;;;;;;;;OAaG;IACH,qBAXG;QAAuB,OAAO;QAQN,MAAM;KAC9B,EA6BF;IAzBG,eAA8B"}
1
+ {"version":3,"file":"fakerTransformer.d.ts","sourceRoot":"","sources":["../../../../src/transformers/fakerTransformer.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH;IAX0B,OAAO;IAQN,MAAM;cA8BhC;;IAzCD;;;;;;;;;;;;;OAaG;IACH;QAX0B,OAAO;QAQN,MAAM;OA8BhC;IAzBG,eAA8B"}
@@ -1,4 +1,5 @@
1
+ import { StringReplaceTransformer } from "./stringReplaceTransformer";
1
2
  import { ToUpperCaseTransformer } from "./toUpperCaseTransformer";
2
3
  import { FakerTransformer } from "./fakerTransformer";
3
- export { ToUpperCaseTransformer, FakerTransformer };
4
+ export { StringReplaceTransformer, ToUpperCaseTransformer, FakerTransformer };
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ *
3
+ * @param {Object} options
4
+ * @param {String} options.column
5
+ * @returns Writable
6
+ */
7
+ export function StringReplaceTransformer(options: {
8
+ column: string;
9
+ }): Transform;
10
+ export class StringReplaceTransformer {
11
+ /**
12
+ *
13
+ * @param {Object} options
14
+ * @param {String} options.column
15
+ * @returns Writable
16
+ */
17
+ constructor(options: {
18
+ column: string;
19
+ });
20
+ replacements: {
21
+ column: string;
22
+ };
23
+ }
24
+ import { Transform } from "stream";
25
+ //# sourceMappingURL=stringReplaceTransformer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringReplaceTransformer.d.ts","sourceRoot":"","sources":["../../../../src/transformers/stringReplaceTransformer.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH;IAH2B,MAAM;cAqBhC;;IAxBD;;;;;OAKG;IACH;QAH2B,MAAM;OAqBhC;IAhBG;;MAA2B"}
@@ -1 +1 @@
1
- {"version":3,"file":"toUpperCaseTransformer.d.ts","sourceRoot":"","sources":["../../../../src/transformers/toUpperCaseTransformer.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,gDAHG;IAAwB,MAAM;CAC9B,aAgBF;;IApBD;;;;;OAKG;IACH,qBAHG;QAAwB,MAAM;KAC9B,EAgBF;IAZG,eAA4B"}
1
+ {"version":3,"file":"toUpperCaseTransformer.d.ts","sourceRoot":"","sources":["../../../../src/transformers/toUpperCaseTransformer.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH;IAH2B,MAAM;cAiBhC;;IApBD;;;;;OAKG;IACH;QAH2B,MAAM;OAiBhC;IAZG,eAA4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"multiToolValidator.d.ts","sourceRoot":"","sources":["../../../../src/validators/multiToolValidator.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,4CAfG;IAAuB,OAAO;CAa9B,aAyBF"}
1
+ {"version":3,"file":"multiToolValidator.d.ts","sourceRoot":"","sources":["../../../../src/validators/multiToolValidator.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH;IAf0B,OAAO;cAsChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"requiredValidator.d.ts","sourceRoot":"","sources":["../../../../src/validators/requiredValidator.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,2CAJG;IAAwB,OAAO;IACR,OAAO;CAC9B,aAsBF"}
1
+ {"version":3,"file":"requiredValidator.d.ts","sourceRoot":"","sources":["../../../../src/validators/requiredValidator.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH;IAJ2B,OAAO;IACR,OAAO;cAuBhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"uniqueValidator.d.ts","sourceRoot":"","sources":["../../../../src/validators/uniqueValidator.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,yCAJG;IAAwB,OAAO;IACP,MAAM;CAC9B,aA6BF;;IAlCD;;;;;;OAMG;IACH,qBAJG;QAAwB,OAAO;QACP,MAAM;KAC9B,EA6BF;IAzBG,eAA4B;IAC5B,gBAAwF;IACxF,wBAA0B"}
1
+ {"version":3,"file":"uniqueValidator.d.ts","sourceRoot":"","sources":["../../../../src/validators/uniqueValidator.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH;IAJ2B,OAAO;IACP,MAAM;cA8BhC;;IAlCD;;;;;;OAMG;IACH;QAJ2B,OAAO;QACP,MAAM;OA8BhC;IAzBG,eAA4B;IAC5B,gBAAwF;IACxF,wBAA0B"}
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const { RequiredValidator } = require("./requiredValidator");
3
4
  const { UniqueValidator } = require("./uniqueValidator");
4
5
  const { MultiToolValidator } = require("./multiToolValidator");
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  // @ts-nocheck
3
4
  const { Transform } = require("stream");
4
5
  const validator = require('validator');
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  // @ts-nocheck
3
4
  const { Transform } = require("stream");
4
5
  /**
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  const { Transform } = require("node:stream");
3
4
  /**
4
5
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ffc-pay-etl-framework",
3
- "version": "0.0.11",
3
+ "version": "0.1.12",
4
4
  "publisher": "Defra",
5
5
  "main": "dist/cjs/index.js",
6
6
  "private": false,
@@ -25,12 +25,42 @@
25
25
  "jest": {
26
26
  "setupFiles": [
27
27
  "<rootDir>/jest/setEnvVars.js"
28
+ ],
29
+ "collectCoverage": true,
30
+ "collectCoverageFrom": [
31
+ "**/*.js",
32
+ "!**/*.test.js"
33
+ ],
34
+ "coverageDirectory": "test-output",
35
+ "coverageReporters": [
36
+ "text-summary",
37
+ "lcov"
38
+ ],
39
+ "coveragePathIgnorePatterns": [
40
+ "<rootDir>/node_modules/",
41
+ "<rootDir>/test-output/",
42
+ "<rootDir>/test/"
43
+ ],
44
+ "modulePathIgnorePatterns": [
45
+ "node_modules"
46
+ ],
47
+ "reporters": [
48
+ "default",
49
+ [
50
+ "jest-junit",
51
+ {
52
+ "suiteName": "jest tests",
53
+ "outputDirectory": "test-output",
54
+ "outputName": "junit.xml"
55
+ }
56
+ ]
28
57
  ]
29
58
  },
30
59
  "devDependencies": {
31
60
  "all-contributors-cli": "^6.26.1",
32
61
  "debug": "^4.3.6",
33
62
  "jest": "^29.7.0",
63
+ "jest-junit": "^16.0.0",
34
64
  "nodemon": "^3.1.4",
35
65
  "prettier": "3.3.3",
36
66
  "supports-color": "^9.4.0"
@@ -44,9 +74,8 @@
44
74
  "pg": "^8.12.0",
45
75
  "pg-hstore": "^2.3.4",
46
76
  "sequelize": "^6.37.3",
47
- "sqlite3": "^5.1.7",
48
77
  "tedious": "^18.2.4",
49
- "typescript": "^5.5.3",
78
+ "typescript": "^4.0.0",
50
79
  "validator": "^13.12.0"
51
80
  },
52
81
  "files": [