@felloh-org/lambda-wrapper 1.0.8 → 1.0.9

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.
@@ -13,6 +13,8 @@ var _organisation = _interopRequireDefault(require("../../user/organisation"));
13
13
 
14
14
  var _transaction = _interopRequireDefault(require("../../payment/transaction"));
15
15
 
16
+ var _uuid = require("uuid");
17
+
16
18
  var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10;
17
19
 
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -75,7 +77,7 @@ let Booking = (_dec = (0, _typeorm.Entity)({
75
77
  enumerable: true,
76
78
  writable: true,
77
79
  initializer: function () {
78
- return undefined;
80
+ return (0, _uuid.v4)();
79
81
  }
80
82
  }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "email", [_dec3], {
81
83
  configurable: true,
@@ -7,6 +7,8 @@ exports.default = void 0;
7
7
 
8
8
  var _typeorm = require("typeorm");
9
9
 
10
+ var _uuid = require("uuid");
11
+
10
12
  var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
11
13
 
12
14
  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 }); }
@@ -18,7 +20,7 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
18
20
  let BookingComponent = (_dec = (0, _typeorm.Entity)({
19
21
  name: 'booking_component',
20
22
  schema: 'agent_data'
21
- }), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class BookingComponent {
23
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class BookingComponent {
22
24
  constructor() {
23
25
  _initializerDefineProperty(this, "id", _descriptor, this);
24
26
 
@@ -29,7 +31,9 @@ let BookingComponent = (_dec = (0, _typeorm.Entity)({
29
31
  configurable: true,
30
32
  enumerable: true,
31
33
  writable: true,
32
- initializer: null
34
+ initializer: function () {
35
+ return (0, _uuid.v4)();
36
+ }
33
37
  }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec3], {
34
38
  configurable: true,
35
39
  enumerable: true,
@@ -7,6 +7,8 @@ exports.default = void 0;
7
7
 
8
8
  var _typeorm = require("typeorm");
9
9
 
10
+ var _uuid = require("uuid");
11
+
10
12
  var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
11
13
 
12
14
  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 }); }
@@ -18,7 +20,7 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
18
20
  let BookingComponentType = (_dec = (0, _typeorm.Entity)({
19
21
  name: 'booking_component_type',
20
22
  schema: 'agent_data'
21
- }), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class BookingComponentType {
23
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class BookingComponentType {
22
24
  constructor() {
23
25
  _initializerDefineProperty(this, "id", _descriptor, this);
24
26
 
@@ -29,7 +31,9 @@ let BookingComponentType = (_dec = (0, _typeorm.Entity)({
29
31
  configurable: true,
30
32
  enumerable: true,
31
33
  writable: true,
32
- initializer: null
34
+ initializer: function () {
35
+ return (0, _uuid.v4)();
36
+ }
33
37
  }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec3], {
34
38
  configurable: true,
35
39
  enumerable: true,
@@ -7,7 +7,13 @@ exports.default = void 0;
7
7
 
8
8
  var _typeorm = require("typeorm");
9
9
 
10
- var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
10
+ var _organisation = _interopRequireDefault(require("../../user/organisation"));
11
+
12
+ var _uuid = require("uuid");
13
+
14
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
17
 
12
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 }); }
13
19
 
@@ -18,19 +24,45 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
18
24
  let Supplier = (_dec = (0, _typeorm.Entity)({
19
25
  name: 'supplier',
20
26
  schema: 'agent_data'
21
- }), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Supplier {
27
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _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: "150"
33
+ }), _dec6 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Supplier {
22
34
  constructor() {
23
35
  _initializerDefineProperty(this, "id", _descriptor, this);
24
36
 
25
- _initializerDefineProperty(this, "created_at", _descriptor2, this);
37
+ _initializerDefineProperty(this, "organisation", _descriptor2, this);
38
+
39
+ _initializerDefineProperty(this, "name", _descriptor3, this);
40
+
41
+ _initializerDefineProperty(this, "created_at", _descriptor4, this);
26
42
  }
27
43
 
28
44
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
29
45
  configurable: true,
30
46
  enumerable: true,
31
47
  writable: true,
32
- initializer: null
33
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec3], {
48
+ initializer: function () {
49
+ return (0, _uuid.v4)();
50
+ }
51
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec3, _dec4], {
52
+ configurable: true,
53
+ enumerable: true,
54
+ writable: true,
55
+ initializer: function () {
56
+ return _organisation.default;
57
+ }
58
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "name", [_dec5], {
59
+ configurable: true,
60
+ enumerable: true,
61
+ writable: true,
62
+ initializer: function () {
63
+ return "";
64
+ }
65
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec6], {
34
66
  configurable: true,
35
67
  enumerable: true,
36
68
  writable: true,
@@ -7,6 +7,8 @@ exports.default = void 0;
7
7
 
8
8
  var _typeorm = require("typeorm");
9
9
 
10
+ var _uuid = require("uuid");
11
+
10
12
  var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
11
13
 
12
14
  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 }); }
@@ -18,7 +20,7 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
18
20
  let SupplierType = (_dec = (0, _typeorm.Entity)({
19
21
  name: 'supplier_type',
20
22
  schema: 'agent_data'
21
- }), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class SupplierType {
23
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class SupplierType {
22
24
  constructor() {
23
25
  _initializerDefineProperty(this, "id", _descriptor, this);
24
26
 
@@ -29,7 +31,9 @@ let SupplierType = (_dec = (0, _typeorm.Entity)({
29
31
  configurable: true,
30
32
  enumerable: true,
31
33
  writable: true,
32
- initializer: null
34
+ initializer: function () {
35
+ return (0, _uuid.v4)();
36
+ }
33
37
  }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec3], {
34
38
  configurable: true,
35
39
  enumerable: true,
@@ -0,0 +1,17 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class addSupplierDetail1642771380681 {
4
+ name = 'addSupplierDetail1642771380681'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier" ADD "name" character varying(150) NOT NULL`);
8
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier" ADD "organisation_id" character varying(150)`);
9
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier" ADD CONSTRAINT "FK_4b0eb422429dfbe15daa42def90" FOREIGN KEY ("organisation_id") REFERENCES "user"."organisation"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
10
+ }
11
+
12
+ async down(queryRunner) {
13
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier" DROP CONSTRAINT "FK_4b0eb422429dfbe15daa42def90"`);
14
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier" DROP COLUMN "organisation_id"`);
15
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier" DROP COLUMN "name"`);
16
+ }
17
+ }
@@ -0,0 +1,41 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class swapUuid1642771909248 {
4
+ name = 'swapUuid1642771909248'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component_type" DROP CONSTRAINT "PK_31c60e2f5eb5eb274efbf1551cb"`);
8
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component_type" DROP COLUMN "id"`);
9
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component_type" ADD "id" character varying NOT NULL`);
10
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component_type" ADD CONSTRAINT "PK_31c60e2f5eb5eb274efbf1551cb" PRIMARY KEY ("id")`);
11
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP CONSTRAINT "PK_fde413f2d9d1e1377876431efaa"`);
12
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP COLUMN "id"`);
13
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD "id" character varying NOT NULL`);
14
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD CONSTRAINT "PK_fde413f2d9d1e1377876431efaa" PRIMARY KEY ("id")`);
15
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier" DROP COLUMN "id"`);
16
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier" ADD "id" character varying NOT NULL`);
17
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier" ADD CONSTRAINT "PK_2bc0d2cab6276144d2ff98a2828" PRIMARY KEY ("id")`);
18
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier_type" DROP COLUMN "id"`);
19
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier_type" ADD "id" character varying NOT NULL`);
20
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier_type" ADD CONSTRAINT "PK_682cd6e0ba8042baeb545fc12c7" PRIMARY KEY ("id")`);
21
+ }
22
+
23
+ async down(queryRunner) {
24
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier_type" DROP CONSTRAINT "PK_682cd6e0ba8042baeb545fc12c7"`);
25
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier_type" DROP COLUMN "id"`);
26
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier_type" ADD "id" uuid NOT NULL DEFAULT uuid_generate_v4()`);
27
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier_type" ADD CONSTRAINT "PK_682cd6e0ba8042baeb545fc12c7" PRIMARY KEY ("id")`);
28
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier" DROP CONSTRAINT "PK_2bc0d2cab6276144d2ff98a2828"`);
29
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier" DROP COLUMN "id"`);
30
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier" ADD "id" uuid NOT NULL DEFAULT uuid_generate_v4()`);
31
+ await queryRunner.query(`ALTER TABLE "agent_data"."supplier" ADD CONSTRAINT "PK_2bc0d2cab6276144d2ff98a2828" PRIMARY KEY ("id")`);
32
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP CONSTRAINT "PK_fde413f2d9d1e1377876431efaa"`);
33
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP COLUMN "id"`);
34
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD "id" uuid NOT NULL DEFAULT uuid_generate_v4()`);
35
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD CONSTRAINT "PK_fde413f2d9d1e1377876431efaa" PRIMARY KEY ("id")`);
36
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component_type" DROP CONSTRAINT "PK_31c60e2f5eb5eb274efbf1551cb"`);
37
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component_type" DROP COLUMN "id"`);
38
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component_type" ADD "id" uuid NOT NULL DEFAULT uuid_generate_v4()`);
39
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component_type" ADD CONSTRAINT "PK_31c60e2f5eb5eb274efbf1551cb" PRIMARY KEY ("id")`);
40
+ }
41
+ }
@@ -47,7 +47,7 @@ class Warehouse extends _dependencyAware.default {
47
47
  resourceArn: process.env.WAREHOUSE_ARN,
48
48
  region: process.env.REGION,
49
49
  entities: _entity.default,
50
- logging: false
50
+ logging: true
51
51
  });
52
52
  }
53
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {