@felloh-org/lambda-wrapper 1.1.29 → 1.1.32

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.
@@ -127,3 +127,43 @@ jobs:
127
127
  params:
128
128
  alert_type: 'failed'
129
129
  message: Migrations deployment failed
130
+
131
+ - name: 'migrations.sandbox'
132
+ serial: true
133
+ plan:
134
+ - in_parallel:
135
+ - get: lambda-wrapper
136
+ passed: ['migrations.staging']
137
+ trigger: true
138
+ - get: concourse-scripts
139
+ - task: 'schema.create'
140
+ file: concourse-scripts/scripts/pulumi_npm_run/npm_run.yml
141
+ input_mapping:
142
+ repository: lambda-wrapper
143
+ params:
144
+ NPM_COMMAND: 'orm:schema:create'
145
+ AWS_ACCESS_KEY_ID: ((aws.keys.access))
146
+ AWS_SECRET_ACCESS_KEY: ((aws.keys.secret))
147
+ AWS_REGION: ((aws.region.primary))
148
+ WAREHOUSE_ARN: ((aws.rds.warehouse_arn.sandbox))
149
+ WAREHOUSE_SECRET_ARN: ((aws.secret_manager.warehouse_secret_arn.sandbox))
150
+ WAREHOUSE_DATABASE: 'felloh'
151
+ WAREHOUSE_SCHEMA: 'user'
152
+ - task: 'migrations.run'
153
+ file: concourse-scripts/scripts/pulumi_npm_run/npm_run.yml
154
+ input_mapping:
155
+ repository: lambda-wrapper
156
+ params:
157
+ NPM_COMMAND: 'orm:migration:run'
158
+ AWS_ACCESS_KEY_ID: ((aws.keys.access))
159
+ AWS_SECRET_ACCESS_KEY: ((aws.keys.secret))
160
+ AWS_REGION: ((aws.region.primary))
161
+ WAREHOUSE_ARN: ((aws.rds.warehouse_arn.sandbox))
162
+ WAREHOUSE_SECRET_ARN: ((aws.secret_manager.warehouse_secret_arn.sandbox))
163
+ WAREHOUSE_DATABASE: 'felloh'
164
+ WAREHOUSE_SCHEMA: 'user'
165
+ on_failure:
166
+ put: slack-alert-deploy
167
+ params:
168
+ alert_type: 'failed'
169
+ message: Migrations deployment failed
Binary file
@@ -15,7 +15,7 @@ var _paymentProvider = _interopRequireDefault(require("../payment-provider"));
15
15
 
16
16
  var _transactionMethod = _interopRequireDefault(require("../transaction-method"));
17
17
 
18
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8;
18
+ 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;
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
@@ -51,12 +51,15 @@ let OrganisationPaymentProvider = (_dec = (0, _typeorm.Entity)({
51
51
  type: "varchar",
52
52
  length: "150"
53
53
  }), _dec10 = (0, _typeorm.Column)({
54
+ type: "json",
55
+ nullable: true
56
+ }), _dec11 = (0, _typeorm.Column)({
54
57
  type: "varchar",
55
58
  length: "512"
56
- }), _dec11 = (0, _typeorm.Column)({
59
+ }), _dec12 = (0, _typeorm.Column)({
57
60
  type: "varchar",
58
61
  length: "4"
59
- }), _dec12 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class OrganisationPaymentProvider {
62
+ }), _dec13 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class OrganisationPaymentProvider {
60
63
  constructor() {
61
64
  _initializerDefineProperty(this, "id", _descriptor, this);
62
65
 
@@ -68,11 +71,13 @@ let OrganisationPaymentProvider = (_dec = (0, _typeorm.Entity)({
68
71
 
69
72
  _initializerDefineProperty(this, "public_key", _descriptor5, this);
70
73
 
71
- _initializerDefineProperty(this, "secret_key", _descriptor6, this);
74
+ _initializerDefineProperty(this, "public_creds", _descriptor6, this);
72
75
 
73
- _initializerDefineProperty(this, "secret_key_last_four", _descriptor7, this);
76
+ _initializerDefineProperty(this, "secret_key", _descriptor7, this);
74
77
 
75
- _initializerDefineProperty(this, "created_at", _descriptor8, this);
78
+ _initializerDefineProperty(this, "secret_key_last_four", _descriptor8, this);
79
+
80
+ _initializerDefineProperty(this, "created_at", _descriptor9, this);
76
81
  }
77
82
 
78
83
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
@@ -108,21 +113,26 @@ let OrganisationPaymentProvider = (_dec = (0, _typeorm.Entity)({
108
113
  initializer: function () {
109
114
  return "";
110
115
  }
111
- }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "secret_key", [_dec10], {
116
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "public_creds", [_dec10], {
117
+ configurable: true,
118
+ enumerable: true,
119
+ writable: true,
120
+ initializer: null
121
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "secret_key", [_dec11], {
112
122
  configurable: true,
113
123
  enumerable: true,
114
124
  writable: true,
115
125
  initializer: function () {
116
126
  return "";
117
127
  }
118
- }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "secret_key_last_four", [_dec11], {
128
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "secret_key_last_four", [_dec12], {
119
129
  configurable: true,
120
130
  enumerable: true,
121
131
  writable: true,
122
132
  initializer: function () {
123
133
  return "";
124
134
  }
125
- }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec12], {
135
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec13], {
126
136
  configurable: true,
127
137
  enumerable: true,
128
138
  writable: true,
@@ -146,7 +146,7 @@ let PaymentLink = (_dec = (0, _typeorm.Entity)({
146
146
  }
147
147
  };
148
148
 
149
- if (this.booking !== null) {
149
+ if (this.booking !== null && typeof this.booking.id !== 'undefined') {
150
150
  response.booking = this.booking.getPublicData();
151
151
  }
152
152
 
@@ -154,7 +154,7 @@ let PaymentLink = (_dec = (0, _typeorm.Entity)({
154
154
  response.transactions = this.transactions.map(transaction => transaction.getPublicCompactData());
155
155
  }
156
156
 
157
- if (this.user !== null) {
157
+ if (this.user !== null && typeof this.user.id !== 'undefined') {
158
158
  response.user = this.user.getPublicCompactData();
159
159
  }
160
160
 
@@ -143,10 +143,18 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
143
143
  completed_at: this.completed_at
144
144
  };
145
145
 
146
- if (this.booking !== null) {
146
+ if (this.booking !== null && typeof this.booking.id !== 'undefined') {
147
147
  response.booking = this.booking.getPublicData();
148
148
  }
149
149
 
150
+ if (this.payment_link !== null && typeof this.payment_link !== 'undefined') {
151
+ response.payment_link = this.payment_link.getPublicData();
152
+ }
153
+
154
+ if (this.metadata !== null) {
155
+ response.metadata = this.metadata;
156
+ }
157
+
150
158
  if (this.organisation !== null && typeof this.organisation.id !== 'undefined') {
151
159
  response.organisation = this.organisation.getPublicCompactData();
152
160
  }
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class paymentProviderPublicCreds1657616863683 {
4
+ name = 'paymentProviderPublicCreds1657616863683'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" ADD "public_creds" json`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`ALTER TABLE "user"."user_organisation" DROP CONSTRAINT "FK_81c4608739c8cf71fa1f96e11ae"`);
12
+ }
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.1.29",
3
+ "version": "1.1.32",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {