@merkaly/api 0.2.2-0 → 0.2.2-3
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.
- package/.output/configs/app.document.d.ts +8 -0
- package/.output/configs/app.entity.d.ts +7 -0
- package/.output/configs/app.validator.d.ts +6 -0
- package/.output/main.d.ts +10 -25
- package/.output/modules/assets/asset.document.d.ts +7 -0
- package/.output/modules/assets/asset.entity.d.ts +35 -0
- package/.output/{module/organization → modules/auth}/connections/connection.validator.d.ts +0 -0
- package/.output/{module/organization → modules/auth}/members/member.validator.d.ts +0 -0
- package/.output/modules/auth/organizations/organization.validator.d.ts +6 -0
- package/.output/modules/inventory/brands/brand.document.d.ts +5 -0
- package/.output/modules/inventory/brands/brand.entity.d.ts +32 -0
- package/.output/modules/inventory/brands/brand.validator.d.ts +8 -0
- package/.output/modules/inventory/categories/category.document.d.ts +5 -0
- package/.output/modules/inventory/categories/category.entity.d.ts +32 -0
- package/.output/modules/inventory/categories/category.validator.d.ts +8 -0
- package/.output/modules/inventory/products/product.document.d.ts +12 -0
- package/.output/modules/inventory/products/product.entity.d.ts +39 -0
- package/.output/modules/inventory/products/product.validator.d.ts +16 -0
- package/.output/modules/store/carts/cart.document.d.ts +4 -0
- package/.output/modules/store/carts/cart.entity.d.ts +34 -0
- package/.output/modules/store/carts/cart.validator.d.ts +4 -0
- package/.output/modules/store/items/item.document.d.ts +6 -0
- package/.output/{module → modules}/store/items/item.entity.d.ts +2 -2
- package/.output/modules/store/items/item.validator.d.ts +5 -0
- package/.output/modules/store/orders/order.document.d.ts +5 -0
- package/.output/modules/store/orders/order.entity.d.ts +32 -0
- package/.output/modules/store/orders/order.validator.d.ts +4 -0
- package/package.json +40 -41
- package/.output/config/app.config.d.ts +0 -27
- package/.output/config/app.document.d.ts +0 -9
- package/.output/config/app.entity.d.ts +0 -8
- package/.output/config/app.repository.d.ts +0 -25
- package/.output/config/app.validator.d.ts +0 -4
- package/.output/module/inventory/brands/brand.document.d.ts +0 -7
- package/.output/module/inventory/brands/brand.entity.d.ts +0 -7
- package/.output/module/inventory/brands/brand.validator.d.ts +0 -12
- package/.output/module/inventory/categories/category.document.d.ts +0 -7
- package/.output/module/inventory/categories/category.entity.d.ts +0 -7
- package/.output/module/inventory/categories/category.validator.d.ts +0 -12
- package/.output/module/inventory/media/media.document.d.ts +0 -7
- package/.output/module/inventory/media/media.entity.d.ts +0 -7
- package/.output/module/inventory/media/media.validator.d.ts +0 -10
- package/.output/module/inventory/products/product.document.d.ts +0 -12
- package/.output/module/inventory/products/product.entity.d.ts +0 -14
- package/.output/module/inventory/products/product.validator.d.ts +0 -21
- package/.output/module/inventory/variants/variant.document.d.ts +0 -6
- package/.output/module/inventory/variants/variant.entity.d.ts +0 -6
- package/.output/module/inventory/variants/variant.validator.d.ts +0 -12
- package/.output/module/store/carts/cart.document.d.ts +0 -6
- package/.output/module/store/carts/cart.entity.d.ts +0 -6
- package/.output/module/store/carts/cart.validator.d.ts +0 -8
- package/.output/module/store/items/item.document.d.ts +0 -8
- package/.output/module/store/items/item.validator.d.ts +0 -4
- package/.output/module/store/orders/order.document.d.ts +0 -7
- package/.output/module/store/orders/order.entity.d.ts +0 -5
- package/.output/module/store/orders/order.validator.d.ts +0 -8
package/.output/main.d.ts
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import { BrandDocument } from './
|
|
2
|
-
import * as BrandValidators from './
|
|
3
|
-
import { CategoryDocument } from './
|
|
4
|
-
import * as CategoryValidators from './
|
|
5
|
-
import {
|
|
6
|
-
import * as
|
|
7
|
-
import {
|
|
8
|
-
import * as
|
|
9
|
-
import {
|
|
10
|
-
import * as
|
|
11
|
-
import { CartDocument } from './module/store/carts/cart.document';
|
|
12
|
-
import * as CartValidator from './module/store/carts/cart.validator';
|
|
13
|
-
import { OrderDocument } from './module/store/orders/order.document';
|
|
14
|
-
import * as OrderValidators from './module/store/orders/order.validator';
|
|
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';
|
|
15
11
|
export declare const Inventory: {
|
|
16
12
|
Brand: {
|
|
17
13
|
CreateBrandValidator: typeof BrandValidators.CreateBrandValidator;
|
|
@@ -28,16 +24,6 @@ export declare const Inventory: {
|
|
|
28
24
|
UpdateProductValidator: typeof ProductValidators.UpdateProductValidator;
|
|
29
25
|
ProductDocument: typeof ProductDocument;
|
|
30
26
|
};
|
|
31
|
-
Media: {
|
|
32
|
-
CreateMediaValidator: typeof MediaValidators.CreateMediaValidator;
|
|
33
|
-
UpdateMediaValidator: typeof MediaValidators.UpdateMediaValidator;
|
|
34
|
-
MediaDocument: typeof MediaDocument;
|
|
35
|
-
};
|
|
36
|
-
Variant: {
|
|
37
|
-
CreateVariantValidator: typeof VariantValidators.CreateVariantValidator;
|
|
38
|
-
UpdateVariantValidator: typeof VariantValidators.UpdateVariantValidator;
|
|
39
|
-
VariantDocument: typeof VariantDocument;
|
|
40
|
-
};
|
|
41
27
|
};
|
|
42
28
|
export declare const Store: {
|
|
43
29
|
Order: {
|
|
@@ -51,4 +37,3 @@ export declare const Store: {
|
|
|
51
37
|
CartDocument: typeof CartDocument;
|
|
52
38
|
};
|
|
53
39
|
};
|
|
54
|
-
export { SearchParams } from './config/app.repository';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Schema as MongoSchema } from 'mongoose';
|
|
26
|
+
import { AppEntity } from '../../configs/app.entity';
|
|
27
|
+
export declare class AssetEntity extends AppEntity {
|
|
28
|
+
static readonly $index = "assets";
|
|
29
|
+
name: string;
|
|
30
|
+
weak: boolean;
|
|
31
|
+
description: string;
|
|
32
|
+
type: string;
|
|
33
|
+
size: number;
|
|
34
|
+
}
|
|
35
|
+
export declare const AssetSchema: MongoSchema<AssetEntity, import("mongoose").Model<AssetEntity, any, any, any, any>, {}, {}, {}, {}, "type", AssetEntity>;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Schema as MongoSchema } from 'mongoose';
|
|
26
|
+
import { AppEntity } from '../../../configs/app.entity';
|
|
27
|
+
export declare class BrandEntity extends AppEntity {
|
|
28
|
+
static readonly $index = "inventory_brands";
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const BrandSchema: MongoSchema<BrandEntity, import("mongoose").Model<BrandEntity, any, any, any, any>, {}, {}, {}, {}, "type", BrandEntity>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Schema as MongoSchema } from 'mongoose';
|
|
26
|
+
import { AppEntity } from '../../../configs/app.entity';
|
|
27
|
+
export declare class CategoryEntity extends AppEntity {
|
|
28
|
+
static readonly $index = "inventory_categories";
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const CategorySchema: MongoSchema<CategoryEntity, import("mongoose").Model<CategoryEntity, any, any, any, any>, {}, {}, {}, {}, "type", CategoryEntity>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppDocument } from '../../../configs/app.document';
|
|
2
|
+
import { AssetDocument } from '../../assets/asset.document';
|
|
3
|
+
import { BrandDocument } from '../brands/brand.document';
|
|
4
|
+
import { CategoryDocument } from '../categories/category.document';
|
|
5
|
+
export declare class ProductDocument extends AppDocument<ProductDocument> {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
category: CategoryDocument;
|
|
9
|
+
brand: BrandDocument;
|
|
10
|
+
price: number;
|
|
11
|
+
files: AssetDocument[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Schema as MongoSchema } from 'mongoose';
|
|
26
|
+
import { AppEntity } from '../../../configs/app.entity';
|
|
27
|
+
import { AssetEntity } from '../../assets/asset.entity';
|
|
28
|
+
import { BrandEntity } from '../brands/brand.entity';
|
|
29
|
+
import { CategoryEntity } from '../categories/category.entity';
|
|
30
|
+
export declare class ProductEntity extends AppEntity {
|
|
31
|
+
static readonly $index = "inventory_products";
|
|
32
|
+
name: string;
|
|
33
|
+
description: string;
|
|
34
|
+
price: number;
|
|
35
|
+
category?: CategoryEntity;
|
|
36
|
+
brand?: BrandEntity;
|
|
37
|
+
files: AssetEntity[];
|
|
38
|
+
}
|
|
39
|
+
export declare const ProductSchema: MongoSchema<ProductEntity, import("mongoose").Model<ProductEntity, any, any, any, any>, {}, {}, {}, {}, "type", ProductEntity>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class CreateProductValidator {
|
|
2
|
+
name: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
price: number;
|
|
5
|
+
category?: string;
|
|
6
|
+
brand?: string;
|
|
7
|
+
files: any[];
|
|
8
|
+
}
|
|
9
|
+
export declare class UpdateProductValidator {
|
|
10
|
+
name?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
price?: any;
|
|
13
|
+
category?: string;
|
|
14
|
+
brand?: string;
|
|
15
|
+
files: any[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Schema as MongoSchema } from 'mongoose';
|
|
26
|
+
import { AppEntity } from '../../../configs/app.entity';
|
|
27
|
+
import { ItemEntity } from '../items/item.entity';
|
|
28
|
+
export declare class CartEntity extends AppEntity {
|
|
29
|
+
static readonly $index = "store_carts";
|
|
30
|
+
user: string;
|
|
31
|
+
number: string;
|
|
32
|
+
items: ItemEntity[];
|
|
33
|
+
}
|
|
34
|
+
export declare const CartSchema: MongoSchema<CartEntity, import("mongoose").Model<CartEntity, any, any, any, any>, {}, {}, {}, {}, "type", CartEntity>;
|
|
@@ -0,0 +1,6 @@
|
|
|
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 +1,8 @@
|
|
|
1
|
-
import { AppEntity } from '../../../
|
|
1
|
+
import { AppEntity } from '../../../configs/app.entity';
|
|
2
2
|
import { ProductEntity } from '../../inventory/products/product.entity';
|
|
3
3
|
import { CartEntity } from '../carts/cart.entity';
|
|
4
4
|
export declare class ItemEntity extends AppEntity {
|
|
5
|
-
product: ProductEntity;
|
|
6
5
|
quantity: number;
|
|
6
|
+
product: ProductEntity;
|
|
7
7
|
carts: CartEntity[];
|
|
8
8
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Schema as MongoSchema } from 'mongoose';
|
|
26
|
+
import { AppEntity } from '../../../configs/app.entity';
|
|
27
|
+
export declare class OrderEntity extends AppEntity {
|
|
28
|
+
static readonly $index = "store_orders";
|
|
29
|
+
number: string;
|
|
30
|
+
price: number;
|
|
31
|
+
}
|
|
32
|
+
export declare const OrderSchema: MongoSchema<OrderEntity, import("mongoose").Model<OrderEntity, any, any, any, any>, {}, {}, {}, {}, "type", OrderEntity>;
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@merkaly/api",
|
|
3
|
-
"version": "0.2.2-
|
|
3
|
+
"version": "0.2.2-3",
|
|
4
4
|
"description": "NestJS Backend ApiRest Service",
|
|
5
|
-
"
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/merkaly-io/api.git"
|
|
8
|
+
},
|
|
6
9
|
"license": "UNLICENSED",
|
|
10
|
+
"author": "Randy Tellez Galan <kronhyx@gmail.com>",
|
|
7
11
|
"main": "./.output/main",
|
|
8
12
|
"types": "./.output/types.d.ts",
|
|
9
13
|
"files": [
|
|
@@ -11,49 +15,46 @@
|
|
|
11
15
|
],
|
|
12
16
|
"scripts": {
|
|
13
17
|
"prebuild": "yarn run clean",
|
|
14
|
-
"prepack": ".bin/package.sh",
|
|
15
|
-
"postpack": "yarn run clean",
|
|
16
18
|
"build": "nest build",
|
|
17
19
|
"clean": "tsc -b --clean",
|
|
18
|
-
"start": "nest start --preserveWatchOutput",
|
|
19
|
-
"dev": "yarn start --watch",
|
|
20
20
|
"console": "ts-node -r tsconfig-paths/register ./src/console.ts",
|
|
21
|
-
"
|
|
22
|
-
"lint": "eslint \"{src,
|
|
21
|
+
"dev": "yarn start --watch",
|
|
22
|
+
"lint": "eslint \"{src,a}/**/*.ts\" . ",
|
|
23
|
+
"prepack": ".bin/package.sh",
|
|
24
|
+
"postpack": "yarn run clean",
|
|
25
|
+
"semantic-release": "yarn run build:package && semantic-release",
|
|
26
|
+
"start": "nest start",
|
|
27
|
+
"start:prod": "node .output/main.js",
|
|
23
28
|
"test": "jest",
|
|
24
|
-
"test:watch": "yarn test -- --watch",
|
|
25
29
|
"test:cov": "yarn test -- --coverage",
|
|
26
30
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
27
|
-
"
|
|
31
|
+
"test:watch": "yarn test -- --watch"
|
|
28
32
|
},
|
|
29
33
|
"dependencies": {
|
|
30
34
|
"@types/auth0": "^2.35.2",
|
|
31
|
-
"auth0": "^2.42.0",
|
|
32
35
|
"class-transformer": "^0.5.1",
|
|
33
36
|
"class-validator": "^0.13.1",
|
|
34
|
-
"
|
|
37
|
+
"mongoose": "^6.5.1",
|
|
35
38
|
"reflect-metadata": "^0.1.13",
|
|
36
|
-
"
|
|
39
|
+
"short-uuid": "^4.2.0"
|
|
37
40
|
},
|
|
38
41
|
"devDependencies": {
|
|
39
42
|
"@commitlint/config-conventional": "^17.0.0",
|
|
40
43
|
"@elastic/elasticsearch": "^8.2.1",
|
|
41
|
-
"@
|
|
42
|
-
"@nestjs/cli": "
|
|
43
|
-
"@nestjs/common": "
|
|
44
|
-
"@nestjs/config": "^2.
|
|
45
|
-
"@nestjs/core": "
|
|
46
|
-
"@nestjs/elasticsearch": "
|
|
47
|
-
"@nestjs/
|
|
48
|
-
"@nestjs/
|
|
49
|
-
"@nestjs/passport": "
|
|
50
|
-
"@nestjs/platform-express": "
|
|
51
|
-
"@nestjs/schematics": "
|
|
52
|
-
"@nestjs/swagger": "^
|
|
53
|
-
"@nestjs/testing": "
|
|
54
|
-
"@
|
|
55
|
-
"@semantic-release/exec": "^6.0.1",
|
|
56
|
-
"@semantic-release/git": "^10.0.0",
|
|
44
|
+
"@google-cloud/storage": "^6.4.1",
|
|
45
|
+
"@nestjs/cli": "^9.1.1",
|
|
46
|
+
"@nestjs/common": "^9.0.11",
|
|
47
|
+
"@nestjs/config": "^2.2.0",
|
|
48
|
+
"@nestjs/core": "^9.0.11",
|
|
49
|
+
"@nestjs/elasticsearch": "^9.0.0",
|
|
50
|
+
"@nestjs/jwt": "^9.0.0",
|
|
51
|
+
"@nestjs/mongoose": "^9.2.0",
|
|
52
|
+
"@nestjs/passport": "^9.0.0",
|
|
53
|
+
"@nestjs/platform-express": "^9.0.11",
|
|
54
|
+
"@nestjs/schematics": "^9.0.1",
|
|
55
|
+
"@nestjs/swagger": "^6.1.0",
|
|
56
|
+
"@nestjs/testing": "^9.0.11",
|
|
57
|
+
"@types/cache-manager": "^4.0.1",
|
|
57
58
|
"@types/express": "^4.17.12",
|
|
58
59
|
"@types/faker": "^5.5.9",
|
|
59
60
|
"@types/jest": "^27.0.0",
|
|
@@ -61,41 +62,39 @@
|
|
|
61
62
|
"@types/node": "^18.0.0",
|
|
62
63
|
"@types/passport-jwt": "^3.0.5",
|
|
63
64
|
"@types/supertest": "^2.0.11",
|
|
65
|
+
"@types/uuid": "^8.3.4",
|
|
64
66
|
"@typescript-eslint/eslint-plugin": "4.33.0",
|
|
65
67
|
"@typescript-eslint/parser": "4.33.0",
|
|
68
|
+
"auth0": "^2.42.0",
|
|
69
|
+
"cache-manager": "^4.1.0",
|
|
70
|
+
"chalk": "^4.1.2",
|
|
66
71
|
"commitlint": "^17.0.1",
|
|
72
|
+
"es-mapping-ts": "^1.0.1",
|
|
67
73
|
"eslint": "7.32.0",
|
|
68
74
|
"eslint-plugin-import": "^2.23.4",
|
|
69
75
|
"express": "^4.17.3",
|
|
70
76
|
"faker": "^5.5.3",
|
|
71
77
|
"husky": "^8.0.1",
|
|
72
78
|
"jest": "27.5.1",
|
|
73
|
-
"
|
|
74
|
-
"nestjs-console": "^7.0.1",
|
|
79
|
+
"nestjs-console": "^8.0.0",
|
|
75
80
|
"passport": "^0.6.0",
|
|
76
81
|
"passport-jwt": "^4.0.0",
|
|
77
82
|
"rimraf": "^3.0.2",
|
|
78
83
|
"rxjs": "^7.2.0",
|
|
79
|
-
"
|
|
84
|
+
"stripe": "^10.3.0",
|
|
80
85
|
"supertest": "^6.1.3",
|
|
81
86
|
"swagger-ui-express": "^4.3.0",
|
|
82
87
|
"ts-jest": "27.1.3",
|
|
83
88
|
"ts-loader": "^9.2.3",
|
|
84
89
|
"ts-node": "^10.0.0",
|
|
85
90
|
"tsconfig-paths": "^4.0.0",
|
|
86
|
-
"
|
|
87
|
-
"typeorm-naming-strategies": "^4.0.0",
|
|
88
|
-
"typescript": "^4.6.2",
|
|
91
|
+
"typescript": "^4.8.2",
|
|
89
92
|
"webpack": "^5"
|
|
90
93
|
},
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"url": "https://github.com/sk-merkaly/api.git"
|
|
94
|
+
"engines": {
|
|
95
|
+
"node": "16"
|
|
94
96
|
},
|
|
95
97
|
"publishConfig": {
|
|
96
98
|
"access": "public"
|
|
97
|
-
},
|
|
98
|
-
"engines": {
|
|
99
|
-
"node": "16"
|
|
100
99
|
}
|
|
101
100
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { HttpModuleOptions } from '@nestjs/axios/dist/interfaces';
|
|
2
|
-
import { ElasticsearchModuleOptions } from '@nestjs/elasticsearch';
|
|
3
|
-
import { TypeOrmModuleOptions } from '@nestjs/typeorm/dist/interfaces/typeorm-options.interface';
|
|
4
|
-
export declare abstract class AppConfig {
|
|
5
|
-
static get elasticsearch(): ElasticsearchModuleOptions;
|
|
6
|
-
static get axios(): HttpModuleOptions;
|
|
7
|
-
static get auth0(): {
|
|
8
|
-
domain: string;
|
|
9
|
-
audience: string;
|
|
10
|
-
client: string;
|
|
11
|
-
secret: string;
|
|
12
|
-
realm: string;
|
|
13
|
-
};
|
|
14
|
-
static get sentry(): {
|
|
15
|
-
dsn: string;
|
|
16
|
-
debug: boolean;
|
|
17
|
-
environment: string;
|
|
18
|
-
};
|
|
19
|
-
static get server(): {
|
|
20
|
-
port: string | number;
|
|
21
|
-
name: string;
|
|
22
|
-
description: string;
|
|
23
|
-
version: string;
|
|
24
|
-
tenant: string;
|
|
25
|
-
};
|
|
26
|
-
static get database(): TypeOrmModuleOptions;
|
|
27
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AppEntity } from './app.entity';
|
|
2
|
-
export declare abstract class AppDocument<E extends AppEntity> {
|
|
3
|
-
protected abstract transform?(entity: E): this;
|
|
4
|
-
$id: string;
|
|
5
|
-
$createdAt: Date;
|
|
6
|
-
$updatedAt: Date;
|
|
7
|
-
$deletedAt: Date;
|
|
8
|
-
serialize?(entity: E): this;
|
|
9
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { GetResponse, Id, QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
|
|
2
|
-
import { ElasticsearchService } from '@nestjs/elasticsearch';
|
|
3
|
-
import { Repository } from 'typeorm';
|
|
4
|
-
import { AppDocument } from './app.document';
|
|
5
|
-
import { AppEntity } from './app.entity';
|
|
6
|
-
import { AppValidator } from './app.validator';
|
|
7
|
-
export interface SearchParams {
|
|
8
|
-
page?: number;
|
|
9
|
-
limit?: number;
|
|
10
|
-
query?: QueryDslQueryContainer;
|
|
11
|
-
}
|
|
12
|
-
export declare abstract class AppRepository<E extends AppEntity, D extends AppDocument<E> = AppDocument<E>> {
|
|
13
|
-
protected readonly $elastic: ElasticsearchService;
|
|
14
|
-
protected abstract $document: D;
|
|
15
|
-
protected abstract repository: Repository<E>;
|
|
16
|
-
protected get $index(): string;
|
|
17
|
-
protected get $routing(): string;
|
|
18
|
-
find(search?: SearchParams): Promise<import("@elastic/elasticsearch/lib/api/types").SearchResponse<E, Record<string, import("@elastic/elasticsearch/lib/api/types").AggregationsAggregate>>>;
|
|
19
|
-
create(validator: AppValidator<any>): Promise<GetResponse<D>>;
|
|
20
|
-
read(id: Id): Promise<GetResponse<D>>;
|
|
21
|
-
update(id: Id, validator: AppValidator<any>): Promise<GetResponse<D>>;
|
|
22
|
-
delete(id: Id): Promise<void>;
|
|
23
|
-
protected $create(id: Id, document: AppDocument<AppEntity>): Promise<GetResponse<D>>;
|
|
24
|
-
protected $update(id: Id, doc: AppDocument<AppEntity>): Promise<GetResponse<D>>;
|
|
25
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AppDocument } from '../../../config/app.document';
|
|
2
|
-
import { BrandEntity } from './brand.entity';
|
|
3
|
-
export declare class BrandDocument extends AppDocument<BrandEntity> {
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
protected transform?(entity: BrandEntity): this;
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AppValidator } from '../../../config/app.validator';
|
|
2
|
-
import { BrandEntity } from './brand.entity';
|
|
3
|
-
export declare class CreateBrandValidator extends AppValidator<BrandEntity> {
|
|
4
|
-
name: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
toEntity?(): BrandEntity;
|
|
7
|
-
}
|
|
8
|
-
export declare class UpdateBrandValidator extends AppValidator<BrandEntity> {
|
|
9
|
-
name?: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
toEntity?(entity: BrandEntity): BrandEntity;
|
|
12
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AppDocument } from '../../../config/app.document';
|
|
2
|
-
import { CategoryEntity } from './category.entity';
|
|
3
|
-
export declare class CategoryDocument extends AppDocument<CategoryEntity> {
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
protected transform?(entity: CategoryEntity): this;
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AppValidator } from '../../../config/app.validator';
|
|
2
|
-
import { CategoryEntity } from './category.entity';
|
|
3
|
-
export declare class CreateCategoryValidator extends AppValidator<CategoryEntity> {
|
|
4
|
-
name: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
toEntity?(): CategoryEntity;
|
|
7
|
-
}
|
|
8
|
-
export declare class UpdateCategoryValidator extends AppValidator<CategoryEntity> {
|
|
9
|
-
name: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
toEntity?(entity: CategoryEntity): CategoryEntity;
|
|
12
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AppValidator } from '../../../config/app.validator';
|
|
2
|
-
import { MediaEntity } from './media.entity';
|
|
3
|
-
export declare class CreateMediaValidator extends AppValidator<MediaEntity> {
|
|
4
|
-
name: string;
|
|
5
|
-
toEntity?(): MediaEntity;
|
|
6
|
-
}
|
|
7
|
-
export declare class UpdateMediaValidator extends AppValidator<MediaEntity> {
|
|
8
|
-
name: string;
|
|
9
|
-
toEntity?(entity: MediaEntity): MediaEntity;
|
|
10
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AppDocument } from '../../../config/app.document';
|
|
2
|
-
import { BrandEntity } from '../brands/brand.entity';
|
|
3
|
-
import { CategoryEntity } from '../categories/category.entity';
|
|
4
|
-
import { ProductEntity } from './product.entity';
|
|
5
|
-
export declare class ProductDocument extends AppDocument<ProductEntity> {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
category: Pick<CategoryEntity, 'id' | 'name' | 'description'>;
|
|
9
|
-
brand: Pick<BrandEntity, 'id' | 'name' | 'description'>;
|
|
10
|
-
price: number;
|
|
11
|
-
protected transform?(entity: ProductEntity): this;
|
|
12
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AppEntity } from '../../../config/app.entity';
|
|
2
|
-
import { BrandEntity } from '../brands/brand.entity';
|
|
3
|
-
import { CategoryEntity } from '../categories/category.entity';
|
|
4
|
-
import { MediaEntity } from '../media/media.entity';
|
|
5
|
-
import { VariantEntity } from '../variants/variant.entity';
|
|
6
|
-
export declare class ProductEntity extends AppEntity {
|
|
7
|
-
name: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
price: number;
|
|
10
|
-
category?: CategoryEntity;
|
|
11
|
-
brand?: BrandEntity;
|
|
12
|
-
variants: VariantEntity[];
|
|
13
|
-
media: MediaEntity[];
|
|
14
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Id } from '@elastic/elasticsearch/lib/api/types';
|
|
2
|
-
import { AppValidator } from '../../../config/app.validator';
|
|
3
|
-
import { CreateVariantValidator } from '../variants/variant.validator';
|
|
4
|
-
import { ProductEntity } from './product.entity';
|
|
5
|
-
export declare class CreateProductValidator extends AppValidator<ProductEntity> {
|
|
6
|
-
name: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
price: number;
|
|
9
|
-
category?: string;
|
|
10
|
-
brand?: string;
|
|
11
|
-
variants?: CreateVariantValidator[];
|
|
12
|
-
toEntity?(): ProductEntity;
|
|
13
|
-
}
|
|
14
|
-
export declare class UpdateProductValidator extends AppValidator<ProductEntity> {
|
|
15
|
-
name?: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
price: number;
|
|
18
|
-
category?: Id;
|
|
19
|
-
brand?: Id;
|
|
20
|
-
toEntity?(entity: ProductEntity): ProductEntity;
|
|
21
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AppValidator } from '../../../config/app.validator';
|
|
2
|
-
import { ProductEntity } from '../products/product.entity';
|
|
3
|
-
import { VariantEntity } from './variant.entity';
|
|
4
|
-
export declare class CreateVariantValidator extends AppValidator<VariantEntity> {
|
|
5
|
-
price: number;
|
|
6
|
-
active: boolean;
|
|
7
|
-
toEntity?(product?: ProductEntity): VariantEntity;
|
|
8
|
-
}
|
|
9
|
-
export declare class UpdateVariantValidator extends AppValidator<VariantEntity> {
|
|
10
|
-
price: number;
|
|
11
|
-
toEntity?(entity: VariantEntity): VariantEntity;
|
|
12
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AppValidator } from '../../../config/app.validator';
|
|
2
|
-
import { CartEntity } from './cart.entity';
|
|
3
|
-
export declare class CreateCartValidator extends AppValidator<CartEntity> {
|
|
4
|
-
toEntity?(): CartEntity;
|
|
5
|
-
}
|
|
6
|
-
export declare class UpdateCartValidator extends AppValidator<CartEntity> {
|
|
7
|
-
toEntity?(entity: CartEntity): CartEntity;
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AppDocument } from '../../../config/app.document';
|
|
2
|
-
import { ProductEntity } from '../../inventory/products/product.entity';
|
|
3
|
-
import { ItemEntity } from './item.entity';
|
|
4
|
-
export declare class ItemDocument extends AppDocument<ItemEntity> {
|
|
5
|
-
product: Pick<ProductEntity, 'id' | 'name' | 'price'>;
|
|
6
|
-
quantity: number;
|
|
7
|
-
protected transform?(entity: ItemEntity): this;
|
|
8
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AppDocument } from '../../../config/app.document';
|
|
2
|
-
import { OrderEntity } from './order.entity';
|
|
3
|
-
export declare class OrderDocument extends AppDocument<OrderEntity> {
|
|
4
|
-
number: string;
|
|
5
|
-
price: number;
|
|
6
|
-
protected transform?(entity: OrderEntity): this;
|
|
7
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AppValidator } from '../../../config/app.validator';
|
|
2
|
-
import { OrderEntity } from './order.entity';
|
|
3
|
-
export declare class CreateOrderValidator extends AppValidator<OrderEntity> {
|
|
4
|
-
toEntity?(): OrderEntity;
|
|
5
|
-
}
|
|
6
|
-
export declare class UpdateOrderValidator extends AppValidator<OrderEntity> {
|
|
7
|
-
toEntity?(entity: OrderEntity): OrderEntity;
|
|
8
|
-
}
|