@felloh-org/lambda-wrapper 1.11.46 → 1.11.48
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.
|
@@ -31,8 +31,10 @@ var _organisationType = _interopRequireDefault(require("./organisation-type"));
|
|
|
31
31
|
|
|
32
32
|
var _organisationPartner = _interopRequireDefault(require("./organisation-partner"));
|
|
33
33
|
|
|
34
|
+
var _webhookLog = _interopRequireDefault(require("./webhook-log"));
|
|
35
|
+
|
|
34
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
37
|
|
|
36
|
-
const ENTITIES = [
|
|
38
|
+
const ENTITIES = [_feature.default, _loginLink.default, _organisation.default, _organisationFeature.default, _organisationPartner.default, _organisationPayoutConfig.default, _organisationType.default, _organisationWebhook.default, _role.default, _user.default, _userActivity.default, _userRole.default, _webhookLog.default, _webhookTypes.default];
|
|
37
39
|
|
|
38
40
|
var _default = exports.default = ENTITIES;
|
|
@@ -0,0 +1,79 @@
|
|
|
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, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5;
|
|
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 WebhookLog = exports.default = (_dec = (0, _typeorm.Entity)({
|
|
23
|
+
name: 'webhook_log',
|
|
24
|
+
schema: 'user'
|
|
25
|
+
}), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.ManyToOne)(() => _organisationWebhook.default), _dec4 = (0, _typeorm.JoinColumn)({
|
|
26
|
+
name: 'webhook_id',
|
|
27
|
+
referencedColumnName: 'id'
|
|
28
|
+
}), _dec5 = (0, _typeorm.Column)({
|
|
29
|
+
type: "boolean",
|
|
30
|
+
default: false
|
|
31
|
+
}), _dec6 = (0, _typeorm.CreateDateColumn)({
|
|
32
|
+
type: 'timestamp with time zone',
|
|
33
|
+
default: () => 'NOW()'
|
|
34
|
+
}), _dec7 = (0, _typeorm.UpdateDateColumn)({
|
|
35
|
+
type: 'timestamp with time zone',
|
|
36
|
+
default: () => 'NOW()'
|
|
37
|
+
}), _dec(_class = (_class2 = class WebhookLog {
|
|
38
|
+
constructor() {
|
|
39
|
+
_initializerDefineProperty(this, "id", _descriptor, this);
|
|
40
|
+
|
|
41
|
+
_initializerDefineProperty(this, "organisation_webhook", _descriptor2, this);
|
|
42
|
+
|
|
43
|
+
_initializerDefineProperty(this, "is_success", _descriptor3, this);
|
|
44
|
+
|
|
45
|
+
_initializerDefineProperty(this, "created_at", _descriptor4, this);
|
|
46
|
+
|
|
47
|
+
_initializerDefineProperty(this, "updated_at", _descriptor5, this);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
|
|
51
|
+
configurable: true,
|
|
52
|
+
enumerable: true,
|
|
53
|
+
writable: true,
|
|
54
|
+
initializer: null
|
|
55
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "organisation_webhook", [_dec3, _dec4], {
|
|
56
|
+
configurable: true,
|
|
57
|
+
enumerable: true,
|
|
58
|
+
writable: true,
|
|
59
|
+
initializer: function () {
|
|
60
|
+
return _organisationWebhook.default;
|
|
61
|
+
}
|
|
62
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "is_success", [_dec5], {
|
|
63
|
+
configurable: true,
|
|
64
|
+
enumerable: true,
|
|
65
|
+
writable: true,
|
|
66
|
+
initializer: function () {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec6], {
|
|
70
|
+
configurable: true,
|
|
71
|
+
enumerable: true,
|
|
72
|
+
writable: true,
|
|
73
|
+
initializer: null
|
|
74
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec7], {
|
|
75
|
+
configurable: true,
|
|
76
|
+
enumerable: true,
|
|
77
|
+
writable: true,
|
|
78
|
+
initializer: null
|
|
79
|
+
})), _class2)) || _class);
|
package/dist/index.js
CHANGED
|
@@ -663,6 +663,12 @@ Object.defineProperty(exports, "WarehouseService", {
|
|
|
663
663
|
return _warehouse.default;
|
|
664
664
|
}
|
|
665
665
|
});
|
|
666
|
+
Object.defineProperty(exports, "WebhookLog", {
|
|
667
|
+
enumerable: true,
|
|
668
|
+
get: function () {
|
|
669
|
+
return _webhookLog.default;
|
|
670
|
+
}
|
|
671
|
+
});
|
|
666
672
|
Object.defineProperty(exports, "WebhookTypesEntity", {
|
|
667
673
|
enumerable: true,
|
|
668
674
|
get: function () {
|
|
@@ -822,6 +828,8 @@ var _organisationPayoutConfig = _interopRequireDefault(require("./entity/user/or
|
|
|
822
828
|
|
|
823
829
|
var _organisationPartner = _interopRequireDefault(require("./entity/user/organisation-partner"));
|
|
824
830
|
|
|
831
|
+
var _webhookLog = _interopRequireDefault(require("./entity/user/webhook-log"));
|
|
832
|
+
|
|
825
833
|
var _batch3 = _interopRequireDefault(require("./entity/nuvei/batch"));
|
|
826
834
|
|
|
827
835
|
var _merchant2 = _interopRequireDefault(require("./entity/nuvei/merchant"));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class webhookLog1696844776497 {
|
|
4
|
+
name = 'webhookLog1696844776497'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE "user"."webhook_log" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "is_success" boolean NOT NULL DEFAULT false, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), "webhook_id" uuid, CONSTRAINT "PK_5164958b17361a85955a433d958" PRIMARY KEY ("id"))`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "user"."webhook_log" ADD CONSTRAINT "FK_56a3f6a8db5033543a35f2ede5b" FOREIGN KEY ("webhook_id") REFERENCES "user"."organisation_webhook"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async down(queryRunner) {
|
|
12
|
+
await queryRunner.query(`ALTER TABLE "user"."webhook_log" DROP CONSTRAINT "FK_56a3f6a8db5033543a35f2ede5b"`);
|
|
13
|
+
await queryRunner.query(`DROP TABLE "user"."webhook_log"`);
|
|
14
|
+
}
|
|
15
|
+
}
|
package/dist/wrapper/index.js
CHANGED
|
@@ -49,12 +49,17 @@ const handleError = (di, error) => {
|
|
|
49
49
|
const logger = di.get(_dependencies.DEFINITIONS.LOGGER);
|
|
50
50
|
let errorCode = error === null || error === void 0 ? void 0 : error.code;
|
|
51
51
|
logger.metric('lambda.status_code', errorCode || 500);
|
|
52
|
-
logger.error(error);
|
|
53
52
|
|
|
54
53
|
if (error instanceof _response.default) {
|
|
54
|
+
if (error.getCode().toString().startsWith('5')) {
|
|
55
|
+
logger.error(error);
|
|
56
|
+
}
|
|
57
|
+
|
|
55
58
|
return error.generate();
|
|
56
59
|
}
|
|
57
60
|
|
|
61
|
+
logger.error(error);
|
|
62
|
+
|
|
58
63
|
if (error.message === 'Database returned more than the allowed response size limit') {
|
|
59
64
|
errorCode = 413;
|
|
60
65
|
}
|