@felloh-org/lambda-wrapper 1.1.55 → 1.1.56
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.
|
@@ -24,7 +24,7 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
|
|
|
24
24
|
let UserActivity = (_dec = (0, _typeorm.Entity)({
|
|
25
25
|
name: 'user_activity',
|
|
26
26
|
schema: 'user'
|
|
27
|
-
}), _dec2 = (0, _typeorm.
|
|
27
|
+
}), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.ManyToOne)(() => _user.default), _dec4 = (0, _typeorm.JoinColumn)({
|
|
28
28
|
name: 'user_id',
|
|
29
29
|
referencedColumnName: 'id'
|
|
30
30
|
}), _dec5 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec6 = (0, _typeorm.JoinColumn)({
|
|
@@ -54,11 +54,32 @@ let UserActivity = (_dec = (0, _typeorm.Entity)({
|
|
|
54
54
|
_initializerDefineProperty(this, "created_at", _descriptor6, this);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
getPublicData() {
|
|
58
|
+
const response = {
|
|
59
|
+
id: this.id,
|
|
60
|
+
type: this.type,
|
|
61
|
+
entity_id: this.entity_id,
|
|
62
|
+
created_at: this.created_at
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
if (this.user !== null && typeof this.user.id !== 'undefined') {
|
|
66
|
+
response.user = this.user.getPublicCompactData();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (this.organisation !== null && typeof this.organisation.id !== 'undefined') {
|
|
70
|
+
response.organisation = this.organisation.getPublicCompactData();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return response;
|
|
74
|
+
}
|
|
75
|
+
|
|
57
76
|
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
|
|
58
77
|
configurable: true,
|
|
59
78
|
enumerable: true,
|
|
60
79
|
writable: true,
|
|
61
|
-
initializer:
|
|
80
|
+
initializer: function () {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
62
83
|
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "user", [_dec3, _dec4], {
|
|
63
84
|
configurable: true,
|
|
64
85
|
enumerable: true,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class uuidIdString1659081328054 {
|
|
4
|
+
name = 'uuidIdString1659081328054'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "user"."user_activity" DROP CONSTRAINT "PK_daec6d19443689bda7d7785dff5"`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "user"."user_activity" DROP COLUMN "id"`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE "user"."user_activity" ADD "id" character varying NOT NULL`);
|
|
10
|
+
await queryRunner.query(`ALTER TABLE "user"."user_activity" ADD CONSTRAINT "PK_daec6d19443689bda7d7785dff5" PRIMARY KEY ("id")`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async down(queryRunner) {
|
|
14
|
+
await queryRunner.query(`ALTER TABLE "user"."user_activity" DROP CONSTRAINT "PK_daec6d19443689bda7d7785dff5"`);
|
|
15
|
+
await queryRunner.query(`ALTER TABLE "user"."user_activity" DROP COLUMN "id"`);
|
|
16
|
+
await queryRunner.query(`ALTER TABLE "user"."user_activity" ADD "id" uuid NOT NULL DEFAULT uuid_generate_v4()`);
|
|
17
|
+
await queryRunner.query(`ALTER TABLE "user"."user_activity" ADD CONSTRAINT "PK_daec6d19443689bda7d7785dff5" PRIMARY KEY ("id")`);
|
|
18
|
+
}
|
|
19
|
+
}
|