@infrab4a/connect 5.4.0 → 5.5.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/index.cjs.js +592 -24
- package/index.esm.js +591 -25
- package/package.json +1 -1
- package/src/domain/catalog/models/product-base.d.ts +1 -0
- package/src/domain/catalog/models/product-review.d.ts +2 -0
- package/src/domain/catalog/models/product.d.ts +1 -0
- package/src/domain/catalog/repositories/index.d.ts +1 -0
- package/src/domain/catalog/repositories/product-catalog.repository.d.ts +17 -0
- package/src/domain/shopping/models/order.d.ts +1 -1
- package/src/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +1 -1
- package/src/infra/hasura-graphql/models/index.d.ts +1 -0
- package/src/infra/hasura-graphql/models/product-catalog-hasura-graphql.d.ts +16 -0
- package/src/infra/hasura-graphql/models/variant-hasura-graphql.d.ts +7 -0
- package/src/infra/hasura-graphql/repositories/catalog/index.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/product-catalog-hasura-graphql.repository.d.ts +22 -0
- package/src/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
2
|
import { Shops } from './enums';
|
|
3
|
+
import type { Product } from './product';
|
|
3
4
|
export declare class ProductReview extends BaseModel<ProductReview> {
|
|
4
5
|
id: number;
|
|
5
6
|
productId: string;
|
|
@@ -16,5 +17,6 @@ export declare class ProductReview extends BaseModel<ProductReview> {
|
|
|
16
17
|
orderId?: string;
|
|
17
18
|
createdAt?: Date;
|
|
18
19
|
updatedAt?: Date;
|
|
20
|
+
product: Product;
|
|
19
21
|
static get identifiersFields(): GenericIdentifier[];
|
|
20
22
|
}
|
|
@@ -6,6 +6,7 @@ export * from './category.repository';
|
|
|
6
6
|
export * from './filter-option.repository';
|
|
7
7
|
export * from './filter.repository';
|
|
8
8
|
export * from './group.repository';
|
|
9
|
+
export * from './product-catalog.repository';
|
|
9
10
|
export * from './product-errors.repository';
|
|
10
11
|
export * from './product-reviews.repository';
|
|
11
12
|
export * from './product-stock-notification.repository';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ProductHasuraGraphQL } from '../../../infra';
|
|
2
|
+
import { FindRepositoryParams, RepositoryCacheOptions, RepositoryFindResult } from '../../generic';
|
|
3
|
+
import { Product, ProductGender } from '../models';
|
|
4
|
+
export interface ProductCatalogRepository {
|
|
5
|
+
get({ id }: {
|
|
6
|
+
id: string;
|
|
7
|
+
}): Promise<Product>;
|
|
8
|
+
find(params?: FindRepositoryParams<ProductHasuraGraphQL>, optionsParams?: {
|
|
9
|
+
cache?: RepositoryCacheOptions;
|
|
10
|
+
}): Promise<RepositoryFindResult<ProductHasuraGraphQL>>;
|
|
11
|
+
getByEAN(EAN: string, options?: {
|
|
12
|
+
cache?: RepositoryCacheOptions;
|
|
13
|
+
}): Promise<Product>;
|
|
14
|
+
findCatalog(params: FindRepositoryParams<Product>, mainGender?: Extract<ProductGender, 'female' | 'male' | 'unisex'>, options?: {
|
|
15
|
+
cache?: RepositoryCacheOptions;
|
|
16
|
+
}): Promise<RepositoryFindResult<Product>>;
|
|
17
|
+
}
|
|
@@ -11,10 +11,10 @@ export declare class Order extends Checkout {
|
|
|
11
11
|
deliveredAt?: string;
|
|
12
12
|
trackingEvents?: OrderTrackingEvent[];
|
|
13
13
|
payment: PaymentTransaction;
|
|
14
|
+
pedidov?: number;
|
|
14
15
|
reshipmentOrderId?: string;
|
|
15
16
|
isChange?: boolean;
|
|
16
17
|
isReshipment?: boolean;
|
|
17
|
-
pedidov?: number;
|
|
18
18
|
metadata?: {
|
|
19
19
|
ip?: string;
|
|
20
20
|
userAgent?: string;
|
|
@@ -5,7 +5,7 @@ import { FirestoreRepository, FirestoreSubRepository } from '../types';
|
|
|
5
5
|
export declare const withHelpers: <TMixinBase extends MixinCtor<any, any[]> = MixinCtor<any, any[]>>(MixinBase: MixinCtor<any, any[]> & TMixinBase) => {
|
|
6
6
|
new (...args: any[]): {
|
|
7
7
|
[x: string]: any;
|
|
8
|
-
toArray<T extends ModelBaseStructure<T, T["identifiersFields"][number]>>(snapShot: QuerySnapshot<T> | QueryDocumentSnapshot<T>[]): T[];
|
|
8
|
+
toArray<T extends ModelBaseStructure<T, T["identifiersFields"][number]>>(snapShot: QuerySnapshot<T, import("firebase/firestore").DocumentData> | QueryDocumentSnapshot<T, import("firebase/firestore").DocumentData>[]): T[];
|
|
9
9
|
isSubCollection<T_1 extends ModelBaseStructure<T_1, T_1["identifiersFields"][number]>, E extends ModelBaseStructure<E, E["identifiersFields"][number]>>(repository: FirestoreRepository<T_1> | FirestoreSubRepository<T_1, E>): repository is FirestoreSubRepository<T_1, E>;
|
|
10
10
|
};
|
|
11
11
|
} & TMixinBase;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './category-hasura-graphql';
|
|
2
2
|
export * from './kit-product-hasura-graphql';
|
|
3
|
+
export * from './product-catalog-hasura-graphql';
|
|
3
4
|
export * from './product-errors-hasura-graphql';
|
|
4
5
|
export * from './product-hasura-graphql';
|
|
5
6
|
export * from './variant-hasura-graphql';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Product } from '../../../domain';
|
|
2
|
+
export declare class ProductCatalogHasuraGraphQL extends Product {
|
|
3
|
+
firestoreId?: string;
|
|
4
|
+
fullPrice?: number;
|
|
5
|
+
subscriberDiscountPercentage?: number;
|
|
6
|
+
subscriberPrice?: number;
|
|
7
|
+
productId?: number;
|
|
8
|
+
differentials?: string;
|
|
9
|
+
whoMustUse?: string;
|
|
10
|
+
howToUse?: string;
|
|
11
|
+
brandDescription?: string;
|
|
12
|
+
categoryId?: number;
|
|
13
|
+
ingredients?: string;
|
|
14
|
+
hasStock?: boolean;
|
|
15
|
+
intGender?: number;
|
|
16
|
+
}
|
|
@@ -5,4 +5,11 @@ export declare class VariantHasuraGraphQL extends Variant {
|
|
|
5
5
|
subscriberDiscountPercentage?: number;
|
|
6
6
|
subscriberPrice?: number;
|
|
7
7
|
hasStock?: boolean;
|
|
8
|
+
differentials?: string;
|
|
9
|
+
whoMustUse?: string;
|
|
10
|
+
howToUse?: string;
|
|
11
|
+
brandDescription?: string;
|
|
12
|
+
categoryId?: number;
|
|
13
|
+
ingredients?: string;
|
|
14
|
+
intGender?: number;
|
|
8
15
|
}
|
|
@@ -4,6 +4,7 @@ export * from './category-hasura-graphql.repository';
|
|
|
4
4
|
export * from './category-product-hasura-graphql.repository';
|
|
5
5
|
export * from './filter-hasura-graphql.repository';
|
|
6
6
|
export * from './filter-option-hasura-graphql.repository';
|
|
7
|
+
export * from './product-catalog-hasura-graphql.repository';
|
|
7
8
|
export * from './product-errors-hasura-graphql.repository';
|
|
8
9
|
export * from './product-hasura-graphql.repository';
|
|
9
10
|
export * from './product-review-hasura-graphql.repository';
|
package/src/infra/hasura-graphql/repositories/catalog/product-catalog-hasura-graphql.repository.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FindRepositoryParams, Product, ProductCatalogRepository, ProductGender, RepositoryCacheOptions, RepositoryFindResult } from '../../../../domain';
|
|
2
|
+
import { HasuraConstructorParams } from '../../mixins';
|
|
3
|
+
import { ProductCatalogHasuraGraphQL, ProductHasuraGraphQL } from '../../models';
|
|
4
|
+
declare const ProductCatalogHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("../../types").GraphQLRepository<ProductCatalogHasuraGraphQL> & import("../../../../domain").FindRepository<ProductCatalogHasuraGraphQL, FindRepositoryParams<ProductCatalogHasuraGraphQL>>, any[]>;
|
|
5
|
+
export declare class ProductCatalogHasuraGraphQLRepository extends ProductCatalogHasuraGraphQLRepository_base implements ProductCatalogRepository {
|
|
6
|
+
constructor({ endpoint, authOptions, interceptors, cache, }: Pick<HasuraConstructorParams<ProductCatalogHasuraGraphQL>, 'endpoint' | 'authOptions' | 'interceptors' | 'cache'>);
|
|
7
|
+
get({ id }: {
|
|
8
|
+
id: string;
|
|
9
|
+
}, options?: {
|
|
10
|
+
cache?: RepositoryCacheOptions;
|
|
11
|
+
}): Promise<Product>;
|
|
12
|
+
getByEAN(EAN: string, options?: {
|
|
13
|
+
cache?: RepositoryCacheOptions;
|
|
14
|
+
}): Promise<Product>;
|
|
15
|
+
find(params?: FindRepositoryParams<ProductHasuraGraphQL>, optionsParams?: {
|
|
16
|
+
cache?: RepositoryCacheOptions;
|
|
17
|
+
}): Promise<RepositoryFindResult<ProductHasuraGraphQL>>;
|
|
18
|
+
findCatalog(params: FindRepositoryParams<ProductHasuraGraphQL>, mainGender?: Extract<ProductGender, 'female' | 'male'>, options?: {
|
|
19
|
+
cache?: RepositoryCacheOptions;
|
|
20
|
+
}): Promise<RepositoryFindResult<ProductHasuraGraphQL>>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
package/src/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare class VariantHasuraGraphQLRepository extends VariantHasuraGraphQL
|
|
|
8
8
|
find(params?: FindRepositoryParams<VariantHasuraGraphQL>): Promise<RepositoryFindResult<VariantHasuraGraphQL>>;
|
|
9
9
|
getByEAN(EAN: string): Promise<VariantHasuraGraphQL>;
|
|
10
10
|
update(params: UpdateRepositoryParams<VariantHasuraGraphQL>): Promise<VariantHasuraGraphQL>;
|
|
11
|
+
private updateMetadata;
|
|
11
12
|
private getId;
|
|
12
13
|
}
|
|
13
14
|
export {};
|