@felloh-org/lambda-wrapper 1.1.60 → 1.1.63
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/dist/entity/agent-data/booking/index.js +11 -1
- package/dist/entity/payment/organisation-payment-provider/index.js +48 -36
- package/dist/entity/user/organisation-webhook/index.js +110 -0
- package/dist/entity/user/webhook-types/index.js +120 -0
- package/dist/migration/agent-data/1659707743290-booking_soft_delete.js +13 -0
- package/dist/migration/payment/1659527810407-organisation-payment-provider-name.js +26 -0
- package/dist/migration/user/1660126405407-webhooks.js +26 -0
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ var _uuid = require("uuid");
|
|
|
17
17
|
|
|
18
18
|
var _bookingComponent = _interopRequireDefault(require("../booking-component"));
|
|
19
19
|
|
|
20
|
-
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;
|
|
20
|
+
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, _descriptor14;
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
|
|
@@ -61,6 +61,9 @@ let Booking = (_dec = (0, _typeorm.Entity)({
|
|
|
61
61
|
type: 'timestamp with time zone'
|
|
62
62
|
}), _dec16 = (0, _typeorm.UpdateDateColumn)({
|
|
63
63
|
type: 'timestamp with time zone'
|
|
64
|
+
}), _dec17 = (0, _typeorm.DeleteDateColumn)({
|
|
65
|
+
type: 'timestamp with time zone',
|
|
66
|
+
nullable: true
|
|
64
67
|
}), _dec(_class = (_class2 = class Booking {
|
|
65
68
|
constructor() {
|
|
66
69
|
_initializerDefineProperty(this, "id", _descriptor, this);
|
|
@@ -88,6 +91,8 @@ let Booking = (_dec = (0, _typeorm.Entity)({
|
|
|
88
91
|
_initializerDefineProperty(this, "created_at", _descriptor12, this);
|
|
89
92
|
|
|
90
93
|
_initializerDefineProperty(this, "updated_at", _descriptor13, this);
|
|
94
|
+
|
|
95
|
+
_initializerDefineProperty(this, "deleted_at", _descriptor14, this);
|
|
91
96
|
}
|
|
92
97
|
|
|
93
98
|
/**
|
|
@@ -202,5 +207,10 @@ let Booking = (_dec = (0, _typeorm.Entity)({
|
|
|
202
207
|
enumerable: true,
|
|
203
208
|
writable: true,
|
|
204
209
|
initializer: null
|
|
210
|
+
}), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec17], {
|
|
211
|
+
configurable: true,
|
|
212
|
+
enumerable: true,
|
|
213
|
+
writable: true,
|
|
214
|
+
initializer: null
|
|
205
215
|
})), _class2)) || _class);
|
|
206
216
|
exports.default = Booking;
|
|
@@ -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, _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, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14;
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
@@ -28,15 +28,18 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
|
|
|
28
28
|
let OrganisationPaymentProvider = (_dec = (0, _typeorm.Entity)({
|
|
29
29
|
name: 'organisation_payment_provider',
|
|
30
30
|
schema: 'payment'
|
|
31
|
-
}), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.
|
|
31
|
+
}), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.Column)({
|
|
32
|
+
type: "varchar",
|
|
33
|
+
length: "150"
|
|
34
|
+
}), _dec4 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec5 = (0, _typeorm.JoinColumn)({
|
|
32
35
|
name: 'organisation_id',
|
|
33
36
|
referencedColumnName: 'id'
|
|
34
|
-
}),
|
|
37
|
+
}), _dec6 = (0, _typeorm.ManyToOne)(() => _paymentProvider.default), _dec7 = (0, _typeorm.JoinColumn)({
|
|
35
38
|
name: 'payment_provider_id',
|
|
36
39
|
referencedColumnName: 'id'
|
|
37
|
-
}),
|
|
40
|
+
}), _dec8 = (0, _typeorm.ManyToMany)(() => _transactionMethod.default, {
|
|
38
41
|
cascade: true
|
|
39
|
-
}),
|
|
42
|
+
}), _dec9 = (0, _typeorm.JoinTable)({
|
|
40
43
|
name: "organisation_payment_provider_method",
|
|
41
44
|
schema: "payment",
|
|
42
45
|
joinColumn: {
|
|
@@ -47,50 +50,52 @@ let OrganisationPaymentProvider = (_dec = (0, _typeorm.Entity)({
|
|
|
47
50
|
name: "transaction_method_id",
|
|
48
51
|
referencedColumnName: "id"
|
|
49
52
|
}
|
|
50
|
-
}),
|
|
53
|
+
}), _dec10 = (0, _typeorm.Column)({
|
|
51
54
|
type: "varchar",
|
|
52
55
|
length: "150"
|
|
53
|
-
}),
|
|
56
|
+
}), _dec11 = (0, _typeorm.Column)({
|
|
54
57
|
type: "json",
|
|
55
58
|
nullable: true
|
|
56
|
-
}),
|
|
59
|
+
}), _dec12 = (0, _typeorm.Column)({
|
|
57
60
|
type: "varchar",
|
|
58
61
|
length: "512"
|
|
59
|
-
}),
|
|
62
|
+
}), _dec13 = (0, _typeorm.Column)({
|
|
60
63
|
type: "varchar",
|
|
61
64
|
length: "4"
|
|
62
|
-
}),
|
|
65
|
+
}), _dec14 = (0, _typeorm.Column)({
|
|
63
66
|
type: "boolean",
|
|
64
67
|
default: false
|
|
65
|
-
}),
|
|
68
|
+
}), _dec15 = (0, _typeorm.Column)({
|
|
66
69
|
type: "int"
|
|
67
|
-
}),
|
|
70
|
+
}), _dec16 = (0, _typeorm.CreateDateColumn)(), _dec17 = (0, _typeorm.UpdateDateColumn)(), _dec18 = (0, _typeorm.DeleteDateColumn)(), _dec(_class = (_class2 = class OrganisationPaymentProvider {
|
|
68
71
|
constructor() {
|
|
69
72
|
_initializerDefineProperty(this, "id", _descriptor, this);
|
|
70
73
|
|
|
71
|
-
_initializerDefineProperty(this, "
|
|
74
|
+
_initializerDefineProperty(this, "name", _descriptor2, this);
|
|
75
|
+
|
|
76
|
+
_initializerDefineProperty(this, "organisation", _descriptor3, this);
|
|
72
77
|
|
|
73
|
-
_initializerDefineProperty(this, "payment_provider",
|
|
78
|
+
_initializerDefineProperty(this, "payment_provider", _descriptor4, this);
|
|
74
79
|
|
|
75
|
-
_initializerDefineProperty(this, "transaction_methods",
|
|
80
|
+
_initializerDefineProperty(this, "transaction_methods", _descriptor5, this);
|
|
76
81
|
|
|
77
|
-
_initializerDefineProperty(this, "public_key",
|
|
82
|
+
_initializerDefineProperty(this, "public_key", _descriptor6, this);
|
|
78
83
|
|
|
79
|
-
_initializerDefineProperty(this, "public_creds",
|
|
84
|
+
_initializerDefineProperty(this, "public_creds", _descriptor7, this);
|
|
80
85
|
|
|
81
|
-
_initializerDefineProperty(this, "secret_key",
|
|
86
|
+
_initializerDefineProperty(this, "secret_key", _descriptor8, this);
|
|
82
87
|
|
|
83
|
-
_initializerDefineProperty(this, "secret_key_last_four",
|
|
88
|
+
_initializerDefineProperty(this, "secret_key_last_four", _descriptor9, this);
|
|
84
89
|
|
|
85
|
-
_initializerDefineProperty(this, "is_active",
|
|
90
|
+
_initializerDefineProperty(this, "is_active", _descriptor10, this);
|
|
86
91
|
|
|
87
|
-
_initializerDefineProperty(this, "weight",
|
|
92
|
+
_initializerDefineProperty(this, "weight", _descriptor11, this);
|
|
88
93
|
|
|
89
|
-
_initializerDefineProperty(this, "created_at",
|
|
94
|
+
_initializerDefineProperty(this, "created_at", _descriptor12, this);
|
|
90
95
|
|
|
91
|
-
_initializerDefineProperty(this, "updated_at",
|
|
96
|
+
_initializerDefineProperty(this, "updated_at", _descriptor13, this);
|
|
92
97
|
|
|
93
|
-
_initializerDefineProperty(this, "deleted_at",
|
|
98
|
+
_initializerDefineProperty(this, "deleted_at", _descriptor14, this);
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
|
|
@@ -100,74 +105,81 @@ let OrganisationPaymentProvider = (_dec = (0, _typeorm.Entity)({
|
|
|
100
105
|
initializer: function () {
|
|
101
106
|
return (0, _uuid.v4)();
|
|
102
107
|
}
|
|
103
|
-
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "
|
|
108
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "name", [_dec3], {
|
|
109
|
+
configurable: true,
|
|
110
|
+
enumerable: true,
|
|
111
|
+
writable: true,
|
|
112
|
+
initializer: function () {
|
|
113
|
+
return "";
|
|
114
|
+
}
|
|
115
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec4, _dec5], {
|
|
104
116
|
configurable: true,
|
|
105
117
|
enumerable: true,
|
|
106
118
|
writable: true,
|
|
107
119
|
initializer: function () {
|
|
108
120
|
return _organisation.default;
|
|
109
121
|
}
|
|
110
|
-
}),
|
|
122
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "payment_provider", [_dec6, _dec7], {
|
|
111
123
|
configurable: true,
|
|
112
124
|
enumerable: true,
|
|
113
125
|
writable: true,
|
|
114
126
|
initializer: function () {
|
|
115
127
|
return _paymentProvider.default;
|
|
116
128
|
}
|
|
117
|
-
}),
|
|
129
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "transaction_methods", [_dec8, _dec9], {
|
|
118
130
|
configurable: true,
|
|
119
131
|
enumerable: true,
|
|
120
132
|
writable: true,
|
|
121
133
|
initializer: null
|
|
122
|
-
}),
|
|
134
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "public_key", [_dec10], {
|
|
123
135
|
configurable: true,
|
|
124
136
|
enumerable: true,
|
|
125
137
|
writable: true,
|
|
126
138
|
initializer: function () {
|
|
127
139
|
return "";
|
|
128
140
|
}
|
|
129
|
-
}),
|
|
141
|
+
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "public_creds", [_dec11], {
|
|
130
142
|
configurable: true,
|
|
131
143
|
enumerable: true,
|
|
132
144
|
writable: true,
|
|
133
145
|
initializer: null
|
|
134
|
-
}),
|
|
146
|
+
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "secret_key", [_dec12], {
|
|
135
147
|
configurable: true,
|
|
136
148
|
enumerable: true,
|
|
137
149
|
writable: true,
|
|
138
150
|
initializer: function () {
|
|
139
151
|
return "";
|
|
140
152
|
}
|
|
141
|
-
}),
|
|
153
|
+
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "secret_key_last_four", [_dec13], {
|
|
142
154
|
configurable: true,
|
|
143
155
|
enumerable: true,
|
|
144
156
|
writable: true,
|
|
145
157
|
initializer: function () {
|
|
146
158
|
return "";
|
|
147
159
|
}
|
|
148
|
-
}),
|
|
160
|
+
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "is_active", [_dec14], {
|
|
149
161
|
configurable: true,
|
|
150
162
|
enumerable: true,
|
|
151
163
|
writable: true,
|
|
152
164
|
initializer: function () {
|
|
153
165
|
return false;
|
|
154
166
|
}
|
|
155
|
-
}),
|
|
167
|
+
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "weight", [_dec15], {
|
|
156
168
|
configurable: true,
|
|
157
169
|
enumerable: true,
|
|
158
170
|
writable: true,
|
|
159
171
|
initializer: null
|
|
160
|
-
}),
|
|
172
|
+
}), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec16], {
|
|
161
173
|
configurable: true,
|
|
162
174
|
enumerable: true,
|
|
163
175
|
writable: true,
|
|
164
176
|
initializer: null
|
|
165
|
-
}),
|
|
177
|
+
}), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec17], {
|
|
166
178
|
configurable: true,
|
|
167
179
|
enumerable: true,
|
|
168
180
|
writable: true,
|
|
169
181
|
initializer: null
|
|
170
|
-
}),
|
|
182
|
+
}), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec18], {
|
|
171
183
|
configurable: true,
|
|
172
184
|
enumerable: true,
|
|
173
185
|
writable: true,
|
|
@@ -0,0 +1,110 @@
|
|
|
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 _organisation = _interopRequireDefault(require("../organisation"));
|
|
11
|
+
|
|
12
|
+
var _webhookTypes = _interopRequireDefault(require("../webhook-types"));
|
|
13
|
+
|
|
14
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7;
|
|
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 OrganisationWebhook = (_dec = (0, _typeorm.Entity)({
|
|
25
|
+
name: 'organisation_webhook',
|
|
26
|
+
schema: 'user'
|
|
27
|
+
}), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec4 = (0, _typeorm.JoinColumn)({
|
|
28
|
+
name: 'organisation_id',
|
|
29
|
+
referencedColumnName: 'id'
|
|
30
|
+
}), _dec5 = (0, _typeorm.Column)({
|
|
31
|
+
type: "varchar",
|
|
32
|
+
length: "250"
|
|
33
|
+
}), _dec6 = (0, _typeorm.ManyToMany)(() => _webhookTypes.default, webhook_types => webhook_types.organisation_webhooks), _dec7 = (0, _typeorm.JoinTable)({
|
|
34
|
+
name: "organisation_webhook_types",
|
|
35
|
+
schema: "user",
|
|
36
|
+
joinColumn: {
|
|
37
|
+
name: "organisation_webhook_id",
|
|
38
|
+
referencedColumnName: "id"
|
|
39
|
+
},
|
|
40
|
+
inverseJoinColumn: {
|
|
41
|
+
name: "webhook_type_id",
|
|
42
|
+
referencedColumnName: "id"
|
|
43
|
+
}
|
|
44
|
+
}), _dec8 = (0, _typeorm.CreateDateColumn)({
|
|
45
|
+
type: 'timestamp with time zone',
|
|
46
|
+
default: () => 'NOW()'
|
|
47
|
+
}), _dec9 = (0, _typeorm.UpdateDateColumn)({
|
|
48
|
+
type: 'timestamp with time zone',
|
|
49
|
+
default: () => 'NOW()'
|
|
50
|
+
}), _dec10 = (0, _typeorm.DeleteDateColumn)({
|
|
51
|
+
type: 'timestamp with time zone',
|
|
52
|
+
nullable: true
|
|
53
|
+
}), _dec(_class = (_class2 = class OrganisationWebhook {
|
|
54
|
+
constructor() {
|
|
55
|
+
_initializerDefineProperty(this, "id", _descriptor, this);
|
|
56
|
+
|
|
57
|
+
_initializerDefineProperty(this, "organisation", _descriptor2, this);
|
|
58
|
+
|
|
59
|
+
_initializerDefineProperty(this, "url", _descriptor3, this);
|
|
60
|
+
|
|
61
|
+
_initializerDefineProperty(this, "webhook_types", _descriptor4, this);
|
|
62
|
+
|
|
63
|
+
_initializerDefineProperty(this, "created_at", _descriptor5, this);
|
|
64
|
+
|
|
65
|
+
_initializerDefineProperty(this, "updated_at", _descriptor6, this);
|
|
66
|
+
|
|
67
|
+
_initializerDefineProperty(this, "deleted_at", _descriptor7, this);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
|
|
71
|
+
configurable: true,
|
|
72
|
+
enumerable: true,
|
|
73
|
+
writable: true,
|
|
74
|
+
initializer: null
|
|
75
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec3, _dec4], {
|
|
76
|
+
configurable: true,
|
|
77
|
+
enumerable: true,
|
|
78
|
+
writable: true,
|
|
79
|
+
initializer: function () {
|
|
80
|
+
return _organisation.default;
|
|
81
|
+
}
|
|
82
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "url", [_dec5], {
|
|
83
|
+
configurable: true,
|
|
84
|
+
enumerable: true,
|
|
85
|
+
writable: true,
|
|
86
|
+
initializer: function () {
|
|
87
|
+
return "";
|
|
88
|
+
}
|
|
89
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "webhook_types", [_dec6, _dec7], {
|
|
90
|
+
configurable: true,
|
|
91
|
+
enumerable: true,
|
|
92
|
+
writable: true,
|
|
93
|
+
initializer: null
|
|
94
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec8], {
|
|
95
|
+
configurable: true,
|
|
96
|
+
enumerable: true,
|
|
97
|
+
writable: true,
|
|
98
|
+
initializer: null
|
|
99
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec9], {
|
|
100
|
+
configurable: true,
|
|
101
|
+
enumerable: true,
|
|
102
|
+
writable: true,
|
|
103
|
+
initializer: null
|
|
104
|
+
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec10], {
|
|
105
|
+
configurable: true,
|
|
106
|
+
enumerable: true,
|
|
107
|
+
writable: true,
|
|
108
|
+
initializer: null
|
|
109
|
+
})), _class2)) || _class);
|
|
110
|
+
exports.default = OrganisationWebhook;
|
|
@@ -0,0 +1,120 @@
|
|
|
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 _organisationWebhook = _interopRequireDefault(require("../organisation-webhook"));
|
|
11
|
+
|
|
12
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8;
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
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 }); }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
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.'); }
|
|
21
|
+
|
|
22
|
+
let WebhookTypes = (_dec = (0, _typeorm.Entity)({
|
|
23
|
+
name: 'webhook_types',
|
|
24
|
+
schema: 'user'
|
|
25
|
+
}), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.Column)({
|
|
26
|
+
type: "varchar",
|
|
27
|
+
length: "50"
|
|
28
|
+
}), _dec4 = (0, _typeorm.Column)({
|
|
29
|
+
type: "varchar",
|
|
30
|
+
length: "150"
|
|
31
|
+
}), _dec5 = (0, _typeorm.Column)({
|
|
32
|
+
type: "varchar",
|
|
33
|
+
length: "250"
|
|
34
|
+
}), _dec6 = (0, _typeorm.ManyToMany)(() => _organisationWebhook.default, organisation_webhooks => organisation_webhooks.webhook_types), _dec7 = (0, _typeorm.JoinTable)({
|
|
35
|
+
name: "organisation_webhook_types",
|
|
36
|
+
schema: "user",
|
|
37
|
+
joinColumn: {
|
|
38
|
+
name: "webhook_type_id",
|
|
39
|
+
referencedColumnName: "id"
|
|
40
|
+
},
|
|
41
|
+
inverseJoinColumn: {
|
|
42
|
+
name: "organisation_webhook_id",
|
|
43
|
+
referencedColumnName: "id"
|
|
44
|
+
}
|
|
45
|
+
}), _dec8 = (0, _typeorm.CreateDateColumn)({
|
|
46
|
+
type: 'timestamp with time zone',
|
|
47
|
+
default: () => 'NOW()'
|
|
48
|
+
}), _dec9 = (0, _typeorm.UpdateDateColumn)({
|
|
49
|
+
type: 'timestamp with time zone',
|
|
50
|
+
default: () => 'NOW()'
|
|
51
|
+
}), _dec10 = (0, _typeorm.DeleteDateColumn)({
|
|
52
|
+
type: 'timestamp with time zone',
|
|
53
|
+
nullable: true
|
|
54
|
+
}), _dec(_class = (_class2 = class WebhookTypes {
|
|
55
|
+
constructor() {
|
|
56
|
+
_initializerDefineProperty(this, "id", _descriptor, this);
|
|
57
|
+
|
|
58
|
+
_initializerDefineProperty(this, "machine_name", _descriptor2, this);
|
|
59
|
+
|
|
60
|
+
_initializerDefineProperty(this, "name", _descriptor3, this);
|
|
61
|
+
|
|
62
|
+
_initializerDefineProperty(this, "description", _descriptor4, this);
|
|
63
|
+
|
|
64
|
+
_initializerDefineProperty(this, "organisation_webhooks", _descriptor5, this);
|
|
65
|
+
|
|
66
|
+
_initializerDefineProperty(this, "created_at", _descriptor6, this);
|
|
67
|
+
|
|
68
|
+
_initializerDefineProperty(this, "updated_at", _descriptor7, this);
|
|
69
|
+
|
|
70
|
+
_initializerDefineProperty(this, "deleted_at", _descriptor8, this);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
|
|
74
|
+
configurable: true,
|
|
75
|
+
enumerable: true,
|
|
76
|
+
writable: true,
|
|
77
|
+
initializer: null
|
|
78
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "machine_name", [_dec3], {
|
|
79
|
+
configurable: true,
|
|
80
|
+
enumerable: true,
|
|
81
|
+
writable: true,
|
|
82
|
+
initializer: function () {
|
|
83
|
+
return "";
|
|
84
|
+
}
|
|
85
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "name", [_dec4], {
|
|
86
|
+
configurable: true,
|
|
87
|
+
enumerable: true,
|
|
88
|
+
writable: true,
|
|
89
|
+
initializer: function () {
|
|
90
|
+
return "";
|
|
91
|
+
}
|
|
92
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "description", [_dec5], {
|
|
93
|
+
configurable: true,
|
|
94
|
+
enumerable: true,
|
|
95
|
+
writable: true,
|
|
96
|
+
initializer: function () {
|
|
97
|
+
return "";
|
|
98
|
+
}
|
|
99
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "organisation_webhooks", [_dec6, _dec7], {
|
|
100
|
+
configurable: true,
|
|
101
|
+
enumerable: true,
|
|
102
|
+
writable: true,
|
|
103
|
+
initializer: null
|
|
104
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec8], {
|
|
105
|
+
configurable: true,
|
|
106
|
+
enumerable: true,
|
|
107
|
+
writable: true,
|
|
108
|
+
initializer: null
|
|
109
|
+
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec9], {
|
|
110
|
+
configurable: true,
|
|
111
|
+
enumerable: true,
|
|
112
|
+
writable: true,
|
|
113
|
+
initializer: null
|
|
114
|
+
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec10], {
|
|
115
|
+
configurable: true,
|
|
116
|
+
enumerable: true,
|
|
117
|
+
writable: true,
|
|
118
|
+
initializer: null
|
|
119
|
+
})), _class2)) || _class);
|
|
120
|
+
exports.default = WebhookTypes;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class bookingSoftDelete1659707743290 {
|
|
4
|
+
name = 'bookingSoftDelete1659707743290'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "agent_data"."booking" ADD "deleted_at" TIMESTAMP WITH TIME ZONE`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async down(queryRunner) {
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "agent_data"."booking" DROP COLUMN "deleted_at"`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class organisationPaymentProviderName1659527810407 {
|
|
4
|
+
name = 'organisationPaymentProviderName1659527810407'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" ADD "name" character varying(150) NOT NULL DEFAULT 'UNTITLED'`);
|
|
8
|
+
// Set default "name" value using format "<PROVIDER-NAME> - <TRANSACTION-METHOD-1>,<TRANSACTION-METHOD-2>"
|
|
9
|
+
await queryRunner.query(`
|
|
10
|
+
UPDATE "payment"."organisation_payment_provider"
|
|
11
|
+
SET "name" = CONCAT_WS(' - ', "provider"."name", "methods"."names")
|
|
12
|
+
FROM "payment"."organisation_payment_provider" AS "organisation"
|
|
13
|
+
JOIN (
|
|
14
|
+
SELECT "organisation_payment_provider_id" AS "organisation_id"
|
|
15
|
+
, STRING_AGG("method"."transaction_method_id", ',') AS "names"
|
|
16
|
+
FROM "payment"."organisation_payment_provider_method" AS "method"
|
|
17
|
+
GROUP BY "organisation_id"
|
|
18
|
+
) AS "methods" ON "methods"."organisation_id" = "organisation"."id"
|
|
19
|
+
JOIN "payment"."payment_provider" AS "provider" ON "organisation"."payment_provider_id" = "provider"."id"
|
|
20
|
+
`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async down(queryRunner) {
|
|
24
|
+
await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" DROP COLUMN "name"`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class webhooks1660126405407 {
|
|
4
|
+
name = 'webhooks1660126405407'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE "user"."webhook_types" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "machine_name" character varying(50) NOT NULL, "name" character varying(150) NOT NULL, "description" character varying(250) NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), "deleted_at" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_0062153406a6125e2510c8e4a16" PRIMARY KEY ("id"))`);
|
|
8
|
+
await queryRunner.query(`CREATE TABLE "user"."organisation_webhook" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "url" character varying(250) NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), "deleted_at" TIMESTAMP WITH TIME ZONE, "organisation_id" character varying(150), CONSTRAINT "PK_deb78b83ae8298b4a383c5f2f56" PRIMARY KEY ("id"))`);
|
|
9
|
+
await queryRunner.query(`CREATE TABLE "user"."organisation_webhook_types" ("webhook_type_id" uuid NOT NULL, "organisation_webhook_id" uuid NOT NULL, CONSTRAINT "PK_e4847cc053914fd4613cb4d9ee2" PRIMARY KEY ("webhook_type_id", "organisation_webhook_id"))`);
|
|
10
|
+
await queryRunner.query(`CREATE INDEX "IDX_5e4373e5d6dc38fc8fa54a0a91" ON "user"."organisation_webhook_types" ("webhook_type_id") `);
|
|
11
|
+
await queryRunner.query(`CREATE INDEX "IDX_4ef74efa24be992cd0a1e4b535" ON "user"."organisation_webhook_types" ("organisation_webhook_id") `);
|
|
12
|
+
await queryRunner.query(`ALTER TABLE "user"."organisation_webhook" ADD CONSTRAINT "FK_a2497f989b9ac9d34eb746aa266" FOREIGN KEY ("organisation_id") REFERENCES "user"."organisation"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "user"."organisation_webhook_types" ADD CONSTRAINT "FK_5e4373e5d6dc38fc8fa54a0a919" FOREIGN KEY ("webhook_type_id") REFERENCES "user"."webhook_types"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE "user"."organisation_webhook_types" ADD CONSTRAINT "FK_4ef74efa24be992cd0a1e4b535b" FOREIGN KEY ("organisation_webhook_id") REFERENCES "user"."organisation_webhook"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async down(queryRunner) {
|
|
18
|
+
await queryRunner.query(`ALTER TABLE "user"."organisation_webhook_types" DROP CONSTRAINT "FK_4ef74efa24be992cd0a1e4b535b"`);
|
|
19
|
+
await queryRunner.query(`ALTER TABLE "user"."organisation_webhook_types" DROP CONSTRAINT "FK_5e4373e5d6dc38fc8fa54a0a919"`);
|
|
20
|
+
await queryRunner.query(`ALTER TABLE "user"."organisation_webhook" DROP CONSTRAINT "FK_a2497f989b9ac9d34eb746aa266"`);
|
|
21
|
+
await queryRunner.query(`ALTER TABLE "user"."user_role" DROP CONSTRAINT "FK_32a6fc2fcb019d8e3a8ace0f55f"`);
|
|
22
|
+
await queryRunner.query(`DROP TABLE "user"."organisation_webhook_types"`);
|
|
23
|
+
await queryRunner.query(`DROP TABLE "user"."organisation_webhook"`);
|
|
24
|
+
await queryRunner.query(`DROP TABLE "user"."webhook_types"`);
|
|
25
|
+
}
|
|
26
|
+
}
|