@merkaly/api 0.2.1-4 → 0.2.2-0
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.config.d.ts +27 -0
- package/.output/config/app.document.d.ts +2 -2
- package/.output/config/app.repository.d.ts +25 -0
- package/.output/config/app.validator.d.ts +0 -2
- package/.output/{app.d.ts → main.d.ts} +20 -13
- package/.output/{src → module}/inventory/brands/brand.document.d.ts +1 -1
- package/.output/{src → module}/inventory/brands/brand.entity.d.ts +0 -0
- package/.output/{src → module}/inventory/brands/brand.validator.d.ts +0 -0
- package/.output/{src → module}/inventory/categories/category.document.d.ts +1 -1
- package/.output/{src → module}/inventory/categories/category.entity.d.ts +0 -0
- package/.output/{src → module}/inventory/categories/category.validator.d.ts +0 -2
- package/.output/{src → module}/inventory/media/media.document.d.ts +1 -1
- package/.output/{src → module}/inventory/media/media.entity.d.ts +0 -0
- package/.output/{src → module}/inventory/media/media.validator.d.ts +0 -0
- package/.output/module/inventory/products/product.document.d.ts +12 -0
- package/.output/{src → module}/inventory/products/product.entity.d.ts +1 -6
- package/.output/{src → module}/inventory/products/product.validator.d.ts +4 -7
- package/.output/{src → module}/inventory/variants/variant.document.d.ts +1 -4
- package/.output/{src → module}/inventory/variants/variant.entity.d.ts +0 -5
- package/.output/{src → module}/inventory/variants/variant.validator.d.ts +0 -5
- package/.output/module/organization/connections/connection.validator.d.ts +9 -0
- package/.output/module/organization/members/member.validator.d.ts +3 -0
- package/.output/module/store/carts/cart.document.d.ts +6 -0
- package/.output/module/store/carts/cart.entity.d.ts +6 -0
- package/.output/module/store/carts/cart.validator.d.ts +8 -0
- package/.output/module/store/items/item.document.d.ts +8 -0
- package/.output/module/store/items/item.entity.d.ts +8 -0
- package/.output/module/store/items/item.validator.d.ts +4 -0
- package/.output/{src → module}/store/orders/order.document.d.ts +1 -1
- package/.output/{src → module}/store/orders/order.entity.d.ts +0 -0
- package/.output/{src → module}/store/orders/order.validator.d.ts +0 -0
- package/LICENSE +674 -0
- package/package.json +12 -11
- package/.output/app.js +0 -48
- package/.output/config/app.document.js +0 -38
- package/.output/config/app.entity.js +0 -35
- package/.output/config/app.validator.js +0 -6
- package/.output/src/auth/auth.validator.d.ts +0 -4
- package/.output/src/auth/auth.validator.js +0 -21
- package/.output/src/inventory/brands/brand.document.js +0 -30
- package/.output/src/inventory/brands/brand.entity.js +0 -30
- package/.output/src/inventory/brands/brand.validator.js +0 -53
- package/.output/src/inventory/categories/category.document.js +0 -30
- package/.output/src/inventory/categories/category.entity.js +0 -30
- package/.output/src/inventory/categories/category.validator.js +0 -56
- package/.output/src/inventory/media/media.document.js +0 -30
- package/.output/src/inventory/media/media.entity.js +0 -30
- package/.output/src/inventory/media/media.validator.js +0 -38
- package/.output/src/inventory/products/product.document.d.ts +0 -13
- package/.output/src/inventory/products/product.document.js +0 -54
- package/.output/src/inventory/products/product.entity.js +0 -67
- package/.output/src/inventory/products/product.validator.js +0 -124
- package/.output/src/inventory/variants/variant.document.js +0 -40
- package/.output/src/inventory/variants/variant.entity.js +0 -44
- package/.output/src/inventory/variants/variant.validator.js +0 -83
- package/.output/src/store/orders/order.document.js +0 -30
- package/.output/src/store/orders/order.entity.js +0 -25
- package/.output/src/store/orders/order.validator.js +0 -17
- package/index.ts +0 -24
|
@@ -0,0 +1,27 @@
|
|
|
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 +1,9 @@
|
|
|
1
1
|
import { AppEntity } from './app.entity';
|
|
2
2
|
export declare abstract class AppDocument<E extends AppEntity> {
|
|
3
|
-
protected abstract transform(entity: E): this;
|
|
3
|
+
protected abstract transform?(entity: E): this;
|
|
4
4
|
$id: string;
|
|
5
5
|
$createdAt: Date;
|
|
6
6
|
$updatedAt: Date;
|
|
7
7
|
$deletedAt: Date;
|
|
8
|
-
serialize(entity: E): this;
|
|
8
|
+
serialize?(entity: E): this;
|
|
9
9
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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,6 +1,4 @@
|
|
|
1
|
-
import { SearchRequest } from '@elastic/elasticsearch/lib/api/types';
|
|
2
1
|
import { AppEntity } from './app.entity';
|
|
3
2
|
export declare abstract class AppValidator<E extends AppEntity> {
|
|
4
3
|
abstract toEntity?(...variadic: unknown[]): E;
|
|
5
4
|
}
|
|
6
|
-
export declare type SearchQuery = Omit<SearchRequest, 'index' | 'routing'>;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { BrandDocument } from './
|
|
2
|
-
import * as BrandValidators from './
|
|
3
|
-
import { CategoryDocument } from './
|
|
4
|
-
import * as CategoryValidators from './
|
|
5
|
-
import { MediaDocument } from './
|
|
6
|
-
import * as MediaValidators from './
|
|
7
|
-
import { ProductDocument } from './
|
|
8
|
-
import * as ProductValidators from './
|
|
9
|
-
import { VariantDocument } from './
|
|
10
|
-
import * as VariantValidators from './
|
|
11
|
-
import {
|
|
12
|
-
import * as
|
|
1
|
+
import { BrandDocument } from './module/inventory/brands/brand.document';
|
|
2
|
+
import * as BrandValidators from './module/inventory/brands/brand.validator';
|
|
3
|
+
import { CategoryDocument } from './module/inventory/categories/category.document';
|
|
4
|
+
import * as CategoryValidators from './module/inventory/categories/category.validator';
|
|
5
|
+
import { MediaDocument } from './module/inventory/media/media.document';
|
|
6
|
+
import * as MediaValidators from './module/inventory/media/media.validator';
|
|
7
|
+
import { ProductDocument } from './module/inventory/products/product.document';
|
|
8
|
+
import * as ProductValidators from './module/inventory/products/product.validator';
|
|
9
|
+
import { VariantDocument } from './module/inventory/variants/variant.document';
|
|
10
|
+
import * as VariantValidators from './module/inventory/variants/variant.validator';
|
|
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';
|
|
13
15
|
export declare const Inventory: {
|
|
14
16
|
Brand: {
|
|
15
17
|
CreateBrandValidator: typeof BrandValidators.CreateBrandValidator;
|
|
@@ -17,7 +19,6 @@ export declare const Inventory: {
|
|
|
17
19
|
BrandDocument: typeof BrandDocument;
|
|
18
20
|
};
|
|
19
21
|
Category: {
|
|
20
|
-
FindCategoryValidator: typeof CategoryValidators.FindCategoryValidator;
|
|
21
22
|
CreateCategoryValidator: typeof CategoryValidators.CreateCategoryValidator;
|
|
22
23
|
UpdateCategoryValidator: typeof CategoryValidators.UpdateCategoryValidator;
|
|
23
24
|
CategoryDocument: typeof CategoryDocument;
|
|
@@ -44,4 +45,10 @@ export declare const Store: {
|
|
|
44
45
|
UpdateOrderValidator: typeof OrderValidators.UpdateOrderValidator;
|
|
45
46
|
OrderDocument: typeof OrderDocument;
|
|
46
47
|
};
|
|
48
|
+
Cart: {
|
|
49
|
+
CreateCartValidator: typeof CartValidator.CreateCartValidator;
|
|
50
|
+
UpdateCartValidator: typeof CartValidator.UpdateCartValidator;
|
|
51
|
+
CartDocument: typeof CartDocument;
|
|
52
|
+
};
|
|
47
53
|
};
|
|
54
|
+
export { SearchParams } from './config/app.repository';
|
|
File without changes
|
|
File without changes
|
|
@@ -3,5 +3,5 @@ import { CategoryEntity } from './category.entity';
|
|
|
3
3
|
export declare class CategoryDocument extends AppDocument<CategoryEntity> {
|
|
4
4
|
name: string;
|
|
5
5
|
description: string;
|
|
6
|
-
protected transform(entity: CategoryEntity): this;
|
|
6
|
+
protected transform?(entity: CategoryEntity): this;
|
|
7
7
|
}
|
|
File without changes
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { AppValidator } from '../../../config/app.validator';
|
|
2
2
|
import { CategoryEntity } from './category.entity';
|
|
3
|
-
export declare class FindCategoryValidator {
|
|
4
|
-
}
|
|
5
3
|
export declare class CreateCategoryValidator extends AppValidator<CategoryEntity> {
|
|
6
4
|
name: string;
|
|
7
5
|
description?: string;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
|
@@ -6,14 +6,9 @@ import { VariantEntity } from '../variants/variant.entity';
|
|
|
6
6
|
export declare class ProductEntity extends AppEntity {
|
|
7
7
|
name: string;
|
|
8
8
|
description?: string;
|
|
9
|
-
|
|
10
|
-
availableFrom: Date;
|
|
11
|
-
hashtags: string[];
|
|
9
|
+
price: number;
|
|
12
10
|
category?: CategoryEntity;
|
|
13
11
|
brand?: BrandEntity;
|
|
14
|
-
variant: VariantEntity;
|
|
15
12
|
variants: VariantEntity[];
|
|
16
13
|
media: MediaEntity[];
|
|
17
|
-
get isOutOfStock(): boolean;
|
|
18
|
-
get isDraft(): boolean;
|
|
19
14
|
}
|
|
@@ -5,20 +5,17 @@ import { ProductEntity } from './product.entity';
|
|
|
5
5
|
export declare class CreateProductValidator extends AppValidator<ProductEntity> {
|
|
6
6
|
name: string;
|
|
7
7
|
description?: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
brand?: Id;
|
|
12
|
-
hashtags: string[];
|
|
8
|
+
price: number;
|
|
9
|
+
category?: string;
|
|
10
|
+
brand?: string;
|
|
13
11
|
variants?: CreateVariantValidator[];
|
|
14
12
|
toEntity?(): ProductEntity;
|
|
15
13
|
}
|
|
16
14
|
export declare class UpdateProductValidator extends AppValidator<ProductEntity> {
|
|
17
15
|
name?: string;
|
|
18
16
|
description?: string;
|
|
17
|
+
price: number;
|
|
19
18
|
category?: Id;
|
|
20
19
|
brand?: Id;
|
|
21
|
-
hashtags?: string[];
|
|
22
|
-
active: boolean;
|
|
23
20
|
toEntity?(entity: ProductEntity): ProductEntity;
|
|
24
21
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { AppDocument } from '../../../config/app.document';
|
|
2
2
|
import { VariantEntity } from './variant.entity';
|
|
3
3
|
export declare class VariantDocument extends AppDocument<VariantEntity> {
|
|
4
|
-
sku: string;
|
|
5
|
-
quantity: number;
|
|
6
4
|
price: number;
|
|
7
|
-
|
|
8
|
-
protected transform(entity: VariantEntity): this;
|
|
5
|
+
protected transform?(entity: VariantEntity): this;
|
|
9
6
|
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { AppEntity } from '../../../config/app.entity';
|
|
2
2
|
import { ProductEntity } from '../products/product.entity';
|
|
3
3
|
export declare class VariantEntity extends AppEntity {
|
|
4
|
-
sku: string;
|
|
5
4
|
price: number;
|
|
6
|
-
quantity: number;
|
|
7
|
-
active: boolean;
|
|
8
5
|
product: ProductEntity;
|
|
9
|
-
get isOutOfStock(): boolean;
|
|
10
|
-
get isDraft(): boolean;
|
|
11
6
|
}
|
|
@@ -3,15 +3,10 @@ import { ProductEntity } from '../products/product.entity';
|
|
|
3
3
|
import { VariantEntity } from './variant.entity';
|
|
4
4
|
export declare class CreateVariantValidator extends AppValidator<VariantEntity> {
|
|
5
5
|
price: number;
|
|
6
|
-
sku: string;
|
|
7
|
-
quantity: number;
|
|
8
6
|
active: boolean;
|
|
9
7
|
toEntity?(product?: ProductEntity): VariantEntity;
|
|
10
8
|
}
|
|
11
9
|
export declare class UpdateVariantValidator extends AppValidator<VariantEntity> {
|
|
12
10
|
price: number;
|
|
13
|
-
sku: string;
|
|
14
|
-
quantity: number;
|
|
15
|
-
active: any;
|
|
16
11
|
toEntity?(entity: VariantEntity): VariantEntity;
|
|
17
12
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AddOrganizationEnabledConnection, UpdateOrganizationEnabledConnection } from 'auth0';
|
|
2
|
+
import 'reflect-metadata';
|
|
3
|
+
export declare class CreateConnectionValidator implements AddOrganizationEnabledConnection {
|
|
4
|
+
connection_id: AddOrganizationEnabledConnection['connection_id'];
|
|
5
|
+
assign_membership_on_login: AddOrganizationEnabledConnection['assign_membership_on_login'];
|
|
6
|
+
}
|
|
7
|
+
export declare class UpdateConnectionValidator implements UpdateOrganizationEnabledConnection {
|
|
8
|
+
assign_membership_on_login: UpdateOrganizationEnabledConnection['assign_membership_on_login'];
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AppEntity } from '../../../config/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
|
+
product: ProductEntity;
|
|
6
|
+
quantity: number;
|
|
7
|
+
carts: CartEntity[];
|
|
8
|
+
}
|
|
File without changes
|
|
File without changes
|