@felloh-org/lambda-wrapper 1.6.10 → 1.7.1
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.
- package/.github/workflows/release.yml +9 -0
- package/README.md +1 -1
- package/dist/entity/agent-data/booking/index.js +60 -44
- package/dist/event/base-event/index.js +3 -2
- package/dist/event/csv/email/index.js +24 -0
- package/dist/event/index.js +24 -0
- package/dist/index.js +16 -0
- package/dist/migration/1676565874446-booking-currency.js +13 -0
- package/package.json +1 -1
|
@@ -6,6 +6,10 @@ jobs:
|
|
|
6
6
|
publish:
|
|
7
7
|
name: Publish
|
|
8
8
|
runs-on: ubuntu-latest
|
|
9
|
+
strategy:
|
|
10
|
+
matrix:
|
|
11
|
+
os: [ ubuntu-latest ]
|
|
12
|
+
node-version: [ 16.x ]
|
|
9
13
|
if: github.ref == 'refs/heads/main'
|
|
10
14
|
steps:
|
|
11
15
|
- name: Checkout
|
|
@@ -17,6 +21,11 @@ jobs:
|
|
|
17
21
|
path: '**/node_modules'
|
|
18
22
|
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
|
19
23
|
|
|
24
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
25
|
+
uses: actions/setup-node@v2
|
|
26
|
+
with:
|
|
27
|
+
node-version: ${{ matrix.node-version }}
|
|
28
|
+
|
|
20
29
|
- name: Build and publish release.
|
|
21
30
|
run: yarn install
|
|
22
31
|
env:
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
# Lambda Wrapper [](https://github.com/felloh-org/lambda-wrapper/actions/workflows/release.yml)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A function wrapper to wrap all of our lambdas and provide useful functionality, monitoring and logging + time saving tooling to all of our serverless services.
|
|
@@ -7,21 +7,23 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _typeorm = require("typeorm");
|
|
9
9
|
|
|
10
|
+
var _uuid = require("uuid");
|
|
11
|
+
|
|
10
12
|
var _user = _interopRequireDefault(require("../../user/user"));
|
|
11
13
|
|
|
12
14
|
var _organisation = _interopRequireDefault(require("../../user/organisation"));
|
|
13
15
|
|
|
14
16
|
var _transaction = _interopRequireDefault(require("../../payment/transaction"));
|
|
15
17
|
|
|
16
|
-
var _uuid = require("uuid");
|
|
17
|
-
|
|
18
18
|
var _bookingComponent = _interopRequireDefault(require("../booking-component"));
|
|
19
19
|
|
|
20
20
|
var _paymentLink = _interopRequireDefault(require("../../payment/payment-link"));
|
|
21
21
|
|
|
22
22
|
var _creditNote = _interopRequireDefault(require("../../payment/credit-note"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _currency = require("../../bank/currency");
|
|
25
|
+
|
|
26
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _dec21, _dec22, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _descriptor17, _descriptor18;
|
|
25
27
|
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
29
|
|
|
@@ -38,37 +40,41 @@ let Booking = (_dec = (0, _typeorm.Entity)({
|
|
|
38
40
|
type: "int",
|
|
39
41
|
nullable: true
|
|
40
42
|
}), _dec4 = (0, _typeorm.Column)({
|
|
43
|
+
type: "varchar",
|
|
44
|
+
length: "3",
|
|
45
|
+
default: _currency.DEFAULT_CURRENCY
|
|
46
|
+
}), _dec5 = (0, _typeorm.Column)({
|
|
41
47
|
type: "varchar",
|
|
42
48
|
length: "250",
|
|
43
49
|
nullable: true
|
|
44
|
-
}),
|
|
50
|
+
}), _dec6 = (0, _typeorm.ManyToOne)(() => _user.default, {
|
|
45
51
|
nullable: true
|
|
46
|
-
}),
|
|
52
|
+
}), _dec7 = (0, _typeorm.JoinColumn)({
|
|
47
53
|
name: 'user_id',
|
|
48
54
|
referencedColumnName: 'id'
|
|
49
|
-
}),
|
|
55
|
+
}), _dec8 = (0, _typeorm.OneToMany)(() => _transaction.default, transaction => transaction.booking), _dec9 = (0, _typeorm.OneToMany)(() => _creditNote.default, creditNote => creditNote.booking_applied_to), _dec10 = (0, _typeorm.OneToMany)(() => _bookingComponent.default, bookingComponent => bookingComponent.booking), _dec11 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec12 = (0, _typeorm.JoinColumn)({
|
|
50
56
|
name: 'organisation_id',
|
|
51
57
|
referencedColumnName: 'id'
|
|
52
|
-
}),
|
|
58
|
+
}), _dec13 = (0, _typeorm.Column)({
|
|
53
59
|
type: "varchar",
|
|
54
60
|
length: "150"
|
|
55
|
-
}),
|
|
61
|
+
}), _dec14 = (0, _typeorm.Column)({
|
|
56
62
|
type: "varchar",
|
|
57
63
|
length: "150"
|
|
58
|
-
}),
|
|
64
|
+
}), _dec15 = (0, _typeorm.Index)(), _dec16 = (0, _typeorm.Column)({
|
|
59
65
|
type: "date",
|
|
60
66
|
nullable: true
|
|
61
|
-
}),
|
|
67
|
+
}), _dec17 = (0, _typeorm.Column)({
|
|
62
68
|
type: "date",
|
|
63
69
|
nullable: true
|
|
64
|
-
}),
|
|
70
|
+
}), _dec18 = (0, _typeorm.CreateDateColumn)({
|
|
65
71
|
type: 'timestamp with time zone'
|
|
66
|
-
}),
|
|
72
|
+
}), _dec19 = (0, _typeorm.UpdateDateColumn)({
|
|
67
73
|
type: 'timestamp with time zone'
|
|
68
|
-
}),
|
|
74
|
+
}), _dec20 = (0, _typeorm.DeleteDateColumn)({
|
|
69
75
|
type: 'timestamp with time zone',
|
|
70
76
|
nullable: true
|
|
71
|
-
}),
|
|
77
|
+
}), _dec21 = (0, _typeorm.OneToMany)(() => _paymentLink.default, paymentLink => paymentLink.booking), _dec22 = (0, _typeorm.Column)({
|
|
72
78
|
type: "boolean",
|
|
73
79
|
default: false
|
|
74
80
|
}), _dec(_class = (_class2 = class Booking {
|
|
@@ -77,35 +83,37 @@ let Booking = (_dec = (0, _typeorm.Entity)({
|
|
|
77
83
|
|
|
78
84
|
_initializerDefineProperty(this, "gross_amount", _descriptor2, this);
|
|
79
85
|
|
|
80
|
-
_initializerDefineProperty(this, "
|
|
86
|
+
_initializerDefineProperty(this, "currency", _descriptor3, this);
|
|
87
|
+
|
|
88
|
+
_initializerDefineProperty(this, "email", _descriptor4, this);
|
|
81
89
|
|
|
82
|
-
_initializerDefineProperty(this, "user",
|
|
90
|
+
_initializerDefineProperty(this, "user", _descriptor5, this);
|
|
83
91
|
|
|
84
|
-
_initializerDefineProperty(this, "transactions",
|
|
92
|
+
_initializerDefineProperty(this, "transactions", _descriptor6, this);
|
|
85
93
|
|
|
86
|
-
_initializerDefineProperty(this, "applied_credit_notes",
|
|
94
|
+
_initializerDefineProperty(this, "applied_credit_notes", _descriptor7, this);
|
|
87
95
|
|
|
88
|
-
_initializerDefineProperty(this, "components",
|
|
96
|
+
_initializerDefineProperty(this, "components", _descriptor8, this);
|
|
89
97
|
|
|
90
|
-
_initializerDefineProperty(this, "organisation",
|
|
98
|
+
_initializerDefineProperty(this, "organisation", _descriptor9, this);
|
|
91
99
|
|
|
92
|
-
_initializerDefineProperty(this, "customer_name",
|
|
100
|
+
_initializerDefineProperty(this, "customer_name", _descriptor10, this);
|
|
93
101
|
|
|
94
|
-
_initializerDefineProperty(this, "booking_reference",
|
|
102
|
+
_initializerDefineProperty(this, "booking_reference", _descriptor11, this);
|
|
95
103
|
|
|
96
|
-
_initializerDefineProperty(this, "departure_date",
|
|
104
|
+
_initializerDefineProperty(this, "departure_date", _descriptor12, this);
|
|
97
105
|
|
|
98
|
-
_initializerDefineProperty(this, "return_date",
|
|
106
|
+
_initializerDefineProperty(this, "return_date", _descriptor13, this);
|
|
99
107
|
|
|
100
|
-
_initializerDefineProperty(this, "created_at",
|
|
108
|
+
_initializerDefineProperty(this, "created_at", _descriptor14, this);
|
|
101
109
|
|
|
102
|
-
_initializerDefineProperty(this, "updated_at",
|
|
110
|
+
_initializerDefineProperty(this, "updated_at", _descriptor15, this);
|
|
103
111
|
|
|
104
|
-
_initializerDefineProperty(this, "deleted_at",
|
|
112
|
+
_initializerDefineProperty(this, "deleted_at", _descriptor16, this);
|
|
105
113
|
|
|
106
|
-
_initializerDefineProperty(this, "payment_links",
|
|
114
|
+
_initializerDefineProperty(this, "payment_links", _descriptor17, this);
|
|
107
115
|
|
|
108
|
-
_initializerDefineProperty(this, "is_temporary",
|
|
116
|
+
_initializerDefineProperty(this, "is_temporary", _descriptor18, this);
|
|
109
117
|
}
|
|
110
118
|
|
|
111
119
|
/**
|
|
@@ -123,6 +131,7 @@ let Booking = (_dec = (0, _typeorm.Entity)({
|
|
|
123
131
|
return_date: this.return_date,
|
|
124
132
|
email: this.email,
|
|
125
133
|
gross_amount: this.gross_amount,
|
|
134
|
+
currency: this.currency,
|
|
126
135
|
transactions: [],
|
|
127
136
|
components: [],
|
|
128
137
|
payment_links: [],
|
|
@@ -180,87 +189,94 @@ let Booking = (_dec = (0, _typeorm.Entity)({
|
|
|
180
189
|
enumerable: true,
|
|
181
190
|
writable: true,
|
|
182
191
|
initializer: null
|
|
183
|
-
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "
|
|
192
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "currency", [_dec4], {
|
|
193
|
+
configurable: true,
|
|
194
|
+
enumerable: true,
|
|
195
|
+
writable: true,
|
|
196
|
+
initializer: function () {
|
|
197
|
+
return _currency.DEFAULT_CURRENCY;
|
|
198
|
+
}
|
|
199
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "email", [_dec5], {
|
|
184
200
|
configurable: true,
|
|
185
201
|
enumerable: true,
|
|
186
202
|
writable: true,
|
|
187
203
|
initializer: function () {
|
|
188
204
|
return "";
|
|
189
205
|
}
|
|
190
|
-
}),
|
|
206
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "user", [_dec6, _dec7], {
|
|
191
207
|
configurable: true,
|
|
192
208
|
enumerable: true,
|
|
193
209
|
writable: true,
|
|
194
210
|
initializer: function () {
|
|
195
211
|
return _user.default;
|
|
196
212
|
}
|
|
197
|
-
}),
|
|
213
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "transactions", [_dec8], {
|
|
198
214
|
configurable: true,
|
|
199
215
|
enumerable: true,
|
|
200
216
|
writable: true,
|
|
201
217
|
initializer: null
|
|
202
|
-
}),
|
|
218
|
+
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "applied_credit_notes", [_dec9], {
|
|
203
219
|
configurable: true,
|
|
204
220
|
enumerable: true,
|
|
205
221
|
writable: true,
|
|
206
222
|
initializer: null
|
|
207
|
-
}),
|
|
223
|
+
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "components", [_dec10], {
|
|
208
224
|
configurable: true,
|
|
209
225
|
enumerable: true,
|
|
210
226
|
writable: true,
|
|
211
227
|
initializer: null
|
|
212
|
-
}),
|
|
228
|
+
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec11, _dec12], {
|
|
213
229
|
configurable: true,
|
|
214
230
|
enumerable: true,
|
|
215
231
|
writable: true,
|
|
216
232
|
initializer: function () {
|
|
217
233
|
return _organisation.default;
|
|
218
234
|
}
|
|
219
|
-
}),
|
|
235
|
+
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "customer_name", [_dec13], {
|
|
220
236
|
configurable: true,
|
|
221
237
|
enumerable: true,
|
|
222
238
|
writable: true,
|
|
223
239
|
initializer: function () {
|
|
224
240
|
return "";
|
|
225
241
|
}
|
|
226
|
-
}),
|
|
242
|
+
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "booking_reference", [_dec14, _dec15], {
|
|
227
243
|
configurable: true,
|
|
228
244
|
enumerable: true,
|
|
229
245
|
writable: true,
|
|
230
246
|
initializer: function () {
|
|
231
247
|
return "";
|
|
232
248
|
}
|
|
233
|
-
}),
|
|
249
|
+
}), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "departure_date", [_dec16], {
|
|
234
250
|
configurable: true,
|
|
235
251
|
enumerable: true,
|
|
236
252
|
writable: true,
|
|
237
253
|
initializer: null
|
|
238
|
-
}),
|
|
254
|
+
}), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "return_date", [_dec17], {
|
|
239
255
|
configurable: true,
|
|
240
256
|
enumerable: true,
|
|
241
257
|
writable: true,
|
|
242
258
|
initializer: null
|
|
243
|
-
}),
|
|
259
|
+
}), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec18], {
|
|
244
260
|
configurable: true,
|
|
245
261
|
enumerable: true,
|
|
246
262
|
writable: true,
|
|
247
263
|
initializer: null
|
|
248
|
-
}),
|
|
264
|
+
}), _descriptor15 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec19], {
|
|
249
265
|
configurable: true,
|
|
250
266
|
enumerable: true,
|
|
251
267
|
writable: true,
|
|
252
268
|
initializer: null
|
|
253
|
-
}),
|
|
269
|
+
}), _descriptor16 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec20], {
|
|
254
270
|
configurable: true,
|
|
255
271
|
enumerable: true,
|
|
256
272
|
writable: true,
|
|
257
273
|
initializer: null
|
|
258
|
-
}),
|
|
274
|
+
}), _descriptor17 = _applyDecoratedDescriptor(_class2.prototype, "payment_links", [_dec21], {
|
|
259
275
|
configurable: true,
|
|
260
276
|
enumerable: true,
|
|
261
277
|
writable: true,
|
|
262
278
|
initializer: null
|
|
263
|
-
}),
|
|
279
|
+
}), _descriptor18 = _applyDecoratedDescriptor(_class2.prototype, "is_temporary", [_dec22], {
|
|
264
280
|
configurable: true,
|
|
265
281
|
enumerable: true,
|
|
266
282
|
writable: true,
|
|
@@ -11,12 +11,13 @@ exports.default = void 0;
|
|
|
11
11
|
class BaseEvent {
|
|
12
12
|
/**
|
|
13
13
|
* BaseEvent constructor
|
|
14
|
+
* @param type
|
|
14
15
|
*/
|
|
15
|
-
constructor() {
|
|
16
|
+
constructor(type = null) {
|
|
16
17
|
this.base = {
|
|
17
18
|
Source: process.env.SERVICE_NAME,
|
|
18
19
|
EventBusName: process.env.EVENT_BRIDGE_ARN,
|
|
19
|
-
DetailType: null,
|
|
20
|
+
DetailType: type || null,
|
|
20
21
|
Time: new Date(),
|
|
21
22
|
Detail: {}
|
|
22
23
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _baseEvent = _interopRequireDefault(require("../../base-event"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const EVENT_TYPE = 'csv:export-link';
|
|
13
|
+
|
|
14
|
+
class TransactionCompleteEmail extends _baseEvent.default {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.setDetailType(EVENT_TYPE);
|
|
18
|
+
this.setDetailParam('data', {});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var _default = TransactionCompleteEmail;
|
|
24
|
+
exports.default = _default;
|
package/dist/event/index.js
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "BaseEvent", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _baseEvent.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "CSVEmail", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _email.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "TransactionCompleteEmailEvent", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _email2.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
6
24
|
Object.defineProperty(exports, "UserPasswordChanged", {
|
|
7
25
|
enumerable: true,
|
|
8
26
|
get: function () {
|
|
@@ -20,4 +38,10 @@ var _registration = _interopRequireDefault(require("./user/registration"));
|
|
|
20
38
|
|
|
21
39
|
var _changed = _interopRequireDefault(require("./user/password/changed"));
|
|
22
40
|
|
|
41
|
+
var _email = _interopRequireDefault(require("./csv/email"));
|
|
42
|
+
|
|
43
|
+
var _email2 = _interopRequireDefault(require("./transaction/complete/email"));
|
|
44
|
+
|
|
45
|
+
var _baseEvent = _interopRequireDefault(require("./base-event"));
|
|
46
|
+
|
|
23
47
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "AmendmentEntity", {
|
|
|
27
27
|
return _amendment.default;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "BaseEvent", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _baseEvent.default;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
30
36
|
Object.defineProperty(exports, "BenficiaryEntity", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
get: function () {
|
|
@@ -51,6 +57,12 @@ Object.defineProperty(exports, "BookingEntity", {
|
|
|
51
57
|
return _booking.default;
|
|
52
58
|
}
|
|
53
59
|
});
|
|
60
|
+
Object.defineProperty(exports, "CSVEmailEvent", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _email2.default;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
54
66
|
Object.defineProperty(exports, "ChargebackEntity", {
|
|
55
67
|
enumerable: true,
|
|
56
68
|
get: function () {
|
|
@@ -706,6 +718,8 @@ var _transaction6 = _interopRequireDefault(require("./entity/saltedge/transactio
|
|
|
706
718
|
|
|
707
719
|
var _paymentInitationTypes = _interopRequireDefault(require("./enums/payment-initation-types"));
|
|
708
720
|
|
|
721
|
+
var _baseEvent = _interopRequireDefault(require("./event/base-event"));
|
|
722
|
+
|
|
709
723
|
var _registration = _interopRequireDefault(require("./event/user/registration"));
|
|
710
724
|
|
|
711
725
|
var _changed = _interopRequireDefault(require("./event/user/password/changed"));
|
|
@@ -718,6 +732,8 @@ var _complete = _interopRequireDefault(require("./event/transaction/complete"));
|
|
|
718
732
|
|
|
719
733
|
var _email = _interopRequireDefault(require("./event/transaction/complete/email"));
|
|
720
734
|
|
|
735
|
+
var _email2 = _interopRequireDefault(require("./event/csv/email"));
|
|
736
|
+
|
|
721
737
|
var _model = _interopRequireDefault(require("./model"));
|
|
722
738
|
|
|
723
739
|
var _response = _interopRequireWildcard(require("./model/response"));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class bookingCurrency1676565874446 {
|
|
4
|
+
name = 'bookingCurrency1676565874446'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "agent_data"."booking" ADD "currency" character varying(3) NOT NULL DEFAULT 'GBX'`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async down(queryRunner) {
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "agent_data"."booking" DROP COLUMN "currency"`);
|
|
12
|
+
}
|
|
13
|
+
}
|