@infrab4a/connect 5.4.0-beta.6 → 5.4.0-beta.7
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 +4 -13
- package/index.esm.js +4 -13
- package/package.json +1 -1
- package/src/domain/catalog/models/product-base.d.ts +1 -0
- package/src/domain/catalog/models/variant.d.ts +0 -1
- package/src/domain/shopping/models/order.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts +0 -1
package/index.cjs.js
CHANGED
|
@@ -7384,6 +7384,7 @@ const commonFields$1 = [
|
|
|
7384
7384
|
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7385
7385
|
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
7386
7386
|
{ showVariants: { columnName: 'show_variants' } },
|
|
7387
|
+
{ variantSlug: { columnName: 'variant_slug' } },
|
|
7387
7388
|
];
|
|
7388
7389
|
class ProductCatalogHasuraGraphQLRepository extends withFindHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
7389
7390
|
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
@@ -7712,6 +7713,7 @@ const commonFields = [
|
|
|
7712
7713
|
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7713
7714
|
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
7714
7715
|
{ showVariants: { columnName: 'show_variants' } },
|
|
7716
|
+
{ variantSlug: { columnName: 'variant_slug' } },
|
|
7715
7717
|
];
|
|
7716
7718
|
const fieldsConfiguration$2 = [
|
|
7717
7719
|
...commonFields,
|
|
@@ -7967,7 +7969,8 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
7967
7969
|
? (await this.find({ filters: { firestoreId: identifiers.id }, options: { enableCount: false } }, options))
|
|
7968
7970
|
.data?.[0]
|
|
7969
7971
|
: await super.get(identifiers, options);
|
|
7970
|
-
|
|
7972
|
+
if (product.productId)
|
|
7973
|
+
throw new NotFoundError('Product not found, it is a variant');
|
|
7971
7974
|
product.reviews =
|
|
7972
7975
|
product.reviews ||
|
|
7973
7976
|
(await this.findReviewsByProduct(product.productId ? +product.productId : +product.id, false, options));
|
|
@@ -8041,18 +8044,6 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8041
8044
|
}
|
|
8042
8045
|
return product;
|
|
8043
8046
|
}
|
|
8044
|
-
async getBySlugVariantData(product) {
|
|
8045
|
-
if (!product.reviews.length && product.rate > 0) {
|
|
8046
|
-
product.reviews = await this.findReviewsByProduct((product.productId ? product.productId : product.id), true);
|
|
8047
|
-
}
|
|
8048
|
-
// if (!product.metadata) {
|
|
8049
|
-
// product.metadata = await this.findReviewsByProduct(
|
|
8050
|
-
// (product.productId ? product.productId : product.id) as number,
|
|
8051
|
-
// true,
|
|
8052
|
-
// )
|
|
8053
|
-
// }
|
|
8054
|
-
return product;
|
|
8055
|
-
}
|
|
8056
8047
|
async getByEAN(EAN, options) {
|
|
8057
8048
|
if (this.cache?.cacheAdapter && options?.cache?.enabled) {
|
|
8058
8049
|
const cacheKey = `${this.model.name.toLowerCase()}:EAN:${EAN}`;
|
package/index.esm.js
CHANGED
|
@@ -7360,6 +7360,7 @@ const commonFields$1 = [
|
|
|
7360
7360
|
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7361
7361
|
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
7362
7362
|
{ showVariants: { columnName: 'show_variants' } },
|
|
7363
|
+
{ variantSlug: { columnName: 'variant_slug' } },
|
|
7363
7364
|
];
|
|
7364
7365
|
class ProductCatalogHasuraGraphQLRepository extends withFindHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
7365
7366
|
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
@@ -7688,6 +7689,7 @@ const commonFields = [
|
|
|
7688
7689
|
{ tagsProfile: { columnName: 'tags_profile', type: HasuraGraphQLColumnType.Jsonb } },
|
|
7689
7690
|
{ daysOfUse: { columnName: 'days_of_use' } },
|
|
7690
7691
|
{ showVariants: { columnName: 'show_variants' } },
|
|
7692
|
+
{ variantSlug: { columnName: 'variant_slug' } },
|
|
7691
7693
|
];
|
|
7692
7694
|
const fieldsConfiguration$2 = [
|
|
7693
7695
|
...commonFields,
|
|
@@ -7943,7 +7945,8 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
7943
7945
|
? (await this.find({ filters: { firestoreId: identifiers.id }, options: { enableCount: false } }, options))
|
|
7944
7946
|
.data?.[0]
|
|
7945
7947
|
: await super.get(identifiers, options);
|
|
7946
|
-
|
|
7948
|
+
if (product.productId)
|
|
7949
|
+
throw new NotFoundError('Product not found, it is a variant');
|
|
7947
7950
|
product.reviews =
|
|
7948
7951
|
product.reviews ||
|
|
7949
7952
|
(await this.findReviewsByProduct(product.productId ? +product.productId : +product.id, false, options));
|
|
@@ -8017,18 +8020,6 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8017
8020
|
}
|
|
8018
8021
|
return product;
|
|
8019
8022
|
}
|
|
8020
|
-
async getBySlugVariantData(product) {
|
|
8021
|
-
if (!product.reviews.length && product.rate > 0) {
|
|
8022
|
-
product.reviews = await this.findReviewsByProduct((product.productId ? product.productId : product.id), true);
|
|
8023
|
-
}
|
|
8024
|
-
// if (!product.metadata) {
|
|
8025
|
-
// product.metadata = await this.findReviewsByProduct(
|
|
8026
|
-
// (product.productId ? product.productId : product.id) as number,
|
|
8027
|
-
// true,
|
|
8028
|
-
// )
|
|
8029
|
-
// }
|
|
8030
|
-
return product;
|
|
8031
|
-
}
|
|
8032
8023
|
async getByEAN(EAN, options) {
|
|
8033
8024
|
if (this.cache?.cacheAdapter && options?.cache?.enabled) {
|
|
8034
8025
|
const cacheKey = `${this.model.name.toLowerCase()}:EAN:${EAN}`;
|
package/package.json
CHANGED
|
@@ -4,6 +4,5 @@ export type ProductVariantIdentifiers = 'id' | 'productId';
|
|
|
4
4
|
export declare class Variant extends ProductBase<Variant, ProductVariantIdentifiers> {
|
|
5
5
|
productId: string;
|
|
6
6
|
grade?: VariantGrade[];
|
|
7
|
-
variantSlug?: string;
|
|
8
7
|
static get identifiersFields(): ProductVariantIdentifiers[];
|
|
9
8
|
}
|
package/src/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ export declare class ProductHasuraGraphQLRepository extends ProductHasuraGraphQL
|
|
|
15
15
|
getBySlug(slug: string, options?: {
|
|
16
16
|
cache?: RepositoryCacheOptions;
|
|
17
17
|
}): Promise<ProductHasuraGraphQL>;
|
|
18
|
-
private getBySlugVariantData;
|
|
19
18
|
getByEAN(EAN: string, options?: {
|
|
20
19
|
cache?: RepositoryCacheOptions;
|
|
21
20
|
}): Promise<ProductHasuraGraphQL>;
|