ffc-pay-etl-framework 1.1.0-alpha.2 → 1.1.0-alpha.6

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.
@@ -1,6 +1,5 @@
1
1
  const EventEmitter = require('node:events');
2
2
  const { Transform } = require('node:stream');
3
- const { Sequelize } = require('sequelize');
4
3
  const debug = require('debug')('destination');
5
4
  const DEFAULT_PORT = 5432;
6
5
  function isKeyWord(column) {
@@ -109,6 +108,7 @@ function PostgresDestination(options) {
109
108
  }
110
109
  });
111
110
  Object.assign(Transform.prototype, {
111
+ type: 'PostgresDestination',
112
112
  setConnection: function (connection) {
113
113
  this.connection = connection;
114
114
  }.bind(transform),
@@ -3,6 +3,7 @@ const EventEmitter = require('node:events');
3
3
  const util = require('node:util');
4
4
  const { RowMetaData } = require("./rowMetaData");
5
5
  const { compose } = require("node:stream");
6
+ const { Destinations } = require('..');
6
7
  /**
7
8
  * @typedef {Object} Etl
8
9
  * @function loader
@@ -65,6 +66,9 @@ function Etl() {
65
66
  if (connection) {
66
67
  destination.setConnection(connection);
67
68
  }
69
+ else if (destination.type === 'PostgresDestination') {
70
+ throw new Error(`No connection could be found with name ${connectionname}`);
71
+ }
68
72
  if (tasks) {
69
73
  for (const task of tasks) {
70
74
  task.setETL(self);
@@ -1 +1 @@
1
- {"version":3,"file":"postgresDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/postgresDestination.js"],"names":[],"mappings":"AA0DA;;;;;;;;GAQG;AACH;IAN2B,KAAK;IACL,cAAc;IACd,OAAO;IACP,aAAa;cA+DvC;AAxGD,yFAiCC;AAlDD,gDAEC;AAED,oEAGC;AAED,2DAEC;AAED,uDAEC"}
1
+ {"version":3,"file":"postgresDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/postgresDestination.js"],"names":[],"mappings":"AAyDA;;;;;;;;GAQG;AACH;IAN2B,KAAK;IACL,cAAc;IACd,OAAO;IACP,aAAa;cAgEvC;AAzGD,yFAiCC;AAlDD,gDAEC;AAED,oEAGC;AAED,2DAEC;AAED,uDAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/index.js"],"names":[],"mappings":";AAMA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,4BA+EC;;IA5EG,aAAe;IACf,qBAAuB;IACvB,sBAAwB;IACxB,qBAAuB;IACvB,0BAA4B;IAC5B,uBAAyB;IAEzB,6BAGC;IAED,gBAgBC;IAED,sCAUC;IAED,qCAGC;IAED,mCAGC;IAED,wDAgBC;IAED,mCAGC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/index.js"],"names":[],"mappings":";AAOA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,4BAgFC;;IA7EG,aAAe;IACf,qBAAuB;IACvB,sBAAwB;IACxB,qBAAuB;IACvB,0BAA4B;IAC5B,uBAAyB;IAEzB,6BAGC;IAED,gBAgBC;IAED,sCAUC;IAED,qCAGC;IAED,mCAGC;IAED,wDAiBC;IAED,mCAGC"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const EventEmitter = require('node:events');
4
4
  const { Transform } = require('node:stream');
5
- const { Sequelize } = require('sequelize');
6
5
  const debug = require('debug')('destination');
7
6
  const DEFAULT_PORT = 5432;
8
7
  function isKeyWord(column) {
@@ -110,6 +109,7 @@ function PostgresDestination(options) {
110
109
  }
111
110
  });
112
111
  Object.assign(Transform.prototype, {
112
+ type: 'PostgresDestination',
113
113
  setConnection: function (connection) {
114
114
  this.connection = connection;
115
115
  }.bind(transform),
@@ -5,6 +5,7 @@ const EventEmitter = require('node:events');
5
5
  const util = require('node:util');
6
6
  const { RowMetaData } = require("./rowMetaData");
7
7
  const { compose } = require("node:stream");
8
+ const { Destinations } = require('..');
8
9
  /**
9
10
  * @typedef {Object} Etl
10
11
  * @function loader
@@ -67,6 +68,9 @@ function Etl() {
67
68
  if (connection) {
68
69
  destination.setConnection(connection);
69
70
  }
71
+ else if (destination.type === 'PostgresDestination') {
72
+ throw new Error(`No connection could be found with name ${connectionname}`);
73
+ }
70
74
  if (tasks) {
71
75
  for (const task of tasks) {
72
76
  task.setETL(self);
@@ -1 +1 @@
1
- {"version":3,"file":"postgresDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/postgresDestination.js"],"names":[],"mappings":"AA0DA;;;;;;;;GAQG;AACH;IAN2B,KAAK;IACL,cAAc;IACd,OAAO;IACP,aAAa;cA+DvC;AAxGD,yFAiCC;AAlDD,gDAEC;AAED,oEAGC;AAED,2DAEC;AAED,uDAEC"}
1
+ {"version":3,"file":"postgresDestination.d.ts","sourceRoot":"","sources":["../../../../src/destinations/postgresDestination.js"],"names":[],"mappings":"AAyDA;;;;;;;;GAQG;AACH;IAN2B,KAAK;IACL,cAAc;IACd,OAAO;IACP,aAAa;cAgEvC;AAzGD,yFAiCC;AAlDD,gDAEC;AAED,oEAGC;AAED,2DAEC;AAED,uDAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/index.js"],"names":[],"mappings":";AAMA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,4BA+EC;;IA5EG,aAAe;IACf,qBAAuB;IACvB,sBAAwB;IACxB,qBAAuB;IACvB,0BAA4B;IAC5B,uBAAyB;IAEzB,6BAGC;IAED,gBAgBC;IAED,sCAUC;IAED,qCAGC;IAED,mCAGC;IAED,wDAgBC;IAED,mCAGC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/index.js"],"names":[],"mappings":";AAOA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,4BAgFC;;IA7EG,aAAe;IACf,qBAAuB;IACvB,sBAAwB;IACxB,qBAAuB;IACvB,0BAA4B;IAC5B,uBAAyB;IAEzB,6BAGC;IAED,gBAgBC;IAED,sCAUC;IAED,qCAGC;IAED,mCAGC;IAED,wDAiBC;IAED,mCAGC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ffc-pay-etl-framework",
3
- "version": "1.1.0-alpha.2",
3
+ "version": "1.1.0-alpha.6",
4
4
  "publisher": "Defra",
5
5
  "main": "dist/cjs/index.js",
6
6
  "private": false,