@merkaly/api 0.2.2-3 → 0.2.2-30

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 (131) hide show
  1. package/.output/abstract/abstract.document.d.ts +7 -0
  2. package/.output/abstract/abstract.document.js +12 -0
  3. package/.output/abstract/abstract.entity.d.ts +8 -0
  4. package/.output/abstract/abstract.entity.js +54 -0
  5. package/.output/abstract/abstract.validator.d.ts +18 -0
  6. package/.output/abstract/abstract.validator.js +73 -0
  7. package/.output/modules/assets/asset.entity.d.ts +3 -28
  8. package/.output/modules/assets/asset.entity.js +69 -0
  9. package/.output/modules/content/banners/banner.document.d.ts +16 -0
  10. package/.output/modules/content/banners/banner.document.js +31 -0
  11. package/.output/modules/content/banners/banner.entity.d.ts +19 -0
  12. package/.output/modules/content/banners/banner.entity.js +104 -0
  13. package/.output/modules/content/banners/banner.validator.d.ts +7 -0
  14. package/.output/modules/content/banners/banner.validator.js +58 -0
  15. package/.output/modules/content/pages/page.document.d.ts +10 -0
  16. package/.output/modules/content/pages/page.document.js +32 -0
  17. package/.output/modules/content/pages/page.entity.d.ts +11 -0
  18. package/.output/modules/content/pages/page.entity.js +69 -0
  19. package/.output/modules/content/pages/page.types.d.ts +8 -0
  20. package/.output/modules/content/pages/page.types.js +13 -0
  21. package/.output/modules/content/pages/page.validator.d.ts +11 -0
  22. package/.output/modules/content/pages/page.validator.js +73 -0
  23. package/.output/modules/insight/validators/order.validator.d.ts +4 -0
  24. package/.output/modules/insight/validators/order.validator.js +27 -0
  25. package/.output/modules/inventory/brands/brand.document.d.ts +2 -2
  26. package/.output/modules/inventory/brands/brand.document.js +30 -0
  27. package/.output/modules/inventory/brands/brand.entity.d.ts +2 -28
  28. package/.output/modules/inventory/brands/brand.entity.js +50 -0
  29. package/.output/modules/inventory/brands/brand.validator.js +45 -0
  30. package/.output/modules/inventory/categories/category.document.d.ts +3 -2
  31. package/.output/modules/inventory/categories/category.document.js +31 -0
  32. package/.output/modules/inventory/categories/category.entity.d.ts +5 -28
  33. package/.output/modules/inventory/categories/category.entity.js +61 -0
  34. package/.output/modules/inventory/categories/category.validator.d.ts +2 -0
  35. package/.output/modules/inventory/categories/category.validator.js +57 -0
  36. package/.output/modules/inventory/products/entities/code.entity.d.ts +5 -0
  37. package/.output/modules/inventory/products/entities/code.entity.js +53 -0
  38. package/.output/modules/inventory/products/entities/dimension.entity.d.ts +6 -0
  39. package/.output/modules/inventory/products/entities/dimension.entity.js +57 -0
  40. package/.output/modules/inventory/products/entities/price.entity.d.ts +4 -0
  41. package/.output/modules/inventory/products/entities/price.entity.js +49 -0
  42. package/.output/modules/inventory/products/entities/seo.entity.d.ts +5 -0
  43. package/.output/modules/inventory/products/entities/seo.entity.js +53 -0
  44. package/.output/modules/inventory/products/product.document.d.ts +19 -8
  45. package/.output/modules/inventory/products/product.document.js +32 -0
  46. package/.output/modules/inventory/products/product.entity.d.ts +12 -29
  47. package/.output/modules/inventory/products/product.entity.js +97 -0
  48. package/.output/modules/inventory/products/product.validator.d.ts +14 -10
  49. package/.output/modules/inventory/products/product.validator.js +113 -0
  50. package/.output/modules/inventory/products/validators/code.validator.d.ts +5 -0
  51. package/.output/modules/inventory/products/validators/code.validator.js +37 -0
  52. package/.output/modules/inventory/products/validators/dimension.validator.d.ts +6 -0
  53. package/.output/modules/inventory/products/validators/dimension.validator.js +43 -0
  54. package/.output/modules/inventory/products/validators/price.validator.d.ts +4 -0
  55. package/.output/modules/inventory/products/validators/price.validator.js +30 -0
  56. package/.output/modules/inventory/products/validators/seo.validator.d.ts +5 -0
  57. package/.output/modules/inventory/products/validators/seo.validator.js +37 -0
  58. package/.output/modules/inventory/properties/property.entity.d.ts +7 -0
  59. package/.output/modules/inventory/properties/property.entity.js +55 -0
  60. package/.output/modules/inventory/properties/property.validator.d.ts +12 -0
  61. package/.output/modules/inventory/properties/property.validator.js +51 -0
  62. package/.output/modules/sales/clients/client.entity.d.ts +12 -0
  63. package/.output/modules/sales/clients/client.entity.js +73 -0
  64. package/.output/modules/sales/clients/client.validator.d.ts +12 -0
  65. package/.output/modules/sales/clients/client.validator.js +67 -0
  66. package/.output/modules/sales/orders/billing/billing.document.d.ts +7 -0
  67. package/.output/modules/sales/orders/billing/billing.document.js +9 -0
  68. package/.output/modules/sales/orders/billing/billing.entity.d.ts +7 -0
  69. package/.output/modules/sales/orders/billing/billing.entity.js +44 -0
  70. package/.output/modules/sales/orders/billing/billing.validator.d.ts +7 -0
  71. package/.output/modules/sales/orders/billing/billing.validator.js +40 -0
  72. package/.output/modules/sales/orders/item/item.document.d.ts +6 -0
  73. package/.output/modules/sales/orders/item/item.document.js +9 -0
  74. package/.output/modules/sales/orders/item/item.entity.d.ts +7 -0
  75. package/.output/modules/sales/orders/item/item.entity.js +54 -0
  76. package/.output/modules/{store/orders/order.entity.d.ts → sales/orders/item/item.schema.d.ts} +3 -8
  77. package/.output/modules/sales/orders/item/item.schema.js +6 -0
  78. package/.output/modules/sales/orders/item/item.validator.d.ts +4 -0
  79. package/.output/modules/sales/orders/item/item.validator.js +29 -0
  80. package/.output/modules/sales/orders/order.entity.d.ts +18 -0
  81. package/.output/modules/sales/orders/order.entity.js +90 -0
  82. package/.output/modules/sales/orders/order.validator.d.ts +18 -0
  83. package/.output/modules/sales/orders/order.validator.js +75 -0
  84. package/.output/modules/sales/orders/payment/payment.entity.d.ts +4 -0
  85. package/.output/modules/sales/orders/payment/payment.entity.js +28 -0
  86. package/.output/modules/{store/carts/cart.entity.d.ts → sales/orders/payment/payment.schema.d.ts} +3 -10
  87. package/.output/modules/sales/orders/payment/payment.schema.js +6 -0
  88. package/.output/modules/sales/orders/payment/payment.validator.d.ts +6 -0
  89. package/.output/modules/sales/orders/payment/payment.validator.js +10 -0
  90. package/.output/modules/sales/orders/shipping/shipping.document.d.ts +7 -0
  91. package/.output/modules/sales/orders/shipping/shipping.document.js +9 -0
  92. package/.output/modules/sales/orders/shipping/shipping.entity.d.ts +7 -0
  93. package/.output/modules/sales/orders/shipping/shipping.entity.js +44 -0
  94. package/.output/modules/sales/orders/shipping/shipping.validator.d.ts +7 -0
  95. package/.output/modules/sales/orders/shipping/shipping.validator.js +40 -0
  96. package/.output/modules/sales/orders/status/status.document.d.ts +5 -0
  97. package/.output/modules/sales/orders/status/status.document.js +9 -0
  98. package/.output/modules/sales/orders/status/status.entity.d.ts +6 -0
  99. package/.output/modules/sales/orders/status/status.entity.js +37 -0
  100. package/.output/modules/sales/orders/status/status.validator.d.ts +8 -0
  101. package/.output/modules/sales/orders/status/status.validator.js +12 -0
  102. package/.output/modules/search/search.validator.d.ts +6 -0
  103. package/.output/modules/search/search.validator.js +49 -0
  104. package/.output/modules/{auth → setting}/connections/connection.validator.d.ts +0 -1
  105. package/.output/modules/setting/connections/connection.validator.js +37 -0
  106. package/.output/modules/{auth → setting}/members/member.validator.d.ts +0 -1
  107. package/.output/modules/setting/members/member.validator.js +2 -0
  108. package/.output/modules/setting/organization/organization.types.d.ts +22 -0
  109. package/.output/modules/setting/organization/organization.types.js +102 -0
  110. package/.output/modules/setting/organization/organization.validator.d.ts +17 -0
  111. package/.output/modules/setting/organization/organization.validator.js +83 -0
  112. package/.output/modules/setting/social/social.validator.d.ts +11 -0
  113. package/.output/modules/setting/social/social.validator.js +36 -0
  114. package/.output/modules/users/user.validator.d.ts +10 -0
  115. package/.output/modules/users/user.validator.js +50 -0
  116. package/.output/types.d.ts +23 -0
  117. package/.output/types.js +2 -0
  118. package/package.json +23 -16
  119. package/.output/configs/app.document.d.ts +0 -8
  120. package/.output/configs/app.entity.d.ts +0 -7
  121. package/.output/configs/app.validator.d.ts +0 -6
  122. package/.output/main.d.ts +0 -39
  123. package/.output/modules/assets/asset.document.d.ts +0 -7
  124. package/.output/modules/auth/organizations/organization.validator.d.ts +0 -6
  125. package/.output/modules/store/carts/cart.document.d.ts +0 -4
  126. package/.output/modules/store/carts/cart.validator.d.ts +0 -4
  127. package/.output/modules/store/items/item.document.d.ts +0 -6
  128. package/.output/modules/store/items/item.entity.d.ts +0 -8
  129. package/.output/modules/store/items/item.validator.d.ts +0 -5
  130. package/.output/modules/store/orders/order.document.d.ts +0 -5
  131. package/.output/modules/store/orders/order.validator.d.ts +0 -4
