@felloh-org/lambda-wrapper 1.11.72 → 1.11.74

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.
@@ -51,8 +51,10 @@ var _transactionSurcharge = _interopRequireDefault(require("./transaction-surcha
51
51
 
52
52
  var _organisationTokenisationProvider = _interopRequireDefault(require("./organisation-tokenisation-provider"));
53
53
 
54
+ var _transactionRisk = _interopRequireDefault(require("./transaction-risk"));
55
+
54
56
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
55
57
 
56
- const ENTITIES = [_chargeback.default, _creditNote.default, _customer.default, _ecommerce.default, _organisationPaymentProvider.default, _organisationPaymentProviderMethod.default, _organisationTokenisationProvider.default, _paymentLink.default, _paymentLinkType.default, _paymentProvider.default, _refund.default, _refundStatus.default, _tokenisationProvider.default, _transaction.default, _transactionEvent.default, _transactionEventType.default, _transactionMethod.default, _transactionStatus.default, _transactionSource.default, _transactionType.default, _transactionMetadata.default, _transactionReason.default, _transactionSurcharge.default];
58
+ const ENTITIES = [_chargeback.default, _creditNote.default, _customer.default, _ecommerce.default, _organisationPaymentProvider.default, _organisationPaymentProviderMethod.default, _organisationTokenisationProvider.default, _paymentLink.default, _paymentLinkType.default, _paymentProvider.default, _refund.default, _refundStatus.default, _tokenisationProvider.default, _transaction.default, _transactionEvent.default, _transactionEventType.default, _transactionMethod.default, _transactionStatus.default, _transactionSource.default, _transactionType.default, _transactionMetadata.default, _transactionReason.default, _transactionSurcharge.default, _transactionRisk.default];
57
59
 
58
60
  var _default = exports.default = ENTITIES;
@@ -21,6 +21,8 @@ var _paymentLink = _interopRequireDefault(require("../payment-link"));
21
21
 
22
22
  var _transactionMetadata = _interopRequireDefault(require("../transaction-metadata"));
23
23
 
24
+ var _transactionRisk = _interopRequireDefault(require("../transaction-risk"));
25
+
24
26
  var _paymentProvider = _interopRequireDefault(require("../payment-provider"));
25
27
 
26
28
  var _organisationPaymentProvider = _interopRequireDefault(require("../organisation-payment-provider"));
@@ -43,7 +45,7 @@ var _refund = _interopRequireDefault(require("../refund"));
43
45
 
44
46
  var _customer = _interopRequireDefault(require("../customer"));
45
47
 
46
- 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, _dec26, _dec27, _dec28, _dec29, _dec30, _dec31, _dec32, _dec33, _dec34, _dec35, _dec36, _dec37, _dec38, _dec39, _dec40, _dec41, _dec42, _dec43, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21, _descriptor22, _descriptor23, _descriptor24, _descriptor25, _descriptor26, _descriptor27, _descriptor28, _descriptor29, _descriptor30;
48
+ 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, _dec26, _dec27, _dec28, _dec29, _dec30, _dec31, _dec32, _dec33, _dec34, _dec35, _dec36, _dec37, _dec38, _dec39, _dec40, _dec41, _dec42, _dec43, _dec44, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21, _descriptor22, _descriptor23, _descriptor24, _descriptor25, _descriptor26, _descriptor27, _descriptor28, _descriptor29, _descriptor30, _descriptor31;
47
49
 
48
50
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
49
51
 
@@ -90,60 +92,60 @@ let Transaction = exports.default = (_dec = (0, _typeorm.Entity)({
90
92
  }), _dec19 = (0, _typeorm.JoinColumn)({
91
93
  name: 'ecommerce_id',
92
94
  referencedColumnName: 'id'
93
- }), _dec20 = (0, _typeorm.OneToOne)(() => _transactionMetadata.default, transactionMetadata => transactionMetadata.transaction), _dec21 = (0, _typeorm.ManyToOne)(() => _paymentProvider.default), _dec22 = (0, _typeorm.JoinColumn)({
95
+ }), _dec20 = (0, _typeorm.OneToOne)(() => _transactionMetadata.default, transactionMetadata => transactionMetadata.transaction), _dec21 = (0, _typeorm.OneToOne)(() => _transactionRisk.default, transactionRisk => transactionRisk.transaction), _dec22 = (0, _typeorm.ManyToOne)(() => _paymentProvider.default), _dec23 = (0, _typeorm.JoinColumn)({
94
96
  name: 'payment_provider_id',
95
97
  referencedColumnName: 'id'
96
- }), _dec23 = (0, _typeorm.ManyToOne)(() => _organisationPaymentProvider.default, {
98
+ }), _dec24 = (0, _typeorm.ManyToOne)(() => _organisationPaymentProvider.default, {
97
99
  nullable: true
98
- }), _dec24 = (0, _typeorm.JoinColumn)({
100
+ }), _dec25 = (0, _typeorm.JoinColumn)({
99
101
  name: 'organisation_payment_provider_id',
100
102
  referencedColumnName: 'id'
101
- }), _dec25 = (0, _typeorm.ManyToOne)(() => _tokenisationProvider.default, {
103
+ }), _dec26 = (0, _typeorm.ManyToOne)(() => _tokenisationProvider.default, {
102
104
  nullable: true
103
- }), _dec26 = (0, _typeorm.JoinColumn)({
105
+ }), _dec27 = (0, _typeorm.JoinColumn)({
104
106
  name: 'tokenisation_provider_id',
105
107
  referencedColumnName: 'id'
106
- }), _dec27 = (0, _typeorm.OneToMany)(() => _refund.default, refund => refund.transaction, {
108
+ }), _dec28 = (0, _typeorm.OneToMany)(() => _refund.default, refund => refund.transaction, {
107
109
  nullable: true
108
- }), _dec28 = (0, _typeorm.OneToOne)(() => _transactionSurcharge.default, transactionSurcharge => transactionSurcharge.transaction, {
110
+ }), _dec29 = (0, _typeorm.OneToOne)(() => _transactionSurcharge.default, transactionSurcharge => transactionSurcharge.transaction, {
109
111
  nullable: true
110
- }), _dec29 = (0, _typeorm.Column)({
112
+ }), _dec30 = (0, _typeorm.Column)({
111
113
  type: "varchar",
112
114
  length: "250",
113
115
  nullable: true
114
- }), _dec30 = (0, _typeorm.Column)({
116
+ }), _dec31 = (0, _typeorm.Column)({
115
117
  type: "varchar",
116
118
  length: "3",
117
119
  default: _currency.DEFAULT_CURRENCY
118
- }), _dec31 = (0, _typeorm.Column)({
119
- type: "json",
120
- nullable: true
121
120
  }), _dec32 = (0, _typeorm.Column)({
122
- type: "timestamp with time zone",
121
+ type: "json",
123
122
  nullable: true
124
123
  }), _dec33 = (0, _typeorm.Column)({
125
- type: "text",
124
+ type: "timestamp with time zone",
126
125
  nullable: true
127
126
  }), _dec34 = (0, _typeorm.Column)({
128
127
  type: "text",
129
128
  nullable: true
130
129
  }), _dec35 = (0, _typeorm.Column)({
130
+ type: "text",
131
+ nullable: true
132
+ }), _dec36 = (0, _typeorm.Column)({
131
133
  type: "varchar",
132
134
  length: "15",
133
135
  nullable: true
134
- }), _dec36 = (0, _typeorm.Column)({
136
+ }), _dec37 = (0, _typeorm.Column)({
135
137
  type: "varchar",
136
138
  nullable: true
137
- }), _dec37 = (0, _typeorm.CreateDateColumn)({
139
+ }), _dec38 = (0, _typeorm.CreateDateColumn)({
138
140
  type: 'timestamp with time zone'
139
- }), _dec38 = (0, _typeorm.UpdateDateColumn)({
141
+ }), _dec39 = (0, _typeorm.UpdateDateColumn)({
140
142
  type: 'timestamp with time zone'
141
- }), _dec39 = (0, _typeorm.OneToMany)(() => _transactionBatch.default, transactionBatch => transactionBatch.transaction), _dec40 = (0, _typeorm.Column)({
143
+ }), _dec40 = (0, _typeorm.OneToMany)(() => _transactionBatch.default, transactionBatch => transactionBatch.transaction), _dec41 = (0, _typeorm.Column)({
142
144
  type: "timestamp with time zone",
143
145
  nullable: true
144
- }), _dec41 = (0, _typeorm.OneToOne)(() => _transactionSettlement.default, transactionSettlement => transactionSettlement.transaction), _dec42 = (0, _typeorm.ManyToOne)(() => _customer.default, {
146
+ }), _dec42 = (0, _typeorm.OneToOne)(() => _transactionSettlement.default, transactionSettlement => transactionSettlement.transaction), _dec43 = (0, _typeorm.ManyToOne)(() => _customer.default, {
145
147
  nullable: true
146
- }), _dec43 = (0, _typeorm.JoinColumn)({
148
+ }), _dec44 = (0, _typeorm.JoinColumn)({
147
149
  name: 'customer_id',
148
150
  referencedColumnName: 'id'
149
151
  }), _dec(_class = (_class2 = class Transaction {
@@ -170,43 +172,45 @@ let Transaction = exports.default = (_dec = (0, _typeorm.Entity)({
170
172
 
171
173
  _initializerDefineProperty(this, "metadata", _descriptor11, this);
172
174
 
173
- _initializerDefineProperty(this, "payment_provider", _descriptor12, this);
175
+ _initializerDefineProperty(this, "risk", _descriptor12, this);
174
176
 
175
- _initializerDefineProperty(this, "organisation_payment_provider", _descriptor13, this);
177
+ _initializerDefineProperty(this, "payment_provider", _descriptor13, this);
176
178
 
177
- _initializerDefineProperty(this, "tokenisation_provider", _descriptor14, this);
179
+ _initializerDefineProperty(this, "organisation_payment_provider", _descriptor14, this);
178
180
 
179
- _initializerDefineProperty(this, "refund", _descriptor15, this);
181
+ _initializerDefineProperty(this, "tokenisation_provider", _descriptor15, this);
180
182
 
181
- _initializerDefineProperty(this, "surcharge", _descriptor16, this);
183
+ _initializerDefineProperty(this, "refund", _descriptor16, this);
182
184
 
183
- _initializerDefineProperty(this, "provider_reference", _descriptor17, this);
185
+ _initializerDefineProperty(this, "surcharge", _descriptor17, this);
184
186
 
185
- _initializerDefineProperty(this, "currency", _descriptor18, this);
187
+ _initializerDefineProperty(this, "provider_reference", _descriptor18, this);
186
188
 
187
- _initializerDefineProperty(this, "provider_metadata", _descriptor19, this);
189
+ _initializerDefineProperty(this, "currency", _descriptor19, this);
188
190
 
189
- _initializerDefineProperty(this, "completed_at", _descriptor20, this);
191
+ _initializerDefineProperty(this, "provider_metadata", _descriptor20, this);
190
192
 
191
- _initializerDefineProperty(this, "message", _descriptor21, this);
193
+ _initializerDefineProperty(this, "completed_at", _descriptor21, this);
192
194
 
193
- _initializerDefineProperty(this, "user_agent", _descriptor22, this);
195
+ _initializerDefineProperty(this, "message", _descriptor22, this);
194
196
 
195
- _initializerDefineProperty(this, "ip_address", _descriptor23, this);
197
+ _initializerDefineProperty(this, "user_agent", _descriptor23, this);
196
198
 
197
- _initializerDefineProperty(this, "fingerprint", _descriptor24, this);
199
+ _initializerDefineProperty(this, "ip_address", _descriptor24, this);
198
200
 
199
- _initializerDefineProperty(this, "created_at", _descriptor25, this);
201
+ _initializerDefineProperty(this, "fingerprint", _descriptor25, this);
200
202
 
201
- _initializerDefineProperty(this, "updated_at", _descriptor26, this);
203
+ _initializerDefineProperty(this, "created_at", _descriptor26, this);
202
204
 
203
- _initializerDefineProperty(this, "batch", _descriptor27, this);
205
+ _initializerDefineProperty(this, "updated_at", _descriptor27, this);
204
206
 
205
- _initializerDefineProperty(this, "assigned_at", _descriptor28, this);
207
+ _initializerDefineProperty(this, "batch", _descriptor28, this);
206
208
 
207
- _initializerDefineProperty(this, "settlement", _descriptor29, this);
209
+ _initializerDefineProperty(this, "assigned_at", _descriptor29, this);
208
210
 
209
- _initializerDefineProperty(this, "customer", _descriptor30, this);
211
+ _initializerDefineProperty(this, "settlement", _descriptor30, this);
212
+
213
+ _initializerDefineProperty(this, "customer", _descriptor31, this);
210
214
  }
211
215
 
212
216
  getPublicData() {
@@ -227,6 +231,7 @@ let Transaction = exports.default = (_dec = (0, _typeorm.Entity)({
227
231
  payment_link: null,
228
232
  ecommerce: null,
229
233
  metadata: null,
234
+ risk: null,
230
235
  organisation: null,
231
236
  assigned_at: this.assigned_at
232
237
  };
@@ -259,6 +264,10 @@ let Transaction = exports.default = (_dec = (0, _typeorm.Entity)({
259
264
  response.metadata = this.metadata;
260
265
  }
261
266
 
267
+ if (this.risk !== null) {
268
+ response.risk = this.risk;
269
+ }
270
+
262
271
  if (this.organisation !== null && typeof this.organisation.id !== 'undefined' && typeof this.organisation.getPublicCompactData === 'function') {
263
272
  response.organisation = this.organisation.getPublicCompactData();
264
273
  }
@@ -322,6 +331,10 @@ let Transaction = exports.default = (_dec = (0, _typeorm.Entity)({
322
331
  response.metadata = this.metadata;
323
332
  }
324
333
 
334
+ if (this.risk !== null) {
335
+ response.risk = this.risk;
336
+ }
337
+
325
338
  if (this.organisation !== null && typeof this.organisation.id !== 'undefined' && typeof this.organisation.getPublicCompactData === 'function') {
326
339
  response.organisation = this.organisation.getPublicCompactData();
327
340
  }
@@ -406,111 +419,116 @@ let Transaction = exports.default = (_dec = (0, _typeorm.Entity)({
406
419
  enumerable: true,
407
420
  writable: true,
408
421
  initializer: null
409
- }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "payment_provider", [_dec21, _dec22], {
422
+ }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "risk", [_dec21], {
423
+ configurable: true,
424
+ enumerable: true,
425
+ writable: true,
426
+ initializer: null
427
+ }), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "payment_provider", [_dec22, _dec23], {
410
428
  configurable: true,
411
429
  enumerable: true,
412
430
  writable: true,
413
431
  initializer: function () {
414
432
  return _paymentProvider.default;
415
433
  }
416
- }), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "organisation_payment_provider", [_dec23, _dec24], {
434
+ }), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "organisation_payment_provider", [_dec24, _dec25], {
417
435
  configurable: true,
418
436
  enumerable: true,
419
437
  writable: true,
420
438
  initializer: function () {
421
439
  return _organisationPaymentProvider.default;
422
440
  }
423
- }), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "tokenisation_provider", [_dec25, _dec26], {
441
+ }), _descriptor15 = _applyDecoratedDescriptor(_class2.prototype, "tokenisation_provider", [_dec26, _dec27], {
424
442
  configurable: true,
425
443
  enumerable: true,
426
444
  writable: true,
427
445
  initializer: function () {
428
446
  return _tokenisationProvider.default;
429
447
  }
430
- }), _descriptor15 = _applyDecoratedDescriptor(_class2.prototype, "refund", [_dec27], {
448
+ }), _descriptor16 = _applyDecoratedDescriptor(_class2.prototype, "refund", [_dec28], {
431
449
  configurable: true,
432
450
  enumerable: true,
433
451
  writable: true,
434
452
  initializer: null
435
- }), _descriptor16 = _applyDecoratedDescriptor(_class2.prototype, "surcharge", [_dec28], {
453
+ }), _descriptor17 = _applyDecoratedDescriptor(_class2.prototype, "surcharge", [_dec29], {
436
454
  configurable: true,
437
455
  enumerable: true,
438
456
  writable: true,
439
457
  initializer: null
440
- }), _descriptor17 = _applyDecoratedDescriptor(_class2.prototype, "provider_reference", [_dec29], {
458
+ }), _descriptor18 = _applyDecoratedDescriptor(_class2.prototype, "provider_reference", [_dec30], {
441
459
  configurable: true,
442
460
  enumerable: true,
443
461
  writable: true,
444
462
  initializer: function () {
445
463
  return "";
446
464
  }
447
- }), _descriptor18 = _applyDecoratedDescriptor(_class2.prototype, "currency", [_dec30], {
465
+ }), _descriptor19 = _applyDecoratedDescriptor(_class2.prototype, "currency", [_dec31], {
448
466
  configurable: true,
449
467
  enumerable: true,
450
468
  writable: true,
451
469
  initializer: function () {
452
470
  return _currency.DEFAULT_CURRENCY;
453
471
  }
454
- }), _descriptor19 = _applyDecoratedDescriptor(_class2.prototype, "provider_metadata", [_dec31], {
472
+ }), _descriptor20 = _applyDecoratedDescriptor(_class2.prototype, "provider_metadata", [_dec32], {
455
473
  configurable: true,
456
474
  enumerable: true,
457
475
  writable: true,
458
476
  initializer: null
459
- }), _descriptor20 = _applyDecoratedDescriptor(_class2.prototype, "completed_at", [_dec32], {
477
+ }), _descriptor21 = _applyDecoratedDescriptor(_class2.prototype, "completed_at", [_dec33], {
460
478
  configurable: true,
461
479
  enumerable: true,
462
480
  writable: true,
463
481
  initializer: null
464
- }), _descriptor21 = _applyDecoratedDescriptor(_class2.prototype, "message", [_dec33], {
482
+ }), _descriptor22 = _applyDecoratedDescriptor(_class2.prototype, "message", [_dec34], {
465
483
  configurable: true,
466
484
  enumerable: true,
467
485
  writable: true,
468
486
  initializer: null
469
- }), _descriptor22 = _applyDecoratedDescriptor(_class2.prototype, "user_agent", [_dec34], {
487
+ }), _descriptor23 = _applyDecoratedDescriptor(_class2.prototype, "user_agent", [_dec35], {
470
488
  configurable: true,
471
489
  enumerable: true,
472
490
  writable: true,
473
491
  initializer: null
474
- }), _descriptor23 = _applyDecoratedDescriptor(_class2.prototype, "ip_address", [_dec35], {
492
+ }), _descriptor24 = _applyDecoratedDescriptor(_class2.prototype, "ip_address", [_dec36], {
475
493
  configurable: true,
476
494
  enumerable: true,
477
495
  writable: true,
478
496
  initializer: function () {
479
497
  return "";
480
498
  }
481
- }), _descriptor24 = _applyDecoratedDescriptor(_class2.prototype, "fingerprint", [_dec36], {
499
+ }), _descriptor25 = _applyDecoratedDescriptor(_class2.prototype, "fingerprint", [_dec37], {
482
500
  configurable: true,
483
501
  enumerable: true,
484
502
  writable: true,
485
503
  initializer: function () {
486
504
  return "";
487
505
  }
488
- }), _descriptor25 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec37], {
506
+ }), _descriptor26 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec38], {
489
507
  configurable: true,
490
508
  enumerable: true,
491
509
  writable: true,
492
510
  initializer: null
493
- }), _descriptor26 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec38], {
511
+ }), _descriptor27 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec39], {
494
512
  configurable: true,
495
513
  enumerable: true,
496
514
  writable: true,
497
515
  initializer: null
498
- }), _descriptor27 = _applyDecoratedDescriptor(_class2.prototype, "batch", [_dec39], {
516
+ }), _descriptor28 = _applyDecoratedDescriptor(_class2.prototype, "batch", [_dec40], {
499
517
  configurable: true,
500
518
  enumerable: true,
501
519
  writable: true,
502
520
  initializer: null
503
- }), _descriptor28 = _applyDecoratedDescriptor(_class2.prototype, "assigned_at", [_dec40], {
521
+ }), _descriptor29 = _applyDecoratedDescriptor(_class2.prototype, "assigned_at", [_dec41], {
504
522
  configurable: true,
505
523
  enumerable: true,
506
524
  writable: true,
507
525
  initializer: null
508
- }), _descriptor29 = _applyDecoratedDescriptor(_class2.prototype, "settlement", [_dec41], {
526
+ }), _descriptor30 = _applyDecoratedDescriptor(_class2.prototype, "settlement", [_dec42], {
509
527
  configurable: true,
510
528
  enumerable: true,
511
529
  writable: true,
512
530
  initializer: null
513
- }), _descriptor30 = _applyDecoratedDescriptor(_class2.prototype, "customer", [_dec42, _dec43], {
531
+ }), _descriptor31 = _applyDecoratedDescriptor(_class2.prototype, "customer", [_dec43, _dec44], {
514
532
  configurable: true,
515
533
  enumerable: true,
516
534
  writable: true,
@@ -0,0 +1,143 @@
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 _transaction = _interopRequireDefault(require("../transaction"));
11
+
12
+ var _geojson = require("geojson");
13
+
14
+ 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, _descriptor10;
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 TransactionRisk = exports.default = (_dec = (0, _typeorm.Entity)({
25
+ name: 'transaction_risk',
26
+ schema: 'payment'
27
+ }), _dec2 = (0, _typeorm.ManyToOne)(() => _transaction.default, {
28
+ primary: true
29
+ }), _dec3 = (0, _typeorm.JoinColumn)({
30
+ name: 'transaction_id',
31
+ referencedColumnName: 'id'
32
+ }), _dec4 = (0, _typeorm.Column)({
33
+ type: "int",
34
+ nullable: true
35
+ }), _dec5 = (0, _typeorm.Index)({
36
+ spatial: true
37
+ }), _dec6 = (0, _typeorm.Column)({
38
+ type: 'geography',
39
+ spatialFeatureType: 'Point',
40
+ srid: 4326,
41
+ nullable: true
42
+ }), _dec7 = (0, _typeorm.Column)({
43
+ type: "varchar",
44
+ nullable: true,
45
+ length: 10
46
+ }), _dec8 = (0, _typeorm.Column)({
47
+ type: "varchar",
48
+ nullable: true,
49
+ length: 100
50
+ }), _dec9 = (0, _typeorm.Column)({
51
+ type: "varchar",
52
+ nullable: true,
53
+ length: 100
54
+ }), _dec10 = (0, _typeorm.Column)({
55
+ type: "varchar",
56
+ nullable: true,
57
+ length: 100
58
+ }), _dec11 = (0, _typeorm.Column)({
59
+ type: "varchar",
60
+ nullable: true,
61
+ length: 100
62
+ }), _dec12 = (0, _typeorm.Column)({
63
+ type: "varchar",
64
+ nullable: true,
65
+ length: 100
66
+ }), _dec13 = (0, _typeorm.CreateDateColumn)({
67
+ type: 'timestamp with time zone'
68
+ }), _dec(_class = (_class2 = class TransactionRisk {
69
+ constructor() {
70
+ _initializerDefineProperty(this, "transaction", _descriptor, this);
71
+
72
+ _initializerDefineProperty(this, "blocklists", _descriptor2, this);
73
+
74
+ _initializerDefineProperty(this, "location", _descriptor3, this);
75
+
76
+ _initializerDefineProperty(this, "country_code", _descriptor4, this);
77
+
78
+ _initializerDefineProperty(this, "isp", _descriptor5, this);
79
+
80
+ _initializerDefineProperty(this, "os", _descriptor6, this);
81
+
82
+ _initializerDefineProperty(this, "browser", _descriptor7, this);
83
+
84
+ _initializerDefineProperty(this, "city", _descriptor8, this);
85
+
86
+ _initializerDefineProperty(this, "region", _descriptor9, this);
87
+
88
+ _initializerDefineProperty(this, "created_at", _descriptor10, this);
89
+ }
90
+
91
+ }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "transaction", [_dec2, _dec3], {
92
+ configurable: true,
93
+ enumerable: true,
94
+ writable: true,
95
+ initializer: function () {
96
+ return _transaction.default;
97
+ }
98
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "blocklists", [_dec4], {
99
+ configurable: true,
100
+ enumerable: true,
101
+ writable: true,
102
+ initializer: null
103
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "location", [_dec5, _dec6], {
104
+ configurable: true,
105
+ enumerable: true,
106
+ writable: true,
107
+ initializer: null
108
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "country_code", [_dec7], {
109
+ configurable: true,
110
+ enumerable: true,
111
+ writable: true,
112
+ initializer: null
113
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "isp", [_dec8], {
114
+ configurable: true,
115
+ enumerable: true,
116
+ writable: true,
117
+ initializer: null
118
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "os", [_dec9], {
119
+ configurable: true,
120
+ enumerable: true,
121
+ writable: true,
122
+ initializer: null
123
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "browser", [_dec10], {
124
+ configurable: true,
125
+ enumerable: true,
126
+ writable: true,
127
+ initializer: null
128
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "city", [_dec11], {
129
+ configurable: true,
130
+ enumerable: true,
131
+ writable: true,
132
+ initializer: null
133
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "region", [_dec12], {
134
+ configurable: true,
135
+ enumerable: true,
136
+ writable: true,
137
+ initializer: null
138
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec13], {
139
+ configurable: true,
140
+ enumerable: true,
141
+ writable: true,
142
+ initializer: null
143
+ })), _class2)) || _class);
package/dist/index.js CHANGED
@@ -609,6 +609,12 @@ Object.defineProperty(exports, "TransactionReasonEntity", {
609
609
  return _transactionReason.default;
610
610
  }
611
611
  });
612
+ Object.defineProperty(exports, "TransactionRiskEntity", {
613
+ enumerable: true,
614
+ get: function () {
615
+ return _transactionRisk.default;
616
+ }
617
+ });
612
618
  Object.defineProperty(exports, "TransactionSourceEntity", {
613
619
  enumerable: true,
614
620
  get: function () {
@@ -816,6 +822,8 @@ var _refundStatus = _interopRequireDefault(require("./entity/payment/refund-stat
816
822
 
817
823
  var _transactionSurcharge = _interopRequireDefault(require("./entity/payment/transaction-surcharge"));
818
824
 
825
+ var _transactionRisk = _interopRequireDefault(require("./entity/payment/transaction-risk"));
826
+
819
827
  var _country = _interopRequireDefault(require("./entity/reference/country"));
820
828
 
821
829
  var _transaction3 = _interopRequireDefault(require("./entity/total-processing/transaction"));
@@ -0,0 +1,16 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class transactionRis1707862771162 {
4
+ name = 'transactionRis1707862771162'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`CREATE TABLE "payment"."transaction_risk" ("blocklists" integer, "location" geography(Point,4326), "country_cide" character varying(10), "isp" character varying(100), "os" character varying(100), "browser" character varying(100), "city" character varying(100), "region" character varying(100), "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "transaction_id" character varying NOT NULL, CONSTRAINT "PK_68576ba1bc9f74b2261b3d615ee" PRIMARY KEY ("transaction_id"))`);
8
+ await queryRunner.query(`CREATE INDEX "IDX_800723809d712d0811cc308154" ON "payment"."transaction_risk" USING GiST ("location") `);
9
+ await queryRunner.query(`ALTER TABLE "payment"."transaction_risk" ADD CONSTRAINT "FK_68576ba1bc9f74b2261b3d615ee" FOREIGN KEY ("transaction_id") REFERENCES "payment"."transaction"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
10
+ }
11
+
12
+ async down(queryRunner) {
13
+ await queryRunner.query(`ALTER TABLE "payment"."transaction_risk" DROP CONSTRAINT "FK_68576ba1bc9f74b2261b3d615ee"`);
14
+ await queryRunner.query(`DROP TABLE "payment"."transaction_risk"`);
15
+ }
16
+ }
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class transactionRiskFix1707863333445 {
4
+ name = 'transactionRiskFix1707863333445'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "payment"."transaction_risk" RENAME COLUMN "country_cide" TO "country_code"`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`ALTER TABLE "payment"."transaction_risk" RENAME COLUMN "country_code" TO "country_cide"`);
12
+ }
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.11.72",
3
+ "version": "1.11.74",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -61,6 +61,7 @@
61
61
  "axios": "^0.26.1",
62
62
  "dotenv": "^16.0.0",
63
63
  "epsagon": "^1.121.3",
64
+ "geojson": "^0.5.0",
64
65
  "moment": "^2.29.3",
65
66
  "typeorm": "^0.2.41",
66
67
  "typeorm-aurora-data-api-driver": "^2.4.2",