@merkaly/api 0.2.4-8 → 0.2.4

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.
Files changed (44) hide show
  1. package/.output/abstract/abstract.exception.d.ts +11 -0
  2. package/.output/abstract/abstract.exception.js +53 -0
  3. package/.output/exceptions/missing-identity.exception.d.ts +5 -0
  4. package/.output/exceptions/missing-identity.exception.js +30 -0
  5. package/.output/exceptions/store-not-implemented.exception.d.ts +5 -0
  6. package/.output/exceptions/store-not-implemented.exception.js +31 -0
  7. package/.output/exceptions/store-not-recognized.exception.d.ts +5 -0
  8. package/.output/exceptions/store-not-recognized.exception.js +30 -0
  9. package/.output/modules/content/pages/page.entity.d.ts +3 -6
  10. package/.output/modules/content/pages/page.fixture.js +2 -5
  11. package/.output/modules/content/pages/page.types.d.ts +12 -0
  12. package/.output/modules/content/pages/page.validator.d.ts +2 -5
  13. package/.output/modules/content/pages/page.validator.js +3 -15
  14. package/.output/modules/inventory/brands/brand.entity.d.ts +3 -0
  15. package/.output/modules/inventory/brands/brand.exception.d.ts +5 -0
  16. package/.output/modules/inventory/brands/brand.exception.js +40 -0
  17. package/.output/modules/inventory/brands/brand.validator.d.ts +2 -0
  18. package/.output/modules/inventory/brands/brand.validator.js +9 -0
  19. package/.output/modules/inventory/categories/category.entity.d.ts +3 -0
  20. package/.output/modules/inventory/categories/category.exception.d.ts +5 -0
  21. package/.output/modules/inventory/categories/category.exception.js +40 -0
  22. package/.output/modules/inventory/categories/category.validator.d.ts +2 -0
  23. package/.output/modules/inventory/categories/category.validator.js +9 -0
  24. package/.output/modules/inventory/products/product.entity.d.ts +1 -0
  25. package/.output/modules/inventory/products/product.exception.d.ts +5 -0
  26. package/.output/modules/inventory/products/product.exception.js +40 -0
  27. package/.output/modules/inventory/products/product.validator.d.ts +2 -1
  28. package/.output/modules/inventory/products/product.validator.js +7 -0
  29. package/.output/modules/inventory/properties/property.exception.d.ts +5 -0
  30. package/.output/modules/inventory/properties/property.exception.js +40 -0
  31. package/.output/modules/sales/clients/client.entity.d.ts +2 -1
  32. package/.output/modules/sales/clients/client.exception.d.ts +5 -0
  33. package/.output/modules/sales/clients/client.exception.js +40 -0
  34. package/.output/modules/sales/clients/client.validator.d.ts +5 -2
  35. package/.output/modules/sales/clients/client.validator.js +13 -1
  36. package/.output/modules/sales/orders/order.exception.d.ts +13 -0
  37. package/.output/modules/sales/orders/order.exception.js +46 -0
  38. package/.output/modules/setting/organization/organization.validator.d.ts +1 -0
  39. package/.output/modules/setting/organization/organization.validator.js +5 -0
  40. package/.output/services/logger.service.d.ts +11 -0
  41. package/.output/services/logger.service.js +54 -0
  42. package/.output/types.d.ts +4 -1
  43. package/README.md +14 -14
  44. package/package.json +9 -9