@@ -0,0 +1,102 @@
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.OrganizationMetadataAddress = exports.OrganizationMetadataSocial = exports.OrganizationMetadataLocalization = exports.OrganizationMetadataInformation = void 0;
13
+ var class_validator_1 = require("class-validator");
14
+ var OrganizationMetadataInformation = (function () {
15
+ function OrganizationMetadataInformation() {
16
+ this.keywords = [];
17
+ }
18
+ __decorate([
19
+ (0, class_validator_1.IsOptional)(),
20
+ (0, class_validator_1.IsString)(),
21
+ __metadata("design:type", String)
22
+ ], OrganizationMetadataInformation.prototype, "title", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsOptional)(),
25
+ (0, class_validator_1.IsString)(),
26
+ __metadata("design:type", String)
27
+ ], OrganizationMetadataInformation.prototype, "description", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsOptional)(),
30
+ (0, class_validator_1.IsString)({ each: true }),
31
+ __metadata("design:type", Array)
32
+ ], OrganizationMetadataInformation.prototype, "keywords", void 0);
33
+ return OrganizationMetadataInformation;
34
+ }());
35
+ exports.OrganizationMetadataInformation = OrganizationMetadataInformation;
36
+ var OrganizationMetadataLocalization = (function () {
37
+ function OrganizationMetadataLocalization() {
38
+ }
39
+ __decorate([
40
+ (0, class_validator_1.IsOptional)(),
41
+ (0, class_validator_1.IsString)(),
42
+ __metadata("design:type", String)
43
+ ], OrganizationMetadataLocalization.prototype, "language", void 0);
44
+ __decorate([
45
+ (0, class_validator_1.IsOptional)(),
46
+ (0, class_validator_1.IsString)(),
47
+ __metadata("design:type", String)
48
+ ], OrganizationMetadataLocalization.prototype, "currency", void 0);
49
+ return OrganizationMetadataLocalization;
50
+ }());
51
+ exports.OrganizationMetadataLocalization = OrganizationMetadataLocalization;
52
+ var OrganizationMetadataSocial = (function () {
53
+ function OrganizationMetadataSocial() {
54
+ }
55
+ __decorate([
56
+ (0, class_validator_1.IsOptional)(),
57
+ (0, class_validator_1.IsString)(),
58
+ __metadata("design:type", String)
59
+ ], OrganizationMetadataSocial.prototype, "name", void 0);
60
+ __decorate([
61
+ (0, class_validator_1.IsOptional)(),
62
+ (0, class_validator_1.IsUrl)(),
63
+ __metadata("design:type", String)
64
+ ], OrganizationMetadataSocial.prototype, "url", void 0);
65
+ return OrganizationMetadataSocial;
66
+ }());
67
+ exports.OrganizationMetadataSocial = OrganizationMetadataSocial;
68
+ var OrganizationMetadataAddress = (function () {
69
+ function OrganizationMetadataAddress() {
70
+ }
71
+ __decorate([
72
+ (0, class_validator_1.IsOptional)(),
73
+ __metadata("design:type", String)
74
+ ], OrganizationMetadataAddress.prototype, "country", void 0);
75
+ __decorate([
76
+ (0, class_validator_1.IsString)(),
77
+ (0, class_validator_1.IsOptional)(),
78
+ __metadata("design:type", String)
79
+ ], OrganizationMetadataAddress.prototype, "code", void 0);
80
+ __decorate([
81
+ (0, class_validator_1.IsString)(),
82
+ (0, class_validator_1.IsOptional)(),
83
+ __metadata("design:type", String)
84
+ ], OrganizationMetadataAddress.prototype, "line1", void 0);
85
+ __decorate([
86
+ (0, class_validator_1.IsString)(),
87
+ (0, class_validator_1.IsOptional)(),
88
+ __metadata("design:type", String)
89
+ ], OrganizationMetadataAddress.prototype, "line2", void 0);
90
+ __decorate([
91
+ (0, class_validator_1.IsOptional)(),
92
+ (0, class_validator_1.IsString)(),
93
+ __metadata("design:type", String)
94
+ ], OrganizationMetadataAddress.prototype, "city", void 0);
95
+ __decorate([
96
+ (0, class_validator_1.IsString)(),
97
+ (0, class_validator_1.IsOptional)(),
98
+ __metadata("design:type", String)
99
+ ], OrganizationMetadataAddress.prototype, "state", void 0);
100
+ return OrganizationMetadataAddress;
101
+ }());
102
+ exports.OrganizationMetadataAddress = OrganizationMetadataAddress;
@@ -0,0 +1,17 @@
1
+ import { CreateOrganization, UpdateOrganization } from 'auth0';
2
+ import { OrganizationMetadataAddress, OrganizationMetadataInformation, OrganizationMetadataLocalization, OrganizationMetadataSocial } from './organization.types';
3
+ export declare class OrganizationMetadataValidator {
4
+ information?: OrganizationMetadataInformation;
5
+ localization?: OrganizationMetadataLocalization;
6
+ address?: OrganizationMetadataAddress;
7
+ social?: OrganizationMetadataSocial[];
8
+ }
9
+ export declare class CreateOrganizationValidator implements CreateOrganization {
10
+ name: string;
11
+ email: string;
12
+ password?: string;
13
+ }
14
+ export declare class UpdateOrganizationValidator implements UpdateOrganization {
15
+ display_name?: string;
16
+ metadata: OrganizationMetadataValidator;
17
+ }
@@ -0,0 +1,83 @@
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.UpdateOrganizationValidator = exports.CreateOrganizationValidator = exports.OrganizationMetadataValidator = void 0;
13
+ var class_transformer_1 = require("class-transformer");
14
+ var class_validator_1 = require("class-validator");
15
+ var organization_types_1 = require("./organization.types");
16
+ var OrganizationMetadataValidator = (function () {
17
+ function OrganizationMetadataValidator() {
18
+ }
19
+ __decorate([
20
+ (0, class_validator_1.IsOptional)(),
21
+ (0, class_validator_1.ValidateNested)(),
22
+ (0, class_transformer_1.Type)(function () { return organization_types_1.OrganizationMetadataInformation; }),
23
+ __metadata("design:type", organization_types_1.OrganizationMetadataInformation)
24
+ ], OrganizationMetadataValidator.prototype, "information", void 0);
25
+ __decorate([
26
+ (0, class_validator_1.IsOptional)(),
27
+ (0, class_validator_1.ValidateNested)(),
28
+ (0, class_transformer_1.Type)(function () { return organization_types_1.OrganizationMetadataLocalization; }),
29
+ __metadata("design:type", organization_types_1.OrganizationMetadataLocalization)
30
+ ], OrganizationMetadataValidator.prototype, "localization", void 0);
31
+ __decorate([
32
+ (0, class_validator_1.IsOptional)(),
33
+ (0, class_validator_1.ValidateNested)(),
34
+ (0, class_transformer_1.Type)(function () { return organization_types_1.OrganizationMetadataAddress; }),
35
+ __metadata("design:type", organization_types_1.OrganizationMetadataAddress)
36
+ ], OrganizationMetadataValidator.prototype, "address", void 0);
37
+ __decorate([
38
+ (0, class_validator_1.IsOptional)(),
39
+ (0, class_validator_1.ValidateNested)({ each: true }),
40
+ (0, class_transformer_1.Type)(function () { return organization_types_1.OrganizationMetadataSocial; }),
41
+ __metadata("design:type", Array)
42
+ ], OrganizationMetadataValidator.prototype, "social", void 0);
43
+ return OrganizationMetadataValidator;
44
+ }());
45
+ exports.OrganizationMetadataValidator = OrganizationMetadataValidator;
46
+ var CreateOrganizationValidator = (function () {
47
+ function CreateOrganizationValidator() {
48
+ }
49
+ __decorate([
50
+ (0, class_validator_1.IsString)(),
51
+ (0, class_validator_1.Length)(3, 255),
52
+ __metadata("design:type", String)
53
+ ], CreateOrganizationValidator.prototype, "name", void 0);
54
+ __decorate([
55
+ (0, class_validator_1.IsString)(),
56
+ (0, class_validator_1.IsEmail)(),
57
+ __metadata("design:type", String)
58
+ ], CreateOrganizationValidator.prototype, "email", void 0);
59
+ __decorate([
60
+ (0, class_validator_1.IsString)(),
61
+ __metadata("design:type", String)
62
+ ], CreateOrganizationValidator.prototype, "password", void 0);
63
+ return CreateOrganizationValidator;
64
+ }());
65
+ exports.CreateOrganizationValidator = CreateOrganizationValidator;
66
+ var UpdateOrganizationValidator = (function () {
67
+ function UpdateOrganizationValidator() {
68
+ }
69
+ __decorate([
70
+ (0, class_validator_1.IsString)(),
71
+ (0, class_validator_1.IsOptional)(),
72
+ (0, class_validator_1.Length)(3, 255),
73
+ __metadata("design:type", String)
74
+ ], UpdateOrganizationValidator.prototype, "display_name", void 0);
75
+ __decorate([
76
+ (0, class_validator_1.IsOptional)(),
77
+ (0, class_validator_1.ValidateNested)(),
78
+ (0, class_transformer_1.Type)(function () { return OrganizationMetadataValidator; }),
79
+ __metadata("design:type", OrganizationMetadataValidator)
80
+ ], UpdateOrganizationValidator.prototype, "metadata", void 0);
81
+ return UpdateOrganizationValidator;
82
+ }());
83
+ exports.UpdateOrganizationValidator = UpdateOrganizationValidator;
@@ -0,0 +1,11 @@
1
+ export declare enum SocialType {
2
+ FACEBOOK = "facebook",
3
+ TWITTER = "twitter",
4
+ INSTAGRAM = "instagram",
5
+ TIKTOK = "tiktok",
6
+ LINKEDIN = "linkedin"
7
+ }
8
+ export declare class CreateSocialValidator {
9
+ name: SocialType;
10
+ url: string;
11
+ }
@@ -0,0 +1,36 @@
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.CreateSocialValidator = exports.SocialType = void 0;
13
+ var class_validator_1 = require("class-validator");
14
+ var SocialType;
15
+ (function (SocialType) {
16
+ SocialType["FACEBOOK"] = "facebook";
17
+ SocialType["TWITTER"] = "twitter";
18
+ SocialType["INSTAGRAM"] = "instagram";
19
+ SocialType["TIKTOK"] = "tiktok";
20
+ SocialType["LINKEDIN"] = "linkedin";
21
+ })(SocialType = exports.SocialType || (exports.SocialType = {}));
22
+ var CreateSocialValidator = (function () {
23
+ function CreateSocialValidator() {
24
+ }
25
+ __decorate([
26
+ (0, class_validator_1.IsString)(),
27
+ (0, class_validator_1.IsEnum)(SocialType),
28
+ __metadata("design:type", String)
29
+ ], CreateSocialValidator.prototype, "name", void 0);
30
+ __decorate([
31
+ (0, class_validator_1.IsUrl)(),
32
+ __metadata("design:type", String)
33
+ ], CreateSocialValidator.prototype, "url", void 0);
34
+ return CreateSocialValidator;
35
+ }());
36
+ exports.CreateSocialValidator = CreateSocialValidator;
@@ -0,0 +1,10 @@
1
+ import { MetaAddress } from '../../types';
2
+ export declare class AddressValidator implements MetaAddress {
3
+ name: string;
4
+ country: string;
5
+ code: string;
6
+ line1: string;
7
+ line2?: string;
8
+ city: string;
9
+ state: string;
10
+ }
@@ -0,0 +1,50 @@
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.AddressValidator = void 0;
13
+ var class_validator_1 = require("class-validator");
14
+ var AddressValidator = (function () {
15
+ function AddressValidator() {
16
+ }
17
+ __decorate([
18
+ (0, class_validator_1.IsString)(),
19
+ __metadata("design:type", String)
20
+ ], AddressValidator.prototype, "name", void 0);
21
+ __decorate([
22
+ (0, class_validator_1.IsISO31661Alpha3)(),
23
+ __metadata("design:type", String)
24
+ ], AddressValidator.prototype, "country", void 0);
25
+ __decorate([
26
+ (0, class_validator_1.IsString)(),
27
+ __metadata("design:type", String)
28
+ ], AddressValidator.prototype, "code", void 0);
29
+ __decorate([
30
+ (0, class_validator_1.IsString)(),
31
+ __metadata("design:type", String)
32
+ ], AddressValidator.prototype, "line1", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsString)(),
35
+ (0, class_validator_1.IsOptional)(),
36
+ __metadata("design:type", String)
37
+ ], AddressValidator.prototype, "line2", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsOptional)(),
40
+ (0, class_validator_1.IsString)(),
41
+ __metadata("design:type", String)
42
+ ], AddressValidator.prototype, "city", void 0);
43
+ __decorate([
44
+ (0, class_validator_1.IsString)(),
45
+ (0, class_validator_1.IsOptional)(),
46
+ __metadata("design:type", String)
47
+ ], AddressValidator.prototype, "state", void 0);
48
+ return AddressValidator;
49
+ }());
50
+ exports.AddressValidator = AddressValidator;
@@ -0,0 +1,23 @@
1
+ import { GetResponse, SearchHit, SearchRequest, SearchTotalHits } from '@elastic/elasticsearch/lib/api/types';
2
+ import { AppMetadata, User, UserMetadata } from 'auth0';
3
+ export declare type Document<D> = GetResponse<D>;
4
+ export declare type Search<D> = {
5
+ total: SearchTotalHits;
6
+ hits: SearchHit<D>[];
7
+ max_score?: number;
8
+ };
9
+ export declare type SearchQuery = Omit<SearchRequest, 'index' | 'filter_path'>;
10
+ export interface MetaAddress {
11
+ name: string;
12
+ country: string;
13
+ code: string;
14
+ line1: string;
15
+ line2?: string;
16
+ city: string;
17
+ state: string;
18
+ }
19
+ export interface UserMeta extends UserMetadata {
20
+ addresses?: MetaAddress[];
21
+ }
22
+ export declare type AppMeta = AppMetadata;
23
+ export declare type UserDocument = User<AppMeta, UserMeta>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/api",
3
- "version": "0.2.2-3",
3
+ "version": "0.2.2-30",
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": "./.output/main",
11
+ "main": "./src/main",
12
12
  "types": "./.output/types.d.ts",
