@infrab4a/connect 3.13.3 → 3.13.6-beta.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/bundles/infrab4a-connect.umd.js +725 -116
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/catalog/helpers/index.d.ts +1 -1
- package/domain/catalog/models/category-collection-children.d.ts +1 -2
- package/domain/catalog/models/category-filter.d.ts +1 -1
- package/domain/catalog/models/category.d.ts +1 -2
- package/domain/catalog/models/filter-option.d.ts +1 -2
- package/domain/catalog/models/filter.d.ts +1 -2
- package/domain/catalog/models/kit-product.d.ts +1 -1
- package/domain/catalog/models/product.d.ts +1 -2
- package/domain/catalog/models/variant.d.ts +1 -2
- package/domain/generic/model/base.model.d.ts +9 -5
- package/domain/generic/model/types/base-model-builder.type.d.ts +4 -2
- package/domain/generic/model/types/identifier-model.type.d.ts +6 -5
- package/domain/generic/model/types/model-base-structure.type.d.ts +9 -3
- package/domain/generic/model/types/non-function-property-name.type.d.ts +12 -3
- package/domain/generic/repository/get.repository.d.ts +2 -2
- package/domain/generic/repository/types/repository-find-filters.type.d.ts +3 -3
- package/domain/generic/repository/types/repository-order-by-list.type.d.ts +2 -2
- package/domain/generic/repository/types/repository-update-params.type.d.ts +2 -2
- package/domain/location/models/address.d.ts +4 -3
- package/domain/shopping/models/checkout.d.ts +5 -6
- package/domain/shopping/models/subscription/checkout.d.ts +3 -4
- package/domain/users/models/subscription/subscription.d.ts +3 -3
- package/domain/users/models/user-address.d.ts +1 -1
- package/domain/users/models/user.d.ts +3 -4
- package/esm2015/domain/catalog/helpers/index.js +2 -2
- package/esm2015/domain/catalog/helpers/round-product-price.helper.js +15 -0
- package/esm2015/domain/catalog/models/category-collection-children.js +1 -4
- package/esm2015/domain/catalog/models/category-filter.js +1 -4
- package/esm2015/domain/catalog/models/category.js +1 -4
- package/esm2015/domain/catalog/models/filter-option.js +1 -4
- package/esm2015/domain/catalog/models/filter.js +1 -4
- package/esm2015/domain/catalog/models/kit-product.js +2 -2
- package/esm2015/domain/catalog/models/product.js +1 -4
- package/esm2015/domain/catalog/models/variant.js +1 -4
- package/esm2015/domain/generic/model/base.model.js +3 -2
- package/esm2015/domain/generic/model/types/base-model-builder.type.js +1 -1
- package/esm2015/domain/generic/model/types/identifier-model.type.js +1 -1
- package/esm2015/domain/generic/model/types/model-base-structure.type.js +1 -1
- package/esm2015/domain/generic/model/types/non-function-property-name.type.js +1 -1
- package/esm2015/domain/generic/repository/get.repository.js +1 -1
- package/esm2015/domain/generic/repository/types/repository-find-filters.type.js +1 -1
- package/esm2015/domain/generic/repository/types/repository-order-by-list.type.js +1 -1
- package/esm2015/domain/generic/repository/types/repository-update-params.type.js +1 -1
- package/esm2015/domain/location/models/address.js +2 -2
- package/esm2015/domain/shopping/models/checkout.js +6 -7
- package/esm2015/domain/shopping/models/order.js +1 -1
- package/esm2015/domain/shopping/models/subscription/checkout.js +6 -6
- package/esm2015/domain/users/models/subscription/subscription.js +6 -6
- package/esm2015/domain/users/models/user-address.js +1 -1
- package/esm2015/domain/users/models/user.js +3 -3
- package/esm2015/infra/elasticsearch/adapters/axios.adapter.js +1 -1
- package/esm2015/infra/elasticsearch/indexes/products-index.js +8 -3
- package/esm2015/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +3 -3
- package/esm2015/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +1 -1
- package/esm2015/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +1 -1
- package/esm2015/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +1 -1
- package/esm2015/infra/firebase/firestore/mixins/with-firestore.mixin.js +1 -1
- package/esm2015/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +2 -2
- package/esm2015/infra/firebase/firestore/mixins/with-helpers.mixin.js +1 -1
- package/esm2015/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +1 -1
- package/esm2015/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +1 -1
- package/esm2015/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +2 -2
- package/esm2015/infra/firebase/firestore/types/firestore-sub.repository.type.js +1 -1
- package/esm2015/infra/firebase/firestore/types/firestore.helpers.type.js +1 -1
- package/esm2015/infra/firebase/firestore/types/firestore.repository.type.js +1 -1
- package/esm2015/infra/hasura-graphql/mixins/helpers/attribute-option.helper.js +1 -1
- package/esm2015/infra/hasura-graphql/mixins/helpers/bind-filter-query.helper.js +19 -14
- package/esm2015/infra/hasura-graphql/mixins/helpers/filter-option.helper.js +1 -1
- package/esm2015/infra/hasura-graphql/mixins/helpers/graphql-field.helper.js +23 -18
- package/esm2015/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.js +19 -3
- package/esm2015/infra/hasura-graphql/mixins/with-crud-hasura-graphql.mixin.js +2 -2
- package/esm2015/infra/hasura-graphql/mixins/with-delete-hasura-graphql.mixin.js +5 -3
- package/esm2015/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.js +18 -4
- package/esm2015/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.js +5 -3
- package/esm2015/infra/hasura-graphql/mixins/with-hasura-graphql.mixin.js +7 -4
- package/esm2015/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.js +7 -5
- package/esm2015/infra/hasura-graphql/types/graphql.repository.type.js +1 -1
- package/esm2015/infra/hasura-graphql/types/hasura-graphql-fields.type.js +1 -1
- package/esm2015/utils/decorators/debug.class.decorator.js +7 -0
- package/esm2015/utils/decorators/index.js +3 -0
- package/esm2015/utils/decorators/trace.method.decorator.js +81 -0
- package/esm2015/utils/helpers/class-name.helper.js +15 -0
- package/esm2015/utils/helpers/debug-decorator.helper.js +18 -0
- package/esm2015/utils/helpers/debug.helper.js +150 -0
- package/esm2015/utils/helpers/index.js +5 -0
- package/esm2015/utils/helpers/reflect.helper.js +165 -0
- package/esm2015/utils/index.js +4 -1
- package/esm2015/utils/log.utils.js +9 -0
- package/fesm2015/infrab4a-connect.js +557 -90
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/infra/elasticsearch/adapters/axios.adapter.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +3 -3
- package/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +3 -3
- package/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +1 -1
- package/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +3 -3
- package/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +4 -4
- package/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +4 -4
- package/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +3 -3
- package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shop-settings/shop-settings-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/campaign-dashboard-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/campaign-hashtag-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +3 -3
- package/infra/firebase/firestore/types/firestore.helpers.type.d.ts +5 -5
- package/infra/firebase/firestore/types/firestore.repository.type.d.ts +1 -1
- package/infra/hasura-graphql/mixins/helpers/attribute-option.helper.d.ts +5 -3
- package/infra/hasura-graphql/mixins/helpers/bind-filter-query.helper.d.ts +5 -5
- package/infra/hasura-graphql/mixins/helpers/filter-option.helper.d.ts +4 -2
- package/infra/hasura-graphql/mixins/helpers/graphql-field.helper.d.ts +6 -5
- package/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.d.ts +2 -1
- package/infra/hasura-graphql/mixins/with-crud-hasura-graphql.mixin.d.ts +4 -4
- package/infra/hasura-graphql/mixins/with-delete-hasura-graphql.mixin.d.ts +2 -2
- package/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.d.ts +11 -9
- package/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.d.ts +5 -4
- package/infra/hasura-graphql/mixins/with-hasura-graphql.mixin.d.ts +2 -2
- package/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.d.ts +2 -2
- package/infra/hasura-graphql/types/graphql.repository.type.d.ts +5 -3
- package/infra/hasura-graphql/types/hasura-graphql-fields.type.d.ts +7 -3
- package/package.json +3 -2
- package/utils/decorators/debug.class.decorator.d.ts +2 -0
- package/utils/decorators/index.d.ts +2 -0
- package/utils/decorators/trace.method.decorator.d.ts +14 -0
- package/utils/helpers/class-name.helper.d.ts +3 -0
- package/utils/helpers/debug-decorator.helper.d.ts +9 -0
- package/utils/helpers/debug.helper.d.ts +60 -0
- package/utils/helpers/index.d.ts +4 -0
- package/utils/helpers/reflect.helper.d.ts +50 -0
- package/utils/index.d.ts +3 -0
- package/utils/log.utils.d.ts +7 -0
- package/esm2015/domain/catalog/helpers/RoundProdutcPriceHelper.js +0 -15
- /package/domain/catalog/helpers/{RoundProdutcPriceHelper.d.ts → round-product-price.helper.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './round-product-price.helper';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseModel
|
|
1
|
+
import { BaseModel } from '../../generic/model';
|
|
2
2
|
export declare type CategoryCollectionChildrenIdentifiers = 'collectionId' | 'categoryId';
|
|
3
3
|
export declare class CategoryCollectionChildren extends BaseModel<CategoryCollectionChildren, CategoryCollectionChildrenIdentifiers> {
|
|
4
4
|
collectionId: number;
|
|
@@ -9,6 +9,5 @@ export declare class CategoryCollectionChildren extends BaseModel<CategoryCollec
|
|
|
9
9
|
slug: string;
|
|
10
10
|
reference?: string;
|
|
11
11
|
parent?: CategoryCollectionChildren;
|
|
12
|
-
identifierFields(): NonFunctionPropertyNames<CategoryCollectionChildren>[];
|
|
13
12
|
static get identifiersFields(): CategoryCollectionChildrenIdentifiers[];
|
|
14
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model';
|
|
2
2
|
declare type CategoryFilterIdentifiers = 'id' | 'filterId' | 'categoryId';
|
|
3
|
-
export declare class CategoryFilter extends BaseModel<CategoryFilter> {
|
|
3
|
+
export declare class CategoryFilter extends BaseModel<CategoryFilter, CategoryFilterIdentifiers> {
|
|
4
4
|
id: number;
|
|
5
5
|
filterId: number;
|
|
6
6
|
categoryId: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseModel, GenericIdentifier
|
|
1
|
+
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
2
|
import { Shops } from './enums';
|
|
3
3
|
import { Filter } from './filter';
|
|
4
4
|
import { CategoryCondition, CategoryMetadata } from './types';
|
|
@@ -25,6 +25,5 @@ export declare class Category extends BaseModel<Category> {
|
|
|
25
25
|
parentId?: number;
|
|
26
26
|
parent?: Category;
|
|
27
27
|
filters?: Filter[];
|
|
28
|
-
identifierFields(): NonFunctionPropertyNames<Category>[];
|
|
29
28
|
static get identifiersFields(): GenericIdentifier[];
|
|
30
29
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { BaseModel, GenericIdentifier
|
|
1
|
+
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
2
|
export declare class FilterOption extends BaseModel<FilterOption> {
|
|
3
3
|
id: string;
|
|
4
4
|
filterId: number;
|
|
5
5
|
description: string;
|
|
6
6
|
createdAt?: Date;
|
|
7
7
|
updatedAt?: Date;
|
|
8
|
-
identifierFields(): NonFunctionPropertyNames<FilterOption>[];
|
|
9
8
|
static get identifiersFields(): GenericIdentifier[];
|
|
10
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseModel, GenericIdentifier
|
|
1
|
+
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
2
|
import { FilterOption } from './filter-option';
|
|
3
3
|
export declare class Filter extends BaseModel<Filter> {
|
|
4
4
|
id: number;
|
|
@@ -8,6 +8,5 @@ export declare class Filter extends BaseModel<Filter> {
|
|
|
8
8
|
options?: FilterOption[];
|
|
9
9
|
createdAt?: Date;
|
|
10
10
|
updatedAt?: Date;
|
|
11
|
-
identifierFields(): NonFunctionPropertyNames<Filter>[];
|
|
12
11
|
static get identifiersFields(): GenericIdentifier[];
|
|
13
12
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model';
|
|
2
2
|
import { Product } from './product';
|
|
3
|
-
declare type KitProductIdentifiers = 'productId' | '
|
|
3
|
+
declare type KitProductIdentifiers = 'productId' | 'kitProductId';
|
|
4
4
|
export declare class KitProduct extends BaseModel<KitProduct, KitProductIdentifiers> {
|
|
5
5
|
productId: string;
|
|
6
6
|
kitProductId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseModel, GenericIdentifier
|
|
1
|
+
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
2
|
import { Category } from './category';
|
|
3
3
|
import { KitProduct } from './kit-product';
|
|
4
4
|
import { ProductEvaluation, ProductGender, ProductMetadata, ProductReview, ShopDescription, ShopPrice, Stock } from './types';
|
|
@@ -40,6 +40,5 @@ export declare class Product extends BaseModel<Product> {
|
|
|
40
40
|
private reviewsTotal?;
|
|
41
41
|
get evaluation(): ProductEvaluation;
|
|
42
42
|
set evaluation(evaluation: ProductEvaluation);
|
|
43
|
-
identifierFields(): NonFunctionPropertyNames<Product>[];
|
|
44
43
|
static get identifiersFields(): GenericIdentifier[];
|
|
45
44
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseModel
|
|
1
|
+
import { BaseModel } from '../../generic/model';
|
|
2
2
|
import { ShopPrice, Stock, VariantGrade } from './types';
|
|
3
3
|
export declare type ProductVariantIdentifiers = 'id' | 'productId';
|
|
4
4
|
export declare class Variant extends BaseModel<Variant, ProductVariantIdentifiers> {
|
|
@@ -13,6 +13,5 @@ export declare class Variant extends BaseModel<Variant, ProductVariantIdentifier
|
|
|
13
13
|
weight: number;
|
|
14
14
|
createdAt?: Date;
|
|
15
15
|
updatedAt?: Date;
|
|
16
|
-
identifierFields(): NonFunctionPropertyNames<Variant>[];
|
|
17
16
|
static get identifiersFields(): ProductVariantIdentifiers[];
|
|
18
17
|
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { ModelBaseStructure, NonFunctionAndIdentifierProperties,
|
|
2
|
-
export declare type GenericIdentifier<
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ModelBaseStructure, NonFunctionAndIdentifierProperties, NonFunctionAndIdentifierPropertyNames } from './types';
|
|
2
|
+
export declare type GenericIdentifier<M = {
|
|
3
|
+
id: string;
|
|
4
|
+
}, T = NonFunctionAndIdentifierPropertyNames<M>> = T;
|
|
5
|
+
export declare class BaseModel<Model extends ModelBaseStructure<Model, Identifiers>, Identifiers = GenericIdentifier> implements ModelBaseStructure<Model, Identifiers> {
|
|
6
|
+
get identifier(): {
|
|
7
|
+
[key in Extract<NonFunctionAndIdentifierPropertyNames<Model>, Identifiers>]: Model[key];
|
|
8
|
+
};
|
|
5
9
|
get identifiersFields(): Identifiers[];
|
|
6
10
|
constructor(args?: Partial<Model>);
|
|
7
|
-
static toInstance<T
|
|
11
|
+
static toInstance<T>(this: new () => T, data?: Partial<NonFunctionAndIdentifierProperties<T>>): T;
|
|
8
12
|
static isModel<T extends ModelBaseStructure>(this: new () => T, value: any): value is T;
|
|
9
13
|
toPlain(): any;
|
|
10
14
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { PartialIdentifiersModel } from './identifier-model.type';
|
|
2
|
+
import { ModelBaseStructure } from './model-base-structure.type';
|
|
1
3
|
import { NonFunctionAndIdentifierPropertiesWithNoPartial } from './non-function-properties.type';
|
|
2
4
|
import { NonFunctionAndIdentifierPropertyNames } from './non-function-property-name.type';
|
|
3
|
-
export interface BaseModelBuilder<T
|
|
5
|
+
export interface BaseModelBuilder<T extends ModelBaseStructure<T>, Identifiers = NonFunctionAndIdentifierPropertyNames<T> | any, P extends T & {
|
|
4
6
|
prototype: unknown;
|
|
5
7
|
} = T & {
|
|
6
8
|
prototype: unknown;
|
|
@@ -10,6 +12,6 @@ export interface BaseModelBuilder<T, Identifiers = NonFunctionAndIdentifierPrope
|
|
|
10
12
|
prototype: {
|
|
11
13
|
[key in keyof P['prototype']]: P['prototype'][key];
|
|
12
14
|
};
|
|
13
|
-
toInstance(this: new () =>
|
|
15
|
+
toInstance<E>(this: new () => E, data?: NonFunctionAndIdentifierPropertiesWithNoPartial<T> | PartialIdentifiersModel<T>): E;
|
|
14
16
|
isModel(model: any): model is T;
|
|
15
17
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropType } from '../../../../utils';
|
|
2
2
|
import { ModelBaseStructure } from './model-base-structure.type';
|
|
3
|
-
import { NonFunctionAndIdentifierPropertiesWithNoPartial } from './non-function-properties.type';
|
|
4
3
|
import { NonFunctionAndIdentifierPropertyNames } from './non-function-property-name.type';
|
|
5
|
-
export declare type IdentifierModel<Model extends ModelBaseStructure> =
|
|
6
|
-
export declare type IdentifiersModel<Model extends ModelBaseStructure> =
|
|
7
|
-
|
|
4
|
+
export declare type IdentifierModel<Model extends ModelBaseStructure> = Extract<NonFunctionAndIdentifierPropertyNames<Model>, PropType<Model, 'identifiersFields'>[number]>;
|
|
5
|
+
export declare type IdentifiersModel<Model extends ModelBaseStructure> = {
|
|
6
|
+
[K in IdentifierModel<Model>]: Model[K];
|
|
7
|
+
};
|
|
8
|
+
export declare type PartialIdentifiersModel<Model extends ModelBaseStructure> = Partial<IdentifiersModel<Model>>;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { NonFunctionAndIdentifierPropertyNames } from '..';
|
|
2
|
+
declare type ModelBaseStructureRecord = Record<string, any> & {
|
|
3
|
+
identifiersFields: any[];
|
|
4
|
+
};
|
|
5
|
+
export declare type ModelBaseStructure<M extends ModelBaseStructureRecord = ModelBaseStructureRecord, I = M['identifiersFields'][number]> = {
|
|
6
|
+
identifier: {
|
|
7
|
+
[key in Extract<NonFunctionAndIdentifierPropertyNames<M>, I>]: M[key];
|
|
8
|
+
};
|
|
4
9
|
identifiersFields: I[];
|
|
5
10
|
toPlain: any;
|
|
6
11
|
};
|
|
12
|
+
export {};
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
export declare type
|
|
2
|
-
|
|
1
|
+
export declare type IfEquals<X, Y, A = X, B = never> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? A : B;
|
|
2
|
+
export declare type ReadonlyKeys<T> = {
|
|
3
|
+
[P in keyof T]-?: IfEquals<{
|
|
4
|
+
[Q in P]: T[P];
|
|
5
|
+
}, {
|
|
6
|
+
-readonly [Q in P]: T[P];
|
|
7
|
+
}, never, P>;
|
|
8
|
+
}[keyof T];
|
|
9
|
+
export declare type WritableKeys<T> = Exclude<keyof T, ReadonlyKeys<T>>;
|
|
10
|
+
export declare type NonFunctionPropertyNames<T, P = T, E extends WritableKeys<P> = WritableKeys<P>> = {
|
|
11
|
+
[K in E]: P[K] extends Function ? never : K extends 'identifiersFields' ? never : K;
|
|
3
12
|
}[E];
|
|
4
|
-
export declare type NonFunctionAndIdentifierPropertyNames<T> = NonFunctionPropertyNames<
|
|
13
|
+
export declare type NonFunctionAndIdentifierPropertyNames<T> = NonFunctionPropertyNames<Omit<T, 'identifier' | 'identifiersFields'>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare type GetRepositoryParams<Model extends ModelBaseStructure> =
|
|
1
|
+
import { IdentifiersModel, ModelBaseStructure } from '../model/types';
|
|
2
|
+
export declare type GetRepositoryParams<Model extends ModelBaseStructure> = IdentifiersModel<Model>;
|
|
3
3
|
export interface GetRepository<Model extends ModelBaseStructure, Params = GetRepositoryParams<Model>> {
|
|
4
4
|
get(identifiers: Params): Promise<Model>;
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropType } from '../../../../utils';
|
|
2
2
|
import { ModelBaseStructure } from '../../model';
|
|
3
|
-
import {
|
|
3
|
+
import { NonFunctionAndIdentifierPropertyNames } from '../../model/types/non-function-property-name.type';
|
|
4
4
|
import { Where } from '../enums/where.enum';
|
|
5
5
|
export declare type RepositoryFindFieltersOptions<Model, FieldName extends keyof Model> = {
|
|
6
6
|
operator: Where;
|
|
@@ -8,6 +8,6 @@ export declare type RepositoryFindFieltersOptions<Model, FieldName extends keyof
|
|
|
8
8
|
};
|
|
9
9
|
export declare type RepositoryFindField<Model, FieldName extends keyof Model> = RepositoryFindFieltersOptions<Model, FieldName> | RepositoryFindFieltersOptions<Model, FieldName>[] | Partial<PropType<Model, FieldName>>;
|
|
10
10
|
export declare type NestedRepositoryFindFieltersOptions<Model> = {
|
|
11
|
-
[key in
|
|
11
|
+
[key in NonFunctionAndIdentifierPropertyNames<Model>]?: PropType<Model, key> extends ModelBaseStructure ? NestedRepositoryFindFieltersOptions<PropType<Model, key>> : PropType<Required<Model>, key> extends any[] ? PropType<Required<Model>, key>[number] extends ModelBaseStructure ? NestedRepositoryFindFieltersOptions<PropType<Required<Model>, key>[number]> : PropType<Required<Model>, key>[number] extends Record<string, any> ? NestedRepositoryFindFieltersOptions<PropType<Required<Model>, key>[number]> : RepositoryFindField<Model, key> : PropType<Model, key> extends Record<string, any> ? NestedRepositoryFindFieltersOptions<Required<PropType<Model, key>>> : RepositoryFindField<Model, key>;
|
|
12
12
|
};
|
|
13
|
-
export declare type RepositoryFindFielters<Model extends ModelBaseStructure
|
|
13
|
+
export declare type RepositoryFindFielters<Model extends ModelBaseStructure> = NestedRepositoryFindFieltersOptions<Model>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NonFunctionAndIdentifierPropertyNames } from '../../model/types/non-function-property-name.type';
|
|
2
2
|
export declare type RepositoryOrderBy<Model> = {
|
|
3
|
-
[key in
|
|
3
|
+
[key in NonFunctionAndIdentifierPropertyNames<Model>]?: 'asc' | 'desc';
|
|
4
4
|
};
|
|
5
5
|
export declare type RepositoryOrderByList<Model> = RepositoryOrderBy<Model>[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ModelBaseStructure } from '../..';
|
|
2
2
|
import { PropType } from '../../../../utils';
|
|
3
|
-
import {
|
|
3
|
+
import { NonFunctionAndIdentifierPropertyNames } from '../../model/types/non-function-property-name.type';
|
|
4
4
|
export declare type UpdateOptionAction = 'removeField' | 'update' | 'merge' | 'remove' | 'null';
|
|
5
5
|
export declare type UpdateOptions<T> = {
|
|
6
6
|
action: UpdateOptionAction;
|
|
7
7
|
value?: T;
|
|
8
8
|
};
|
|
9
9
|
export declare type RepositoryUpdateParams<Model extends ModelBaseStructure> = {
|
|
10
|
-
[key in
|
|
10
|
+
[key in NonFunctionAndIdentifierPropertyNames<Model>]?: UpdateOptions<PropType<Model, key>> | PropType<Model, key>;
|
|
11
11
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { BaseModel, GenericIdentifier } from '../../generic
|
|
1
|
+
import { BaseModel, GenericIdentifier, ModelBaseStructure } from '../../generic';
|
|
2
2
|
import { LocationGeometry } from './types/location-geometry.type';
|
|
3
|
-
export declare abstract class Address<Identifiers =
|
|
3
|
+
export declare abstract class Address<ChildAddress extends ModelBaseStructure<ChildAddress, Identifiers>, Identifiers = ChildAddress['identifiersFields']> extends BaseModel<ChildAddress, Identifiers> {
|
|
4
|
+
id: string;
|
|
4
5
|
default?: boolean;
|
|
5
6
|
recipient?: string;
|
|
6
7
|
zip?: string;
|
|
@@ -19,5 +20,5 @@ export declare abstract class Address<Identifiers = GenericIdentifier> extends B
|
|
|
19
20
|
formattedAddress?: string;
|
|
20
21
|
placeId?: string;
|
|
21
22
|
geometry?: LocationGeometry;
|
|
22
|
-
static get identifiersFields():
|
|
23
|
+
static get identifiersFields(): Array<GenericIdentifier | {}>;
|
|
23
24
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Shops } from '../../catalog/models/enums/shops.enum';
|
|
2
2
|
import { BaseModel, GenericIdentifier } from '../../generic/model/base.model';
|
|
3
|
-
import { User } from '../../users
|
|
3
|
+
import { User, UserAddress } from '../../users';
|
|
4
4
|
import { Coupon } from './coupons/coupon';
|
|
5
5
|
import { LineItem } from './line-item';
|
|
6
6
|
import { ShippingMethod } from './shipping-method';
|
|
7
|
-
import { Shops } from '../../catalog/models/enums/shops.enum';
|
|
8
7
|
export declare class Checkout extends BaseModel<Checkout> {
|
|
9
8
|
id?: string;
|
|
10
9
|
paymentId?: string;
|
|
11
|
-
status?:
|
|
10
|
+
status?: any;
|
|
12
11
|
createdAt?: Date;
|
|
13
12
|
updatedAt?: Date;
|
|
14
13
|
completedAt?: Date;
|
|
@@ -19,8 +18,8 @@ export declare class Checkout extends BaseModel<Checkout> {
|
|
|
19
18
|
glampoints?: number;
|
|
20
19
|
lineItems?: LineItem[];
|
|
21
20
|
user?: User;
|
|
22
|
-
shippingAddress?:
|
|
23
|
-
billingAddress?:
|
|
21
|
+
shippingAddress?: UserAddress;
|
|
22
|
+
billingAddress?: UserAddress;
|
|
24
23
|
shipping?: ShippingMethod;
|
|
25
24
|
coupon?: Coupon;
|
|
26
25
|
static get identifiersFields(): GenericIdentifier[];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Address } from '../../../location/models/address';
|
|
2
1
|
import { BaseModel, GenericIdentifier } from '../../../generic/model/base.model';
|
|
2
|
+
import { User, UserAddress } from '../../../users';
|
|
3
3
|
import { Coupon } from '../coupons/coupon';
|
|
4
|
-
import { User } from '../../../users/models/user';
|
|
5
4
|
import { SubscriptionPlan } from './plan';
|
|
6
5
|
export declare class CheckoutSubscription extends BaseModel<CheckoutSubscription> {
|
|
7
6
|
id?: string;
|
|
@@ -13,8 +12,8 @@ export declare class CheckoutSubscription extends BaseModel<CheckoutSubscription
|
|
|
13
12
|
discount?: number;
|
|
14
13
|
subTotalPrice?: number;
|
|
15
14
|
totalPrice?: number;
|
|
16
|
-
shippingAddress:
|
|
17
|
-
billingAddress?:
|
|
15
|
+
shippingAddress: UserAddress;
|
|
16
|
+
billingAddress?: UserAddress;
|
|
18
17
|
subscriptionPlan: SubscriptionPlan;
|
|
19
18
|
coupon?: Coupon;
|
|
20
19
|
static get identifiersFields(): GenericIdentifier[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Address } from '../../../location/models/address';
|
|
2
1
|
import { BaseModel, GenericIdentifier } from '../../../generic/model/base.model';
|
|
3
2
|
import { Coupon } from '../../../shopping/models/coupons/coupon';
|
|
4
3
|
import { SubscriptionPlan } from '../../../shopping/models/subscription/plan';
|
|
5
4
|
import { User } from '../user';
|
|
5
|
+
import { UserAddress } from '../user-address';
|
|
6
6
|
import { Edition } from './edition';
|
|
7
7
|
import { Status } from './enums/status.enum';
|
|
8
8
|
import { SubscriptionPayment } from './payment';
|
|
@@ -19,8 +19,8 @@ export declare class Subscription extends BaseModel<Subscription> {
|
|
|
19
19
|
updatedAt: Date;
|
|
20
20
|
user: User;
|
|
21
21
|
subscriptionPlan: SubscriptionPlan;
|
|
22
|
-
shippingAddress:
|
|
23
|
-
billingAddress?:
|
|
22
|
+
shippingAddress: UserAddress;
|
|
23
|
+
billingAddress?: UserAddress;
|
|
24
24
|
coupon?: Coupon;
|
|
25
25
|
editions: Edition[];
|
|
26
26
|
payment?: SubscriptionPayment[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address } from '../../location/models/address';
|
|
2
2
|
export declare type UserAddressIdentifiers = 'id' | 'userId';
|
|
3
|
-
export declare class UserAddress extends Address<UserAddressIdentifiers> {
|
|
3
|
+
export declare class UserAddress extends Address<UserAddress, UserAddressIdentifiers> {
|
|
4
4
|
id: string;
|
|
5
5
|
userId: string;
|
|
6
6
|
static get identifiersFields(): UserAddressIdentifiers[];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { BaseModel, GenericIdentifier } from '../../generic
|
|
2
|
-
import { NonFunctionProperties, ModelBaseStructure } from '../../generic/model/types';
|
|
3
|
-
import { Area, OfficePosition, UserType } from './enums';
|
|
1
|
+
import { BaseModel, GenericIdentifier, NonFunctionAndIdentifierProperties } from '../../generic';
|
|
4
2
|
import { BeautyProfile } from './beauty-profile';
|
|
3
|
+
import { Area, OfficePosition, UserType } from './enums';
|
|
5
4
|
export declare class User extends BaseModel<User> {
|
|
6
5
|
id: string;
|
|
7
6
|
cpf?: string;
|
|
@@ -22,7 +21,7 @@ export declare class User extends BaseModel<User> {
|
|
|
22
21
|
dateCreated?: Date;
|
|
23
22
|
dateModified?: Date;
|
|
24
23
|
beautyProfile?: BeautyProfile;
|
|
25
|
-
static toInstance<T
|
|
24
|
+
static toInstance<T>(this: new () => T, data?: Partial<NonFunctionAndIdentifierProperties<User>>): T;
|
|
26
25
|
toPlain(): any;
|
|
27
26
|
static get identifiersFields(): GenericIdentifier[];
|
|
28
27
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
export * from './round-product-price.helper';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb25uZWN0L3NyYy9kb21haW4vY2F0YWxvZy9oZWxwZXJzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsOEJBQThCLENBQUEiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3JvdW5kLXByb2R1Y3QtcHJpY2UuaGVscGVyJ1xuIl19
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LineItem } from '../../shopping';
|
|
2
|
+
export class RoundProductPricesHelper {
|
|
3
|
+
static roundProductPrices(product) {
|
|
4
|
+
product.price.price = Number(product.price.price.toFixed(2));
|
|
5
|
+
product.price.fullPrice = Number(product.price.fullPrice.toFixed(2));
|
|
6
|
+
if (product.price.subscriberPrice) {
|
|
7
|
+
product.price.subscriberPrice = Number(product.price.subscriberPrice.toFixed(2));
|
|
8
|
+
}
|
|
9
|
+
if (product instanceof LineItem && product.pricePaid) {
|
|
10
|
+
product.pricePaid = Number(product.pricePaid.toFixed(2));
|
|
11
|
+
}
|
|
12
|
+
return product;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91bmQtcHJvZHVjdC1wcmljZS5oZWxwZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb25uZWN0L3NyYy9kb21haW4vY2F0YWxvZy9oZWxwZXJzL3JvdW5kLXByb2R1Y3QtcHJpY2UuaGVscGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQTtBQUd6QyxNQUFNLE9BQU8sd0JBQXdCO0lBQzVCLE1BQU0sQ0FBQyxrQkFBa0IsQ0FBQyxPQUFnQjtRQUMvQyxPQUFPLENBQUMsS0FBSyxDQUFDLEtBQUssR0FBRyxNQUFNLENBQUMsT0FBTyxDQUFDLEtBQUssQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUE7UUFDNUQsT0FBTyxDQUFDLEtBQUssQ0FBQyxTQUFTLEdBQUcsTUFBTSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFBO1FBQ3BFLElBQUksT0FBTyxDQUFDLEtBQUssQ0FBQyxlQUFlLEVBQUU7WUFDakMsT0FBTyxDQUFDLEtBQUssQ0FBQyxlQUFlLEdBQUcsTUFBTSxDQUFD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WN0LnByaWNlUGFpZCA9IE51bWJlcihwcm9kdWN0LnByaWNlUGFpZC50b0ZpeGVkKDIpKVxuICAgIH1cblxuICAgIHJldHVybiBwcm9kdWN0XG4gIH1cbn1cbiJdfQ==
|
|
@@ -2,9 +2,6 @@ import { __decorate, __metadata } from "tslib";
|
|
|
2
2
|
import { Type } from 'class-transformer';
|
|
3
3
|
import { BaseModel } from '../../generic/model';
|
|
4
4
|
export class CategoryCollectionChildren extends BaseModel {
|
|
5
|
-
identifierFields() {
|
|
6
|
-
return ['collectionId', 'categoryId'];
|
|
7
|
-
}
|
|
8
5
|
static get identifiersFields() {
|
|
9
6
|
return ['collectionId', 'categoryId'];
|
|
10
7
|
}
|
|
@@ -13,4 +10,4 @@ __decorate([
|
|
|
13
10
|
Type(() => CategoryCollectionChildren),
|
|
14
11
|
__metadata("design:type", CategoryCollectionChildren)
|
|
15
12
|
], CategoryCollectionChildren.prototype, "parent", void 0);
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2F0ZWdvcnktY29sbGVjdGlvbi1jaGlsZHJlbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Nvbm5lY3Qvc3JjL2RvbWFpbi9jYXRhbG9nL21vZGVscy9jYXRlZ29yeS1jb2xsZWN0aW9uLWNoaWxkcmVuLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sbUJBQW1CLENBQUE7QUFDeEMsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLHFCQUFxQixDQUFBO0FBSS9DLE1BQU0sT0FBTywwQkFBMkIsU0FBUSxTQUcvQztJQVlDLE1BQU0sS0FBSyxpQkFBaUI7UUFDMUIsT0FBTyxDQUFDLGNBQWMs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klkJywgJ2NhdGVnb3J5SWQnXVxuICB9XG59XG4iXX0=
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model';
|
|
2
2
|
export class CategoryFilter extends BaseModel {
|
|
3
|
-
// identifierFields(): NonFunctionPropertyNames<CategoryFilter>[] {
|
|
4
|
-
// return ['id']
|
|
5
|
-
// }
|
|
6
3
|
static get identifiersFields() {
|
|
7
4
|
return ['id', 'filterId', 'categoryId'];
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2F0ZWdvcnktZmlsdGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29ubmVjdC9zcmMvZG9tYWluL2NhdGFsb2cvbW9kZWxzL2NhdGVnb3J5LWZpbHRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0scUJBQXFCLENBQUE7QUFJL0MsTUFBTSxPQUFPLGNBQWUsU0FBUSxTQUFvRDtJQUt0RixNQUFNLEtBQUssaUJBQWlCO1FBQzFCLE9BQU8sQ0FBQyxJQUFJLEVBQUUsVUFBVSxFQUFFLFlBQVksQ0FBQyxDQUFBO0lBQ3pDLENBQUM7Q0FDRiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEJhc2VNb2RlbCB9IGZyb20gJy4uLy4uL2dlbmVyaWMvbW9kZWwnXG5cbnR5cGUgQ2F0ZWdvcnlGaWx0ZXJJZGVudGlmaWVycyA9ICdpZCcgfCAnZmlsdGVySWQnIHwgJ2NhdGVnb3J5SWQnXG5cbmV4cG9ydCBjbGFzcyBDYXRlZ29yeUZpbHRlciBleHRlbmRzIEJhc2VNb2RlbDxDYXRlZ29yeUZpbHRlciwgQ2F0ZWdvcnlGaWx0ZXJJZGVudGlmaWVycz4ge1xuICBpZDogbnVtYmVyXG4gIGZpbHRlcklkOiBudW1iZXJcbiAgY2F0ZWdvcnlJZDogbnVtYmVyXG5cbiAgc3RhdGljIGdldCBpZGVudGlmaWVyc0ZpZWxkcygpOiBDYXRlZ29yeUZpbHRlcklkZW50aWZpZXJzW10ge1xuICAgIHJldHVybiBbJ2lkJywgJ2ZpbHRlcklkJywgJ2NhdGVnb3J5SWQnXVxuICB9XG59XG4iXX0=
|
|
@@ -3,9 +3,6 @@ import { Type } from 'class-transformer';
|
|
|
3
3
|
import { BaseModel } from '../../generic/model';
|
|
4
4
|
import { Filter } from './filter';
|
|
5
5
|
export class Category extends BaseModel {
|
|
6
|
-
identifierFields() {
|
|
7
|
-
return ['id'];
|
|
8
|
-
}
|
|
9
6
|
static get identifiersFields() {
|
|
10
7
|
return ['id'];
|
|
11
8
|
}
|
|
@@ -18,4 +15,4 @@ __decorate([
|
|
|
18
15
|
Type(() => Filter),
|
|
19
16
|
__metadata("design:type", Array)
|
|
20
17
|
], Category.prototype, "filters", void 0);
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2F0ZWdvcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb25uZWN0L3NyYy9kb21haW4vY2F0YWxvZy9tb2RlbHMvY2F0ZWdvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxJQUFJLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQTtBQUN4QyxPQUFPLEVBQUUsU0FBUyxFQUFxQixNQUFNLHFCQUFxQixDQUFBO0FBRWxFLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxVQUFVLENBQUE7QUFHakMsTUFBT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/OiBEYXRlXG4gIHVwZGF0ZWRBdD86IERhdGVcbiAgc2hvcD86IFNob3BzXG4gIHNob3BzPzogc3RyaW5nW11cbiAgcHVibGlzaGVkOiBib29sZWFuXG4gIG1ldGFkYXRhOiBDYXRlZ29yeU1ldGFkYXRhXG4gIGlzQ29sbGVjdGlvbj86IGJvb2xlYW5cbiAgcmVmZXJlbmNlPzogc3RyaW5nXG4gIHBhcmVudElkPzogbnVtYmVyXG5cbiAgQFR5cGUoKCkgPT4gQ2F0ZWdvcnkpXG4gIHBhcmVudD86IENhdGVnb3J5XG5cbiAgQFR5cGUoKCkgPT4gRmlsdGVyKVxuICBmaWx0ZXJzPzogRmlsdGVyW11cblxuICBzdGF0aWMgZ2V0IGlkZW50aWZpZXJzRmllbGRzKCk6IEdlbmVyaWNJZGVudGlmaWVyW10ge1xuICAgIHJldHVybiBbJ2lkJ11cbiAgfVxufVxuIl19
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model';
|
|
2
2
|
export class FilterOption extends BaseModel {
|
|
3
|
-
identifierFields() {
|
|
4
|
-
return ['id'];
|
|
5
|
-
}
|
|
6
3
|
static get identifiersFields() {
|
|
7
4
|
return ['id'];
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsdGVyLW9wdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Nvbm5lY3Qvc3JjL2RvbWFpbi9jYXRhbG9nL21vZGVscy9maWx0ZXItb3B0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQXFCLE1BQU0scUJBQXFCLENBQUE7QUFFbEUsTUFBTSxPQUFPLFlBQWEsU0FBUSxTQUF1QjtJQU92RCxNQUFNLEtBQUssaUJBQWlCO1FBQzFCLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQTtJQUNmLENBQUM7Q0FDRiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEJhc2VNb2RlbCwgR2VuZXJpY0lkZW50aWZpZXIgfSBmcm9tICcuLi8uLi9nZW5lcmljL21vZGVsJ1xuXG5leHBvcnQgY2xhc3MgRmlsdGVyT3B0aW9uIGV4dGVuZHMgQmFzZU1vZGVsPEZpbHRlck9wdGlvbj4ge1xuICBpZDogc3RyaW5nXG4gIGZpbHRlcklkOiBudW1iZXJcbiAgZGVzY3JpcHRpb246IHN0cmluZ1xuICBjcmVhdGVkQXQ/OiBEYXRlXG4gIHVwZGF0ZWRBdD86IERhdGVcblxuICBzdGF0aWMgZ2V0IGlkZW50aWZpZXJzRmllbGRzKCk6IEdlbmVyaWNJZGVudGlmaWVyW10ge1xuICAgIHJldHVybiBbJ2lkJ11cbiAgfVxufVxuIl19
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model';
|
|
2
2
|
export class Filter extends BaseModel {
|
|
3
|
-
identifierFields() {
|
|
4
|
-
return ['id'];
|
|
5
|
-
}
|
|
6
3
|
static get identifiersFields() {
|
|
7
4
|
return ['id'];
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsdGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29ubmVjdC9zcmMvZG9tYWluL2NhdGFsb2cvbW9kZWxzL2ZpbHRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFxQixNQUFNLHFCQUFxQixDQUFBO0FBR2xFLE1BQU0sT0FBTyxNQUFPLFNBQVEsU0FBaUI7SUFTM0MsTUFBTSxLQUFLLGlCQUFpQjtRQUMxQixPQUFPLENBQUMsSUFBSSxDQUFDLENBQUE7SUFDZixDQUFDO0NBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBCYXNlTW9kZWwsIEdlbmVyaWNJZGVudGlmaWVyIH0gZnJvbSAnLi4vLi4vZ2VuZXJpYy9tb2RlbCdcbmltcG9ydCB7IEZpbHRlck9wdGlvbiB9IGZyb20gJy4vZmlsdGVyLW9wdGlvbidcblxuZXhwb3J0IGNsYXNzIEZpbHRlciBleHRlbmRzIEJhc2VNb2RlbDxGaWx0ZXI+IHtcbiAgaWQ6IG51bWJlclxuICBkZXNjcmlwdGlvbjogc3RyaW5nXG4gIHNsdWc6IHN0cmluZ1xuICBlbmFibGVkOiBib29sZWFuXG4gIG9wdGlvbnM/OiBGaWx0ZXJPcHRpb25bXVxuICBjcmVhdGVkQXQ/OiBEYXRlXG4gIHVwZGF0ZWRBdD86IERhdGVcblxuICBzdGF0aWMgZ2V0IGlkZW50aWZpZXJzRmllbGRzKCk6IEdlbmVyaWNJZGVudGlmaWVyW10ge1xuICAgIHJldHVybiBbJ2lkJ11cbiAgfVxufVxuIl19
|
|
@@ -4,7 +4,7 @@ import { BaseModel } from '../../generic/model';
|
|
|
4
4
|
import { Product } from './product';
|
|
5
5
|
export class KitProduct extends BaseModel {
|
|
6
6
|
static get identifiersFields() {
|
|
7
|
-
return ['productId', '
|
|
7
|
+
return ['productId', 'kitProductId'];
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
__decorate([
|
|
@@ -15,4 +15,4 @@ __decorate([
|
|
|
15
15
|
Type(() => Product),
|
|
16
16
|
__metadata("design:type", Product)
|
|
17
17
|
], KitProduct.prototype, "product", void 0);
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2Z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9kdWN0LCBLaXRQcm9kdWN0SWRlbnRpZmllcnM+IHtcbiAgcHJvZHVjdElkOiBzdHJpbmdcbiAga2l0UHJvZHVjdElkOiBzdHJpbmdcbiAgcXVhbnRpdHk6IG51bWJlclxuXG4gIEBUeXBlKCgpID0+IFByb2R1Y3QpXG4gIGtpdDogUHJvZHVjdFxuXG4gIEBUeXBlKCgpID0+IFByb2R1Y3QpXG4gIHByb2R1Y3Q6IFByb2R1Y3RcblxuICBzdGF0aWMgZ2V0IGlkZW50aWZpZXJzRmllbGRzKCk6IEtpdFByb2R1Y3RJZGVudGlmaWVyc1tdIHtcbiAgICByZXR1cm4gWydwcm9kdWN0SWQnLCAna2l0UHJvZHVjdElkJ11cbiAgfVxufVxuIl19
|
|
@@ -22,9 +22,6 @@ export class Product extends BaseModel {
|
|
|
22
22
|
this.reviewsTotal = evaluation.count || this.reviewsTotal;
|
|
23
23
|
this.rate = evaluation.rating || this.rate;
|
|
24
24
|
}
|
|
25
|
-
identifierFields() {
|
|
26
|
-
return ['id'];
|
|
27
|
-
}
|
|
28
25
|
static get identifiersFields() {
|
|
29
26
|
return ['id'];
|
|
30
27
|
}
|
|
@@ -37,4 +34,4 @@ __decorate([
|
|
|
37
34
|
Type(() => KitProduct),
|
|
38
35
|
__metadata("design:type", Array)
|
|
39
36
|
], Product.prototype, "kitProducts", void 0);
|
|
40
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZHVjdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Nvbm5lY3Qvc3JjL2RvbWFpbi9jYXRhbG9nL21vZGVscy9wcm9kdWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sbUJBQW1CLENBQUE7Q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5yYXRlID0gbnVsbFxuXG4gICAgICByZXR1cm5cbiAgICB9XG5cbiAgICB0aGlzLnJldmlld3MgPSBldmFsdWF0aW9uLnJldmlld3MgfHwgdGhpcy5yZXZpZXdzXG4gICAgdGhpcy5yZXZpZXdzVG90YWwgPSBldmFsdWF0aW9uLmNvdW50IHx8IHRoaXMucmV2aWV3c1RvdGFsXG4gICAgdGhpcy5yYXRlID0gZXZhbHVhdGlvbi5yYXRpbmcgfHwgdGhpcy5yYXRlXG4gIH1cblxuICBzdGF0aWMgZ2V0IGlkZW50aWZpZXJzRmllbGRzKCk6IEdlbmVyaWNJZGVudGlmaWVyW10ge1xuICAgIHJldHVybiBbJ2lkJ11cbiAgfVxufVxuIl19
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { BaseModel } from '../../generic/model';
|
|
2
2
|
export class Variant extends BaseModel {
|
|
3
|
-
identifierFields() {
|
|
4
|
-
return ['id'];
|
|
5
|
-
}
|
|
6
3
|
static get identifiersFields() {
|
|
7
4
|
return ['id', 'productId'];
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFyaWFudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Nvbm5lY3Qvc3JjL2RvbWFpbi9jYXRhbG9nL21vZGVscy92YXJpYW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQTtBQUsvQyxNQUFNLE9BQU8sT0FBUSxTQUFRLFNBQTZDO0lBYXhFLE1BQU0sS0FBSyxpQkFBaUI7UUFDMUIsT0FBTyxDQUFDLElBQUksRUFBRSxXQUFXLENBQUMsQ0FBQTtJQUM1QixDQUFDO0NBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBCYXNlTW9kZWwgfSBmcm9tICcuLi8uLi9nZW5lcmljL21vZGVsJ1xuaW1wb3J0IHsgU2hvcFByaWNlLCBTdG9jaywgVmFyaWFudEdyYWRlIH0gZnJvbSAnLi90eXBlcydcblxuZXhwb3J0IHR5cGUgUHJvZHVjdFZhcmlhbnRJZGVudGlmaWVycyA9ICdpZCcgfCAncHJvZHVjdElkJ1xuXG5leHBvcnQgY2xhc3MgVmFyaWFudCBleHRlbmRzIEJhc2VNb2RlbDxWYXJpYW50LCBQcm9kdWN0VmFyaWFudElkZW50aWZpZXJzPiB7XG4gIGlkOiBzdHJpbmdcbiAgcHJvZHVjdElkOiBzdHJpbmdcbiAgc2t1OiBzdHJpbmdcbiAgcHJpY2U6IFNob3BQcmljZVxuICBFQU46IHN0cmluZ1xuICBzdG9jazogU3RvY2tcbiAgZ3JhZGU/OiBWYXJpYW50R3JhZGVbXVxuICBjb3N0UHJpY2U6IG51bWJlclxuICB3ZWlnaHQ6IG51bWJlclxuICBjcmVhdGVkQXQ/OiBEYXRlXG4gIHVwZGF0ZWRBdD86IERhdGVcblxuICBzdGF0aWMgZ2V0IGlkZW50aWZpZXJzRmllbGRzKCk6IFByb2R1Y3RWYXJpYW50SWRlbnRpZmllcnNbXSB7XG4gICAgcmV0dXJuIFsnaWQnLCAncHJvZHVjdElkJ11cbiAgfVxufVxuIl19
|
|
@@ -2,7 +2,8 @@ import { instanceToPlain, plainToInstance } from 'class-transformer';
|
|
|
2
2
|
export class BaseModel {
|
|
3
3
|
get identifier() {
|
|
4
4
|
const fields = this.constructor.identifiersFields.filter((field) => field !== 'identifier');
|
|
5
|
-
|
|
5
|
+
const data = this;
|
|
6
|
+
return fields.reduce((object, field) => (Object.assign(Object.assign({}, object), { [field]: data[field] })), {});
|
|
6
7
|
}
|
|
7
8
|
get identifiersFields() {
|
|
8
9
|
return this.constructor.identifiersFields;
|
|
@@ -20,4 +21,4 @@ export class BaseModel {
|
|
|
20
21
|
return instanceToPlain(this);
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS5tb2RlbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Nvbm5lY3Qvc3JjL2RvbWFpbi9nZW5lcmljL21vZGVsL2Jhc2UubW9kZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGVBQWUsRUFBRSxlQUFlLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQTtBQVVwRSxNQUFNLE9BQU8sU0FBUztJQUdwQixJQUFJLFVBQVU7UUFDWixNQUFNLE1BQU0sR0FBSSxJQUFJLENBQUMsV0FBdUMsQ0FBQyxpQkFBaUIsQ0FBQyxNQUFNLENBQ25GLENBQUMsS0FBSyxFQUFFLEVBQUUsQ0FBQyxLQUFLLEtBQUssWUFBWSxDQUNsQyxDQUFBO1FBQ0QsTUFBTSxJQUFJLEdBQXdCLElBQUksQ0FBQTtRQUV0QyxPQUFPLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQyxNQUFNLEVBQUUsS0FBSyxFQUFFLEVBQUUsQ0FBQyxpQ0FBTSxNQUFNLEtBQUUsQ0FBQyxLQUFLLENBQUMsRUFBRSxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUcsRUFBRSxFQUFFLENBQUMsQ0FBQTtJQUNwRixDQUFDO0lBRUQsSUFBSSxpQkFBaUI7UUFDbkIsT0FBUSxJQUFJLENBQUMsV0FBb0QsQ0FBQyxpQkFBaUIsQ0FBQTtJQUNyRixDQUFDO0lBRUQsWUFBWSxJQUFxQjtRQUMvQixNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxJQUFJ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