@merkaly/api 0.1.11 → 0.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/app.d.ts +2 -0
- package/.output/config/app.config.d.ts +28 -0
- package/.output/config/app.controller.d.ts +11 -0
- package/.output/config/app.document.d.ts +12 -0
- package/.output/config/app.entity.d.ts +9 -0
- package/.output/config/app.exception.d.ts +11 -0
- package/.output/config/app.middleware.d.ts +3 -0
- package/.output/config/app.module.d.ts +6 -0
- package/.output/config/app.repository.d.ts +24 -0
- package/.output/config/app.router.d.ts +6 -0
- package/.output/config/app.validator.d.ts +7 -0
- package/.output/src/auth/auth.controller.d.ts +9 -0
- package/.output/src/auth/auth.decorator.d.ts +5 -0
- package/.output/src/auth/auth.guard.d.ts +16 -0
- package/.output/src/auth/auth.module.d.ts +9 -0
- package/.output/src/auth/auth.repository.d.ts +11 -0
- package/.output/src/auth/auth.strategy.d.ts +18 -0
- package/{src → .output/src}/auth/auth.validator.d.ts +0 -0
- package/.output/src/inventory/brands/brand.controller.d.ts +15 -0
- package/.output/src/inventory/brands/brand.document.d.ts +8 -0
- package/{src → .output/src}/inventory/brands/brand.entity.d.ts +1 -1
- package/.output/src/inventory/brands/brand.exception.d.ts +6 -0
- package/.output/src/inventory/brands/brand.module.d.ts +8 -0
- package/.output/src/inventory/brands/brand.repository.d.ts +9 -0
- package/.output/src/inventory/brands/brand.validator.d.ts +13 -0
- package/.output/src/inventory/categories/category.controller.d.ts +12 -0
- package/.output/src/inventory/categories/category.document.d.ts +8 -0
- package/{src → .output/src}/inventory/categories/category.entity.d.ts +1 -3
- package/.output/src/inventory/categories/category.exception.d.ts +6 -0
- package/.output/src/inventory/categories/category.module.d.ts +8 -0
- package/.output/src/inventory/categories/category.repository.d.ts +9 -0
- package/.output/src/inventory/categories/category.validator.d.ts +16 -0
- package/.output/src/inventory/inventory.module.d.ts +14 -0
- package/.output/src/inventory/media/media.controller.d.ts +6 -0
- package/.output/src/inventory/media/media.document.d.ts +8 -0
- package/.output/src/inventory/media/media.entity.d.ts +8 -0
- package/.output/src/inventory/media/media.exception.d.ts +6 -0
- package/.output/src/inventory/media/media.module.d.ts +8 -0
- package/.output/src/inventory/media/media.repository.d.ts +9 -0
- package/.output/src/inventory/media/media.validator.d.ts +12 -0
- package/.output/src/inventory/products/product.controller.d.ts +14 -0
- package/.output/src/inventory/products/product.document.d.ts +13 -0
- package/{src → .output/src}/inventory/products/product.entity.d.ts +1 -3
- package/.output/src/inventory/products/product.exception.d.ts +6 -0
- package/.output/src/inventory/products/product.module.d.ts +8 -0
- package/.output/src/inventory/products/product.repository.d.ts +11 -0
- package/.output/src/inventory/products/product.validator.d.ts +26 -0
- package/.output/src/inventory/variants/variant.controller.d.ts +9 -0
- package/.output/src/inventory/variants/variant.document.d.ts +10 -0
- package/{src → .output/src}/inventory/variants/variant.entity.d.ts +2 -2
- package/.output/src/inventory/variants/variant.exception.d.ts +6 -0
- package/.output/src/inventory/variants/variant.module.d.ts +8 -0
- package/.output/src/inventory/variants/variant.repository.d.ts +9 -0
- package/.output/src/inventory/variants/variant.validator.d.ts +19 -0
- package/.output/src/store/orders/order.controller.d.ts +12 -0
- package/.output/src/store/orders/order.document.d.ts +8 -0
- package/.output/src/store/orders/order.entity.d.ts +6 -0
- package/.output/src/store/orders/order.exception.d.ts +6 -0
- package/.output/src/store/orders/order.module.d.ts +8 -0
- package/.output/src/store/orders/order.repository.d.ts +9 -0
- package/.output/src/store/orders/order.validator.d.ts +10 -0
- package/.output/src/store/store.module.d.ts +10 -0
- package/package.json +24 -23
- package/config/app.entity.d.ts +0 -7
- package/config/app.entity.d.ts.map +0 -1
- package/config/app.entity.ts +0 -9
- package/index.d.ts +0 -3
- package/index.d.ts.map +0 -1
- package/index.ts +0 -3
- package/src/account/connections/connection.validator.d.ts +0 -9
- package/src/account/connections/connection.validator.d.ts.map +0 -1
- package/src/account/connections/connection.validator.ts +0 -15
- package/src/account/connections/index.d.ts +0 -5
- package/src/account/connections/index.d.ts.map +0 -1
- package/src/account/connections/index.ts +0 -5
- package/src/account/index.d.ts +0 -9
- package/src/account/index.d.ts.map +0 -1
- package/src/account/index.ts +0 -9
- package/src/account/organizations/connections/connection.validator.d.ts +0 -10
- package/src/account/organizations/connections/connection.validator.d.ts.map +0 -1
- package/src/account/organizations/connections/connection.validator.ts +0 -16
- package/src/account/organizations/connections/index.d.ts +0 -5
- package/src/account/organizations/connections/index.d.ts.map +0 -1
- package/src/account/organizations/connections/index.ts +0 -6
- package/src/account/organizations/index.d.ts +0 -9
- package/src/account/organizations/index.d.ts.map +0 -1
- package/src/account/organizations/index.ts +0 -9
- package/src/account/organizations/members/index.d.ts +0 -5
- package/src/account/organizations/members/index.d.ts.map +0 -1
- package/src/account/organizations/members/index.ts +0 -6
- package/src/account/organizations/members/member.validator.d.ts +0 -4
- package/src/account/organizations/members/member.validator.d.ts.map +0 -1
- package/src/account/organizations/members/member.validator.ts +0 -5
- package/src/account/organizations/organization.validator.d.ts +0 -18
- package/src/account/organizations/organization.validator.d.ts.map +0 -1
- package/src/account/organizations/organization.validator.ts +0 -46
- package/src/account/roles/index.d.ts +0 -7
- package/src/account/roles/index.d.ts.map +0 -1
- package/src/account/roles/index.ts +0 -7
- package/src/account/roles/role.validator.d.ts +0 -13
- package/src/account/roles/role.validator.d.ts.map +0 -1
- package/src/account/roles/role.validator.ts +0 -26
- package/src/account/roles/users/index.d.ts +0 -5
- package/src/account/roles/users/index.d.ts.map +0 -1
- package/src/account/roles/users/index.ts +0 -5
- package/src/account/roles/users/user.validator.d.ts +0 -4
- package/src/account/roles/users/user.validator.d.ts.map +0 -1
- package/src/account/roles/users/user.validator.ts +0 -5
- package/src/account/users/extra/extra.validator.d.ts +0 -2
- package/src/account/users/extra/extra.validator.d.ts.map +0 -1
- package/src/account/users/extra/extra.validator.ts +0 -1
- package/src/account/users/index.d.ts +0 -7
- package/src/account/users/index.d.ts.map +0 -1
- package/src/account/users/index.ts +0 -7
- package/src/account/users/roles/index.d.ts +0 -5
- package/src/account/users/roles/index.d.ts.map +0 -1
- package/src/account/users/roles/index.ts +0 -5
- package/src/account/users/roles/role.validator.d.ts +0 -4
- package/src/account/users/roles/role.validator.d.ts.map +0 -1
- package/src/account/users/roles/role.validator.ts +0 -5
- package/src/account/users/user.validator.d.ts +0 -16
- package/src/account/users/user.validator.d.ts.map +0 -1
- package/src/account/users/user.validator.ts +0 -36
- package/src/auth/auth.validator.d.ts.map +0 -1
- package/src/auth/auth.validator.ts +0 -12
- package/src/inventory/brands/brand.entity.d.ts.map +0 -1
- package/src/inventory/brands/brand.entity.ts +0 -10
- package/src/inventory/brands/brand.validator.d.ts +0 -11
- package/src/inventory/brands/brand.validator.d.ts.map +0 -1
- package/src/inventory/brands/brand.validator.ts +0 -17
- package/src/inventory/categories/category.entity.d.ts.map +0 -1
- package/src/inventory/categories/category.entity.ts +0 -13
- package/src/inventory/categories/category.validator.d.ts +0 -12
- package/src/inventory/categories/category.validator.d.ts.map +0 -1
- package/src/inventory/categories/category.validator.ts +0 -20
- package/src/inventory/media/media.entity.d.ts +0 -6
- package/src/inventory/media/media.entity.d.ts.map +0 -1
- package/src/inventory/media/media.entity.ts +0 -7
- package/src/inventory/media/media.validator.d.ts +0 -6
- package/src/inventory/media/media.validator.d.ts.map +0 -1
- package/src/inventory/media/media.validator.ts +0 -9
- package/src/inventory/products/product.entity.d.ts.map +0 -1
- package/src/inventory/products/product.entity.ts +0 -38
- package/src/inventory/products/product.validator.d.ts +0 -24
- package/src/inventory/products/product.validator.d.ts.map +0 -1
- package/src/inventory/products/product.validator.ts +0 -69
- package/src/inventory/properties/property.entity.d.ts +0 -10
- package/src/inventory/properties/property.entity.d.ts.map +0 -1
- package/src/inventory/properties/property.entity.ts +0 -14
- package/src/inventory/properties/property.validator.d.ts +0 -13
- package/src/inventory/properties/property.validator.d.ts.map +0 -1
- package/src/inventory/properties/property.validator.ts +0 -26
- package/src/inventory/variants/variant.entity.d.ts.map +0 -1
- package/src/inventory/variants/variant.entity.ts +0 -22
- package/src/inventory/variants/variant.validator.d.ts +0 -11
- package/src/inventory/variants/variant.validator.d.ts.map +0 -1
- package/src/inventory/variants/variant.validator.ts +0 -23
- package/src/store/orders/order.entity.d.ts +0 -6
- package/src/store/orders/order.entity.d.ts.map +0 -1
- package/src/store/orders/order.entity.ts +0 -7
- package/src/store/orders/order.validator.d.ts +0 -8
- package/src/store/orders/order.validator.d.ts.map +0 -1
- package/src/store/orders/order.validator.ts +0 -14
package/.output/app.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
}
|
|
28
|
+
//# sourceMappingURL=app.config.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Id, SearchResponse } from '@elastic/elasticsearch/lib/api/types';
|
|
2
|
+
import { AppEntity } from './app.entity';
|
|
3
|
+
import { SearchQuery } from './app.validator';
|
|
4
|
+
export declare abstract class AppController<E extends AppEntity> {
|
|
5
|
+
abstract find(validator?: SearchQuery): Promise<SearchResponse<E>>;
|
|
6
|
+
abstract read(id: Id): Promise<unknown>;
|
|
7
|
+
abstract create(validator: unknown): Promise<unknown>;
|
|
8
|
+
abstract update(id: Id, validator: unknown): Promise<unknown>;
|
|
9
|
+
abstract delete(id: Id): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=app.controller.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EntityManager } from 'typeorm';
|
|
2
|
+
import { AppEntity } from './app.entity';
|
|
3
|
+
export declare abstract class AppDocument<E extends AppEntity> {
|
|
4
|
+
protected $id: string;
|
|
5
|
+
protected $updatedAt: Date;
|
|
6
|
+
protected $createdAt: Date;
|
|
7
|
+
protected $deletedAt: Date;
|
|
8
|
+
protected $manager: EntityManager;
|
|
9
|
+
serialize(entity: E): this;
|
|
10
|
+
protected abstract transform(entity: E): this;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=app.document.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Id } from '@elastic/elasticsearch/lib/api/types';
|
|
2
|
+
export declare abstract class AppEntity {
|
|
3
|
+
constructor(id?: Id);
|
|
4
|
+
readonly id: Id;
|
|
5
|
+
readonly createdAt: Date;
|
|
6
|
+
readonly updatedAt?: Date;
|
|
7
|
+
readonly deletedAt?: Date;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=app.entity.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ArgumentsHost, ExceptionFilter, HttpException, Logger } from '@nestjs/common';
|
|
2
|
+
import { Request, Response } from 'express';
|
|
3
|
+
export declare abstract class AppException implements ExceptionFilter {
|
|
4
|
+
protected request: Request;
|
|
5
|
+
protected response: Response;
|
|
6
|
+
protected host: ArgumentsHost;
|
|
7
|
+
protected logger: Logger;
|
|
8
|
+
catch(exception: HttpException, host: ArgumentsHost): HttpException | Response<any, Record<string, any>>;
|
|
9
|
+
protected abstract handleError(exception: HttpException): HttpException;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=app.exception.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MiddlewareConsumer, ModuleMetadata, NestModule } from '@nestjs/common';
|
|
2
|
+
export declare const metadata: ModuleMetadata;
|
|
3
|
+
export declare class AppModule implements NestModule {
|
|
4
|
+
configure(consumer: MiddlewareConsumer): MiddlewareConsumer;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=app.module.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GetResponse, Id } from '@elastic/elasticsearch/lib/api/types';
|
|
2
|
+
import { Logger, OnModuleInit } from '@nestjs/common';
|
|
3
|
+
import { ElasticsearchService } from '@nestjs/elasticsearch';
|
|
4
|
+
import { Repository } from 'typeorm';
|
|
5
|
+
import { AppDocument } from './app.document';
|
|
6
|
+
import { AppEntity } from './app.entity';
|
|
7
|
+
import { AppValidator, SearchQuery } from './app.validator';
|
|
8
|
+
export declare abstract class AppRepository<E extends AppEntity, D extends AppDocument<E> = AppDocument<E>> implements OnModuleInit {
|
|
9
|
+
protected readonly $elastic: ElasticsearchService;
|
|
10
|
+
protected readonly $logger: typeof Logger;
|
|
11
|
+
protected abstract $document: D;
|
|
12
|
+
protected abstract repository: Repository<E>;
|
|
13
|
+
onModuleInit(): Promise<import("@elastic/elasticsearch/lib/api/types").IndicesResponseBase | import("@elastic/elasticsearch/lib/api/types").IndicesCreateResponse>;
|
|
14
|
+
protected get $index(): string;
|
|
15
|
+
protected get $routing(): string;
|
|
16
|
+
find(search?: SearchQuery): Promise<import("@elastic/elasticsearch/lib/api/types").SearchResponse<E, Record<string, import("@elastic/elasticsearch/lib/api/types").AggregationsAggregate>>>;
|
|
17
|
+
create(validator: AppValidator<any>): Promise<GetResponse<D>>;
|
|
18
|
+
read(id: Id): Promise<GetResponse<D>>;
|
|
19
|
+
update(id: Id, validator: AppValidator<any>): Promise<GetResponse<D>>;
|
|
20
|
+
delete(id: Id): Promise<void>;
|
|
21
|
+
protected $create(id: Id, document: AppDocument<AppEntity>): Promise<GetResponse<D>>;
|
|
22
|
+
protected $update(id: Id, doc: AppDocument<AppEntity>): Promise<GetResponse<D>>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=app.repository.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SearchRequest } from '@elastic/elasticsearch/lib/api/types';
|
|
2
|
+
import { AppEntity } from './app.entity';
|
|
3
|
+
export declare abstract class AppValidator<E extends AppEntity> {
|
|
4
|
+
abstract toEntity(...variadic: unknown[]): E;
|
|
5
|
+
}
|
|
6
|
+
export declare type SearchQuery = Omit<SearchRequest, 'index' | 'routing'>;
|
|
7
|
+
//# sourceMappingURL=app.validator.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ObjectWithId, TokenResponse, User as Auth0User } from 'auth0';
|
|
2
|
+
import { AuthRepository } from './auth.repository';
|
|
3
|
+
import { LoginValidator } from './auth.validator';
|
|
4
|
+
export declare class AuthController {
|
|
5
|
+
protected readonly authRepository: AuthRepository;
|
|
6
|
+
login({ username, password }: LoginValidator): Promise<Partial<TokenResponse>>;
|
|
7
|
+
user(user: ObjectWithId['id']): Promise<Auth0User>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=auth.controller.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CustomDecorator } from '@nestjs/common';
|
|
2
|
+
export declare const IS_PUBLIC_KEY = "isPublic";
|
|
3
|
+
export declare const Public: () => CustomDecorator;
|
|
4
|
+
export declare const User: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
5
|
+
//# sourceMappingURL=auth.decorator.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ExecutionContext } from '@nestjs/common';
|
|
2
|
+
import { AuthRepository } from './auth.repository';
|
|
3
|
+
declare module 'express' {
|
|
4
|
+
interface Request {
|
|
5
|
+
user?: string;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
declare const AuthGuard_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
|
|
9
|
+
export declare class AuthGuard extends AuthGuard_base {
|
|
10
|
+
protected readonly authRepository: AuthRepository;
|
|
11
|
+
private reflector;
|
|
12
|
+
canActivate(context: ExecutionContext): Promise<any>;
|
|
13
|
+
handleRequest(err: Record<string, unknown>, user: string): any;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=auth.guard.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ModuleMetadata } from '@nestjs/common';
|
|
2
|
+
import { AppRouter } from '../../config/app.router';
|
|
3
|
+
export declare const metadata: ModuleMetadata;
|
|
4
|
+
export declare class AuthModule extends AppRouter {
|
|
5
|
+
static readonly path = "/auth";
|
|
6
|
+
static readonly module: typeof AuthModule;
|
|
7
|
+
static readonly children: any[];
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=auth.module.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { AuthenticationClient, ManagementClient, ObjectWithId, User } from 'auth0';
|
|
3
|
+
export declare class AuthRepository implements OnModuleInit {
|
|
4
|
+
$management: ManagementClient;
|
|
5
|
+
private readonly jwtService;
|
|
6
|
+
private readonly axios;
|
|
7
|
+
get client(): AuthenticationClient;
|
|
8
|
+
onModuleInit(): Promise<ManagementClient>;
|
|
9
|
+
getUser(id: ObjectWithId['id']): Promise<User>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=auth.repository.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Strategy, StrategyOptions } from 'passport-jwt';
|
|
2
|
+
export declare const strategy: StrategyOptions;
|
|
3
|
+
interface DecodedUser {
|
|
4
|
+
iss: string;
|
|
5
|
+
sub: string;
|
|
6
|
+
aud: string[];
|
|
7
|
+
iat: number;
|
|
8
|
+
exp: number;
|
|
9
|
+
azp: string;
|
|
10
|
+
scope: string;
|
|
11
|
+
}
|
|
12
|
+
declare const AuthStrategy_base: new (...args: any[]) => Strategy;
|
|
13
|
+
export declare class AuthStrategy extends AuthStrategy_base {
|
|
14
|
+
constructor();
|
|
15
|
+
validate({ sub }: DecodedUser): string;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=auth.strategy.d.ts.map
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Id } from '@elastic/elasticsearch/lib/api/types';
|
|
2
|
+
import { AppController } from '../../../config/app.controller';
|
|
3
|
+
import { SearchQuery } from '../../../config/app.validator';
|
|
4
|
+
import { BrandEntity } from './brand.entity';
|
|
5
|
+
import { BrandRepository } from './brand.repository';
|
|
6
|
+
import { CreateBrandValidator, UpdateBrandValidator } from './brand.validator';
|
|
7
|
+
export declare class BrandController extends AppController<BrandEntity> {
|
|
8
|
+
protected readonly repository: BrandRepository;
|
|
9
|
+
find(validator?: SearchQuery): Promise<import("@elastic/elasticsearch/lib/api/types").SearchResponse<BrandEntity, Record<string, import("@elastic/elasticsearch/lib/api/types").AggregationsAggregate>>>;
|
|
10
|
+
read(id: Id): Promise<import("@elastic/elasticsearch/lib/api/types").GetResponse<import("../../../config/app.document").AppDocument<BrandEntity>>>;
|
|
11
|
+
create(validator: CreateBrandValidator): Promise<import("@elastic/elasticsearch/lib/api/types").GetResponse<import("../../../config/app.document").AppDocument<BrandEntity>>>;
|
|
12
|
+
update(id: Id, validator: UpdateBrandValidator): Promise<import("@elastic/elasticsearch/lib/api/types").GetResponse<import("../../../config/app.document").AppDocument<BrandEntity>>>;
|
|
13
|
+
delete(id: Id): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=brand.controller.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
}
|
|
8
|
+
//# sourceMappingURL=brand.document.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HttpException } from '@nestjs/common';
|
|
2
|
+
import { AppException } from '../../../config/app.exception';
|
|
3
|
+
export declare class BrandException extends AppException {
|
|
4
|
+
handleError(exception: HttpException): HttpException;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=brand.exception.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModuleMetadata } from '@nestjs/common';
|
|
2
|
+
import { AppRouter } from '../../../config/app.router';
|
|
3
|
+
export declare const metadata: ModuleMetadata;
|
|
4
|
+
export declare class BrandModule extends AppRouter {
|
|
5
|
+
static readonly path = "/brands";
|
|
6
|
+
static readonly module: typeof BrandModule;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=brand.module.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { AppRepository } from '../../../config/app.repository';
|
|
3
|
+
import { BrandDocument } from './brand.document';
|
|
4
|
+
import { BrandEntity } from './brand.entity';
|
|
5
|
+
export declare class BrandRepository extends AppRepository<BrandEntity> {
|
|
6
|
+
protected repository: Repository<BrandEntity>;
|
|
7
|
+
protected $document: BrandDocument;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=brand.repository.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
}
|
|
13
|
+
//# sourceMappingURL=brand.validator.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Id } from '@elastic/elasticsearch/lib/api/types';
|
|
2
|
+
import { CategoryRepository } from './category.repository';
|
|
3
|
+
import { CreateCategoryValidator, FindCategoryValidator, UpdateCategoryValidator } from './category.validator';
|
|
4
|
+
export declare class CategoryController {
|
|
5
|
+
protected readonly repository: CategoryRepository;
|
|
6
|
+
find(validator?: FindCategoryValidator): Promise<import("@elastic/elasticsearch/lib/api/types").SearchResponse<import("./category.entity").CategoryEntity, Record<string, import("@elastic/elasticsearch/lib/api/types").AggregationsAggregate>>>;
|
|
7
|
+
read(id: Id): Promise<import("@elastic/elasticsearch/lib/api/types").GetResponse<import("../../../config/app.document").AppDocument<import("./category.entity").CategoryEntity>>>;
|
|
8
|
+
create(validator: CreateCategoryValidator): Promise<import("@elastic/elasticsearch/lib/api/types").GetResponse<import("../../../config/app.document").AppDocument<import("./category.entity").CategoryEntity>>>;
|
|
9
|
+
update(id: Id, validator: UpdateCategoryValidator): Promise<import("@elastic/elasticsearch/lib/api/types").GetResponse<import("../../../config/app.document").AppDocument<import("./category.entity").CategoryEntity>>>;
|
|
10
|
+
delete(id: Id): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=category.controller.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
}
|
|
8
|
+
//# sourceMappingURL=category.document.d.ts.map
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { AppEntity } from '
|
|
1
|
+
import { AppEntity } from '../../../config/app.entity';
|
|
2
2
|
import { ProductEntity } from '../products/product.entity';
|
|
3
|
-
import { PropertyEntity } from '../properties/property.entity';
|
|
4
3
|
export declare class CategoryEntity extends AppEntity {
|
|
5
4
|
name: string;
|
|
6
5
|
description: string;
|
|
7
6
|
products: ProductEntity[];
|
|
8
|
-
properties: PropertyEntity[];
|
|
9
7
|
}
|
|
10
8
|
//# sourceMappingURL=category.entity.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HttpException } from '@nestjs/common';
|
|
2
|
+
import { AppException } from '../../../config/app.exception';
|
|
3
|
+
export declare class CategoryException extends AppException {
|
|
4
|
+
handleError(exception: HttpException): HttpException;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=category.exception.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModuleMetadata } from '@nestjs/common';
|
|
2
|
+
import { AppRouter } from '../../../config/app.router';
|
|
3
|
+
export declare const metadata: ModuleMetadata;
|
|
4
|
+
export declare class CategoryModule extends AppRouter {
|
|
5
|
+
static readonly path = "/categories";
|
|
6
|
+
static readonly module: typeof CategoryModule;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=category.module.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { AppRepository } from '../../../config/app.repository';
|
|
3
|
+
import { CategoryDocument } from './category.document';
|
|
4
|
+
import { CategoryEntity } from './category.entity';
|
|
5
|
+
export declare class CategoryRepository extends AppRepository<CategoryEntity> {
|
|
6
|
+
protected repository: Repository<CategoryEntity>;
|
|
7
|
+
protected $document: CategoryDocument;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=category.repository.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { AppValidator } from '../../../config/app.validator';
|
|
3
|
+
import { CategoryEntity } from './category.entity';
|
|
4
|
+
export declare class FindCategoryValidator {
|
|
5
|
+
}
|
|
6
|
+
export declare class CreateCategoryValidator extends AppValidator<CategoryEntity> {
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
toEntity(): CategoryEntity;
|
|
10
|
+
}
|
|
11
|
+
export declare class UpdateCategoryValidator extends AppValidator<CategoryEntity> {
|
|
12
|
+
name: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
toEntity(entity: CategoryEntity): CategoryEntity;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=category.validator.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ModuleMetadata } from '@nestjs/common';
|
|
2
|
+
import { AppRouter } from '../../config/app.router';
|
|
3
|
+
import { BrandModule } from './brands/brand.module';
|
|
4
|
+
import { CategoryModule } from './categories/category.module';
|
|
5
|
+
import { MediaModule } from './media/media.module';
|
|
6
|
+
import { ProductModule } from './products/product.module';
|
|
7
|
+
import { VariantModule } from './variants/variant.module';
|
|
8
|
+
export declare const metadata: ModuleMetadata;
|
|
9
|
+
export declare class InventoryModule extends AppRouter {
|
|
10
|
+
static readonly path = "/inventory";
|
|
11
|
+
static readonly module: typeof InventoryModule;
|
|
12
|
+
static readonly children: (typeof BrandModule | typeof CategoryModule | typeof MediaModule | typeof ProductModule | typeof VariantModule)[];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=inventory.module.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MediaRepository } from './media.repository';
|
|
2
|
+
export declare class MediaController {
|
|
3
|
+
protected readonly repository: MediaRepository;
|
|
4
|
+
find(): Promise<import("@elastic/elasticsearch/lib/api/types").SearchResponse<import("./media.entity").MediaEntity, Record<string, import("@elastic/elasticsearch/lib/api/types").AggregationsAggregate>>>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=media.controller.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AppDocument } from '../../../config/app.document';
|
|
2
|
+
import { MediaEntity } from './media.entity';
|
|
3
|
+
export declare class MediaDocument extends AppDocument<MediaEntity> {
|
|
4
|
+
name: string;
|
|
5
|
+
url: string;
|
|
6
|
+
protected transform(entity: MediaEntity): this;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=media.document.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AppEntity } from '../../../config/app.entity';
|
|
2
|
+
import { ProductEntity } from '../products/product.entity';
|
|
3
|
+
export declare class MediaEntity extends AppEntity {
|
|
4
|
+
name: string;
|
|
5
|
+
url: string;
|
|
6
|
+
product?: ProductEntity;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=media.entity.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HttpException } from '@nestjs/common';
|
|
2
|
+
import { AppException } from '../../../config/app.exception';
|
|
3
|
+
export declare class MediaException extends AppException {
|
|
4
|
+
handleError(exception: HttpException): HttpException;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=media.exception.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModuleMetadata } from '@nestjs/common';
|
|
2
|
+
import { AppRouter } from '../../../config/app.router';
|
|
3
|
+
export declare const metadata: ModuleMetadata;
|
|
4
|
+
export declare class MediaModule extends AppRouter {
|
|
5
|
+
static readonly path = "/media";
|
|
6
|
+
static readonly module: typeof MediaModule;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=media.module.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { AppRepository } from '../../../config/app.repository';
|
|
3
|
+
import { MediaDocument } from './media.document';
|
|
4
|
+
import { MediaEntity } from './media.entity';
|
|
5
|
+
export declare class MediaRepository extends AppRepository<MediaEntity> {
|
|
6
|
+
protected repository: Repository<MediaEntity>;
|
|
7
|
+
protected $document: MediaDocument;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=media.repository.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { AppValidator } from '../../../config/app.validator';
|
|
3
|
+
import { MediaEntity } from './media.entity';
|
|
4
|
+
export declare class CreateMediaValidator extends AppValidator<MediaEntity> {
|
|
5
|
+
name: string;
|
|
6
|
+
toEntity(): MediaEntity;
|
|
7
|
+
}
|
|
8
|
+
export declare class UpdateMediaValidator extends AppValidator<MediaEntity> {
|
|
9
|
+
name: string;
|
|
10
|
+
toEntity(entity: MediaEntity): MediaEntity;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=media.validator.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Id } from '@elastic/elasticsearch/lib/api/types';
|
|
2
|
+
import { AppController } from '../../../config/app.controller';
|
|
3
|
+
import { ProductEntity } from './product.entity';
|
|
4
|
+
import { ProductRepository } from './product.repository';
|
|
5
|
+
import { CreateProductValidator, UpdateProductValidator } from './product.validator';
|
|
6
|
+
export declare class ProductController extends AppController<ProductEntity> {
|
|
7
|
+
protected readonly repository: ProductRepository;
|
|
8
|
+
find(): Promise<import("@elastic/elasticsearch/lib/api/types").SearchResponse<ProductEntity, Record<string, import("@elastic/elasticsearch/lib/api/types").AggregationsAggregate>>>;
|
|
9
|
+
create(validator: CreateProductValidator): Promise<import("@elastic/elasticsearch/lib/api/types").GetResponse<import("../../../config/app.document").AppDocument<ProductEntity>>>;
|
|
10
|
+
read(id: Id): Promise<import("@elastic/elasticsearch/lib/api/types").GetResponse<import("../../../config/app.document").AppDocument<ProductEntity>>>;
|
|
11
|
+
update(id: Id, validator: UpdateProductValidator): Promise<import("@elastic/elasticsearch/lib/api/types").GetResponse<import("../../../config/app.document").AppDocument<ProductEntity>>>;
|
|
12
|
+
delete(id: Id): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=product.controller.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Id } from '@elastic/elasticsearch/lib/api/types';
|
|
2
|
+
import { AppDocument } from '../../../config/app.document';
|
|
3
|
+
import { ProductEntity } from './product.entity';
|
|
4
|
+
export declare class ProductDocument extends AppDocument<ProductEntity> {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
availableFrom: Date;
|
|
8
|
+
active: boolean;
|
|
9
|
+
category: Id;
|
|
10
|
+
brand: Id;
|
|
11
|
+
protected transform(entity: ProductEntity): this;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=product.document.d.ts.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { AppEntity } from '
|
|
1
|
+
import { AppEntity } from '../../../config/app.entity';
|
|
2
2
|
import { BrandEntity } from '../brands/brand.entity';
|
|
3
3
|
import { CategoryEntity } from '../categories/category.entity';
|
|
4
4
|
import { MediaEntity } from '../media/media.entity';
|
|
5
|
-
import { PropertyEntity } from '../properties/property.entity';
|
|
6
5
|
import { VariantEntity } from '../variants/variant.entity';
|
|
7
6
|
export declare class ProductEntity extends AppEntity {
|
|
8
7
|
name: string;
|
|
@@ -12,7 +11,6 @@ export declare class ProductEntity extends AppEntity {
|
|
|
12
11
|
hashtags: string[];
|
|
13
12
|
category?: CategoryEntity;
|
|
14
13
|
brand?: BrandEntity;
|
|
15
|
-
properties: PropertyEntity[];
|
|
16
14
|
variant: VariantEntity;
|
|
17
15
|
variants: VariantEntity[];
|
|
18
16
|
media: MediaEntity[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HttpException } from '@nestjs/common';
|
|
2
|
+
import { AppException } from '../../../config/app.exception';
|
|
3
|
+
export declare class ProductException extends AppException {
|
|
4
|
+
handleError(exception: HttpException): HttpException;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=product.exception.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModuleMetadata } from '@nestjs/common';
|
|
2
|
+
import { AppRouter } from '../../../config/app.router';
|
|
3
|
+
export declare const metadata: ModuleMetadata;
|
|
4
|
+
export declare class ProductModule extends AppRouter {
|
|
5
|
+
static readonly path = "/products";
|
|
6
|
+
static readonly module: typeof ProductModule;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=product.module.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { AppRepository } from '../../../config/app.repository';
|
|
3
|
+
import { ProductDocument } from './product.document';
|
|
4
|
+
import { ProductEntity } from './product.entity';
|
|
5
|
+
import { CreateProductValidator } from './product.validator';
|
|
6
|
+
export declare class ProductRepository extends AppRepository<ProductEntity> {
|
|
7
|
+
protected repository: Repository<ProductEntity>;
|
|
8
|
+
protected $document: ProductDocument;
|
|
9
|
+
create(validator: CreateProductValidator): Promise<import("@elastic/elasticsearch/lib/api/types").GetResponse<import("../../../config/app.document").AppDocument<ProductEntity>>>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=product.repository.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Id } from '@elastic/elasticsearch/lib/api/types';
|
|
2
|
+
import 'reflect-metadata';
|
|
3
|
+
import { AppValidator } from '../../../config/app.validator';
|
|
4
|
+
import { CreateVariantValidator } from '../variants/variant.validator';
|
|
5
|
+
import { ProductEntity } from './product.entity';
|
|
6
|
+
export declare class CreateProductValidator extends AppValidator<ProductEntity> {
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
availableFrom: Date;
|
|
10
|
+
active: boolean;
|
|
11
|
+
category?: Id;
|
|
12
|
+
brand?: Id;
|
|
13
|
+
hashtags: string[];
|
|
14
|
+
variants: CreateVariantValidator[];
|
|
15
|
+
toEntity(): ProductEntity;
|
|
16
|
+
}
|
|
17
|
+
export declare class UpdateProductValidator extends AppValidator<ProductEntity> {
|
|
18
|
+
name?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
category?: Id;
|
|
21
|
+
brand?: Id;
|
|
22
|
+
hashtags?: string[];
|
|
23
|
+
active: boolean;
|
|
24
|
+
toEntity(entity: ProductEntity): ProductEntity;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=product.validator.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Id } from '@elastic/elasticsearch/lib/api/types';
|
|
2
|
+
import { SearchQuery } from '../../../config/app.validator';
|
|
3
|
+
import { VariantRepository } from './variant.repository';
|
|
4
|
+
export declare class VariantController {
|
|
5
|
+
protected readonly repository: VariantRepository;
|
|
6
|
+
find(search?: SearchQuery): Promise<import("@elastic/elasticsearch/lib/api/types").SearchResponse<import("./variant.entity").VariantEntity, Record<string, import("@elastic/elasticsearch/lib/api/types").AggregationsAggregate>>>;
|
|
7
|
+
read(id: Id): Promise<import("@elastic/elasticsearch/lib/api/types").GetResponse<import("../../../config/app.document").AppDocument<import("./variant.entity").VariantEntity>>>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=variant.controller.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppDocument } from '../../../config/app.document';
|
|
2
|
+
import { VariantEntity } from './variant.entity';
|
|
3
|
+
export declare class VariantDocument extends AppDocument<VariantEntity> {
|
|
4
|
+
sku: string;
|
|
5
|
+
quantity: number;
|
|
6
|
+
price: number;
|
|
7
|
+
active: boolean;
|
|
8
|
+
protected transform(entity: VariantEntity): this;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=variant.document.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AppEntity } from '
|
|
1
|
+
import { AppEntity } from '../../../config/app.entity';
|
|
2
2
|
import { ProductEntity } from '../products/product.entity';
|
|
3
3
|
export declare class VariantEntity extends AppEntity {
|
|
4
|
-
price: number;
|
|
5
4
|
sku: string;
|
|
5
|
+
price: number;
|
|
6
6
|
quantity: number;
|
|
7
7
|
active: boolean;
|
|
8
8
|
product: ProductEntity;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HttpException } from '@nestjs/common';
|
|
2
|
+
import { AppException } from '../../../config/app.exception';
|
|
3
|
+
export declare class VariantException extends AppException {
|
|
4
|
+
handleError(exception: HttpException): HttpException;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=variant.exception.d.ts.map
|