@infrab4a/connect 4.5.0 → 4.7.0-beta.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 +70 -0
- package/index.esm.js +69 -1
- package/package.json +1 -1
- package/src/domain/catalog/models/index.d.ts +1 -0
- package/src/domain/catalog/models/product-stock-notification.d.ts +9 -0
- package/src/domain/catalog/repositories/index.d.ts +1 -0
- package/src/domain/catalog/repositories/product-stock-notification.repository.d.ts +5 -0
- package/src/domain/catalog/repositories/product.repository.d.ts +13 -0
- package/src/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +3 -1
- package/src/infra/hasura-graphql/repositories/catalog/index.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts +2 -0
- package/src/infra/hasura-graphql/repositories/catalog/product-stock-notification-hasura-graphql.repository.d.ts +11 -0
package/index.cjs.js
CHANGED
|
@@ -220,6 +220,12 @@ class ProductReviews extends BaseModel {
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
class ProductStockNotification extends BaseModel {
|
|
224
|
+
static get identifiersFields() {
|
|
225
|
+
return ['id'];
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
223
229
|
class Variant extends BaseModel {
|
|
224
230
|
static get identifiersFields() {
|
|
225
231
|
return ['id', 'productId'];
|
|
@@ -3339,6 +3345,9 @@ class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFires
|
|
|
3339
3345
|
});
|
|
3340
3346
|
this.reviews = {};
|
|
3341
3347
|
}
|
|
3348
|
+
fetchProductReviews(filters) {
|
|
3349
|
+
throw new Error('Method not implemented.');
|
|
3350
|
+
}
|
|
3342
3351
|
async getBySlug(slug) {
|
|
3343
3352
|
var _a;
|
|
3344
3353
|
const result = await this.find({
|
|
@@ -3380,6 +3389,9 @@ class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFires
|
|
|
3380
3389
|
findCatalog(params) {
|
|
3381
3390
|
return this.find(params);
|
|
3382
3391
|
}
|
|
3392
|
+
async fetchPaginatedReviews() {
|
|
3393
|
+
return Promise.resolve([]);
|
|
3394
|
+
}
|
|
3383
3395
|
}
|
|
3384
3396
|
|
|
3385
3397
|
class ProductVariantFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base)))) {
|
|
@@ -5376,6 +5388,30 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5376
5388
|
product.metadata = metadata && (await this.updateMetadata(+id, { metadata }));
|
|
5377
5389
|
return product;
|
|
5378
5390
|
}
|
|
5391
|
+
async fetchProductReviews() {
|
|
5392
|
+
let data = [];
|
|
5393
|
+
let count = 0;
|
|
5394
|
+
let offset = 0;
|
|
5395
|
+
const limit = 500;
|
|
5396
|
+
do {
|
|
5397
|
+
const result = await super.find(Object.assign({ fields: ['id', 'name', 'sku', 'reviews'] }, ({
|
|
5398
|
+
limits: {
|
|
5399
|
+
offset,
|
|
5400
|
+
limit,
|
|
5401
|
+
},
|
|
5402
|
+
})));
|
|
5403
|
+
data = data.concat(result.data);
|
|
5404
|
+
count = result.data.length;
|
|
5405
|
+
offset += limit;
|
|
5406
|
+
} while (count === limit);
|
|
5407
|
+
return data.reduce((reviews, product) => [
|
|
5408
|
+
...reviews,
|
|
5409
|
+
...product.reviews.map((review) => (Object.assign(Object.assign({}, review), { reviewStatus: this.getReviewStatus(review), productId: product.id, productName: product.name, productSku: product.sku }))),
|
|
5410
|
+
], []);
|
|
5411
|
+
}
|
|
5412
|
+
getReviewStatus(review) {
|
|
5413
|
+
return review.status === true ? 'approved' : review.status === false ? 'rejected' : 'pending';
|
|
5414
|
+
}
|
|
5379
5415
|
async fetchReviews(status) {
|
|
5380
5416
|
const reviewsExpression = {
|
|
5381
5417
|
status: status === 'pending'
|
|
@@ -5614,6 +5650,38 @@ class ProductReviewsHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHa
|
|
|
5614
5650
|
}
|
|
5615
5651
|
}
|
|
5616
5652
|
|
|
5653
|
+
class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5654
|
+
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5655
|
+
super({
|
|
5656
|
+
tableName: 'product_stock_notification',
|
|
5657
|
+
model: ProductStockNotification,
|
|
5658
|
+
endpoint,
|
|
5659
|
+
authOptions,
|
|
5660
|
+
interceptors,
|
|
5661
|
+
fields: [
|
|
5662
|
+
'id',
|
|
5663
|
+
{ productId: { columnName: 'product_id' } },
|
|
5664
|
+
'email',
|
|
5665
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
5666
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
5667
|
+
],
|
|
5668
|
+
});
|
|
5669
|
+
}
|
|
5670
|
+
async addCustomerEmail(productId, email) {
|
|
5671
|
+
const notification = await this.find({
|
|
5672
|
+
filters: {
|
|
5673
|
+
productId,
|
|
5674
|
+
email,
|
|
5675
|
+
},
|
|
5676
|
+
}).then((data) => data.data.shift());
|
|
5677
|
+
if (!notification)
|
|
5678
|
+
this.create({
|
|
5679
|
+
productId,
|
|
5680
|
+
email,
|
|
5681
|
+
});
|
|
5682
|
+
}
|
|
5683
|
+
}
|
|
5684
|
+
|
|
5617
5685
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5618
5686
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5619
5687
|
super({
|
|
@@ -6133,6 +6201,8 @@ exports.ProductHasuraGraphQL = ProductHasuraGraphQL;
|
|
|
6133
6201
|
exports.ProductHasuraGraphQLRepository = ProductHasuraGraphQLRepository;
|
|
6134
6202
|
exports.ProductReviews = ProductReviews;
|
|
6135
6203
|
exports.ProductReviewsHasuraGraphQLRepository = ProductReviewsHasuraGraphQLRepository;
|
|
6204
|
+
exports.ProductStockNotification = ProductStockNotification;
|
|
6205
|
+
exports.ProductStockNotificationHasuraGraphQLRepository = ProductStockNotificationHasuraGraphQLRepository;
|
|
6136
6206
|
exports.ProductVariantFirestoreRepository = ProductVariantFirestoreRepository;
|
|
6137
6207
|
exports.ProductsIndex = ProductsIndex;
|
|
6138
6208
|
exports.RecoveryPassword = RecoveryPassword;
|
package/index.esm.js
CHANGED
|
@@ -196,6 +196,12 @@ class ProductReviews extends BaseModel {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
class ProductStockNotification extends BaseModel {
|
|
200
|
+
static get identifiersFields() {
|
|
201
|
+
return ['id'];
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
199
205
|
class Variant extends BaseModel {
|
|
200
206
|
static get identifiersFields() {
|
|
201
207
|
return ['id', 'productId'];
|
|
@@ -3315,6 +3321,9 @@ class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFires
|
|
|
3315
3321
|
});
|
|
3316
3322
|
this.reviews = {};
|
|
3317
3323
|
}
|
|
3324
|
+
fetchProductReviews(filters) {
|
|
3325
|
+
throw new Error('Method not implemented.');
|
|
3326
|
+
}
|
|
3318
3327
|
async getBySlug(slug) {
|
|
3319
3328
|
var _a;
|
|
3320
3329
|
const result = await this.find({
|
|
@@ -3356,6 +3365,9 @@ class ProductFirestoreRepository extends withCrudFirestore(withHelpers(withFires
|
|
|
3356
3365
|
findCatalog(params) {
|
|
3357
3366
|
return this.find(params);
|
|
3358
3367
|
}
|
|
3368
|
+
async fetchPaginatedReviews() {
|
|
3369
|
+
return Promise.resolve([]);
|
|
3370
|
+
}
|
|
3359
3371
|
}
|
|
3360
3372
|
|
|
3361
3373
|
class ProductVariantFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base)))) {
|
|
@@ -5352,6 +5364,30 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5352
5364
|
product.metadata = metadata && (await this.updateMetadata(+id, { metadata }));
|
|
5353
5365
|
return product;
|
|
5354
5366
|
}
|
|
5367
|
+
async fetchProductReviews() {
|
|
5368
|
+
let data = [];
|
|
5369
|
+
let count = 0;
|
|
5370
|
+
let offset = 0;
|
|
5371
|
+
const limit = 500;
|
|
5372
|
+
do {
|
|
5373
|
+
const result = await super.find(Object.assign({ fields: ['id', 'name', 'sku', 'reviews'] }, ({
|
|
5374
|
+
limits: {
|
|
5375
|
+
offset,
|
|
5376
|
+
limit,
|
|
5377
|
+
},
|
|
5378
|
+
})));
|
|
5379
|
+
data = data.concat(result.data);
|
|
5380
|
+
count = result.data.length;
|
|
5381
|
+
offset += limit;
|
|
5382
|
+
} while (count === limit);
|
|
5383
|
+
return data.reduce((reviews, product) => [
|
|
5384
|
+
...reviews,
|
|
5385
|
+
...product.reviews.map((review) => (Object.assign(Object.assign({}, review), { reviewStatus: this.getReviewStatus(review), productId: product.id, productName: product.name, productSku: product.sku }))),
|
|
5386
|
+
], []);
|
|
5387
|
+
}
|
|
5388
|
+
getReviewStatus(review) {
|
|
5389
|
+
return review.status === true ? 'approved' : review.status === false ? 'rejected' : 'pending';
|
|
5390
|
+
}
|
|
5355
5391
|
async fetchReviews(status) {
|
|
5356
5392
|
const reviewsExpression = {
|
|
5357
5393
|
status: status === 'pending'
|
|
@@ -5590,6 +5626,38 @@ class ProductReviewsHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHa
|
|
|
5590
5626
|
}
|
|
5591
5627
|
}
|
|
5592
5628
|
|
|
5629
|
+
class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5630
|
+
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5631
|
+
super({
|
|
5632
|
+
tableName: 'product_stock_notification',
|
|
5633
|
+
model: ProductStockNotification,
|
|
5634
|
+
endpoint,
|
|
5635
|
+
authOptions,
|
|
5636
|
+
interceptors,
|
|
5637
|
+
fields: [
|
|
5638
|
+
'id',
|
|
5639
|
+
{ productId: { columnName: 'product_id' } },
|
|
5640
|
+
'email',
|
|
5641
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
5642
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
5643
|
+
],
|
|
5644
|
+
});
|
|
5645
|
+
}
|
|
5646
|
+
async addCustomerEmail(productId, email) {
|
|
5647
|
+
const notification = await this.find({
|
|
5648
|
+
filters: {
|
|
5649
|
+
productId,
|
|
5650
|
+
email,
|
|
5651
|
+
},
|
|
5652
|
+
}).then((data) => data.data.shift());
|
|
5653
|
+
if (!notification)
|
|
5654
|
+
this.create({
|
|
5655
|
+
productId,
|
|
5656
|
+
email,
|
|
5657
|
+
});
|
|
5658
|
+
}
|
|
5659
|
+
}
|
|
5660
|
+
|
|
5593
5661
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5594
5662
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5595
5663
|
super({
|
|
@@ -5926,4 +5994,4 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5926
5994
|
}
|
|
5927
5995
|
}
|
|
5928
5996
|
|
|
5929
|
-
export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, GenderDestination, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, Logger, NotFoundError, OfficePosition, Order, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, Plans, Product, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductReviews, ProductReviewsHasuraGraphQLRepository, ProductSpents, ProductVariantFirestoreRepository, ProductsIndex, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RoundProductPricesHelper, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, is, isDebuggable, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
|
5997
|
+
export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, GenderDestination, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, Logger, NotFoundError, OfficePosition, Order, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, Plans, Product, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductReviews, ProductReviewsHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RoundProductPricesHelper, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, is, isDebuggable, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ export * from './filter-option';
|
|
|
7
7
|
export * from './kit-product';
|
|
8
8
|
export * from './product';
|
|
9
9
|
export * from './product-reviews';
|
|
10
|
+
export * from './product-stock-notification';
|
|
10
11
|
export * from './types';
|
|
11
12
|
export * from './variant';
|
|
12
13
|
export * from './wishlist';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
|
+
export declare class ProductStockNotification extends BaseModel<ProductStockNotification> {
|
|
3
|
+
id: number;
|
|
4
|
+
productId: string;
|
|
5
|
+
email: string;
|
|
6
|
+
createdAt?: Date;
|
|
7
|
+
updatedAt?: Date;
|
|
8
|
+
static get identifiersFields(): GenericIdentifier[];
|
|
9
|
+
}
|
|
@@ -4,6 +4,7 @@ export * from './category.repository';
|
|
|
4
4
|
export * from './filter-option.repository';
|
|
5
5
|
export * from './filter.repository';
|
|
6
6
|
export * from './product-reviews.repository';
|
|
7
|
+
export * from './product-stock-notification.repository';
|
|
7
8
|
export * from './product.repository';
|
|
8
9
|
export * from './subscription-product.repository';
|
|
9
10
|
export * from './variant.repository';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CrudRepository } from '../../generic/repository/crud.repository';
|
|
2
|
+
import { ProductStockNotification } from '../models';
|
|
3
|
+
export interface ProductStockNotificationRepository extends CrudRepository<ProductStockNotification> {
|
|
4
|
+
addCustomerEmail(productId: string, email: string): Promise<void>;
|
|
5
|
+
}
|
|
@@ -6,10 +6,23 @@ export type ReviewWithProductData = ProductReview & {
|
|
|
6
6
|
productId: string;
|
|
7
7
|
productName: string;
|
|
8
8
|
productSku: string;
|
|
9
|
+
reviewStatus?: 'pending' | 'approved' | 'rejected';
|
|
10
|
+
};
|
|
11
|
+
export type PaginatedReviewFilters = {
|
|
12
|
+
sku?: string;
|
|
13
|
+
status: ReviewStatusParams;
|
|
14
|
+
email?: string;
|
|
15
|
+
rate?: number;
|
|
16
|
+
period?: {
|
|
17
|
+
start: Date;
|
|
18
|
+
end: Date;
|
|
19
|
+
};
|
|
20
|
+
limit?: number;
|
|
9
21
|
};
|
|
10
22
|
export interface ProductRepository extends CrudRepository<Product> {
|
|
11
23
|
getBySlug(slug: string): Promise<Product>;
|
|
12
24
|
fetchReviews(status: ReviewStatusParams): Promise<ReviewWithProductData[]>;
|
|
25
|
+
fetchProductReviews(filters: PaginatedReviewFilters): Promise<ReviewWithProductData[]>;
|
|
13
26
|
cleanShoppingCountFromIds(ids: string[]): Promise<any>;
|
|
14
27
|
findCatalog(params: FindRepositoryParams<Product>, mainGender?: Extract<ProductGender, 'female' | 'male' | 'unisex'>): Promise<RepositoryFindResult<Product>>;
|
|
15
28
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { FindRepositoryParams, Product, ProductRepository, RepositoryFindResult, ReviewStatusParams, ReviewWithProductData } from '../../../../../domain';
|
|
1
|
+
import { FindRepositoryParams, PaginatedReviewFilters, Product, ProductRepository, RepositoryFindResult, ReviewStatusParams, ReviewWithProductData } from '../../../../../domain';
|
|
2
2
|
import { FirestoreConstructorParams } from '../../mixins';
|
|
3
3
|
declare const ProductFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("../..").FirestoreRepository<Product> & import("../../../../../domain").CrudRepository<Product, import("../../../../../domain").CrudParams<Product>> & import("../..").FirestoreHelpers, [FirestoreConstructorParams<Product>, ...any[]]>;
|
|
4
4
|
export declare class ProductFirestoreRepository extends ProductFirestoreRepository_base implements ProductRepository {
|
|
5
5
|
private reviews;
|
|
6
6
|
constructor({ firestore, interceptors }: Pick<FirestoreConstructorParams<Product>, 'firestore' | 'interceptors'>);
|
|
7
|
+
fetchProductReviews(filters: PaginatedReviewFilters): Promise<ReviewWithProductData[]>;
|
|
7
8
|
getBySlug(slug: string): Promise<Product>;
|
|
8
9
|
fetchReviews(status: ReviewStatusParams): Promise<ReviewWithProductData[]>;
|
|
9
10
|
cleanShoppingCountFromIds(): Promise<void>;
|
|
10
11
|
findCatalog(params: FindRepositoryParams<Product>): Promise<RepositoryFindResult<Product>>;
|
|
12
|
+
fetchPaginatedReviews(): Promise<ReviewWithProductData[]>;
|
|
11
13
|
}
|
|
12
14
|
export {};
|
|
@@ -5,5 +5,6 @@ export * from './filter-hasura-graphql.repository';
|
|
|
5
5
|
export * from './filter-option-hasura-graphql.repository';
|
|
6
6
|
export * from './product-hasura-graphql.repository';
|
|
7
7
|
export * from './product-review-hasura-graphql.repository';
|
|
8
|
+
export * from './product-stock-notification-hasura-graphql.repository';
|
|
8
9
|
export * from './variant-hasura-graphql.repository';
|
|
9
10
|
export * from './wishlist-hasura-graphql.repository';
|
package/src/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare class ProductHasuraGraphQLRepository extends ProductHasuraGraphQL
|
|
|
12
12
|
find(params?: FindRepositoryParams<ProductHasuraGraphQL>): Promise<RepositoryFindResult<ProductHasuraGraphQL>>;
|
|
13
13
|
getBySlug(slug: string): Promise<ProductHasuraGraphQL>;
|
|
14
14
|
update(params: UpdateRepositoryParams<ProductHasuraGraphQL>): Promise<ProductHasuraGraphQL>;
|
|
15
|
+
fetchProductReviews(): Promise<ReviewWithProductData[]>;
|
|
16
|
+
private getReviewStatus;
|
|
15
17
|
fetchReviews(status: ReviewStatusParams): Promise<ReviewWithProductData[]>;
|
|
16
18
|
findCatalog(params: FindRepositoryParams<ProductHasuraGraphQL>, mainGender?: Extract<ProductGender, 'female' | 'male'>): Promise<RepositoryFindResult<ProductHasuraGraphQL>>;
|
|
17
19
|
private updateCategories;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Filter, ProductStockNotification } from '../../../../domain';
|
|
2
|
+
import { ProductStockNotificationRepository } from '../../../../domain/catalog/repositories';
|
|
3
|
+
import { HasuraConstructorParams } from '../../mixins';
|
|
4
|
+
declare const ProductStockNotificationHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("../..").GraphQLRepository<ProductStockNotification> & import("../../../../domain").CrudRepository<ProductStockNotification, import("../../../../domain").CrudParams<ProductStockNotification>> & import("../../../../domain").UpdateRepository<ProductStockNotification, import("../../../../domain").RepositoryUpdateParams<ProductStockNotification>> & {
|
|
5
|
+
paramsToPlain(params: import("../../../../domain").RepositoryUpdateParams<ProductStockNotification>): Partial<ProductStockNotification>;
|
|
6
|
+
}, [HasuraConstructorParams<ProductStockNotification> & import("../../mixins").CreateConstructorParams & import("../../mixins").DeleteConstructorParams & import("../../mixins").GetConstructorParams & import("../../mixins").UpdateConstructorParams, ...any[]]>;
|
|
7
|
+
export declare class ProductStockNotificationHasuraGraphQLRepository extends ProductStockNotificationHasuraGraphQLRepository_base implements ProductStockNotificationRepository {
|
|
8
|
+
constructor({ endpoint, authOptions, interceptors, }: Pick<HasuraConstructorParams<Filter>, 'endpoint' | 'authOptions' | 'interceptors'>);
|
|
9
|
+
addCustomerEmail(productId: string, email: string): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|