13
13
  "files": [
14
14
  ".output"
@@ -17,46 +17,53 @@
17
17
  "prebuild": "yarn run clean",
18
18
  "build": "nest build",
19
19
  "clean": "tsc -b --clean",
20
- "console": "ts-node -r tsconfig-paths/register ./src/console.ts",
20
+ "console": "ts-node -r tsconfig-paths/register ./src/app.console.ts",
21
21
  "dev": "yarn start --watch",
22
- "lint": "eslint \"{src,a}/**/*.ts\" . ",
22
+ "lint": "eslint \"{src,test}/**/*.ts\" . ",
23
+ "migrate": "tsc --target es5 ./src/migrations/*.ts && migrate --config ./src/app.migration.ts",
23
24
  "prepack": ".bin/package.sh",
24
25
  "postpack": "yarn run clean",
25
26
  "semantic-release": "yarn run build:package && semantic-release",
26
27
  "start": "nest start",
27
- "start:prod": "node .output/main.js",
28
+ "start:prod": "node ./src/main.js",
28
29
  "test": "jest",
29
30
  "test:cov": "yarn test -- --coverage",
30
31
  "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
31
32
  "test:watch": "yarn test -- --watch"
32
33
  },
34
+ "lint-staged": {
35
+ "*.**": "yarn lint --cache --fix"
36
+ },
33
37
  "dependencies": {
38
+ "@elastic/elasticsearch": "^8.4.0",
34
39
  "@types/auth0": "^2.35.2",
35
40
  "class-transformer": "^0.5.1",
36
41
  "class-validator": "^0.13.1",
37
- "mongoose": "^6.5.1",
38
- "reflect-metadata": "^0.1.13",
39
- "short-uuid": "^4.2.0"
42
+ "mongoose": "^6",
43
+ "reflect-metadata": "^0.1.13"
40
44
  },
