@infrab4a/connect 5.4.0-beta.7 → 5.4.0-beta.9
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 +108 -11
- package/index.esm.js +108 -12
- package/package.json +1 -1
- package/src/domain/catalog/repositories/product-catalog.repository.d.ts +4 -0
- 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/repositories/catalog/product-catalog-hasura-graphql.repository.d.ts +5 -3
package/index.cjs.js
CHANGED
|
@@ -5851,6 +5851,9 @@ tslib.__decorate([
|
|
|
5851
5851
|
tslib.__metadata("design:type", Product)
|
|
5852
5852
|
], KitProductHasuraGraphQL.prototype, "product", void 0);
|
|
5853
5853
|
|
|
5854
|
+
class ProductCatalogHasuraGraphQL extends Product {
|
|
5855
|
+
}
|
|
5856
|
+
|
|
5854
5857
|
class ProductHasuraGraphQL extends Product {
|
|
5855
5858
|
}
|
|
5856
5859
|
tslib.__decorate([
|
|
@@ -7390,7 +7393,7 @@ class ProductCatalogHasuraGraphQLRepository extends withFindHasuraGraphQL(withHa
|
|
|
7390
7393
|
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
7391
7394
|
super({
|
|
7392
7395
|
tableName: 'product_catalog',
|
|
7393
|
-
model:
|
|
7396
|
+
model: ProductCatalogHasuraGraphQL,
|
|
7394
7397
|
endpoint,
|
|
7395
7398
|
authOptions,
|
|
7396
7399
|
interceptors,
|
|
@@ -7398,8 +7401,16 @@ class ProductCatalogHasuraGraphQLRepository extends withFindHasuraGraphQL(withHa
|
|
|
7398
7401
|
cache,
|
|
7399
7402
|
});
|
|
7400
7403
|
}
|
|
7401
|
-
async get({ id }) {
|
|
7402
|
-
|
|
7404
|
+
async get({ id }, options) {
|
|
7405
|
+
if (this.cache?.cacheAdapter && options?.cache?.enabled) {
|
|
7406
|
+
const cacheKey = `${this.model.name.toLowerCase()}:id:${id}`;
|
|
7407
|
+
const cachedData = await this.cache.cacheAdapter.get(cacheKey);
|
|
7408
|
+
if (cachedData) {
|
|
7409
|
+
this.logger.log(`Dados recuperados do cache: ${cacheKey}`);
|
|
7410
|
+
return this.model.toInstance(deserialize(cachedData));
|
|
7411
|
+
}
|
|
7412
|
+
}
|
|
7413
|
+
const product = await super
|
|
7403
7414
|
.find({
|
|
7404
7415
|
filters: {
|
|
7405
7416
|
id,
|
|
@@ -7409,9 +7420,29 @@ class ProductCatalogHasuraGraphQLRepository extends withFindHasuraGraphQL(withHa
|
|
|
7409
7420
|
},
|
|
7410
7421
|
})
|
|
7411
7422
|
.then((res) => res.data.at(0));
|
|
7423
|
+
if (!product)
|
|
7424
|
+
throw new NotFoundError(`Product not found`);
|
|
7425
|
+
if (this.cache?.cacheAdapter && options?.cache?.enabled && product) {
|
|
7426
|
+
const cacheKey = `${this.model.name.toLowerCase()}:id:${id}`;
|
|
7427
|
+
await this.cache.cacheAdapter.set({
|
|
7428
|
+
key: cacheKey,
|
|
7429
|
+
data: serialize(product),
|
|
7430
|
+
expirationInSeconds: options?.cache?.ttl || this.cache.ttlDefault,
|
|
7431
|
+
});
|
|
7432
|
+
this.logger.log(`Dados salvos no cache: ${cacheKey}`);
|
|
7433
|
+
}
|
|
7434
|
+
return product;
|
|
7412
7435
|
}
|
|
7413
7436
|
async getByEAN(EAN, options) {
|
|
7414
|
-
|
|
7437
|
+
if (this.cache?.cacheAdapter && options?.cache?.enabled) {
|
|
7438
|
+
const cacheKey = `${this.model.name.toLowerCase()}:EAN:${EAN}`;
|
|
7439
|
+
const cachedData = await this.cache.cacheAdapter.get(cacheKey);
|
|
7440
|
+
if (cachedData) {
|
|
7441
|
+
this.logger.log(`Dados recuperados do cache: ${cacheKey}`);
|
|
7442
|
+
return this.model.toInstance(deserialize(cachedData));
|
|
7443
|
+
}
|
|
7444
|
+
}
|
|
7445
|
+
const product = await super
|
|
7415
7446
|
.find({
|
|
7416
7447
|
filters: {
|
|
7417
7448
|
EAN,
|
|
@@ -7421,6 +7452,19 @@ class ProductCatalogHasuraGraphQLRepository extends withFindHasuraGraphQL(withHa
|
|
|
7421
7452
|
},
|
|
7422
7453
|
})
|
|
7423
7454
|
.then((res) => res.data.at(0));
|
|
7455
|
+
if (!product)
|
|
7456
|
+
return null;
|
|
7457
|
+
RoundProductPricesHelper.roundProductPrices(product);
|
|
7458
|
+
if (this.cache?.cacheAdapter && options?.cache?.enabled && product) {
|
|
7459
|
+
const cacheKey = `${this.model.name.toLowerCase()}:EAN:${EAN}`;
|
|
7460
|
+
await this.cache.cacheAdapter.set({
|
|
7461
|
+
key: cacheKey,
|
|
7462
|
+
data: serialize(product),
|
|
7463
|
+
expirationInSeconds: options?.cache?.ttl || this.cache.ttlDefault,
|
|
7464
|
+
});
|
|
7465
|
+
this.logger.log(`Dados salvos no cache: ${cacheKey}`);
|
|
7466
|
+
}
|
|
7467
|
+
return product;
|
|
7424
7468
|
}
|
|
7425
7469
|
async find(params, optionsParams) {
|
|
7426
7470
|
const { filters, fields, ...options } = params || {};
|
|
@@ -7906,6 +7950,28 @@ const fieldsConfiguration$2 = [
|
|
|
7906
7950
|
{ tagsProfile: { columnName: 'tags_profile' } },
|
|
7907
7951
|
{ tagsCollection: { columnName: 'tags_collection' } },
|
|
7908
7952
|
{ variantSlug: { columnName: 'variant_slug' } },
|
|
7953
|
+
{
|
|
7954
|
+
reviews: {
|
|
7955
|
+
columnName: 'reviews',
|
|
7956
|
+
foreignKeyColumn: { product_id: 'id' },
|
|
7957
|
+
fields: [
|
|
7958
|
+
'id',
|
|
7959
|
+
'shop',
|
|
7960
|
+
'rate',
|
|
7961
|
+
'author',
|
|
7962
|
+
'email',
|
|
7963
|
+
'location',
|
|
7964
|
+
'review',
|
|
7965
|
+
'status',
|
|
7966
|
+
'title',
|
|
7967
|
+
{ personId: { columnName: 'person_id' } },
|
|
7968
|
+
'points',
|
|
7969
|
+
{ orderId: { columnName: 'order_id' } },
|
|
7970
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
7971
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
7972
|
+
],
|
|
7973
|
+
},
|
|
7974
|
+
},
|
|
7909
7975
|
],
|
|
7910
7976
|
},
|
|
7911
7977
|
},
|
|
@@ -7971,9 +8037,12 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
7971
8037
|
: await super.get(identifiers, options);
|
|
7972
8038
|
if (product.productId)
|
|
7973
8039
|
throw new NotFoundError('Product not found, it is a variant');
|
|
7974
|
-
product.reviews =
|
|
7975
|
-
|
|
7976
|
-
|
|
8040
|
+
product.reviews = product.reviews || (await this.findReviewsByProduct(+product.id, false, options));
|
|
8041
|
+
if (!product.variants?.length) {
|
|
8042
|
+
for (const [index, variant] of product.variants.entries()) {
|
|
8043
|
+
product.variants[index].reviews = await this.findReviewsByProduct(+variant.id, true);
|
|
8044
|
+
}
|
|
8045
|
+
}
|
|
7977
8046
|
return product;
|
|
7978
8047
|
}
|
|
7979
8048
|
async find(params, optionsParams) {
|
|
@@ -7991,8 +8060,6 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
7991
8060
|
return super.find({
|
|
7992
8061
|
...options,
|
|
7993
8062
|
filters: { ...filters },
|
|
7994
|
-
// filters: { ...filters, hasVariants: { operator: Where.EQUALS, value: false } },
|
|
7995
|
-
// filters: { ...filters, productId: { operator: Where.ISNULL } },
|
|
7996
8063
|
fields: [
|
|
7997
8064
|
...bindFields,
|
|
7998
8065
|
...(bindFields.includes('price')
|
|
@@ -8029,8 +8096,10 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8029
8096
|
if (!result.data.length)
|
|
8030
8097
|
return null;
|
|
8031
8098
|
const product = result?.data?.shift();
|
|
8032
|
-
if (!product.
|
|
8033
|
-
|
|
8099
|
+
if (!product.variants?.length) {
|
|
8100
|
+
for (const [index, variant] of product.variants.entries()) {
|
|
8101
|
+
product.variants[index].reviews = await this.findReviewsByProduct(+variant.id, true);
|
|
8102
|
+
}
|
|
8034
8103
|
}
|
|
8035
8104
|
RoundProductPricesHelper.roundProductPrices(product);
|
|
8036
8105
|
if (this.cache?.cacheAdapter && options?.cache?.enabled && product) {
|
|
@@ -8251,6 +8320,11 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8251
8320
|
type: 'product_review_bool_exp',
|
|
8252
8321
|
required: true,
|
|
8253
8322
|
},
|
|
8323
|
+
order_by: {
|
|
8324
|
+
type: '[product_review_order_by]',
|
|
8325
|
+
value: [{ createdAt: 'desc' }],
|
|
8326
|
+
required: true,
|
|
8327
|
+
},
|
|
8254
8328
|
});
|
|
8255
8329
|
const reviews = data?.map((review) => this.bindReviewToModel(review));
|
|
8256
8330
|
if (this.cache?.cacheAdapter && options?.cache?.enabled && reviews) {
|
|
@@ -8678,6 +8752,28 @@ const fieldsConfiguration$1 = [
|
|
|
8678
8752
|
}),
|
|
8679
8753
|
},
|
|
8680
8754
|
},
|
|
8755
|
+
{
|
|
8756
|
+
reviews: {
|
|
8757
|
+
columnName: 'reviews',
|
|
8758
|
+
foreignKeyColumn: { product_id: 'id' },
|
|
8759
|
+
fields: [
|
|
8760
|
+
'id',
|
|
8761
|
+
'shop',
|
|
8762
|
+
'rate',
|
|
8763
|
+
'author',
|
|
8764
|
+
'email',
|
|
8765
|
+
'location',
|
|
8766
|
+
'review',
|
|
8767
|
+
'status',
|
|
8768
|
+
'title',
|
|
8769
|
+
{ personId: { columnName: 'person_id' } },
|
|
8770
|
+
'points',
|
|
8771
|
+
{ orderId: { columnName: 'order_id' } },
|
|
8772
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
8773
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
8774
|
+
],
|
|
8775
|
+
},
|
|
8776
|
+
},
|
|
8681
8777
|
{ variantSlug: { columnName: 'variant_slug' } },
|
|
8682
8778
|
{ createdAt: { columnName: 'created_at' } },
|
|
8683
8779
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
@@ -10303,6 +10399,7 @@ exports.PaymentFirestoreRepository = PaymentFirestoreRepository;
|
|
|
10303
10399
|
exports.PaymentProviderFactory = PaymentProviderFactory;
|
|
10304
10400
|
exports.PaymentTransaction = PaymentTransaction;
|
|
10305
10401
|
exports.Product = Product;
|
|
10402
|
+
exports.ProductCatalogHasuraGraphQL = ProductCatalogHasuraGraphQL;
|
|
10306
10403
|
exports.ProductCatalogHasuraGraphQLRepository = ProductCatalogHasuraGraphQLRepository;
|
|
10307
10404
|
exports.ProductErrors = ProductErrors;
|
|
10308
10405
|
exports.ProductErrorsHasuraGraphQL = ProductErrorsHasuraGraphQL;
|
package/index.esm.js
CHANGED
|
@@ -5827,6 +5827,9 @@ __decorate([
|
|
|
5827
5827
|
__metadata("design:type", Product)
|
|
5828
5828
|
], KitProductHasuraGraphQL.prototype, "product", void 0);
|
|
5829
5829
|
|
|
5830
|
+
class ProductCatalogHasuraGraphQL extends Product {
|
|
5831
|
+
}
|
|
5832
|
+
|
|
5830
5833
|
class ProductHasuraGraphQL extends Product {
|
|
5831
5834
|
}
|
|
5832
5835
|
__decorate([
|
|
@@ -7366,7 +7369,7 @@ class ProductCatalogHasuraGraphQLRepository extends withFindHasuraGraphQL(withHa
|
|
|
7366
7369
|
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
7367
7370
|
super({
|
|
7368
7371
|
tableName: 'product_catalog',
|
|
7369
|
-
model:
|
|
7372
|
+
model: ProductCatalogHasuraGraphQL,
|
|
7370
7373
|
endpoint,
|
|
7371
7374
|
authOptions,
|
|
7372
7375
|
interceptors,
|
|
@@ -7374,8 +7377,16 @@ class ProductCatalogHasuraGraphQLRepository extends withFindHasuraGraphQL(withHa
|
|
|
7374
7377
|
cache,
|
|
7375
7378
|
});
|
|
7376
7379
|
}
|
|
7377
|
-
async get({ id }) {
|
|
7378
|
-
|
|
7380
|
+
async get({ id }, options) {
|
|
7381
|
+
if (this.cache?.cacheAdapter && options?.cache?.enabled) {
|
|
7382
|
+
const cacheKey = `${this.model.name.toLowerCase()}:id:${id}`;
|
|
7383
|
+
const cachedData = await this.cache.cacheAdapter.get(cacheKey);
|
|
7384
|
+
if (cachedData) {
|
|
7385
|
+
this.logger.log(`Dados recuperados do cache: ${cacheKey}`);
|
|
7386
|
+
return this.model.toInstance(deserialize(cachedData));
|
|
7387
|
+
}
|
|
7388
|
+
}
|
|
7389
|
+
const product = await super
|
|
7379
7390
|
.find({
|
|
7380
7391
|
filters: {
|
|
7381
7392
|
id,
|
|
@@ -7385,9 +7396,29 @@ class ProductCatalogHasuraGraphQLRepository extends withFindHasuraGraphQL(withHa
|
|
|
7385
7396
|
},
|
|
7386
7397
|
})
|
|
7387
7398
|
.then((res) => res.data.at(0));
|
|
7399
|
+
if (!product)
|
|
7400
|
+
throw new NotFoundError(`Product not found`);
|
|
7401
|
+
if (this.cache?.cacheAdapter && options?.cache?.enabled && product) {
|
|
7402
|
+
const cacheKey = `${this.model.name.toLowerCase()}:id:${id}`;
|
|
7403
|
+
await this.cache.cacheAdapter.set({
|
|
7404
|
+
key: cacheKey,
|
|
7405
|
+
data: serialize(product),
|
|
7406
|
+
expirationInSeconds: options?.cache?.ttl || this.cache.ttlDefault,
|
|
7407
|
+
});
|
|
7408
|
+
this.logger.log(`Dados salvos no cache: ${cacheKey}`);
|
|
7409
|
+
}
|
|
7410
|
+
return product;
|
|
7388
7411
|
}
|
|
7389
7412
|
async getByEAN(EAN, options) {
|
|
7390
|
-
|
|
7413
|
+
if (this.cache?.cacheAdapter && options?.cache?.enabled) {
|
|
7414
|
+
const cacheKey = `${this.model.name.toLowerCase()}:EAN:${EAN}`;
|
|
7415
|
+
const cachedData = await this.cache.cacheAdapter.get(cacheKey);
|
|
7416
|
+
if (cachedData) {
|
|
7417
|
+
this.logger.log(`Dados recuperados do cache: ${cacheKey}`);
|
|
7418
|
+
return this.model.toInstance(deserialize(cachedData));
|
|
7419
|
+
}
|
|
7420
|
+
}
|
|
7421
|
+
const product = await super
|
|
7391
7422
|
.find({
|
|
7392
7423
|
filters: {
|
|
7393
7424
|
EAN,
|
|
@@ -7397,6 +7428,19 @@ class ProductCatalogHasuraGraphQLRepository extends withFindHasuraGraphQL(withHa
|
|
|
7397
7428
|
},
|
|
7398
7429
|
})
|
|
7399
7430
|
.then((res) => res.data.at(0));
|
|
7431
|
+
if (!product)
|
|
7432
|
+
return null;
|
|
7433
|
+
RoundProductPricesHelper.roundProductPrices(product);
|
|
7434
|
+
if (this.cache?.cacheAdapter && options?.cache?.enabled && product) {
|
|
7435
|
+
const cacheKey = `${this.model.name.toLowerCase()}:EAN:${EAN}`;
|
|
7436
|
+
await this.cache.cacheAdapter.set({
|
|
7437
|
+
key: cacheKey,
|
|
7438
|
+
data: serialize(product),
|
|
7439
|
+
expirationInSeconds: options?.cache?.ttl || this.cache.ttlDefault,
|
|
7440
|
+
});
|
|
7441
|
+
this.logger.log(`Dados salvos no cache: ${cacheKey}`);
|
|
7442
|
+
}
|
|
7443
|
+
return product;
|
|
7400
7444
|
}
|
|
7401
7445
|
async find(params, optionsParams) {
|
|
7402
7446
|
const { filters, fields, ...options } = params || {};
|
|
@@ -7882,6 +7926,28 @@ const fieldsConfiguration$2 = [
|
|
|
7882
7926
|
{ tagsProfile: { columnName: 'tags_profile' } },
|
|
7883
7927
|
{ tagsCollection: { columnName: 'tags_collection' } },
|
|
7884
7928
|
{ variantSlug: { columnName: 'variant_slug' } },
|
|
7929
|
+
{
|
|
7930
|
+
reviews: {
|
|
7931
|
+
columnName: 'reviews',
|
|
7932
|
+
foreignKeyColumn: { product_id: 'id' },
|
|
7933
|
+
fields: [
|
|
7934
|
+
'id',
|
|
7935
|
+
'shop',
|
|
7936
|
+
'rate',
|
|
7937
|
+
'author',
|
|
7938
|
+
'email',
|
|
7939
|
+
'location',
|
|
7940
|
+
'review',
|
|
7941
|
+
'status',
|
|
7942
|
+
'title',
|
|
7943
|
+
{ personId: { columnName: 'person_id' } },
|
|
7944
|
+
'points',
|
|
7945
|
+
{ orderId: { columnName: 'order_id' } },
|
|
7946
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
7947
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
7948
|
+
],
|
|
7949
|
+
},
|
|
7950
|
+
},
|
|
7885
7951
|
],
|
|
7886
7952
|
},
|
|
7887
7953
|
},
|
|
@@ -7947,9 +8013,12 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
7947
8013
|
: await super.get(identifiers, options);
|
|
7948
8014
|
if (product.productId)
|
|
7949
8015
|
throw new NotFoundError('Product not found, it is a variant');
|
|
7950
|
-
product.reviews =
|
|
7951
|
-
|
|
7952
|
-
|
|
8016
|
+
product.reviews = product.reviews || (await this.findReviewsByProduct(+product.id, false, options));
|
|
8017
|
+
if (!product.variants?.length) {
|
|
8018
|
+
for (const [index, variant] of product.variants.entries()) {
|
|
8019
|
+
product.variants[index].reviews = await this.findReviewsByProduct(+variant.id, true);
|
|
8020
|
+
}
|
|
8021
|
+
}
|
|
7953
8022
|
return product;
|
|
7954
8023
|
}
|
|
7955
8024
|
async find(params, optionsParams) {
|
|
@@ -7967,8 +8036,6 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
7967
8036
|
return super.find({
|
|
7968
8037
|
...options,
|
|
7969
8038
|
filters: { ...filters },
|
|
7970
|
-
// filters: { ...filters, hasVariants: { operator: Where.EQUALS, value: false } },
|
|
7971
|
-
// filters: { ...filters, productId: { operator: Where.ISNULL } },
|
|
7972
8039
|
fields: [
|
|
7973
8040
|
...bindFields,
|
|
7974
8041
|
...(bindFields.includes('price')
|
|
@@ -8005,8 +8072,10 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8005
8072
|
if (!result.data.length)
|
|
8006
8073
|
return null;
|
|
8007
8074
|
const product = result?.data?.shift();
|
|
8008
|
-
if (!product.
|
|
8009
|
-
|
|
8075
|
+
if (!product.variants?.length) {
|
|
8076
|
+
for (const [index, variant] of product.variants.entries()) {
|
|
8077
|
+
product.variants[index].reviews = await this.findReviewsByProduct(+variant.id, true);
|
|
8078
|
+
}
|
|
8010
8079
|
}
|
|
8011
8080
|
RoundProductPricesHelper.roundProductPrices(product);
|
|
8012
8081
|
if (this.cache?.cacheAdapter && options?.cache?.enabled && product) {
|
|
@@ -8227,6 +8296,11 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8227
8296
|
type: 'product_review_bool_exp',
|
|
8228
8297
|
required: true,
|
|
8229
8298
|
},
|
|
8299
|
+
order_by: {
|
|
8300
|
+
type: '[product_review_order_by]',
|
|
8301
|
+
value: [{ createdAt: 'desc' }],
|
|
8302
|
+
required: true,
|
|
8303
|
+
},
|
|
8230
8304
|
});
|
|
8231
8305
|
const reviews = data?.map((review) => this.bindReviewToModel(review));
|
|
8232
8306
|
if (this.cache?.cacheAdapter && options?.cache?.enabled && reviews) {
|
|
@@ -8654,6 +8728,28 @@ const fieldsConfiguration$1 = [
|
|
|
8654
8728
|
}),
|
|
8655
8729
|
},
|
|
8656
8730
|
},
|
|
8731
|
+
{
|
|
8732
|
+
reviews: {
|
|
8733
|
+
columnName: 'reviews',
|
|
8734
|
+
foreignKeyColumn: { product_id: 'id' },
|
|
8735
|
+
fields: [
|
|
8736
|
+
'id',
|
|
8737
|
+
'shop',
|
|
8738
|
+
'rate',
|
|
8739
|
+
'author',
|
|
8740
|
+
'email',
|
|
8741
|
+
'location',
|
|
8742
|
+
'review',
|
|
8743
|
+
'status',
|
|
8744
|
+
'title',
|
|
8745
|
+
{ personId: { columnName: 'person_id' } },
|
|
8746
|
+
'points',
|
|
8747
|
+
{ orderId: { columnName: 'order_id' } },
|
|
8748
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
8749
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
8750
|
+
],
|
|
8751
|
+
},
|
|
8752
|
+
},
|
|
8657
8753
|
{ variantSlug: { columnName: 'variant_slug' } },
|
|
8658
8754
|
{ createdAt: { columnName: 'created_at' } },
|
|
8659
8755
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
@@ -10055,4 +10151,4 @@ class ProductsVertexSearch {
|
|
|
10055
10151
|
}
|
|
10056
10152
|
}
|
|
10057
10153
|
|
|
10058
|
-
export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BrandEquityOptions, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, Group, GroupFirestoreRepository, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, NotFoundError, ObsEmitter, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderStatus, PagarMeV5OrderStatus, PagarMeV5PaymentStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, PagarmeV5BankSlipAxiosAdapter, PagarmeV5CardAxiosAdapter, PagarmeV5PixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product, ProductCatalogHasuraGraphQLRepository, ProductErrors, ProductErrorsHasuraGraphQL, ProductErrorsHasuraGraphQLRepository, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductLabelEnum, ProductReview, ProductReviewHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RestCacheAdapter, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, StockLimitError, StockOutError, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, TransactionPaymentMethods, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, deserialize, getClass, is, isDebuggable, isUUID, parseDateTime, registerClass, resolveClass, serialize, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
|
10154
|
+
export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BrandEquityOptions, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, Group, GroupFirestoreRepository, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, NotFoundError, ObsEmitter, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderStatus, PagarMeV5OrderStatus, PagarMeV5PaymentStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, PagarmeV5BankSlipAxiosAdapter, PagarmeV5CardAxiosAdapter, PagarmeV5PixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product, ProductCatalogHasuraGraphQL, ProductCatalogHasuraGraphQLRepository, ProductErrors, ProductErrorsHasuraGraphQL, ProductErrorsHasuraGraphQLRepository, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductLabelEnum, ProductReview, ProductReviewHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RestCacheAdapter, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, StockLimitError, StockOutError, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, TransactionPaymentMethods, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, deserialize, getClass, is, isDebuggable, isUUID, parseDateTime, registerClass, resolveClass, serialize, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { ProductHasuraGraphQL } from '../../../infra';
|
|
1
2
|
import { FindRepositoryParams, RepositoryCacheOptions, RepositoryFindResult } from '../../generic';
|
|
2
3
|
import { Product, ProductGender } from '../models';
|
|
3
4
|
export interface ProductCatalogRepository {
|
|
4
5
|
get({ id }: {
|
|
5
6
|
id: string;
|
|
6
7
|
}): Promise<Product>;
|
|
8
|
+
find(params?: FindRepositoryParams<ProductHasuraGraphQL>, optionsParams?: {
|
|
9
|
+
cache?: RepositoryCacheOptions;
|
|
10
|
+
}): Promise<RepositoryFindResult<ProductHasuraGraphQL>>;
|
|
7
11
|
getByEAN(EAN: string, options?: {
|
|
8
12
|
cache?: RepositoryCacheOptions;
|
|
9
13
|
}): Promise<Product>;
|
|
@@ -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
|
+
}
|
package/src/infra/hasura-graphql/repositories/catalog/product-catalog-hasura-graphql.repository.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { FindRepositoryParams, Product, ProductCatalogRepository, ProductGender, RepositoryCacheOptions, RepositoryFindResult } from '../../../../domain';
|
|
2
2
|
import { HasuraConstructorParams } from '../../mixins';
|
|
3
|
-
import { ProductHasuraGraphQL } from '../../models';
|
|
4
|
-
declare const ProductCatalogHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("../../types").GraphQLRepository<
|
|
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
5
|
export declare class ProductCatalogHasuraGraphQLRepository extends ProductCatalogHasuraGraphQLRepository_base implements ProductCatalogRepository {
|
|
6
|
-
constructor({ endpoint, authOptions, interceptors, cache, }: Pick<HasuraConstructorParams<
|
|
6
|
+
constructor({ endpoint, authOptions, interceptors, cache, }: Pick<HasuraConstructorParams<ProductCatalogHasuraGraphQL>, 'endpoint' | 'authOptions' | 'interceptors' | 'cache'>);
|
|
7
7
|
get({ id }: {
|
|
8
8
|
id: string;
|
|
9
|
+
}, options?: {
|
|
10
|
+
cache?: RepositoryCacheOptions;
|
|
9
11
|
}): Promise<Product>;
|
|
10
12
|
getByEAN(EAN: string, options?: {
|
|
11
13
|
cache?: RepositoryCacheOptions;
|