@merkaly/api 0.2.2-0 → 0.2.2-1
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/config/app.document.d.ts +4 -3
- package/.output/config/app.repository.d.ts +4 -4
- package/.output/config/app.validator.d.ts +6 -0
- package/.output/module/inventory/brands/brand.document.d.ts +1 -1
- package/.output/module/inventory/categories/category.document.d.ts +1 -1
- package/.output/module/inventory/media/media.document.d.ts +1 -1
- package/.output/module/inventory/products/product.document.d.ts +1 -1
- package/.output/module/inventory/variants/variant.document.d.ts +1 -1
- package/.output/module/store/carts/cart.document.d.ts +1 -1
- package/.output/module/store/items/item.document.d.ts +1 -1
- package/.output/module/store/orders/order.document.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AppEntity } from './app.entity';
|
|
2
|
-
export declare abstract class AppDocument
|
|
3
|
-
protected abstract transform?(entity:
|
|
2
|
+
export declare abstract class AppDocument {
|
|
3
|
+
protected abstract transform?(entity: unknown): this;
|
|
4
4
|
$id: string;
|
|
5
5
|
$createdAt: Date;
|
|
6
6
|
$updatedAt: Date;
|
|
7
7
|
$deletedAt: Date;
|
|
8
|
-
|
|
8
|
+
private _routing;
|
|
9
|
+
serialize?(entity: AppEntity): this;
|
|
9
10
|
}
|
|
@@ -9,17 +9,17 @@ export interface SearchParams {
|
|
|
9
9
|
limit?: number;
|
|
10
10
|
query?: QueryDslQueryContainer;
|
|
11
11
|
}
|
|
12
|
-
export declare abstract class AppRepository<E extends AppEntity, D extends AppDocument
|
|
12
|
+
export declare abstract class AppRepository<E extends AppEntity, D extends AppDocument> {
|
|
13
13
|
protected readonly $elastic: ElasticsearchService;
|
|
14
14
|
protected abstract $document: D;
|
|
15
15
|
protected abstract repository: Repository<E>;
|
|
16
16
|
protected get $index(): string;
|
|
17
17
|
protected get $routing(): string;
|
|
18
|
-
find(search?: SearchParams): Promise<import("@elastic/elasticsearch/lib/api/types").
|
|
18
|
+
find(search?: SearchParams): Promise<import("@elastic/elasticsearch/lib/api/types").SearchHitsMetadata<D>>;
|
|
19
19
|
create(validator: AppValidator<any>): Promise<GetResponse<D>>;
|
|
20
20
|
read(id: Id): Promise<GetResponse<D>>;
|
|
21
21
|
update(id: Id, validator: AppValidator<any>): Promise<GetResponse<D>>;
|
|
22
22
|
delete(id: Id): Promise<void>;
|
|
23
|
-
protected $create(id: Id, document:
|
|
24
|
-
protected $update(id: Id, doc:
|
|
23
|
+
protected $create(id: Id, document: D): Promise<GetResponse<D>>;
|
|
24
|
+
protected $update(id: Id, doc: D): Promise<GetResponse<D>>;
|
|
25
25
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
|
|
1
2
|
import { AppEntity } from './app.entity';
|
|
2
3
|
export declare abstract class AppValidator<E extends AppEntity> {
|
|
3
4
|
abstract toEntity?(...variadic: unknown[]): E;
|
|
4
5
|
}
|
|
6
|
+
export declare class FindValidator {
|
|
7
|
+
page: number;
|
|
8
|
+
limit: number;
|
|
9
|
+
query?: QueryDslQueryContainer;
|
|
10
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppDocument } from '../../../config/app.document';
|
|
2
2
|
import { BrandEntity } from './brand.entity';
|
|
3
|
-
export declare class BrandDocument extends AppDocument
|
|
3
|
+
export declare class BrandDocument extends AppDocument {
|
|
4
4
|
name: string;
|
|
5
5
|
description: string;
|
|
6
6
|
protected transform?(entity: BrandEntity): this;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppDocument } from '../../../config/app.document';
|
|
2
2
|
import { CategoryEntity } from './category.entity';
|
|
3
|
-
export declare class CategoryDocument extends AppDocument
|
|
3
|
+
export declare class CategoryDocument extends AppDocument {
|
|
4
4
|
name: string;
|
|
5
5
|
description: string;
|
|
6
6
|
protected transform?(entity: CategoryEntity): this;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppDocument } from '../../../config/app.document';
|
|
2
2
|
import { MediaEntity } from './media.entity';
|
|
3
|
-
export declare class MediaDocument extends AppDocument
|
|
3
|
+
export declare class MediaDocument extends AppDocument {
|
|
4
4
|
name: string;
|
|
5
5
|
url: string;
|
|
6
6
|
protected transform?(entity: MediaEntity): this;
|
|
@@ -2,7 +2,7 @@ import { AppDocument } from '../../../config/app.document';
|
|
|
2
2
|
import { BrandEntity } from '../brands/brand.entity';
|
|
3
3
|
import { CategoryEntity } from '../categories/category.entity';
|
|
4
4
|
import { ProductEntity } from './product.entity';
|
|
5
|
-
export declare class ProductDocument extends AppDocument
|
|
5
|
+
export declare class ProductDocument extends AppDocument {
|
|
6
6
|
name: string;
|
|
7
7
|
description: string;
|
|
8
8
|
category: Pick<CategoryEntity, 'id' | 'name' | 'description'>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppDocument } from '../../../config/app.document';
|
|
2
2
|
import { VariantEntity } from './variant.entity';
|
|
3
|
-
export declare class VariantDocument extends AppDocument
|
|
3
|
+
export declare class VariantDocument extends AppDocument {
|
|
4
4
|
price: number;
|
|
5
5
|
protected transform?(entity: VariantEntity): this;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppDocument } from '../../../config/app.document';
|
|
2
2
|
import { CartEntity } from './cart.entity';
|
|
3
|
-
export declare class CartDocument extends AppDocument
|
|
3
|
+
export declare class CartDocument extends AppDocument {
|
|
4
4
|
number: string;
|
|
5
5
|
protected transform?(entity: CartEntity): this;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppDocument } from '../../../config/app.document';
|
|
2
2
|
import { ProductEntity } from '../../inventory/products/product.entity';
|
|
3
3
|
import { ItemEntity } from './item.entity';
|
|
4
|
-
export declare class ItemDocument extends AppDocument
|
|
4
|
+
export declare class ItemDocument extends AppDocument {
|
|
5
5
|
product: Pick<ProductEntity, 'id' | 'name' | 'price'>;
|
|
6
6
|
quantity: number;
|
|
7
7
|
protected transform?(entity: ItemEntity): this;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppDocument } from '../../../config/app.document';
|
|
2
2
|
import { OrderEntity } from './order.entity';
|
|
3
|
-
export declare class OrderDocument extends AppDocument
|
|
3
|
+
export declare class OrderDocument extends AppDocument {
|
|
4
4
|
number: string;
|
|
5
5
|
price: number;
|
|
6
6
|
protected transform?(entity: OrderEntity): this;
|