@felloh-org/lambda-wrapper 1.11.85 → 1.11.87

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.
@@ -28,8 +28,6 @@ const run = async () => {
28
28
  await queryRunner.createSchema('acquirer', true);
29
29
  await queryRunner.createSchema('operations', true);
30
30
  await queryRunner.createSchema('basis_theory', true);
31
- await queryRunner.createSchema('hubspot', true);
32
- await queryRunner.createSchema('helpscout', true);
33
31
  await queryRunner.createSchema('aisp', true);
34
32
  } catch (error) {
35
33
  console.log(error);
@@ -13,7 +13,7 @@ var _user = _interopRequireDefault(require("../../user/user"));
13
13
 
14
14
  var _gocardlessAgreement = _interopRequireDefault(require("../gocardless-agreement"));
15
15
 
16
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8;
16
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9;
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
@@ -39,15 +39,19 @@ let Requisition = exports.default = (_dec = (0, _typeorm.Entity)({
39
39
  name: 'agreement_id',
40
40
  referencedColumnName: 'id'
41
41
  }), _dec9 = (0, _typeorm.Column)({
42
+ type: "varchar",
43
+ length: "250",
44
+ nullable: true
45
+ }), _dec10 = (0, _typeorm.Column)({
42
46
  type: "boolean",
43
47
  default: false
44
- }), _dec10 = (0, _typeorm.Column)({
48
+ }), _dec11 = (0, _typeorm.Column)({
45
49
  type: "timestamp with time zone",
46
50
  nullable: true
47
- }), _dec11 = (0, _typeorm.Column)({
51
+ }), _dec12 = (0, _typeorm.Column)({
48
52
  type: "timestamp with time zone",
49
53
  nullable: true
50
- }), _dec12 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Requisition {
54
+ }), _dec13 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Requisition {
51
55
  constructor() {
52
56
  _initializerDefineProperty(this, "id", _descriptor, this);
53
57
 
@@ -57,13 +61,15 @@ let Requisition = exports.default = (_dec = (0, _typeorm.Entity)({
57
61
 
58
62
  _initializerDefineProperty(this, "Agreement", _descriptor4, this);
59
63
 
60
- _initializerDefineProperty(this, "is_complete", _descriptor5, this);
64
+ _initializerDefineProperty(this, "institution_name", _descriptor5, this);
61
65
 
62
- _initializerDefineProperty(this, "initial_scrape_commenced_at", _descriptor6, this);
66
+ _initializerDefineProperty(this, "is_complete", _descriptor6, this);
63
67
 
64
- _initializerDefineProperty(this, "initial_scrape_completed_at", _descriptor7, this);
68
+ _initializerDefineProperty(this, "initial_scrape_commenced_at", _descriptor7, this);
65
69
 
66
- _initializerDefineProperty(this, "created_at", _descriptor8, this);
70
+ _initializerDefineProperty(this, "initial_scrape_completed_at", _descriptor8, this);
71
+
72
+ _initializerDefineProperty(this, "created_at", _descriptor9, this);
67
73
  }
68
74
 
69
75
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
@@ -94,24 +100,31 @@ let Requisition = exports.default = (_dec = (0, _typeorm.Entity)({
94
100
  initializer: function () {
95
101
  return _gocardlessAgreement.default;
96
102
  }
97
- }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "is_complete", [_dec9], {
103
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "institution_name", [_dec9], {
104
+ configurable: true,
105
+ enumerable: true,
106
+ writable: true,
107
+ initializer: function () {
108
+ return "";
109
+ }
110
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "is_complete", [_dec10], {
98
111
  configurable: true,
99
112
  enumerable: true,
100
113
  writable: true,
101
114
  initializer: function () {
102
115
  return false;
103
116
  }
104
- }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "initial_scrape_commenced_at", [_dec10], {
117
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "initial_scrape_commenced_at", [_dec11], {
105
118
  configurable: true,
106
119
  enumerable: true,
107
120
  writable: true,
108
121
  initializer: null
109
- }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "initial_scrape_completed_at", [_dec11], {
122
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "initial_scrape_completed_at", [_dec12], {
110
123
  configurable: true,
111
124
  enumerable: true,
112
125
  writable: true,
113
126
  initializer: null
114
- }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec12], {
127
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec13], {
115
128
  configurable: true,
116
129
  enumerable: true,
117
130
  writable: true,
@@ -15,7 +15,7 @@ var _disbursal = _interopRequireDefault(require("../../bank/disbursal"));
15
15
 
16
16
  var _booking = _interopRequireDefault(require("../../agent-data/booking"));
17
17
 
18
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15;
18
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _dec21, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16;
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
@@ -64,15 +64,19 @@ let Transaction = exports.default = (_dec = (0, _typeorm.Entity)({
64
64
  type: "varchar",
65
65
  length: "150",
66
66
  nullable: true
67
- }), _dec15 = (0, _typeorm.CreateDateColumn)({
67
+ }), _dec15 = (0, _typeorm.Column)({
68
+ type: "varchar",
69
+ length: "150",
70
+ nullable: true
71
+ }), _dec16 = (0, _typeorm.CreateDateColumn)({
68
72
  type: 'timestamp with time zone'
69
- }), _dec16 = (0, _typeorm.UpdateDateColumn)({
73
+ }), _dec17 = (0, _typeorm.UpdateDateColumn)({
70
74
  type: 'timestamp with time zone'
71
- }), _dec17 = (0, _typeorm.ManyToOne)(() => _disbursal.default), _dec18 = (0, _typeorm.JoinColumn)({
75
+ }), _dec18 = (0, _typeorm.ManyToOne)(() => _disbursal.default), _dec19 = (0, _typeorm.JoinColumn)({
72
76
  name: 'disbursal_id',
73
77
  referencedColumnName: 'id',
74
78
  nullable: true
75
- }), _dec19 = (0, _typeorm.ManyToOne)(() => _booking.default), _dec20 = (0, _typeorm.JoinColumn)({
79
+ }), _dec20 = (0, _typeorm.ManyToOne)(() => _booking.default), _dec21 = (0, _typeorm.JoinColumn)({
76
80
  name: 'booking_id',
77
81
  referencedColumnName: 'id'
78
82
  }), _dec(_class = (_class2 = class Transaction {
@@ -99,13 +103,15 @@ let Transaction = exports.default = (_dec = (0, _typeorm.Entity)({
99
103
 
100
104
  _initializerDefineProperty(this, "type", _descriptor11, this);
101
105
 
102
- _initializerDefineProperty(this, "created_at", _descriptor12, this);
106
+ _initializerDefineProperty(this, "type_code", _descriptor12, this);
103
107
 
104
- _initializerDefineProperty(this, "updated_at", _descriptor13, this);
108
+ _initializerDefineProperty(this, "created_at", _descriptor13, this);
105
109
 
106
- _initializerDefineProperty(this, "disbursal", _descriptor14, this);
110
+ _initializerDefineProperty(this, "updated_at", _descriptor14, this);
107
111
 
108
- _initializerDefineProperty(this, "booking", _descriptor15, this);
112
+ _initializerDefineProperty(this, "disbursal", _descriptor15, this);
113
+
114
+ _initializerDefineProperty(this, "booking", _descriptor16, this);
109
115
  }
110
116
 
111
117
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
@@ -177,24 +183,31 @@ let Transaction = exports.default = (_dec = (0, _typeorm.Entity)({
177
183
  initializer: function () {
178
184
  return "";
179
185
  }
180
- }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec15], {
186
+ }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "type_code", [_dec15], {
187
+ configurable: true,
188
+ enumerable: true,
189
+ writable: true,
190
+ initializer: function () {
191
+ return "";
192
+ }
193
+ }), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec16], {
181
194
  configurable: true,
182
195
  enumerable: true,
183
196
  writable: true,
184
197
  initializer: null
185
- }), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec16], {
198
+ }), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec17], {
186
199
  configurable: true,
187
200
  enumerable: true,
188
201
  writable: true,
189
202
  initializer: null
190
- }), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "disbursal", [_dec17, _dec18], {
203
+ }), _descriptor15 = _applyDecoratedDescriptor(_class2.prototype, "disbursal", [_dec18, _dec19], {
191
204
  configurable: true,
192
205
  enumerable: true,
193
206
  writable: true,
194
207
  initializer: function () {
195
208
  return _disbursal.default;
196
209
  }
197
- }), _descriptor15 = _applyDecoratedDescriptor(_class2.prototype, "booking", [_dec19, _dec20], {
210
+ }), _descriptor16 = _applyDecoratedDescriptor(_class2.prototype, "booking", [_dec20, _dec21], {
198
211
  configurable: true,
199
212
  enumerable: true,
200
213
  writable: true,
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class institutionName1710372510335 {
4
+ name = 'institutionName1710372510335'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "aisp"."gocardless_requisition" ADD "institution_name" character varying(250)`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`ALTER TABLE "aisp"."gocardless_requisition" DROP COLUMN "institution_name"`);
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class aispTypeCode1712138801073 {
4
+ name = 'aispTypeCode1712138801073'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "aisp"."transaction" ADD "type_code" character varying(150)`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`ALTER TABLE "aisp"."transaction" DROP COLUMN "type_code"`);
12
+ }
13
+ }
@@ -44,16 +44,28 @@ class Warehouse extends _dependencyAware.default {
44
44
  try {
45
45
  this.connection = await (0, _typeorm.getConnection)();
46
46
  } catch (error) {
47
- this.connection = await (0, _typeorm.createConnection)({
48
- type: 'aurora-data-api-pg',
49
- database: database !== null ? database : process.env.WAREHOUSE_DATABASE,
50
- schema: process.env.WAREHOUSE_SCHEMA,
51
- secretArn: process.env.WAREHOUSE_SECRET_ARN,
52
- resourceArn: process.env.WAREHOUSE_ARN,
53
- region: process.env.REGION,
47
+ const connectionParams = {
54
48
  entities: _entity.default,
49
+ schema: process.env.WAREHOUSE_SCHEMA,
50
+ database: database || process.env.WAREHOUSE_DATABASE,
55
51
  logging: process.env.DB_LOGGING !== 'undefined' && process.env.DB_LOGGING === 'true'
56
- });
52
+ };
53
+
54
+ if (process.env.WAREHOUSE_TYPE === 'postgres') {
55
+ connectionParams.type = 'postgres';
56
+ connectionParams.host = process.env.WAREHOUSE_HOST;
57
+ connectionParams.port = 5432;
58
+ connectionParams.username = process.env.WAREHOUSE_USERNAME;
59
+ connectionParams.password = process.env.WAREHOUSE_PASSWORD;
60
+ connectionParams.ssl = true;
61
+ } else {
62
+ connectionParams.type = 'aurora-data-api-pg';
63
+ connectionParams.secretArn = process.env.WAREHOUSE_SECRET_ARN;
64
+ connectionParams.resourceArn = process.env.WAREHOUSE_ARN;
65
+ connectionParams.region = process.env.REGION;
66
+ }
67
+
68
+ this.connection = await (0, _typeorm.createConnection)(connectionParams);
57
69
  }
58
70
 
59
71
  return this.connection;
package/ormconfig.js CHANGED
@@ -2,24 +2,36 @@ const DotEnv = require('dotenv');
2
2
 
3
3
  DotEnv.config();
4
4
 
5
- module.exports = {
6
- "type": "aurora-data-api-pg",
7
- "database": process.env.WAREHOUSE_DATABASE,
8
- "secretArn": process.env.WAREHOUSE_SECRET_ARN,
9
- "resourceArn": process.env.WAREHOUSE_ARN,
10
- "region": process.env.REGION,
11
- "synchronize": true,
12
- "logging": false,
13
- "schema": 'user',
14
- "entities": [
15
- __dirname + '/dist/entity/**/*.ts',
16
- __dirname + '/dist/entity/**/*.js',
5
+ const connectionParams = {
6
+ database: 'felloh',
7
+ entities: [
8
+ `${__dirname}/dist/entity/**/*.ts`,
9
+ `${__dirname}/dist/entity/**/*.js`,
17
10
  ],
18
- "migrations": [
19
- __dirname + '/dist/migration/**/*.ts',
20
- __dirname + '/dist/migration/**/*.js'
11
+ migrations: [
12
+ `${__dirname}/dist/migration/**/*.ts`,
13
+ `${__dirname}/dist/migration/**/*.js`,
21
14
  ],
22
- "cli": {
23
- "migrationsDir": __dirname + '/src/migration',
15
+ cli: {
16
+ migrationsDir: `${__dirname}/src/migration`,
24
17
  },
18
+ synchronize: true,
19
+ logging: false,
20
+ schema: 'user',
25
21
  };
22
+
23
+ if (process.env.WAREHOUSE_TYPE === 'postgres') {
24
+ connectionParams.type = 'postgres';
25
+ connectionParams.host = process.env.WAREHOUSE_HOST;
26
+ connectionParams.port = 5432;
27
+ connectionParams.username = process.env.WAREHOUSE_USERNAME;
28
+ connectionParams.password = process.env.WAREHOUSE_PASSWORD;
29
+ connectionParams.ssl = true;
30
+ } else {
31
+ connectionParams.type = 'aurora-data-api-pg';
32
+ connectionParams.secretArn = process.env.WAREHOUSE_SECRET_ARN;
33
+ connectionParams.resourceArn = process.env.WAREHOUSE_ARN;
34
+ connectionParams.region = process.env.REGION;
35
+ }
36
+
37
+ module.exports = connectionParams;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.11.85",
3
+ "version": "1.11.87",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -63,6 +63,7 @@
63
63
  "epsagon": "^1.121.3",
64
64
  "geojson": "^0.5.0",
65
65
  "moment": "^2.29.3",
66
+ "pg": "^8.11.3",
66
67
  "typeorm": "^0.2.41",
67
68
  "typeorm-aurora-data-api-driver": "^2.4.2",
68
69
  "useragent": "^2.3.0",