@@ -0,0 +1,11 @@
1
+ import { ArgumentsHost, ExceptionFilter, HttpException } from '@nestjs/common';
2
+ import { Request, Response } from 'express';
3
+ import { LoggerService } from '../services/logger.service';
4
+ export declare abstract class AbstractException implements ExceptionFilter {
5
+ protected readonly $logger: LoggerService;
6
+ protected request: Request;
7
+ protected response: Response;
8
+ protected host: ArgumentsHost;
9
+ catch(exception: HttpException, host: ArgumentsHost): Response<any, Record<string, any>>;
10
+ protected abstract handleError(exception: HttpException): HttpException;
11
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AbstractException = void 0;
13
+ var common_1 = require("@nestjs/common");
14
+ var logger_service_1 = require("../services/logger.service");
15
+ var AbstractException = (function () {
16
+ function AbstractException() {
17
+ }
18
+ AbstractException.prototype.catch = function (exception, host) {
19
+ this.host = host;
20
+ var ctx = this.host.switchToHttp();
21
+ this.response = ctx.getResponse();
22
+ this.request = ctx.getRequest();
23
+ this.$logger.error(exception);
24
+ var handledError = this.handleError(exception);
25
+ if (handledError instanceof common_1.HttpException) {
26
+ var trace = exception.getResponse().message;
27
+ this.response.statusMessage = handledError.name
28
+ .slice(0, -9)
29
+ .replace(/([A-Z])/g, ' $1')
30
+ .trim();
31
+ return this.response
32
+ .status(handledError.getStatus())
33
+ .json({
34
+ statusCode: handledError.getStatus(),
35
+ message: handledError.message,
36
+ error: this.response.statusMessage,
37
+ trace: trace,
38
+ });
39
+ }
40
+ return this.response
41
+ .status(500)
42
+ .json(new common_1.InternalServerErrorException(handledError));
43
+ };
44
+ __decorate([
45
+ (0, common_1.Inject)(),
46
+ __metadata("design:type", logger_service_1.LoggerService)
47
+ ], AbstractException.prototype, "$logger", void 0);
48
+ AbstractException = __decorate([
49
+ (0, common_1.Injectable)()
50
+ ], AbstractException);
51
+ return AbstractException;
52
+ }());
53
+ exports.AbstractException = AbstractException;
@@ -0,0 +1,5 @@
1
+ import { PreconditionFailedException } from '@nestjs/common';
2
+ export declare class MissingIdentityException extends PreconditionFailedException {
3
+ constructor();
4
+ static throw(): void;
5
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.MissingIdentityException = void 0;
19
+ var common_1 = require("@nestjs/common");
20
+ var MissingIdentityException = (function (_super) {
21
+ __extends(MissingIdentityException, _super);
22
+ function MissingIdentityException() {
23
+ return _super.call(this, 'Missing identity parameter on your request') || this;
24
+ }
25
+ MissingIdentityException.throw = function () {
26
+ throw new MissingIdentityException;
27
+ };
28
+ return MissingIdentityException;
29
+ }(common_1.PreconditionFailedException));
30
+ exports.MissingIdentityException = MissingIdentityException;
@@ -0,0 +1,5 @@
1
+ import { NotFoundException } from '@nestjs/common';
2
+ export declare class StoreNotImplementedException extends NotFoundException {
3
+ constructor(identity: string);
4
+ static throw(identity: string): void;
5
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.StoreNotImplementedException = void 0;
19
+ var common_1 = require("@nestjs/common");
20
+ var StoreNotImplementedException = (function (_super) {
21
+ __extends(StoreNotImplementedException, _super);
22
+ function StoreNotImplementedException(identity) {
23
+ return _super.call(this, "No store found by that id or name: [" + identity + "]") || this;
24
+ }
25
+ StoreNotImplementedException.throw = function (identity) {
26
+ common_1.Logger.warn('Store not found or implemented', identity);
27
+ throw new StoreNotImplementedException(identity);
28
+ };
29
+ return StoreNotImplementedException;
30
+ }(common_1.NotFoundException));
31
+ exports.StoreNotImplementedException = StoreNotImplementedException;
@@ -0,0 +1,5 @@
1
+ import { NotAcceptableException } from '@nestjs/common/exceptions/not-acceptable.exception';
2
+ export declare class StoreNotRecognizedException extends NotAcceptableException {
3
+ constructor();
4
+ static throw(): void;
5
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.StoreNotRecognizedException = void 0;
19
+ var not_acceptable_exception_1 = require("@nestjs/common/exceptions/not-acceptable.exception");
20
+ var StoreNotRecognizedException = (function (_super) {
21
+ __extends(StoreNotRecognizedException, _super);
22
+ function StoreNotRecognizedException() {
23
+ return _super.call(this, "The store could not be accepted") || this;
24
+ }
25
+ StoreNotRecognizedException.throw = function () {
26
+ throw new StoreNotRecognizedException();
27
+ };
28
+ return StoreNotRecognizedException;
29
+ }(not_acceptable_exception_1.NotAcceptableException));
30
+ exports.StoreNotRecognizedException = StoreNotRecognizedException;
@@ -1,11 +1,8 @@
1
1
  import { AbstractEntity } from '../../../abstract/abstract.entity';
2
- import { PageTypes } from './page.types';
3
- export declare class PageEntity extends AbstractEntity {
2
+ export declare class PageEntity<C = Record<string, any>> extends AbstractEntity {
4
3
  static readonly $index = "content_pages";
5
- slug: string;
4
+ name: string;
6
5
  title: string;
7
6
  description: string;
8
- image: string;
9
- type: PageTypes;
10
- content: string;
7
+ content: C;
11
8
  }
@@ -17,7 +17,6 @@ var __extends = (this && this.__extends) || (function () {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.PageFixture = void 0;
19
19
  var abstract_fixture_1 = require("../../../abstract/abstract.fixture");
20
- var page_types_1 = require("./page.types");
21
20
  var page_validator_1 = require("./page.validator");
22
21
  var PageFixture = (function (_super) {
23
22
  __extends(PageFixture, _super);
@@ -27,11 +26,9 @@ var PageFixture = (function (_super) {
27
26
  PageFixture.prototype.normal = function () {
28
27
  var page = new page_validator_1.CreatePageValidator();
29
28
  page.title = this.$faker.random.words(6);
30
- page.slug = this.$faker.helpers.slugify(page.title);
29
+ page.name = this.$faker.helpers.slugify(page.title);
31
30
  page.description = this.$faker.lorem.words(45);
32
- page.image = this.$faker.image.image(850, 400, true);
33
- page.content = this.$faker.lorem.paragraph(this.$faker.datatype.number({ min: 30, max: 60 }));
34
- page.type = this.$faker.helpers.arrayElement(Object.values(page_types_1.PageTypes));
31
+ page.content = {};
35
32
  return page;
36
33
  };
37
34
  return PageFixture;
@@ -1,3 +1,6 @@
1
+ import { ProductEntity } from '../../inventory/products/product.entity';
2
+ import { BrandEntity } from '../../inventory/brands/brand.entity';
3
+ import { CategoryEntity } from '../../inventory/categories/category.entity';
1
4
  export declare enum PageTypes {
2
5
  PAGE = "PAGE",
3
6
  POST = "POST"
@@ -6,3 +9,12 @@ export declare enum PageEvents {
6
9
  VALIDATE = "database.content.pages.validate",
7
10
  UPSERT_ES_DOCUMENT = "database.content.pages.upsert-es-document"
8
11
  }
12
+ export interface IndexPageContent {
13
+ hero: any[];
14
+ banners: any[];
15
+ products: ProductEntity[];
16
+ categories: CategoryEntity[];
17
+ brands: BrandEntity[];
18
+ promotions: unknown[];
19
+ services: unknown[];
20
+ }
@@ -1,11 +1,8 @@
1
- import { PageTypes } from './page.types';
2
1
  export declare class CreatePageValidator {
3
- slug: string;
2
+ name: string;
4
3
  title: string;
5
4
  description: string;
6
- image: string;
7
- type: PageTypes;
8
- content: string;
5
+ content: Record<string, any>;
9
6
  }
10
7
  export declare class UpdatePageValidator extends CreatePageValidator {
11
8
  }
@@ -26,17 +26,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.UpdatePageValidator = exports.CreatePageValidator = void 0;
28
28
  var class_validator_1 = require("class-validator");
29
- var page_types_1 = require("./page.types");
30
29
  var CreatePageValidator = (function () {
31
30
  function CreatePageValidator() {
32
31
  this.description = null;
33
- this.image = null;
34
- this.type = page_types_1.PageTypes.PAGE;
35
32
  }
36
33
  __decorate([
37
34
  (0, class_validator_1.IsString)(),
38
35
  __metadata("design:type", String)
39
- ], CreatePageValidator.prototype, "slug", void 0);
36
+ ], CreatePageValidator.prototype, "name", void 0);
40
37
  __decorate([
41
38
  (0, class_validator_1.IsString)(),
42
39
  __metadata("design:type", String)
@@ -47,18 +44,9 @@ var CreatePageValidator = (function () {
47
44
  __metadata("design:type", String)
48
45
  ], CreatePageValidator.prototype, "description", void 0);
49
46
  __decorate([
50
- (0, class_validator_1.IsUrl)(),
51
- (0, class_validator_1.IsOptional)(),
52
- __metadata("design:type", String)
53
- ], CreatePageValidator.prototype, "image", void 0);
54
- __decorate([
55
- (0, class_validator_1.IsString)(),
56
- (0, class_validator_1.IsEnum)(page_types_1.PageTypes),
47
+ (0, class_validator_1.IsObject)(),
48
+ (0, class_validator_1.IsNotEmptyObject)(),
57
49
  __metadata("design:type", Object)
58
- ], CreatePageValidator.prototype, "type", void 0);
59
- __decorate([
60
- (0, class_validator_1.IsString)(),
61
- __metadata("design:type", String)
62
50
  ], CreatePageValidator.prototype, "content", void 0);
63
51
  return CreatePageValidator;
64
52
  }());
@@ -1,6 +1,9 @@
1
1
  import { AbstractEntity } from '../../../abstract/abstract.entity';
2
+ import { AssetEntity } from '../../assets/asset.entity';
2
3
  export declare class BrandEntity extends AbstractEntity {
3
4
  static readonly $index = "inventory_brands";
4
5
  name: string;
5
6
  description: string;
7
+ image: AssetEntity;
8
+ readonly picture: string;
6
9
  }
@@ -0,0 +1,5 @@
1
+ import { HttpException } from '@nestjs/common';
2
+ import { AbstractException } from '../../../abstract/abstract.exception';
3
+ export declare class BrandException extends AbstractException {
4
+ handleError(exception: HttpException): HttpException;
5
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.BrandException = void 0;
25
+ var common_1 = require("@nestjs/common");
26
+ var abstract_exception_1 = require("../../../abstract/abstract.exception");
27
+ var BrandException = (function (_super) {
28
+ __extends(BrandException, _super);
29
+ function BrandException() {
30
+ return _super !== null && _super.apply(this, arguments) || this;
31
+ }
32
+ BrandException.prototype.handleError = function (exception) {
33
+ return exception;
34
+ };
35
+ BrandException = __decorate([
36
+ (0, common_1.Catch)()
37
+ ], BrandException);
38
+ return BrandException;
39
+ }(abstract_exception_1.AbstractException));
40
+ exports.BrandException = BrandException;
@@ -2,8 +2,10 @@ import { AbstractValidator } from "../../../abstract/abstract.validator";
2
2
  export declare class CreateBrandValidator extends AbstractValidator {
3
3
  name: string;
4
4
  description?: string;
5
+ image: string;
5
6
  }
6
7
  export declare class UpdateBrandValidator extends AbstractValidator {
7
8
  name?: string;
8
9
  description?: string;
10
+ image: string;
9
11
  }
@@ -42,6 +42,10 @@ var CreateBrandValidator = (function (_super) {
42
42
  (0, class_validator_1.IsOptional)(),
43
43
  __metadata("design:type", String)
44
44
  ], CreateBrandValidator.prototype, "description", void 0);
45
+ __decorate([
46
+ (0, class_validator_1.IsMongoId)(),
47
+ __metadata("design:type", String)
48
+ ], CreateBrandValidator.prototype, "image", void 0);
45
49
  return CreateBrandValidator;
46
50
  }(abstract_validator_1.AbstractValidator));
47
51
  exports.CreateBrandValidator = CreateBrandValidator;
@@ -61,6 +65,11 @@ var UpdateBrandValidator = (function (_super) {
61
65
  (0, class_validator_1.IsOptional)(),
62
66
  __metadata("design:type", String)
63
67
  ], UpdateBrandValidator.prototype, "description", void 0);
68
+ __decorate([
69
+ (0, class_validator_1.IsMongoId)(),
70
+ (0, class_validator_1.IsOptional)(),
71
+ __metadata("design:type", String)
72
+ ], UpdateBrandValidator.prototype, "image", void 0);
64
73
  return UpdateBrandValidator;
65
74
  }(abstract_validator_1.AbstractValidator));
66
75
  exports.UpdateBrandValidator = UpdateBrandValidator;
@@ -1,9 +1,12 @@
1
1
  import { AbstractEntity } from '../../../abstract/abstract.entity';
2
2
  import { PropertyEntity } from '../properties/property.entity';
3
+ import { AssetEntity } from '../../assets/asset.entity';
3
4
  export declare class CategoryEntity extends AbstractEntity {
4
5
  static readonly $index = "inventory_categories";
5
6
  name: string;
6
7
  description: string;
7
8
  icon: string;
8
9
  properties: PropertyEntity[];
10
+ image: AssetEntity;
11
+ readonly picture: string;
9
12
  }
@@ -0,0 +1,5 @@
1
+ import { HttpException } from '@nestjs/common';
2
+ import { AbstractException } from '../../../abstract/abstract.exception';
3
+ export declare class CategoryException extends AbstractException {
4
+ handleError(exception: HttpException): HttpException;
5
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.CategoryException = void 0;
25
+ var common_1 = require("@nestjs/common");
26
+ var abstract_exception_1 = require("../../../abstract/abstract.exception");
27
+ var CategoryException = (function (_super) {
28
+ __extends(CategoryException, _super);
29
+ function CategoryException() {
30
+ return _super !== null && _super.apply(this, arguments) || this;
31
+ }
32
+ CategoryException.prototype.handleError = function (exception) {
33
+ return exception;
34
+ };
35
+ CategoryException = __decorate([
36
+ (0, common_1.Catch)()
37
+ ], CategoryException);
38
+ return CategoryException;
39
+ }(abstract_exception_1.AbstractException));
40
+ exports.CategoryException = CategoryException;
@@ -3,9 +3,11 @@ export declare class CreateCategoryValidator extends AbstractValidator {
3
3
  name: string;
4
4
  description?: string;
5
5
  icon: string;
6
+ image: string;
6
7
  }
7
8
  export declare class UpdateCategoryValidator extends AbstractValidator {
8
9
  name: string;
9
10
  description?: string;
10
11
  icon: string;
12
+ image: string;
11
13
  }
@@ -49,6 +49,10 @@ var CreateCategoryValidator = (function (_super) {
49
49
  (0, class_validator_1.IsOptional)(),
50
50
  __metadata("design:type", Object)
51
51
  ], CreateCategoryValidator.prototype, "icon", void 0);
52
+ __decorate([
53
+ (0, class_validator_1.IsMongoId)(),
54
+ __metadata("design:type", String)
55
+ ], CreateCategoryValidator.prototype, "image", void 0);
52
56
  return CreateCategoryValidator;
53
57
  }(abstract_validator_1.AbstractValidator));
54
58
  exports.CreateCategoryValidator = CreateCategoryValidator;
@@ -74,6 +78,11 @@ var UpdateCategoryValidator = (function (_super) {
74
78
  (0, class_validator_1.IsOptional)(),
75
79
  __metadata("design:type", Object)
76
80
  ], UpdateCategoryValidator.prototype, "icon", void 0);
81
+ __decorate([
82
+ (0, class_validator_1.IsMongoId)(),
83
+ (0, class_validator_1.IsOptional)(),
84
+ __metadata("design:type", String)
85
+ ], UpdateCategoryValidator.prototype, "image", void 0);
77
86
  return UpdateCategoryValidator;
78
87
  }(abstract_validator_1.AbstractValidator));
79
88
  exports.UpdateCategoryValidator = UpdateCategoryValidator;
@@ -20,5 +20,6 @@ export declare class ProductEntity extends AbstractEntity {
20
20
  code: CodeEntity;
21
21
  dimension: DimensionEntity;
22
22
  seo: SeoEntity;
23
+ stock: number;
23
24
  readonly picture: string;
24
25
  }
@@ -0,0 +1,5 @@
1
+ import { HttpException } from '@nestjs/common';
2
+ import { AbstractException } from '../../../abstract/abstract.exception';
3
+ export declare class ProductException extends AbstractException {
4
+ handleError(exception: HttpException): HttpException;
5
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.ProductException = void 0;
25
+ var common_1 = require("@nestjs/common");
26
+ var abstract_exception_1 = require("../../../abstract/abstract.exception");
27
+ var ProductException = (function (_super) {
28
+ __extends(ProductException, _super);
29
+ function ProductException() {
30
+ return _super !== null && _super.apply(this, arguments) || this;
31
+ }
32
+ ProductException.prototype.handleError = function (exception) {
33
+ return exception;
34
+ };
35
+ ProductException = __decorate([
36
+ (0, common_1.Catch)()
37
+ ], ProductException);
38
+ return ProductException;
39
+ }(abstract_exception_1.AbstractException));
40
+ exports.ProductException = ProductException;
@@ -3,7 +3,7 @@ import { ProductCodeValidator } from './validators/code.validator';
3
3
  import { ProductDimensionValidator } from './validators/dimension.validator';
4
4
  import { ProductPriceValidator } from './validators/price.validator';
5
5
  import { ProductSeoValidator } from './validators/seo.validator';
6
- import { AbstractValidator } from "../../../abstract/abstract.validator";
6
+ import { AbstractValidator } from '../../../abstract/abstract.validator';
7
7
  export declare class CreateProductValidator extends AbstractValidator {
8
8
  name: string;
9
9
  description: string;
@@ -17,6 +17,7 @@ export declare class CreateProductValidator extends AbstractValidator {
17
17
  seo: ProductSeoValidator;
18
18
  dimension: ProductDimensionValidator;
19
19
  code: ProductCodeValidator;
20
+ stock: number | null;
20
21
  }
21
22
  export declare class UpdateProductValidator extends CreateProductValidator {
22
23
  name: string;
@@ -49,6 +49,7 @@ var CreateProductValidator = (function (_super) {
49
49
  _this.seo = new seo_validator_1.ProductSeoValidator();
50
50
  _this.dimension = new dimension_validator_1.ProductDimensionValidator();
51
51
  _this.code = new code_validator_1.ProductCodeValidator();
52
+ _this.stock = null;
52
53
  return _this;
53
54
  }
54
55
  __decorate([
@@ -110,6 +111,12 @@ var CreateProductValidator = (function (_super) {
110
111
  (0, class_transformer_1.Type)(function () { return code_validator_1.ProductCodeValidator; }),
111
112
  __metadata("design:type", Object)
112
113
  ], CreateProductValidator.prototype, "code", void 0);
114
+ __decorate([
115
+ (0, class_validator_1.IsNumber)(),
116
+ (0, class_validator_1.IsOptional)(),
117
+ (0, class_validator_1.Min)(0),
118
+ __metadata("design:type", Number)
119
+ ], CreateProductValidator.prototype, "stock", void 0);
113
120
  return CreateProductValidator;
114
121
  }(abstract_validator_1.AbstractValidator));
115
122
  exports.CreateProductValidator = CreateProductValidator;
@@ -0,0 +1,5 @@
1
+ import { HttpException } from '@nestjs/common';
2
+ import { AbstractException } from '../../../abstract/abstract.exception';
3
+ export declare class PropertyException extends AbstractException {
4
+ handleError(exception: HttpException): HttpException;
5
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.PropertyException = void 0;
25
+ var common_1 = require("@nestjs/common");
26
+ var abstract_exception_1 = require("../../../abstract/abstract.exception");
27
+ var PropertyException = (function (_super) {
28
+ __extends(PropertyException, _super);
29
+ function PropertyException() {
30
+ return _super !== null && _super.apply(this, arguments) || this;
31
+ }
32
+ PropertyException.prototype.handleError = function (exception) {
33
+ return exception;
34
+ };
35
+ PropertyException = __decorate([
36
+ (0, common_1.Catch)()
37
+ ], PropertyException);
38
+ return PropertyException;
39
+ }(abstract_exception_1.AbstractException));
40
+ exports.PropertyException = PropertyException;
@@ -1,6 +1,6 @@
1
1
  import { User } from 'auth0';
2
2
  import { AbstractEntity } from '../../../abstract/abstract.entity';
3
- import { MetaAddress } from "../../../types";
3
+ import { MetaAddress } from '../../../types';
4
4
  export declare class ClientEntity extends AbstractEntity implements User {
5
5
  static readonly $index = "store_clients";
6
6
  readonly name: string;
@@ -8,4 +8,5 @@ export declare class ClientEntity extends AbstractEntity implements User {
8
8
  readonly phone?: string;
9
9
  readonly identificationNumber: string;
10
10
  readonly addresses: MetaAddress[];
11
+ users: string[];
11
12
  }
@@ -0,0 +1,5 @@
1
+ import { HttpException } from '@nestjs/common';
2
+ import { AbstractException } from '../../../abstract/abstract.exception';
3
+ export declare class ClientException extends AbstractException {
4
+ handleError(exception: HttpException): HttpException;
5
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.ClientException = void 0;
25
+ var common_1 = require("@nestjs/common");
26
+ var abstract_exception_1 = require("../../../abstract/abstract.exception");
27
+ var ClientException = (function (_super) {
28
+ __extends(ClientException, _super);
29
+ function ClientException() {
30
+ return _super !== null && _super.apply(this, arguments) || this;
31
+ }
32
+ ClientException.prototype.handleError = function (exception) {
33
+ return exception;
34
+ };
35
+ ClientException = __decorate([
36
+ (0, common_1.Catch)()
37
+ ], ClientException);
38
+ return ClientException;
39
+ }(abstract_exception_1.AbstractException));
40
+ exports.ClientException = ClientException;
@@ -1,5 +1,5 @@
1
- import { MetaAddress } from "../../../types";
2
- import { AbstractValidator } from "../../../abstract/abstract.validator";
1
+ import { MetaAddress } from '../../../types';
2
+ import { AbstractValidator } from '../../../abstract/abstract.validator';
3
3
  export declare class CreateClientValidator extends AbstractValidator {
4
4
  name: string;
5
5
  email: string;
@@ -13,3 +13,6 @@ export declare class UpdateClientValidator extends CreateClientValidator {
13
13
  phone: string;
14
14
  identificationNumber: string;
15
15
  }
16
+ export declare class AddClientUsers {
17
+ ids: string[];
18
+ }
@@ -24,7 +24,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
24
24
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
25
  };
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.UpdateClientValidator = exports.CreateClientValidator = void 0;
27
+ exports.AddClientUsers = exports.UpdateClientValidator = exports.CreateClientValidator = void 0;
28
28
  var class_transformer_1 = require("class-transformer");
29
29
  var class_validator_1 = require("class-validator");
30
30
  var abstract_validator_1 = require("../../../abstract/abstract.validator");
@@ -93,3 +93,15 @@ var UpdateClientValidator = (function (_super) {
93
93
  return UpdateClientValidator;
94
94
  }(CreateClientValidator));
95
95
  exports.UpdateClientValidator = UpdateClientValidator;
96
+ var AddClientUsers = (function () {
97
+ function AddClientUsers() {
98
+ }
99
+ __decorate([
100
+ (0, class_validator_1.IsArray)(),
101
+ (0, class_validator_1.IsString)({ each: true }),
102
+ (0, class_validator_1.ArrayMinSize)(1),
103
+ __metadata("design:type", Array)
104
+ ], AddClientUsers.prototype, "ids", void 0);
105
+ return AddClientUsers;
106
+ }());
107
+ exports.AddClientUsers = AddClientUsers;
@@ -0,0 +1,13 @@
1
+ import { NotAcceptableException } from '@nestjs/common/exceptions/not-acceptable.exception';
2
+ import { ItemEntity } from './item/item.entity';
3
+ export declare class OrderWithUnavailableProduct extends NotAcceptableException {
4
+ readonly items: ItemEntity[];
5
+ readonly message = "Some products are not available";
6
+ readonly name: string;
7
+ constructor(items: ItemEntity[]);
8
+ getResponse(): {
9
+ items: ItemEntity[];
10
+ message: string;
11
+ name: string;
12
+ };
13
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.OrderWithUnavailableProduct = void 0;
30
+ var not_acceptable_exception_1 = require("@nestjs/common/exceptions/not-acceptable.exception");
31
+ var OrderWithUnavailableProduct = (function (_super) {
32
+ __extends(OrderWithUnavailableProduct, _super);
33
+ function OrderWithUnavailableProduct(items) {
34
+ var _this = _super.call(this) || this;
35
+ _this.items = [];
36
+ _this.message = 'Some products are not available';
37
+ _this.name = OrderWithUnavailableProduct.name;
38
+ _this.items = items;
39
+ return _this;
40
+ }
41
+ OrderWithUnavailableProduct.prototype.getResponse = function () {
42
+ return __assign(__assign({}, _super.prototype.getResponse.call(this)), { items: this.items, message: this.message, name: this.name });
43
+ };
44
+ return OrderWithUnavailableProduct;
45
+ }(not_acceptable_exception_1.NotAcceptableException));
46
+ exports.OrderWithUnavailableProduct = OrderWithUnavailableProduct;
@@ -13,5 +13,6 @@ export declare class CreateOrganizationValidator implements CreateOrganization {
13
13
  }
14
14
  export declare class UpdateOrganizationValidator implements UpdateOrganization {
15
15
  display_name?: string;
16
+ branding?: UpdateOrganization['branding'];
16
17
  metadata: OrganizationMetadataValidator;
17
18
  }
@@ -72,6 +72,11 @@ var UpdateOrganizationValidator = (function () {
72
72
  (0, class_validator_1.Length)(3, 255),
73
73
  __metadata("design:type", String)
74
74
  ], UpdateOrganizationValidator.prototype, "display_name", void 0);
75
+ __decorate([
76
+ (0, class_validator_1.IsOptional)(),
77
+ (0, class_validator_1.IsObject)(),
78
+ __metadata("design:type", Object)
79
+ ], UpdateOrganizationValidator.prototype, "branding", void 0);
75
80
  __decorate([
76
81
  (0, class_validator_1.IsOptional)(),
77
82
  (0, class_validator_1.ValidateNested)(),
@@ -0,0 +1,11 @@
1
+ import { LoggerService as NestLogger } from '@nestjs/common';
2
+ import { Request } from 'express';
3
+ export declare class LoggerService implements NestLogger {
4
+ protected readonly $request: Request;
5
+ protected get organization(): any;
6
+ log(message: string): void;
7
+ error(reason: Error): void;
8
+ warn(message: string, scope?: string): void;
9
+ debug(message: string, scope?: string): void;
10
+ verbose(message: string, scope?: string): void;
11
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.LoggerService = void 0;
13
+ var common_1 = require("@nestjs/common");
14
+ var core_1 = require("@nestjs/core");
15
+ var LoggerService = (function () {
16
+ function LoggerService() {
17
+ }
18
+ Object.defineProperty(LoggerService.prototype, "organization", {
19
+ get: function () {
20
+ var _a;
21
+ var session = this.$request.session;
22
+ if (!session) {
23
+ return;
24
+ }
25
+ return ((_a = session.organization) === null || _a === void 0 ? void 0 : _a.name) || '';
26
+ },
27
+ enumerable: false,
28
+ configurable: true
29
+ });
30
+ LoggerService.prototype.log = function (message) {
31
+ return common_1.Logger.log(message, this.organization);
32
+ };
33
+ LoggerService.prototype.error = function (reason) {
34
+ return common_1.Logger.error("[" + reason.name + "]: " + reason.message, this.organization);
35
+ };
36
+ LoggerService.prototype.warn = function (message, scope) {
37
+ return common_1.Logger.warn("[" + scope + "]: " + message, this.organization);
38
+ };
39
+ LoggerService.prototype.debug = function (message, scope) {
40
+ return common_1.Logger.debug("[" + scope + "]: " + message, this.organization);
41
+ };
42
+ LoggerService.prototype.verbose = function (message, scope) {
43
+ return common_1.Logger.verbose("[" + scope + "]: " + message, this.organization);
44
+ };
45
+ __decorate([
46
+ (0, common_1.Inject)(core_1.REQUEST),
47
+ __metadata("design:type", Object)
48
+ ], LoggerService.prototype, "$request", void 0);
49
+ LoggerService = __decorate([
50
+ (0, common_1.Injectable)()
51
+ ], LoggerService);
52
+ return LoggerService;
53
+ }());
54
+ exports.LoggerService = LoggerService;
@@ -1,4 +1,4 @@
1
- import { AppMetadata, User, UserMetadata } from 'auth0';
1
+ import { AppMetadata, OrganizationConnection, User, UserMetadata } from 'auth0';
2
2
  export interface MetaAddress {
3
3
  city: string;
4
4
  code: string;
@@ -8,6 +8,9 @@ export interface MetaAddress {
8
8
  state: string;
9
9
  street: string;
10
10
  }
11
+ export interface LocalOrganization extends OrganizationConnection {
12
+ connected: boolean;
13
+ }
11
14
  export interface UserMeta extends UserMetadata {
12
15
  addresses?: MetaAddress[];
13
16
  }
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  <p align="center">
2
- <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
2
+ <a href="https://www.merkaly.io/" target="blank">
3
+ <img src="https://www.merkaly.io/icon.png" width="320" alt="Merkaly Logo" />
4
+ </a>
3
5
  </p>
4
6
 
5
7
  [travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
@@ -34,33 +36,31 @@
34
36
  ## Installation
35
37
 
36
38
  ```bash
37
- $ npm install
39
+ $ yarn install
40
+ ```
41
+
42
+ ## Generate OpenSSL certificate
43
+
44
+ ```bash
45
+ $ mkdir ".cert"
46
+ $ openssl req -x509 -newkey rsa:4096 -nodes -keyout ./.cert/key.pem -out ./.cert/cert.pem -days 365
38
47
  ```
39
48
 
40
49
  ## Running the app
41
50
 
42
51
  ```bash
43
52
  # development
44
- $ npm run start
45
-
46
- # watch mode
47
- $ npm run start:dev
53
+ $ yarn dev
48
54
 
49
55
  # production mode
50
- $ npm run start:prod
56
+ $ npm start
51
57
  ```
52
58
 
53
59
  ## Test
54
60
 
55
61
  ```bash
56
62
  # unit tests
57
- $ npm run test
58
-
59
- # e2e tests
60
- $ npm run test:e2e
61
-
62
- # test coverage
63
- $ npm run test:cov
63
+ $ yarn test
64
64
  ```
65
65
 
66
66
  ## Support
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/api",
3
- "version": "0.2.4-8",
3
+ "version": "0.2.4",
4
4
  "description": "NestJS Backend ApiRest Service",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "license": "UNLICENSED",
10
10
  "author": "Randy Tellez Galan <kronhyx@gmail.com>",
11
- "main": "./src/main",
11
+ "main": "./.output/main",
12
12
  "types": "./.output/types.d.ts",
13
13
  "files": [
14
14
  ".output"
@@ -35,6 +35,7 @@
35
35
  "*.**": "yarn lint --cache --fix"
36
36
  },
37
37
  "dependencies": {
38
+ "@nestjs/common": "^9.0.11",
38
39
  "@types/auth0": "^3.3.1",
39
40
  "class-transformer": "^0.5.1",
40
41
  "class-validator": "^0.14.0",
@@ -47,7 +48,6 @@
47
48
  "@google-cloud/storage": "^6.4.1",
48
49
  "@nestjs/axios": "^2.0.0",
49
50
  "@nestjs/cli": "^9.1.1",
50
- "@nestjs/common": "^9.0.11",
51
51
  "@nestjs/config": "^2.2.0",
52
52
  "@nestjs/core": "^9.0.11",
53
53
  "@nestjs/event-emitter": "^1.3.1",
@@ -55,17 +55,17 @@
55
55
  "@nestjs/mongoose": "^9.2.0",
56
56
  "@nestjs/passport": "^9.0.0",
57
57
  "@nestjs/platform-express": "^9.0.11",
58
- "@nestjs/platform-socket.io": "^9.3.9",
58
+ "@nestjs/platform-socket.io": "^9.4.0",
59
59
  "@nestjs/schematics": "^9.0.1",
60
60
  "@nestjs/swagger": "^6.1.0",
61
61
  "@nestjs/testing": "^9.0.11",
62
- "@nestjs/websockets": "^9.3.9",
62
+ "@nestjs/websockets": "^9.4.0",
63
63
  "@types/cache-manager": "^4.0.1",
64
64
  "@types/express": "^4.17.12",
65
65
  "@types/express-session": "^1.17.5",
66
66
  "@types/jest": "^27.0.0",
67
67
  "@types/multer": "^1.4.7",
68
- "@types/node": "^18.0.0",
68
+ "@types/node": "^20.1.0",
69
69
  "@types/passport-jwt": "^3.0.5",
70
70
  "@types/supertest": "^2.0.11",
71
71
  "@types/uuid": "^9.0.1",
@@ -98,10 +98,10 @@
98
98
  "typescript": "4.4.4",
99
99
  "webpack": "^5"
100
100
  },
101
- "engines": {
102
- "node": ">=16"
103
- },
104
101
  "publishConfig": {
105
102
  "access": "public"
103
+ },
104
+ "engines": {
105
+ "node": ">=16"
106
106
  }
107
107
  }