41
45
  "devDependencies": {
42
46
  "@commitlint/config-conventional": "^17.0.0",
43
- "@elastic/elasticsearch": "^8.2.1",
47
+ "@faker-js/faker": "^7.5.0",
44
48
  "@google-cloud/storage": "^6.4.1",
45
49
  "@nestjs/cli": "^9.1.1",
46
50
  "@nestjs/common": "^9.0.11",
47
51
  "@nestjs/config": "^2.2.0",
48
52
  "@nestjs/core": "^9.0.11",
49
53
  "@nestjs/elasticsearch": "^9.0.0",
54
+ "@nestjs/event-emitter": "^1.3.1",
50
55
  "@nestjs/jwt": "^9.0.0",
51
56
  "@nestjs/mongoose": "^9.2.0",
52
57
  "@nestjs/passport": "^9.0.0",
53
58
  "@nestjs/platform-express": "^9.0.11",
59
+ "@nestjs/platform-socket.io": "^9.1.6",
54
60
  "@nestjs/schematics": "^9.0.1",
55
61
  "@nestjs/swagger": "^6.1.0",
56
62
  "@nestjs/testing": "^9.0.11",
63
+ "@nestjs/websockets": "^9.1.6",
57
64
  "@types/cache-manager": "^4.0.1",
58
65
  "@types/express": "^4.17.12",
59
- "@types/faker": "^5.5.9",
66
+ "@types/express-session": "^1.17.5",
60
67
  "@types/jest": "^27.0.0",
61
68
  "@types/multer": "^1.4.7",
62
69
  "@types/node": "^18.0.0",
@@ -66,29 +73,29 @@
66
73
  "@typescript-eslint/eslint-plugin": "4.33.0",
67
74
  "@typescript-eslint/parser": "4.33.0",
68
75
  "auth0": "^2.42.0",
69
- "cache-manager": "^4.1.0",
70
- "chalk": "^4.1.2",
76
+ "cache-manager": "^5.0.0",
71
77
  "commitlint": "^17.0.1",
72
- "es-mapping-ts": "^1.0.1",
73
78
  "eslint": "7.32.0",
74
79
  "eslint-plugin-import": "^2.23.4",
75
80
  "express": "^4.17.3",
76
- "faker": "^5.5.3",
81
+ "express-session": "^1.17.3",
77
82
  "husky": "^8.0.1",
78
83
  "jest": "27.5.1",
84
+ "lint-staged": "^13.0.3",
85
+ "migrate-mongoose": "^4.0.0",
79
86
  "nestjs-console": "^8.0.0",
80
87
  "passport": "^0.6.0",
81
88
  "passport-jwt": "^4.0.0",
82
89
  "rimraf": "^3.0.2",
83
90
  "rxjs": "^7.2.0",
84
- "stripe": "^10.3.0",
91
+ "short-unique-id": "^4.4.4",
85
92
  "supertest": "^6.1.3",
86
93
  "swagger-ui-express": "^4.3.0",
87
94
  "ts-jest": "27.1.3",
88
95
  "ts-loader": "^9.2.3",
89
96
  "ts-node": "^10.0.0",
90
97
  "tsconfig-paths": "^4.0.0",
91
- "typescript": "^4.8.2",
98
+ "typescript": "4.4.4",
92
99
  "webpack": "^5"
93
100
  },
