@felloh-org/lambda-wrapper 1.1.50 → 1.1.53

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.
@@ -9,7 +9,11 @@ var _typeorm = require("typeorm");
9
9
 
10
10
  var _user = _interopRequireDefault(require("../user"));
11
11
 
12
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9;
12
+ var _bookingComponent = _interopRequireDefault(require("../../agent-data/booking-component"));
13
+
14
+ var _organisationFeature = _interopRequireDefault(require("../organisation-feature"));
15
+
16
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11;
13
17
 
14
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
19
 
@@ -32,7 +36,11 @@ let Organisation = (_dec = (0, _typeorm.Entity)({
32
36
  type: "varchar",
33
37
  length: "250",
34
38
  nullable: true
35
- }), _dec6 = (0, _typeorm.CreateDateColumn)(), _dec7 = (0, _typeorm.UpdateDateColumn)(), _dec8 = (0, _typeorm.DeleteDateColumn)(), _dec9 = (0, _typeorm.ManyToMany)(() => _user.default, users => users.organisations), _dec10 = (0, _typeorm.JoinTable)({
39
+ }), _dec6 = (0, _typeorm.Column)({
40
+ type: "varchar",
41
+ length: "150",
42
+ nullable: true
43
+ }), _dec7 = (0, _typeorm.CreateDateColumn)(), _dec8 = (0, _typeorm.UpdateDateColumn)(), _dec9 = (0, _typeorm.DeleteDateColumn)(), _dec10 = (0, _typeorm.ManyToMany)(() => _user.default, users => users.organisations), _dec11 = (0, _typeorm.JoinTable)({
36
44
  name: "user_organisation",
37
45
  schema: "user",
38
46
  joinColumn: {
@@ -43,7 +51,7 @@ let Organisation = (_dec = (0, _typeorm.Entity)({
43
51
  name: "user_id",
44
52
  referencedColumnName: "id"
45
53
  }
46
- }), _dec11 = (0, _typeorm.TreeParent)(), _dec12 = (0, _typeorm.TreeChildren)(), _dec(_class = _dec2(_class = (_class2 = class Organisation {
54
+ }), _dec12 = (0, _typeorm.TreeParent)(), _dec13 = (0, _typeorm.TreeChildren)(), _dec14 = (0, _typeorm.OneToMany)(() => _organisationFeature.default, organisationFeature => organisationFeature.organisation), _dec(_class = _dec2(_class = (_class2 = class Organisation {
47
55
  constructor() {
48
56
  _initializerDefineProperty(this, "id", _descriptor, this);
49
57
 
@@ -51,17 +59,21 @@ let Organisation = (_dec = (0, _typeorm.Entity)({
51
59
 
52
60
  _initializerDefineProperty(this, "image", _descriptor3, this);
53
61
 
54
- _initializerDefineProperty(this, "created_at", _descriptor4, this);
62
+ _initializerDefineProperty(this, "legacy_id", _descriptor4, this);
63
+
64
+ _initializerDefineProperty(this, "created_at", _descriptor5, this);
65
+
66
+ _initializerDefineProperty(this, "updated_at", _descriptor6, this);
55
67
 
56
- _initializerDefineProperty(this, "updated_at", _descriptor5, this);
68
+ _initializerDefineProperty(this, "deleted_at", _descriptor7, this);
57
69
 
58
- _initializerDefineProperty(this, "deleted_at", _descriptor6, this);
70
+ _initializerDefineProperty(this, "users", _descriptor8, this);
59
71
 
60
- _initializerDefineProperty(this, "users", _descriptor7, this);
72
+ _initializerDefineProperty(this, "parent", _descriptor9, this);
61
73
 
62
- _initializerDefineProperty(this, "parent", _descriptor8, this);
74
+ _initializerDefineProperty(this, "children", _descriptor10, this);
63
75
 
64
- _initializerDefineProperty(this, "children", _descriptor9, this);
76
+ _initializerDefineProperty(this, "organisation_feature", _descriptor11, this);
65
77
  }
66
78
 
67
79
  propgate(id, name) {
@@ -69,6 +81,28 @@ let Organisation = (_dec = (0, _typeorm.Entity)({
69
81
  this.name = name;
70
82
  }
71
83
 
84
+ getPublicData() {
85
+ const response = {
86
+ id: this.id,
87
+ name: this.name,
88
+ image: this.image,
89
+ created_at: this.created_at,
90
+ updated_at: this.updated_at,
91
+ deleted_at: this.deleted_at,
92
+ features: []
93
+ };
94
+
95
+ if (this.organisation_feature !== null && this.organisation_feature.length >= 1) {
96
+ response.features = this.organisation_feature.map(orgFeature => ({
97
+ id: orgFeature.feature.id,
98
+ name: orgFeature.feature.name,
99
+ machine_name: orgFeature.feature.machine_name
100
+ }));
101
+ }
102
+
103
+ return response;
104
+ }
105
+
72
106
  getPublicCompactData() {
73
107
  return {
74
108
  id: this.id,
@@ -92,32 +126,42 @@ let Organisation = (_dec = (0, _typeorm.Entity)({
92
126
  enumerable: true,
93
127
  writable: true,
94
128
  initializer: null
95
- }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec6], {
129
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "legacy_id", [_dec6], {
130
+ configurable: true,
131
+ enumerable: true,
132
+ writable: true,
133
+ initializer: null
134
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec7], {
135
+ configurable: true,
136
+ enumerable: true,
137
+ writable: true,
138
+ initializer: null
139
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec8], {
96
140
  configurable: true,
97
141
  enumerable: true,
98
142
  writable: true,
99
143
  initializer: null
100
- }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec7], {
144
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec9], {
101
145
  configurable: true,
102
146
  enumerable: true,
103
147
  writable: true,
104
148
  initializer: null
105
- }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec8], {
149
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "users", [_dec10, _dec11], {
106
150
  configurable: true,
107
151
  enumerable: true,
108
152
  writable: true,
109
153
  initializer: null
110
- }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "users", [_dec9, _dec10], {
154
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "parent", [_dec12], {
111
155
  configurable: true,
112
156
  enumerable: true,
113
157
  writable: true,
114
158
  initializer: null
115
- }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "parent", [_dec11], {
159
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "children", [_dec13], {
116
160
  configurable: true,
117
161
  enumerable: true,
118
162
  writable: true,
119
163
  initializer: null
120
- }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "children", [_dec12], {
164
+ }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "organisation_feature", [_dec14], {
121
165
  configurable: true,
122
166
  enumerable: true,
123
167
  writable: true,
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class orgLegacyId1658920205370 {
4
+ name = 'orgLegacyId1658920205370'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "user"."organisation" ADD "legacy_id" character varying(150)`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`ALTER TABLE "user"."organisation" DROP COLUMN "legacy_id"`);
12
+ }
13
+ }
@@ -37,6 +37,7 @@ class AuthenticationService extends _dependencyAware.default {
37
37
  this.userRoleRepository = await that.connection.getRepository(_userRole.default);
38
38
  this.organisationRepository = await that.connection.getRepository(_organisation.default);
39
39
  this.user = await di.get(_dependencies.DEFINITIONS.USER).getUser();
40
+ di.get(_dependencies.DEFINITIONS.LOGGER).info(`user.id: ${this.user.id}`);
40
41
  }
41
42
  };
42
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.1.50",
3
+ "version": "1.1.53",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -17,7 +17,7 @@
17
17
  "start": "yarn build -w",
18
18
  "test": "jest --coverage"
19
19
  },
20
- "author": "Felloh",
20
+ "author": "Felloh.com",
21
21
  "license": "MIT",
22
22
  "devDependencies": {
23
23
  "@babel/cli": "^7.17.6",