@merkaly/api 0.2.2-2 → 0.2.2-20
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/abstract/abstract.document.d.ts +4 -0
- package/.output/abstract/abstract.document.js +10 -0
- package/.output/abstract/abstract.entity.d.ts +8 -0
- package/.output/abstract/abstract.entity.js +34 -0
- package/.output/abstract/abstract.validator.d.ts +18 -0
- package/.output/abstract/abstract.validator.js +56 -0
- package/.output/modules/assets/asset.entity.d.ts +10 -0
- package/.output/modules/assets/asset.entity.js +52 -0
- package/.output/modules/inventory/brands/brand.document.d.ts +5 -0
- package/.output/modules/inventory/brands/brand.document.js +9 -0
- package/.output/modules/inventory/brands/brand.entity.d.ts +6 -0
- package/.output/modules/inventory/brands/brand.entity.js +32 -0
- package/.output/modules/inventory/brands/brand.validator.d.ts +8 -0
- package/.output/modules/inventory/brands/brand.validator.js +43 -0
- package/.output/modules/inventory/categories/category.document.d.ts +6 -0
- package/.output/modules/inventory/categories/category.document.js +10 -0
- package/.output/modules/inventory/categories/category.entity.d.ts +9 -0
- package/.output/modules/inventory/categories/category.entity.js +43 -0
- package/.output/modules/inventory/categories/category.validator.d.ts +10 -0
- package/.output/modules/inventory/categories/category.validator.js +55 -0
- package/.output/modules/inventory/products/product.document.d.ts +23 -0
- package/.output/modules/inventory/products/product.document.js +13 -0
- package/.output/modules/inventory/products/product.entity.d.ts +13 -0
- package/.output/modules/inventory/products/product.entity.js +55 -0
- package/.output/modules/inventory/products/product.validator.d.ts +17 -0
- package/.output/modules/inventory/products/product.validator.js +91 -0
- package/.output/modules/inventory/properties/property.entity.d.ts +7 -0
- package/.output/modules/inventory/properties/property.entity.js +38 -0
- package/.output/modules/inventory/properties/property.validator.d.ts +12 -0
- package/.output/modules/inventory/properties/property.validator.js +50 -0
- package/.output/modules/search/search.validator.d.ts +6 -0
- package/.output/modules/search/search.validator.js +39 -0
- package/.output/{module/organization → modules/settings}/connections/connection.validator.d.ts +0 -0
- package/.output/modules/settings/connections/connection.validator.js +35 -0
- package/.output/{module/organization → modules/settings}/members/member.validator.d.ts +0 -0
- package/.output/modules/settings/members/member.validator.js +3 -0
- package/.output/modules/settings/organization/organization.validator.d.ts +16 -0
- package/.output/modules/settings/organization/organization.validator.js +77 -0
- package/.output/modules/settings/payments/payment.entity.d.ts +8 -0
- package/.output/modules/settings/payments/payment.entity.js +38 -0
- package/.output/modules/settings/payments/payment.validator.d.ts +3 -0
- package/.output/modules/settings/payments/payment.validator.js +7 -0
- package/.output/modules/store/cart/cart.entity.d.ts +9 -0
- package/.output/modules/store/cart/cart.entity.js +39 -0
- package/.output/modules/store/cart/cart.validator.d.ts +19 -0
- package/.output/modules/store/cart/cart.validator.js +64 -0
- package/.output/modules/store/orders/billing/billing.entity.d.ts +7 -0
- package/.output/modules/store/orders/billing/billing.entity.js +46 -0
- package/.output/modules/store/orders/billing/billing.validator.d.ts +7 -0
- package/.output/modules/store/orders/billing/billing.validator.js +44 -0
- package/.output/modules/store/orders/item/item.entity.d.ts +7 -0
- package/.output/modules/store/orders/item/item.entity.js +37 -0
- package/.output/modules/store/orders/item/item.schema.d.ts +27 -0
- package/.output/modules/store/orders/item/item.schema.js +6 -0
- package/.output/modules/store/orders/item/item.validator.d.ts +4 -0
- package/.output/modules/store/orders/item/item.validator.js +27 -0
- package/.output/modules/store/orders/order.entity.d.ts +16 -0
- package/.output/modules/store/orders/order.entity.js +61 -0
- package/.output/modules/store/orders/order.validator.d.ts +12 -0
- package/.output/modules/store/orders/order.validator.js +48 -0
- package/.output/modules/store/orders/shipping/shipping.entity.d.ts +7 -0
- package/.output/modules/store/orders/shipping/shipping.entity.js +46 -0
- package/.output/modules/store/orders/shipping/shipping.validator.d.ts +7 -0
- package/.output/modules/store/orders/shipping/shipping.validator.js +44 -0
- package/.output/modules/store/orders/status/status.entity.d.ts +6 -0
- package/.output/modules/store/orders/status/status.entity.js +37 -0
- package/.output/modules/store/orders/status/status.validator.d.ts +8 -0
- package/.output/modules/store/orders/status/status.validator.js +12 -0
- package/.output/types.d.ts +9 -0
- package/.output/types.js +2 -0
- package/package.json +42 -44
- package/.output/config/app.config.d.ts +0 -26
- package/.output/config/app.document.d.ts +0 -10
- 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 -10
- package/.output/main.d.ts +0 -54
- package/.output/module/auth/auth.repository.d.ts +0 -10
- package/.output/module/auth/auth.repository.d.ts.map +0 -1
- package/.output/module/auth/auth.repository.js +0 -46
- package/.output/module/auth/auth.repository.js.map +0 -1
- 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.entity.d.ts +0 -8
- package/.output/module/store/items/item.validator.d.ts +0 -5
- 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
|
@@ -1,26 +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
|
-
};
|
|
13
|
-
static get sentry(): {
|
|
14
|
-
dsn: string;
|
|
15
|
-
debug: boolean;
|
|
16
|
-
environment: string;
|
|
17
|
-
};
|
|
18
|
-
static get server(): {
|
|
19
|
-
port: number;
|
|
20
|
-
name: string;
|
|
21
|
-
description: string;
|
|
22
|
-
version: string;
|
|
23
|
-
tenant: string;
|
|
24
|
-
};
|
|
25
|
-
static get database(): TypeOrmModuleOptions;
|
|
26
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AppEntity } from './app.entity';
|
|
2
|
-
export declare abstract class AppDocument {
|
|
3
|
-
protected abstract transform?(entity: unknown): this;
|
|
4
|
-
$id: string;
|
|
5
|
-
$createdAt: Date;
|
|
6
|
-
$updatedAt?: Date;
|
|
7
|
-
$deletedAt?: Date;
|
|
8
|
-
private _routing;
|
|
9
|
-
serialize?(entity: AppEntity): this;
|
|
10
|
-
}
|
|
@@ -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> {
|
|
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").SearchHitsMetadata<D>>;
|
|
19
|
-
create(validator: AppValidator<E>): 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: D): Promise<GetResponse<D>>;
|
|
24
|
-
protected $update(id: Id, doc: D): Promise<GetResponse<D>>;
|
|
25
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { QueryDslQueryContainer } 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 class FindValidator {
|
|
7
|
-
page: number;
|
|
8
|
-
limit: number;
|
|
9
|
-
query?: QueryDslQueryContainer;
|
|
10
|
-
}
|
package/.output/main.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
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';
|
|
15
|
-
export declare const Inventory: {
|
|
16
|
-
Brand: {
|
|
17
|
-
CreateBrandValidator: typeof BrandValidators.CreateBrandValidator;
|
|
18
|
-
UpdateBrandValidator: typeof BrandValidators.UpdateBrandValidator;
|
|
19
|
-
BrandDocument: typeof BrandDocument;
|
|
20
|
-
};
|
|
21
|
-
Category: {
|
|
22
|
-
CreateCategoryValidator: typeof CategoryValidators.CreateCategoryValidator;
|
|
23
|
-
UpdateCategoryValidator: typeof CategoryValidators.UpdateCategoryValidator;
|
|
24
|
-
CategoryDocument: typeof CategoryDocument;
|
|
25
|
-
};
|
|
26
|
-
Product: {
|
|
27
|
-
CreateProductValidator: typeof ProductValidators.CreateProductValidator;
|
|
28
|
-
UpdateProductValidator: typeof ProductValidators.UpdateProductValidator;
|
|
29
|
-
ProductDocument: typeof ProductDocument;
|
|
30
|
-
};
|
|
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
|
-
};
|
|
42
|
-
export declare const Store: {
|
|
43
|
-
Order: {
|
|
44
|
-
CreateOrderValidator: typeof OrderValidators.CreateOrderValidator;
|
|
45
|
-
UpdateOrderValidator: typeof OrderValidators.UpdateOrderValidator;
|
|
46
|
-
OrderDocument: typeof OrderDocument;
|
|
47
|
-
};
|
|
48
|
-
Cart: {
|
|
49
|
-
CreateCartValidator: typeof CartValidator.CreateCartValidator;
|
|
50
|
-
UpdateCartValidator: typeof CartValidator.UpdateCartValidator;
|
|
51
|
-
CartDocument: typeof CartDocument;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
export { SearchParams } from './config/app.repository';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { OnModuleInit } from '@nestjs/common';
|
|
2
|
-
import { AuthenticationClient, ManagementClient, ObjectWithId, Organization, User } from 'auth0';
|
|
3
|
-
export declare class AuthRepository implements OnModuleInit {
|
|
4
|
-
$management: ManagementClient;
|
|
5
|
-
readonly $auth0: AuthenticationClient;
|
|
6
|
-
onModuleInit(): Promise<ManagementClient | void>;
|
|
7
|
-
getUser(id: ObjectWithId['id']): Promise<User>;
|
|
8
|
-
getOrganization(): Promise<Organization>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=auth.repository.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.repository.d.ts","sourceRoot":"","sources":["../../../src/module/auth/auth.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EACL,oBAAoB,EAEpB,gBAAgB,EAEhB,YAAY,EACZ,YAAY,EACZ,IAAI,EACL,MAAM,OAAO,CAAA;AAGd,qBACa,cAAe,YAAW,YAAY;IAC1C,WAAW,EAAE,gBAAgB,CAAA;IACpC,SAAgB,MAAM,uBAIpB;IAEK,YAAY,IAAI,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAoB1C,OAAO,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C,eAAe,IAAI,OAAO,CAAC,YAAY,CAAC;CAGtD"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AuthRepository = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const auth0_1 = require("auth0");
|
|
6
|
-
const app_config_1 = require("../../config/app.config");
|
|
7
|
-
let AuthRepository = class AuthRepository {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.$auth0 = new auth0_1.AuthenticationClient({
|
|
10
|
-
domain: app_config_1.AppConfig.auth0.domain,
|
|
11
|
-
clientId: app_config_1.AppConfig.auth0.client,
|
|
12
|
-
clientSecret: app_config_1.AppConfig.auth0.secret
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
onModuleInit() {
|
|
16
|
-
const options = {
|
|
17
|
-
audience: app_config_1.AppConfig.auth0.audience
|
|
18
|
-
};
|
|
19
|
-
return this.$auth0.clientCredentialsGrant(options)
|
|
20
|
-
.then(({ access_token }) => __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
const options = {
|
|
22
|
-
audience: app_config_1.AppConfig.auth0.audience,
|
|
23
|
-
domain: app_config_1.AppConfig.auth0.domain,
|
|
24
|
-
clientId: app_config_1.AppConfig.auth0.client,
|
|
25
|
-
clientSecret: app_config_1.AppConfig.auth0.secret,
|
|
26
|
-
token: access_token
|
|
27
|
-
};
|
|
28
|
-
this.$management = new auth0_1.ManagementClient(options);
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
getUser(id) {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
return this.$management.getUser({ id });
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
getOrganization() {
|
|
37
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
return this.$management.organizations.getByID({ id: app_config_1.AppConfig.server.tenant });
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
AuthRepository = __decorate([
|
|
43
|
-
(0, common_1.Injectable)()
|
|
44
|
-
], AuthRepository);
|
|
45
|
-
exports.AuthRepository = AuthRepository;
|
|
46
|
-
//# sourceMappingURL=auth.repository.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.repository.js","sourceRoot":"","sources":["../../../src/module/auth/auth.repository.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AACzD,iCAQc;AACd,wDAAmD;AAGnD,IAAa,cAAc,GAA3B,MAAa,cAAc;IAA3B;QAEkB,WAAM,GAAG,IAAI,4BAAoB,CAAC;YAChD,MAAM,EAAE,sBAAS,CAAC,KAAK,CAAC,MAAM;YAC9B,QAAQ,EAAE,sBAAS,CAAC,KAAK,CAAC,MAAM;YAChC,YAAY,EAAE,sBAAS,CAAC,KAAK,CAAC,MAAM;SACrC,CAAC,CAAA;IA6BJ,CAAC;IA3BQ,YAAY;QACjB,MAAM,OAAO,GAAkC;YAC7C,QAAQ,EAAE,sBAAS,CAAC,KAAK,CAAC,QAAQ;SACnC,CAAA;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,OAAO,CAAC;aAC/C,IAAI,CAAC,CAAO,EAAE,YAAY,EAAE,EAAE,EAAE;YAE/B,MAAM,OAAO,GAA4B;gBACvC,QAAQ,EAAE,sBAAS,CAAC,KAAK,CAAC,QAAQ;gBAClC,MAAM,EAAE,sBAAS,CAAC,KAAK,CAAC,MAAM;gBAC9B,QAAQ,EAAE,sBAAS,CAAC,KAAK,CAAC,MAAM;gBAChC,YAAY,EAAE,sBAAS,CAAC,KAAK,CAAC,MAAM;gBACpC,KAAK,EAAE,YAAY;aACpB,CAAA;YAED,IAAI,CAAC,WAAW,GAAG,IAAI,wBAAgB,CAAC,OAAO,CAAC,CAAA;QAClD,CAAC,CAAA,CAAC,CAAA;IACN,CAAC;IAEY,OAAO,CAAC,EAAsB;;YACzC,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QACzC,CAAC;KAAA;IAEY,eAAe;;YAC1B,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,sBAAS,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QAChF,CAAC;KAAA;CACF,CAAA;AAnCY,cAAc;IAD1B,IAAA,mBAAU,GAAE;GACA,cAAc,CAmC1B;AAnCY,wCAAc"}
|
|
@@ -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 {
|
|
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 {
|
|
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 { ProductDocument } from '../../inventory/products/product.document';
|
|
3
|
-
import { ItemEntity } from './item.entity';
|
|
4
|
-
export declare class ItemDocument extends AppDocument {
|
|
5
|
-
product: Pick<ProductDocument, '$id' | 'name' | 'price'>;
|
|
6
|
-
quantity: number;
|
|
7
|
-
protected transform?(entity: ItemEntity): this;
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -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
|
-
}
|