@felloh-org/lambda-wrapper 1.11.86 → 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);
@@ -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 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.86",
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",