@felloh-org/lambda-wrapper 1.0.30 → 1.0.33

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.
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _typeorm = require("typeorm");
9
9
 
10
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10;
10
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11;
11
11
 
12
12
  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
13
13
 
@@ -38,11 +38,14 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
38
38
  type: "varchar",
39
39
  length: 50
40
40
  }), _dec9 = (0, _typeorm.Column)({
41
+ type: "varchar",
42
+ length: 50
43
+ }), _dec10 = (0, _typeorm.Column)({
41
44
  type: "int",
42
45
  nullable: true
43
- }), _dec10 = (0, _typeorm.Column)({
44
- type: "timestamp without time zone"
45
46
  }), _dec11 = (0, _typeorm.Column)({
47
+ type: "timestamp without time zone"
48
+ }), _dec12 = (0, _typeorm.Column)({
46
49
  type: "varchar",
47
50
  length: 1500
48
51
  }), _dec(_class = (_class2 = class Transaction {
@@ -61,11 +64,13 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
61
64
 
62
65
  _initializerDefineProperty(this, "merchant_account_id", _descriptor7, this);
63
66
 
64
- _initializerDefineProperty(this, "status", _descriptor8, this);
67
+ _initializerDefineProperty(this, "test", _descriptor8, this);
65
68
 
66
- _initializerDefineProperty(this, "processing_time", _descriptor9, this);
69
+ _initializerDefineProperty(this, "status", _descriptor9, this);
67
70
 
68
- _initializerDefineProperty(this, "merchant_name", _descriptor10, this);
71
+ _initializerDefineProperty(this, "processing_time", _descriptor10, this);
72
+
73
+ _initializerDefineProperty(this, "merchant_name", _descriptor11, this);
69
74
  }
70
75
 
71
76
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "ndc", [_dec2], {
@@ -105,19 +110,24 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
105
110
  enumerable: true,
106
111
  writable: true,
107
112
  initializer: null
108
- }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "status", [_dec9], {
113
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "test", [_dec9], {
114
+ configurable: true,
115
+ enumerable: true,
116
+ writable: true,
117
+ initializer: null
118
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "status", [_dec10], {
109
119
  configurable: true,
110
120
  enumerable: true,
111
121
  writable: true,
112
122
  initializer: null
113
- }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "processing_time", [_dec10], {
123
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "processing_time", [_dec11], {
114
124
  configurable: true,
115
125
  enumerable: true,
116
126
  writable: true,
117
127
  initializer: function () {
118
128
  return null;
119
129
  }
120
- }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "merchant_name", [_dec11], {
130
+ }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "merchant_name", [_dec12], {
121
131
  configurable: true,
122
132
  enumerable: true,
123
133
  writable: true,
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _typeorm = require("typeorm");
9
+
10
+ var _merchant = _interopRequireDefault(require("../merchant"));
11
+
12
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7;
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
17
+
18
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
19
+
20
+ function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
21
+
22
+ let AccountFees = (_dec = (0, _typeorm.Entity)({
23
+ name: 'account_fees',
24
+ schema: 'trust_payments'
25
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.ManyToOne)(() => _merchant.default), _dec4 = (0, _typeorm.JoinColumn)({
26
+ name: 'merchant_number',
27
+ referencedColumnName: 'merchant_number'
28
+ }), _dec5 = (0, _typeorm.Column)({
29
+ type: "int"
30
+ }), _dec6 = (0, _typeorm.Column)({
31
+ type: "varchar",
32
+ length: 100
33
+ }), _dec7 = (0, _typeorm.Column)({
34
+ type: "varchar",
35
+ length: 5
36
+ }), _dec8 = (0, _typeorm.Column)({
37
+ type: "date"
38
+ }), _dec9 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class AccountFees {
39
+ constructor() {
40
+ _initializerDefineProperty(this, "id", _descriptor, this);
41
+
42
+ _initializerDefineProperty(this, "merchant_number", _descriptor2, this);
43
+
44
+ _initializerDefineProperty(this, "amount", _descriptor3, this);
45
+
46
+ _initializerDefineProperty(this, "type", _descriptor4, this);
47
+
48
+ _initializerDefineProperty(this, "currency", _descriptor5, this);
49
+
50
+ _initializerDefineProperty(this, "posting_date", _descriptor6, this);
51
+
52
+ _initializerDefineProperty(this, "created_at", _descriptor7, this);
53
+ }
54
+
55
+ }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
56
+ configurable: true,
57
+ enumerable: true,
58
+ writable: true,
59
+ initializer: function () {
60
+ return undefined;
61
+ }
62
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "merchant_number", [_dec3, _dec4], {
63
+ configurable: true,
64
+ enumerable: true,
65
+ writable: true,
66
+ initializer: function () {
67
+ return _merchant.default;
68
+ }
69
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "amount", [_dec5], {
70
+ configurable: true,
71
+ enumerable: true,
72
+ writable: true,
73
+ initializer: null
74
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "type", [_dec6], {
75
+ configurable: true,
76
+ enumerable: true,
77
+ writable: true,
78
+ initializer: null
79
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "currency", [_dec7], {
80
+ configurable: true,
81
+ enumerable: true,
82
+ writable: true,
83
+ initializer: null
84
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "posting_date", [_dec8], {
85
+ configurable: true,
86
+ enumerable: true,
87
+ writable: true,
88
+ initializer: null
89
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec9], {
90
+ configurable: true,
91
+ enumerable: true,
92
+ writable: true,
93
+ initializer: null
94
+ })), _class2)) || _class);
95
+ exports.default = AccountFees;
@@ -17,8 +17,10 @@ var _ingestedData = _interopRequireDefault(require("./ingested-data"));
17
17
 
18
18
  var _transactionCharges = _interopRequireDefault(require("./transaction-charges"));
19
19
 
20
+ var _accountFees = _interopRequireDefault(require("./account-fees"));
21
+
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
23
 
22
- const ENTITIES = [_batch.default, _merchant.default, _transaction.default, _chargeback.default, _ingestedData.default, _transactionCharges.default];
24
+ const ENTITIES = [_batch.default, _merchant.default, _transaction.default, _chargeback.default, _ingestedData.default, _transactionCharges.default, _accountFees.default];
23
25
  var _default = ENTITIES;
24
26
  exports.default = _default;
package/dist/index.js CHANGED
@@ -213,6 +213,12 @@ Object.defineProperty(exports, "SupplierTypeEntity", {
213
213
  return _supplierType.default;
214
214
  }
215
215
  });
216
+ Object.defineProperty(exports, "TPAccountFees", {
217
+ enumerable: true,
218
+ get: function () {
219
+ return _accountFees.default;
220
+ }
221
+ });
216
222
  Object.defineProperty(exports, "TPBatchEntity", {
217
223
  enumerable: true,
218
224
  get: function () {
@@ -424,6 +430,8 @@ var _ingestedData = _interopRequireDefault(require("./entity/trust-payments/inge
424
430
 
425
431
  var _transactionCharges = _interopRequireDefault(require("./entity/trust-payments/transaction-charges"));
426
432
 
433
+ var _accountFees = _interopRequireDefault(require("./entity/trust-payments/account-fees"));
434
+
427
435
  var _organisation = _interopRequireDefault(require("./entity/user/organisation"));
428
436
 
429
437
  var _role = _interopRequireDefault(require("./entity/user/role"));
@@ -0,0 +1,15 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class trustAccountFees1648717679150 {
4
+ name = 'trustAccountFees1648717679150'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`CREATE TABLE "trust_payments"."account_fees" ("id" character varying NOT NULL, "amount" integer NOT NULL, "type" character varying(100) NOT NULL, "currency" character varying(5) NOT NULL, "posting_date" date NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "merchant_number" character varying(150), CONSTRAINT "PK_d66a2e25724203908299e86838c" PRIMARY KEY ("id"))`);
8
+ await queryRunner.query(`ALTER TABLE "trust_payments"."account_fees" ADD CONSTRAINT "FK_0e136cdae3f87e4cb66d856d6f4" FOREIGN KEY ("merchant_number") REFERENCES "trust_payments"."merchant"("merchant_number") ON DELETE NO ACTION ON UPDATE NO ACTION`);
9
+ }
10
+
11
+ async down(queryRunner) {
12
+ await queryRunner.query(`ALTER TABLE "trust_payments"."account_fees" DROP CONSTRAINT "FK_0e136cdae3f87e4cb66d856d6f4"`);
13
+ await queryRunner.query(`DROP TABLE "trust_payments"."account_fees"`);
14
+ }
15
+ }
@@ -55,6 +55,16 @@ class Warehouse extends _dependencyAware.default {
55
55
 
56
56
  return this.connection;
57
57
  }
58
+ /**
59
+ * Check that a connection can be made to the DB
60
+ * @returns {Promise<void>}
61
+ */
62
+
63
+
64
+ async status() {
65
+ await this.connect();
66
+ await this.connection.manager.query('SELECT schema_name FROM information_schema.schemata');
67
+ }
58
68
 
59
69
  }
60
70
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.0.30",
3
+ "version": "1.0.33",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -21,47 +21,48 @@
21
21
  "author": "Felloh",
22
22
  "license": "MIT",
23
23
  "devDependencies": {
24
- "@babel/cli": "^7.12.10",
25
- "@babel/core": "^7.12.10",
26
- "@babel/eslint-parser": "^7.16.5",
27
- "@babel/node": "^7.12.10",
28
- "@babel/plugin-proposal-decorators": "^7.16.7",
24
+ "@babel/cli": "^7.17.6",
25
+ "@babel/core": "^7.17.9",
26
+ "@babel/eslint-parser": "^7.17.0",
27
+ "@babel/node": "^7.16.8",
28
+ "@babel/plugin-proposal-decorators": "^7.17.9",
29
29
  "@babel/plugin-proposal-optional-chaining": "^7.16.7",
30
- "@babel/plugin-syntax-flow": "^7.12.1",
31
- "@babel/plugin-transform-flow-strip-types": "^7.12.10",
32
- "@babel/preset-env": "^7.12.11",
30
+ "@babel/plugin-syntax-flow": "^7.16.7",
31
+ "@babel/plugin-transform-flow-strip-types": "^7.16.7",
32
+ "@babel/preset-env": "^7.16.11",
33
33
  "@felloh-org/eslint-config": "^1.0.2",
34
- "@types/jest": "^26.0.20",
35
- "aws-sdk": ">=2.831.0",
34
+ "@types/jest": "^27.4.1",
35
+ "aws-sdk": "^2.1111.0",
36
36
  "babel-eslint": "^10.1.0",
37
- "babel-jest": "^26.3.3",
37
+ "babel-jest": "^27.5.1",
38
38
  "babel-plugin-module-resolver": "^4.1.0",
39
39
  "babel-plugin-transform-class-properties": "^6.24.1",
40
- "eslint": "^8.6.0",
40
+ "eslint": "^8.13.0",
41
41
  "eslint-plugin-flowtype": "^8.0.3",
42
- "eslint-plugin-import": "^2.25.3",
43
- "eslint-plugin-sonarjs": "^0.11.0",
44
- "eslint-plugin-unicorn": "^39.0.0",
45
- "jest": "^26.6.3",
42
+ "eslint-plugin-import": "^2.26.0",
43
+ "eslint-plugin-sonarjs": "^0.13.0",
44
+ "eslint-plugin-unicorn": "^42.0.0",
45
+ "jest": "^27.5.1",
46
46
  "nyc": "^15.1.0",
47
- "semantic-release": "^17.3.7",
48
- "transform-class-properties": "^1.0.0-beta"
47
+ "semantic-release": "^19.0.2",
48
+ "transform-class-properties": "^1.0.0-beta",
49
+ "yarn-upgrade-all": "^0.7.1"
49
50
  },
50
51
  "peerDependencies": {
51
52
  "aws-sdk": ">=2.831.0"
52
53
  },
53
54
  "dependencies": {
54
- "alai": "1.0.3",
55
- "async": "^3.2.0",
56
- "axios": "^0.21.1",
57
- "dotenv": "^11.0.0",
58
- "epsagon": "^1.104.2",
59
- "typeorm": "^0.2.41",
60
- "typeorm-aurora-data-api-driver": "^2.3.5",
61
- "useragent": "2.3.0",
62
- "uuid": "^8.2.0",
63
- "validate.js": "0.13.1",
64
- "winston": "^3.3.3",
55
+ "alai": "^1.0.3",
56
+ "async": "^3.2.3",
57
+ "axios": "^0.26.1",
58
+ "dotenv": "^16.0.0",
59
+ "epsagon": "^1.121.3",
60
+ "typeorm": "^0.3.5",
61
+ "typeorm-aurora-data-api-driver": "^2.4.1",
62
+ "useragent": "^2.3.0",
63
+ "uuid": "^8.3.2",
64
+ "validate.js": "^0.13.1",
65
+ "winston": "^3.7.2",
65
66
  "xml2js": "^0.4.23"
66
67
  },
67
68
  "publishConfig": {