@felloh-org/lambda-wrapper 1.0.25 → 1.0.28

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.
@@ -0,0 +1,129 @@
1
+ # --------------------------------------------------------------------------------------------------
2
+ # Resource Types
3
+ # --------------------------------------------------------------------------------------------------
4
+ resource_types:
5
+
6
+ - name: pull-request
7
+ type: docker-image
8
+ source:
9
+ repository: teliaoss/github-pr-resource
10
+
11
+ - name: slack-notification
12
+ type: docker-image
13
+ source:
14
+ repository: mockersf/concourse-slack-notifier
15
+ tag: latest
16
+
17
+ # --------------------------------------------------------------------------------------------------
18
+ # Resources
19
+ # --------------------------------------------------------------------------------------------------
20
+ resources:
21
+
22
+ - name: concourse-scripts
23
+ type: git
24
+ source:
25
+ uri: git@github.com:felloh-org/concourse-scripts.git
26
+ branch: main
27
+ depth: 0
28
+ private_key: ((git.private_key))
29
+
30
+ - name: lambda-wrapper
31
+ type: git
32
+ source:
33
+ uri: git@github.com:felloh-org/lambda-wrapper.git
34
+ branch: main
35
+ depth: 0
36
+ private_key: ((git.private_key))
37
+
38
+ - name: slack-alert-deploy
39
+ type: slack-notification
40
+ source:
41
+ url: ((slack.channels.engineering-deployments))
42
+
43
+ # --------------------------------------------------------------------------------------------------
44
+ # Jobs
45
+ # --------------------------------------------------------------------------------------------------
46
+ jobs:
47
+ - name: 'migrations.staging'
48
+ serial: true
49
+ plan:
50
+ - in_parallel:
51
+ - get: lambda-wrapper
52
+ trigger: true
53
+ - get: concourse-scripts
54
+ - task: 'schema.create'
55
+ file: concourse-scripts/scripts/pulumi_npm_run/npm_run.yml
56
+ input_mapping:
57
+ repository: lambda-wrapper
58
+ params:
59
+ NPM_COMMAND: 'orm:schema:create'
60
+ AWS_ACCESS_KEY_ID: ((aws.keys.access))
61
+ AWS_SECRET_ACCESS_KEY: ((aws.keys.secret))
62
+ AWS_REGION: ((aws.region.primary))
63
+ WAREHOUSE_ARN: ((aws.rds.warehouse_arn.staging))
64
+ WAREHOUSE_SECRET_ARN: ((aws.secret_manager.warehouse_secret_arn.staging))
65
+ WAREHOUSE_DATABASE: 'felloh'
66
+ WAREHOUSE_SCHEMA: 'user'
67
+ - task: 'migrations.run'
68
+ file: concourse-scripts/scripts/pulumi_npm_run/npm_run.yml
69
+ input_mapping:
70
+ repository: lambda-wrapper
71
+ params:
72
+ NPM_COMMAND: 'orm:migration:run'
73
+ AWS_ACCESS_KEY_ID: ((aws.keys.access))
74
+ AWS_SECRET_ACCESS_KEY: ((aws.keys.secret))
75
+ AWS_REGION: ((aws.region.primary))
76
+ WAREHOUSE_ARN: ((aws.rds.warehouse_arn.staging))
77
+ WAREHOUSE_SECRET_ARN: ((aws.secret_manager.warehouse_secret_arn.staging))
78
+ WAREHOUSE_DATABASE: 'felloh'
79
+ WAREHOUSE_SCHEMA: 'user'
80
+ on_failure:
81
+ put: slack-alert-deploy
82
+ params:
83
+ alert_type: 'failed'
84
+ message: Staging deployment failed
85
+
86
+ - name: 'migrations.production'
87
+ serial: true
88
+ plan:
89
+ - in_parallel:
90
+ - get: lambda-wrapper
91
+ passed: ['migrations.staging']
92
+ trigger: true
93
+ - get: concourse-scripts
94
+ - task: 'schema.create'
95
+ file: concourse-scripts/scripts/pulumi_npm_run/npm_run.yml
96
+ input_mapping:
97
+ repository: lambda-wrapper
98
+ params:
99
+ NPM_COMMAND: 'orm:schema:create'
100
+ AWS_ACCESS_KEY_ID: ((aws.keys.access))
101
+ AWS_SECRET_ACCESS_KEY: ((aws.keys.secret))
102
+ AWS_REGION: ((aws.region.primary))
103
+ WAREHOUSE_ARN: ((aws.rds.warehouse_arn.production))
104
+ WAREHOUSE_SECRET_ARN: ((aws.secret_manager.warehouse_secret_arn.production))
105
+ WAREHOUSE_DATABASE: 'felloh'
106
+ WAREHOUSE_SCHEMA: 'user'
107
+ - task: 'migrations.run'
108
+ file: concourse-scripts/scripts/pulumi_npm_run/npm_run.yml
109
+ input_mapping:
110
+ repository: lambda-wrapper
111
+ params:
112
+ NPM_COMMAND: 'orm:migration:run'
113
+ AWS_ACCESS_KEY_ID: ((aws.keys.access))
114
+ AWS_SECRET_ACCESS_KEY: ((aws.keys.secret))
115
+ AWS_REGION: ((aws.region.primary))
116
+ WAREHOUSE_ARN: ((aws.rds.warehouse_arn.production))
117
+ WAREHOUSE_SECRET_ARN: ((aws.secret_manager.warehouse_secret_arn.production))
118
+ WAREHOUSE_DATABASE: 'felloh'
119
+ WAREHOUSE_SCHEMA: 'user'
120
+ on_success:
121
+ put: slack-alert-deploy
122
+ params:
123
+ alert_type: 'success'
124
+ message: Migrations deployment succeeded
125
+ on_failure:
126
+ put: slack-alert-deploy
127
+ params:
128
+ alert_type: 'failed'
129
+ message: Migrations deployment failed
Binary file
package/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ .concourse/private.yml filter=git-crypt diff=git-crypt
@@ -52,7 +52,7 @@ let OrganisationPaymentProvider = (_dec = (0, _typeorm.Entity)({
52
52
  length: "150"
53
53
  }), _dec10 = (0, _typeorm.Column)({
54
54
  type: "varchar",
55
- length: "150"
55
+ length: "512"
56
56
  }), _dec11 = (0, _typeorm.Column)({
57
57
  type: "varchar",
58
58
  length: "4"
@@ -15,7 +15,7 @@ var _booking = _interopRequireDefault(require("../../agent-data/booking"));
15
15
 
16
16
  var _transaction = _interopRequireDefault(require("../transaction"));
17
17
 
18
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;
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, _descriptor16;
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
@@ -58,8 +58,17 @@ let PaymentLink = (_dec = (0, _typeorm.Entity)({
58
58
  type: "varchar",
59
59
  length: "200"
60
60
  }), _dec15 = (0, _typeorm.OneToMany)(() => _transaction.default, transaction => transaction.payment_link), _dec16 = (0, _typeorm.Column)({
61
+ type: "boolean",
62
+ default: true
63
+ }), _dec17 = (0, _typeorm.Column)({
64
+ type: "boolean",
65
+ default: true
66
+ }), _dec18 = (0, _typeorm.Column)({
67
+ type: "boolean",
68
+ default: false
69
+ }), _dec19 = (0, _typeorm.Column)({
61
70
  type: "timestamp with time zone"
62
- }), _dec17 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class PaymentLink {
71
+ }), _dec20 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class PaymentLink {
63
72
  constructor() {
64
73
  _initializerDefineProperty(this, "id", _descriptor, this);
65
74
 
@@ -83,9 +92,15 @@ let PaymentLink = (_dec = (0, _typeorm.Entity)({
83
92
 
84
93
  _initializerDefineProperty(this, "transactions", _descriptor11, this);
85
94
 
86
- _initializerDefineProperty(this, "expires_at", _descriptor12, this);
95
+ _initializerDefineProperty(this, "open_banking_enabled", _descriptor12, this);
87
96
 
88
- _initializerDefineProperty(this, "created_at", _descriptor13, this);
97
+ _initializerDefineProperty(this, "card_enabled", _descriptor13, this);
98
+
99
+ _initializerDefineProperty(this, "moto", _descriptor14, this);
100
+
101
+ _initializerDefineProperty(this, "expires_at", _descriptor15, this);
102
+
103
+ _initializerDefineProperty(this, "created_at", _descriptor16, this);
89
104
  }
90
105
 
91
106
  generateExpiryDate() {
@@ -104,7 +119,11 @@ let PaymentLink = (_dec = (0, _typeorm.Entity)({
104
119
  cancel_url: this.cancel_url,
105
120
  customer_name: this.customer_name,
106
121
  expires_at: this.expires_at,
107
- created_at: this.created_at
122
+ created_at: this.created_at,
123
+ methods: {
124
+ open_banking: this.open_banking_enabled,
125
+ card: this.card_enabled
126
+ }
108
127
  };
109
128
 
110
129
  if (this.booking !== null) {
@@ -128,8 +147,12 @@ let PaymentLink = (_dec = (0, _typeorm.Entity)({
128
147
  amount: this.amount,
129
148
  description: this.description,
130
149
  expires_at: this.expires_at,
131
- created_at: this.created_at
132
- }``;
150
+ created_at: this.created_at,
151
+ methods: {
152
+ open_banking: this.open_banking_enabled,
153
+ card: this.card_enabled
154
+ }
155
+ };
133
156
  }
134
157
 
135
158
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
@@ -205,14 +228,29 @@ let PaymentLink = (_dec = (0, _typeorm.Entity)({
205
228
  enumerable: true,
206
229
  writable: true,
207
230
  initializer: null
208
- }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "expires_at", [_dec16], {
231
+ }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "open_banking_enabled", [_dec16], {
232
+ configurable: true,
233
+ enumerable: true,
234
+ writable: true,
235
+ initializer: null
236
+ }), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "card_enabled", [_dec17], {
237
+ configurable: true,
238
+ enumerable: true,
239
+ writable: true,
240
+ initializer: null
241
+ }), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "moto", [_dec18], {
242
+ configurable: true,
243
+ enumerable: true,
244
+ writable: true,
245
+ initializer: null
246
+ }), _descriptor15 = _applyDecoratedDescriptor(_class2.prototype, "expires_at", [_dec19], {
209
247
  configurable: true,
210
248
  enumerable: true,
211
249
  writable: true,
212
250
  initializer: function () {
213
251
  return this.generateExpiryDate();
214
252
  }
215
- }), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec17], {
253
+ }), _descriptor16 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec20], {
216
254
  configurable: true,
217
255
  enumerable: true,
218
256
  writable: true,
@@ -23,7 +23,9 @@ var _transactionMetadata = _interopRequireDefault(require("../transaction-metada
23
23
 
24
24
  var _paymentProvider = _interopRequireDefault(require("../payment-provider"));
25
25
 
26
- 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;
26
+ var _organisationPaymentProvider = _interopRequireDefault(require("../organisation-payment-provider"));
27
+
28
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _dec21, _dec22, _dec23, _dec24, _dec25, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16;
27
29
 
28
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
31
 
@@ -63,14 +65,22 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
63
65
  }), _dec16 = (0, _typeorm.OneToOne)(() => _transactionMetadata.default, transactionMetadata => transactionMetadata.transaction), _dec17 = (0, _typeorm.ManyToOne)(() => _paymentProvider.default), _dec18 = (0, _typeorm.JoinColumn)({
64
66
  name: 'payment_provider_id',
65
67
  referencedColumnName: 'id'
66
- }), _dec19 = (0, _typeorm.Column)({
68
+ }), _dec19 = (0, _typeorm.ManyToOne)(() => _organisationPaymentProvider.default, {
69
+ nullable: true
70
+ }), _dec20 = (0, _typeorm.JoinColumn)({
71
+ name: 'organisation_payment_provider_id',
72
+ referencedColumnName: 'id'
73
+ }), _dec21 = (0, _typeorm.Column)({
67
74
  type: "varchar",
68
75
  length: "250",
69
76
  nullable: true
70
- }), _dec20 = (0, _typeorm.Column)({
77
+ }), _dec22 = (0, _typeorm.Column)({
71
78
  type: "timestamp with time zone",
72
79
  nullable: true
73
- }), _dec21 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Transaction {
80
+ }), _dec23 = (0, _typeorm.CreateDateColumn)(), _dec24 = (0, _typeorm.Column)({
81
+ type: "text",
82
+ nullable: true
83
+ }), _dec25 = (0, _typeorm.UpdateDateColumn)(), _dec(_class = (_class2 = class Transaction {
74
84
  constructor() {
75
85
  _initializerDefineProperty(this, "id", _descriptor, this);
76
86
 
@@ -92,11 +102,17 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
92
102
 
93
103
  _initializerDefineProperty(this, "payment_provider", _descriptor10, this);
94
104
 
95
- _initializerDefineProperty(this, "provider_reference", _descriptor11, this);
105
+ _initializerDefineProperty(this, "organisation_payment_provider", _descriptor11, this);
106
+
107
+ _initializerDefineProperty(this, "provider_reference", _descriptor12, this);
96
108
 
97
- _initializerDefineProperty(this, "completed_at", _descriptor12, this);
109
+ _initializerDefineProperty(this, "completed_at", _descriptor13, this);
98
110
 
99
- _initializerDefineProperty(this, "created_at", _descriptor13, this);
111
+ _initializerDefineProperty(this, "created_at", _descriptor14, this);
112
+
113
+ _initializerDefineProperty(this, "message", _descriptor15, this);
114
+
115
+ _initializerDefineProperty(this, "updated_at", _descriptor16, this);
100
116
  }
101
117
 
102
118
  getPublicData() {
@@ -195,19 +211,36 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
195
211
  initializer: function () {
196
212
  return _paymentProvider.default;
197
213
  }
198
- }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "provider_reference", [_dec19], {
214
+ }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "organisation_payment_provider", [_dec19, _dec20], {
215
+ configurable: true,
216
+ enumerable: true,
217
+ writable: true,
218
+ initializer: function () {
219
+ return _organisationPaymentProvider.default;
220
+ }
221
+ }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "provider_reference", [_dec21], {
199
222
  configurable: true,
200
223
  enumerable: true,
201
224
  writable: true,
202
225
  initializer: function () {
203
226
  return "";
204
227
  }
205
- }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "completed_at", [_dec20], {
228
+ }), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "completed_at", [_dec22], {
229
+ configurable: true,
230
+ enumerable: true,
231
+ writable: true,
232
+ initializer: null
233
+ }), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec23], {
234
+ configurable: true,
235
+ enumerable: true,
236
+ writable: true,
237
+ initializer: null
238
+ }), _descriptor15 = _applyDecoratedDescriptor(_class2.prototype, "message", [_dec24], {
206
239
  configurable: true,
207
240
  enumerable: true,
208
241
  writable: true,
209
242
  initializer: null
210
- }), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec21], {
243
+ }), _descriptor16 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec25], {
211
244
  configurable: true,
212
245
  enumerable: true,
213
246
  writable: true,
@@ -39,7 +39,8 @@ let Chargeback = (_dec = (0, _typeorm.Entity)({
39
39
  }), _dec8 = (0, _typeorm.Column)({
40
40
  type: "int"
41
41
  }), _dec9 = (0, _typeorm.Column)({
42
- type: "date"
42
+ type: "date",
43
+ nullable: true
43
44
  }), _dec10 = (0, _typeorm.Column)({
44
45
  type: "date"
45
46
  }), _dec11 = (0, _typeorm.Column)({
@@ -0,0 +1,57 @@
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 _batch = _interopRequireDefault(require("../batch"));
11
+
12
+ var _merchant = _interopRequireDefault(require("../merchant"));
13
+
14
+ var _dec, _dec2, _dec3, _dec4, _class, _class2, _descriptor, _descriptor2, _descriptor3;
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ 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 }); }
19
+
20
+ 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; }
21
+
22
+ 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.'); }
23
+
24
+ let Transaction = (_dec = (0, _typeorm.Entity)({
25
+ name: 'ingested_data',
26
+ schema: 'trust_payments'
27
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.Column)({
28
+ type: "varchar",
29
+ length: 10
30
+ }), _dec4 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Transaction {
31
+ constructor() {
32
+ _initializerDefineProperty(this, "id", _descriptor, this);
33
+
34
+ _initializerDefineProperty(this, "type", _descriptor2, this);
35
+
36
+ _initializerDefineProperty(this, "created_at", _descriptor3, this);
37
+ }
38
+
39
+ }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
40
+ configurable: true,
41
+ enumerable: true,
42
+ writable: true,
43
+ initializer: function () {
44
+ return undefined;
45
+ }
46
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "type", [_dec3], {
47
+ configurable: true,
48
+ enumerable: true,
49
+ writable: true,
50
+ initializer: null
51
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec4], {
52
+ configurable: true,
53
+ enumerable: true,
54
+ writable: true,
55
+ initializer: null
56
+ })), _class2)) || _class);
57
+ exports.default = Transaction;
@@ -0,0 +1,15 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class paymentLinkMethods1647251762169 {
4
+ name = 'paymentLinkMethods1647251762169'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "payment"."payment_Link" ADD "open_banking_enabled" boolean NOT NULL DEFAULT true`);
8
+ await queryRunner.query(`ALTER TABLE "payment"."payment_Link" ADD "card_enabled" boolean NOT NULL DEFAULT true`);
9
+ }
10
+
11
+ async down(queryRunner) {
12
+ await queryRunner.query(`ALTER TABLE "payment"."payment_Link" DROP COLUMN "card_enabled"`);
13
+ await queryRunner.query(`ALTER TABLE "payment"."payment_Link" DROP COLUMN "open_banking_enabled"`);
14
+ }
15
+ }
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class paymentLinkMoto1647271619083 {
4
+ name = 'paymentLinkMoto1647271619083'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "payment"."payment_Link" ADD "moto" boolean NOT NULL DEFAULT false`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`ALTER TABLE "payment"."payment_Link" DROP COLUMN "moto"`);
12
+ }
13
+ }
@@ -0,0 +1,15 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class providerSecretLength1647292573651 {
4
+ name = 'providerSecretLength1647292573651'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" DROP COLUMN "secret_key"`);
8
+ await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" ADD "secret_key" character varying(512) NOT NULL`);
9
+ }
10
+
11
+ async down(queryRunner) {
12
+ await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" DROP COLUMN "secret_key"`);
13
+ await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" ADD "secret_key" character varying(150) NOT NULL`);
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class providerSecretLength1647294601399 {
4
+ name = 'providerSecretLength1647294601399'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" DROP COLUMN "secret_key"`);
8
+ await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" ADD "secret_key" character varying(256) NOT NULL`);
9
+ }
10
+
11
+ async down(queryRunner) {
12
+ await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" DROP COLUMN "secret_key"`);
13
+ await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" ADD "secret_key" character varying(250) NOT NULL`);
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class transactionOrganisationPaymentProvider1647428635630 {
4
+ name = 'transactionOrganisationPaymentProvider1647428635630'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "payment"."transaction" ADD "organisation_payment_provider_id" character varying`);
8
+ await queryRunner.query(`ALTER TABLE "payment"."transaction" ADD CONSTRAINT "FK_750e63e5ad1c7c9a3f742b043dc" FOREIGN KEY ("organisation_payment_provider_id") REFERENCES "payment"."organisation_payment_provider"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
9
+ }
10
+
11
+ async down(queryRunner) {
12
+ await queryRunner.query(`ALTER TABLE "payment"."transaction" DROP CONSTRAINT "FK_750e63e5ad1c7c9a3f742b043dc"`);
13
+ await queryRunner.query(`ALTER TABLE "payment"."transaction" DROP COLUMN "organisation_payment_provider_id"`);
14
+ }
15
+ }
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class transactionMessage1647437109221 {
4
+ name = 'transactionMessage1647437109221'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "payment"."transaction" ADD "message" text`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`ALTER TABLE "payment"."transaction" DROP COLUMN "message"`);
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class transactionUpdatedAt1647437500834 {
4
+ name = 'transactionUpdatedAt1647437500834'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "payment"."transaction" ADD "updated_at" TIMESTAMP NOT NULL DEFAULT now()`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`ALTER TABLE "payment"."transaction" DROP COLUMN "updated_at"`);
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class trustChargebackDue1648137333608 {
4
+ name = 'trustChargebackDue1648137333608'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "trust_payments"."chargeback" ALTER COLUMN "due_date" DROP NOT NULL`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`ALTER TABLE "trust_payments"."chargeback" ALTER COLUMN "due_date" SET NOT NULL`);
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class trustFtpLog1648204597084 {
4
+ name = 'trustFtpLog1648204597084'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`CREATE TABLE "trust_payments"."ingested_data" ("id" character varying NOT NULL, "type" character varying(10) NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_95ecbf759d16d46c0d1b08fb7e0" PRIMARY KEY ("id"))`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`DROP TABLE "trust_payments"."ingested_data"`);
12
+ }
13
+ }
@@ -26,13 +26,15 @@ class Warehouse extends _dependencyAware.default {
26
26
  this.connection = null;
27
27
  }
28
28
  /**
29
- *
30
- * @returns {Promise<Connection>}
29
+ * Connect to the warehouse
30
+ * @param database
31
+ * @param cache
32
+ * @returns {Promise<null>}
31
33
  */
32
34
 
33
35
 
34
- async connect() {
35
- if (this.connection) {
36
+ async connect(database = null, cache = true) {
37
+ if (this.connection && cache === true) {
36
38
  return this.connection;
37
39
  }
38
40
 
@@ -41,7 +43,7 @@ class Warehouse extends _dependencyAware.default {
41
43
  } catch (error) {
42
44
  this.connection = await (0, _typeorm.createConnection)({
43
45
  type: 'aurora-data-api-pg',
44
- database: process.env.WAREHOUSE_DATABASE,
46
+ database: database !== null ? database : process.env.WAREHOUSE_DATABASE,
45
47
  schema: process.env.WAREHOUSE_SCHEMA,
46
48
  secretArn: process.env.WAREHOUSE_SECRET_ARN,
47
49
  resourceArn: process.env.WAREHOUSE_ARN,
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.0.25",
3
+ "version": "1.0.28",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
7
  "build": "./node_modules/.bin/babel src --out-dir dist --copy-files --ignore src/migration",
8
8
  "build:orm": "./node_modules/.bin/babel src --out-dir dist --copy-files --ignore src/migration",
9
+ "concourse:deploy": "fly -t felloh-cicd set-pipeline -p lambda-wrapper -c .concourse/pipeline.yml -l .concourse/private.yml",
10
+ "concourse:login": "fly --target felloh-cicd login --insecure --concourse-url https://ci.services.felloh.org --team-name libraries",
11
+ "concourse:sync": "sudo fly -t ci sync",
9
12
  "lint": "./node_modules/.bin/eslint ./src",
10
13
  "orm:migration:generate": "rm -rf dist && yarn build:orm && ./node_modules/.bin/typeorm migration:generate -o -n",
11
14
  "orm:migration:run": "rm -rf dist && yarn build:orm && ./node_modules/.bin/typeorm migration:run",
@@ -34,7 +37,6 @@
34
37
  "babel-jest": "^26.3.3",
35
38
  "babel-plugin-module-resolver": "^4.1.0",
36
39
  "babel-plugin-transform-class-properties": "^6.24.1",
37
- "dotenv": "^11.0.0",
38
40
  "eslint": "^8.6.0",
39
41
  "eslint-plugin-flowtype": "^8.0.3",
40
42
  "eslint-plugin-import": "^2.25.3",
@@ -52,6 +54,7 @@
52
54
  "alai": "1.0.3",
53
55
  "async": "^3.2.0",
54
56
  "axios": "^0.21.1",
57
+ "dotenv": "^11.0.0",
55
58
  "epsagon": "^1.104.2",
56
59
  "typeorm": "^0.2.41",
57
60
  "typeorm-aurora-data-api-driver": "^2.3.5",