94
101
  "engines": {
@@ -1,8 +0,0 @@
1
- export declare class AppDocument<D = Record<any, any>> {
2
- $id: string;
3
- $createdAt: Date;
4
- $updatedAt?: Date;
5
- $deletedAt?: Date;
6
- constructor(partial?: Partial<D>);
7
- static from<D extends any>(partial: Partial<D>): D;
8
- }
@@ -1,7 +0,0 @@
1
- import { Document } from 'mongoose';
2
- export declare abstract class AppEntity extends Document {
3
- static $index: string;
4
- readonly createdAt: Date;
5
- updatedAt?: Date;
6
- deletedAt?: Date;
7
- }
@@ -1,6 +0,0 @@
1
- import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
2
- export declare class FindValidator {
3
- page: number;
4
- limit: number;
5
- query?: QueryDslQueryContainer;
6
- }
package/.output/main.d.ts DELETED
@@ -1,39 +0,0 @@
1
- import { BrandDocument } from './modules/inventory/brands/brand.document';
2
- import * as BrandValidators from './modules/inventory/brands/brand.validator';
3
- import { CategoryDocument } from './modules/inventory/categories/category.document';
4
- import * as CategoryValidators from './modules/inventory/categories/category.validator';
5
- import { ProductDocument } from './modules/inventory/products/product.document';
6
- import * as ProductValidators from './modules/inventory/products/product.validator';
7
- import { CartDocument } from './modules/store/carts/cart.document';
8
- import * as CartValidator from './modules/store/carts/cart.validator';
9
- import { OrderDocument } from './modules/store/orders/order.document';
10
- import * as OrderValidators from './modules/store/orders/order.validator';
11
- export declare const Inventory: {
12
- Brand: {
13
- CreateBrandValidator: typeof BrandValidators.CreateBrandValidator;
14
- UpdateBrandValidator: typeof BrandValidators.UpdateBrandValidator;
15
- BrandDocument: typeof BrandDocument;
16
- };
17
- Category: {
18
- CreateCategoryValidator: typeof CategoryValidators.CreateCategoryValidator;
19
- UpdateCategoryValidator: typeof CategoryValidators.UpdateCategoryValidator;
20
- CategoryDocument: typeof CategoryDocument;
21
- };
22
- Product: {
23
- CreateProductValidator: typeof ProductValidators.CreateProductValidator;
24
- UpdateProductValidator: typeof ProductValidators.UpdateProductValidator;
25
- ProductDocument: typeof ProductDocument;
26
- };
27
- };
28
- export declare const Store: {
29
- Order: {
30
- CreateOrderValidator: typeof OrderValidators.CreateOrderValidator;
31
- UpdateOrderValidator: typeof OrderValidators.UpdateOrderValidator;
32
- OrderDocument: typeof OrderDocument;
33
- };
34
- Cart: {
35
- CreateCartValidator: typeof CartValidator.CreateCartValidator;
36
- UpdateCartValidator: typeof CartValidator.UpdateCartValidator;
37
- CartDocument: typeof CartDocument;
38
- };
39
- };
@@ -1,7 +0,0 @@
1
- import { AppDocument } from '../../configs/app.document';
2
- export declare class AssetDocument extends AppDocument<AssetDocument> {
3
- name: string;
4
- size: number;
5
- type: string;
6
- weak: boolean;
7
- }
@@ -1,6 +0,0 @@
1
- import { CreateOrganization } from 'auth0';
2
- export declare class CreateOrganizationValidator implements CreateOrganization {
3
- name: string;
4
- email: string;
5
- password?: string;
6
- }
@@ -1,4 +0,0 @@
1
- import { AppDocument } from '../../../configs/app.document';
2
- export declare class CartDocument extends AppDocument<CartDocument> {
3
- number: string;
4
- }
@@ -1,4 +0,0 @@
1
- export declare class CreateCartValidator {
2
- }
3
- export declare class UpdateCartValidator {
4
- }
@@ -1,6 +0,0 @@
1
- import { AppDocument } from '../../../configs/app.document';
2
- import { ProductDocument } from '../../inventory/products/product.document';
3
- export declare class ItemDocument extends AppDocument {
4
- product: Pick<ProductDocument, '$id' | 'name' | 'price'>;
5
- quantity: number;
6
- }
@@ -1,8 +0,0 @@
1
- import { AppEntity } from '../../../configs/app.entity';
2
- import { ProductEntity } from '../../inventory/products/product.entity';
3
- import { CartEntity } from '../carts/cart.entity';
4
- export declare class ItemEntity extends AppEntity {
5
- quantity: number;
6
- product: ProductEntity;
7
- carts: CartEntity[];
8
- }
@@ -1,5 +0,0 @@
1
- import { ProductDocument } from '../../inventory/products/product.document';
2
- export declare class CreateItemValidator {
3
- product: ProductDocument;
4
- quantity: number;
5
- }
@@ -1,5 +0,0 @@
1
- import { AppDocument } from '../../../configs/app.document';
2
- export declare class OrderDocument extends AppDocument<OrderDocument> {
3
- number: string;
4
- price: number;
5
- }
@@ -1,4 +0,0 @@
1
- export declare class CreateOrderValidator {
2
- }
3
- export declare class UpdateOrderValidator {
4
- }