@infrab4a/connect 4.20.0 → 4.21.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 +44 -1
- package/index.esm.js +43 -2
- package/package.json +1 -1
- package/src/domain/catalog/models/category-product.d.ts +8 -0
- package/src/domain/catalog/models/index.d.ts +1 -0
- package/src/domain/catalog/models/types/index.d.ts +0 -1
- package/src/domain/catalog/repositories/category-product.repository.d.ts +6 -0
- package/src/domain/catalog/repositories/index.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/category-product-hasura-graphql.repository.d.ts +11 -0
- package/src/infra/hasura-graphql/repositories/catalog/index.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -215,6 +215,12 @@ tslib.__decorate([
|
|
|
215
215
|
tslib.__metadata("design:type", Category)
|
|
216
216
|
], CategoryFilter.prototype, "category", void 0);
|
|
217
217
|
|
|
218
|
+
class CategoryProduct extends BaseModel {
|
|
219
|
+
static get identifiersFields() {
|
|
220
|
+
return ['categoryId', 'productId'];
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
218
224
|
class FilterOption extends BaseModel {
|
|
219
225
|
static get identifiersFields() {
|
|
220
226
|
return ['id'];
|
|
@@ -5266,6 +5272,41 @@ tslib.__decorate([
|
|
|
5266
5272
|
tslib.__metadata("design:returntype", Promise)
|
|
5267
5273
|
], CategoryHasuraGraphQLRepository.prototype, "isChild", null);
|
|
5268
5274
|
|
|
5275
|
+
class CategoryProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5276
|
+
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5277
|
+
super({
|
|
5278
|
+
tableName: 'category_product',
|
|
5279
|
+
model: CategoryProduct,
|
|
5280
|
+
endpoint,
|
|
5281
|
+
authOptions,
|
|
5282
|
+
interceptors,
|
|
5283
|
+
fields: [{ productId: { columnName: 'product_id' } }, { categoryId: { columnName: 'category_id' } }, 'order'],
|
|
5284
|
+
});
|
|
5285
|
+
}
|
|
5286
|
+
async removeProductFromCategory(categoryId, productId) {
|
|
5287
|
+
await this.mutation('delete_category_product', ['affected_rows'], {
|
|
5288
|
+
where: {
|
|
5289
|
+
type: 'category_product_bool_exp',
|
|
5290
|
+
required: true,
|
|
5291
|
+
value: {
|
|
5292
|
+
product_id: { _eq: productId },
|
|
5293
|
+
category_id: { _eq: categoryId },
|
|
5294
|
+
},
|
|
5295
|
+
},
|
|
5296
|
+
});
|
|
5297
|
+
}
|
|
5298
|
+
async addProductToCategory(categoryId, productId) {
|
|
5299
|
+
await this.removeProductFromCategory(categoryId, productId);
|
|
5300
|
+
await this.mutation('insert_category_product', ['affected_rows'], {
|
|
5301
|
+
objects: {
|
|
5302
|
+
type: 'category_product_insert_input!',
|
|
5303
|
+
required: true,
|
|
5304
|
+
value: { category_id: categoryId, product_id: productId },
|
|
5305
|
+
},
|
|
5306
|
+
});
|
|
5307
|
+
}
|
|
5308
|
+
}
|
|
5309
|
+
|
|
5269
5310
|
class FilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5270
5311
|
constructor({ endpoint, authOptions, interceptors, }, filterOptionRepository, categoryFilterRepository) {
|
|
5271
5312
|
super({
|
|
@@ -5678,7 +5719,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5678
5719
|
const plainData = this.paramsToPlain({ id: checkId });
|
|
5679
5720
|
const id = await this.getId(plainData.id);
|
|
5680
5721
|
const product = await super.update(Object.assign({ id }, data));
|
|
5681
|
-
product.categories = categories && (await this.updateCategories(+id, { categories }))
|
|
5722
|
+
// product.categories = categories && (await this.updateCategories(+id, { categories }))
|
|
5682
5723
|
product.kitProducts = kitProducts && (await this.updateKitProducts(+id, { kitProducts }));
|
|
5683
5724
|
product.reviews = reviews && (await this.updateReviews(+id, { reviews }));
|
|
5684
5725
|
product.metadata = metadata && (await this.updateMetadata(+id, { metadata }));
|
|
@@ -6789,6 +6830,8 @@ exports.CategoryFilterHasuraGraphQLRepository = CategoryFilterHasuraGraphQLRepos
|
|
|
6789
6830
|
exports.CategoryFirestoreRepository = CategoryFirestoreRepository;
|
|
6790
6831
|
exports.CategoryHasuraGraphQL = CategoryHasuraGraphQL;
|
|
6791
6832
|
exports.CategoryHasuraGraphQLRepository = CategoryHasuraGraphQLRepository;
|
|
6833
|
+
exports.CategoryProduct = CategoryProduct;
|
|
6834
|
+
exports.CategoryProductHasuraGraphQLRepository = CategoryProductHasuraGraphQLRepository;
|
|
6792
6835
|
exports.Checkout = Checkout;
|
|
6793
6836
|
exports.CheckoutFirestoreRepository = CheckoutFirestoreRepository;
|
|
6794
6837
|
exports.CheckoutSubscription = CheckoutSubscription;
|
package/index.esm.js
CHANGED
|
@@ -209,6 +209,12 @@ __decorate([
|
|
|
209
209
|
__metadata("design:type", Category)
|
|
210
210
|
], CategoryFilter.prototype, "category", void 0);
|
|
211
211
|
|
|
212
|
+
class CategoryProduct extends BaseModel {
|
|
213
|
+
static get identifiersFields() {
|
|
214
|
+
return ['categoryId', 'productId'];
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
212
218
|
class FilterOption extends BaseModel {
|
|
213
219
|
static get identifiersFields() {
|
|
214
220
|
return ['id'];
|
|
@@ -5260,6 +5266,41 @@ __decorate([
|
|
|
5260
5266
|
__metadata("design:returntype", Promise)
|
|
5261
5267
|
], CategoryHasuraGraphQLRepository.prototype, "isChild", null);
|
|
5262
5268
|
|
|
5269
|
+
class CategoryProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5270
|
+
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5271
|
+
super({
|
|
5272
|
+
tableName: 'category_product',
|
|
5273
|
+
model: CategoryProduct,
|
|
5274
|
+
endpoint,
|
|
5275
|
+
authOptions,
|
|
5276
|
+
interceptors,
|
|
5277
|
+
fields: [{ productId: { columnName: 'product_id' } }, { categoryId: { columnName: 'category_id' } }, 'order'],
|
|
5278
|
+
});
|
|
5279
|
+
}
|
|
5280
|
+
async removeProductFromCategory(categoryId, productId) {
|
|
5281
|
+
await this.mutation('delete_category_product', ['affected_rows'], {
|
|
5282
|
+
where: {
|
|
5283
|
+
type: 'category_product_bool_exp',
|
|
5284
|
+
required: true,
|
|
5285
|
+
value: {
|
|
5286
|
+
product_id: { _eq: productId },
|
|
5287
|
+
category_id: { _eq: categoryId },
|
|
5288
|
+
},
|
|
5289
|
+
},
|
|
5290
|
+
});
|
|
5291
|
+
}
|
|
5292
|
+
async addProductToCategory(categoryId, productId) {
|
|
5293
|
+
await this.removeProductFromCategory(categoryId, productId);
|
|
5294
|
+
await this.mutation('insert_category_product', ['affected_rows'], {
|
|
5295
|
+
objects: {
|
|
5296
|
+
type: 'category_product_insert_input!',
|
|
5297
|
+
required: true,
|
|
5298
|
+
value: { category_id: categoryId, product_id: productId },
|
|
5299
|
+
},
|
|
5300
|
+
});
|
|
5301
|
+
}
|
|
5302
|
+
}
|
|
5303
|
+
|
|
5263
5304
|
class FilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5264
5305
|
constructor({ endpoint, authOptions, interceptors, }, filterOptionRepository, categoryFilterRepository) {
|
|
5265
5306
|
super({
|
|
@@ -5672,7 +5713,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5672
5713
|
const plainData = this.paramsToPlain({ id: checkId });
|
|
5673
5714
|
const id = await this.getId(plainData.id);
|
|
5674
5715
|
const product = await super.update(Object.assign({ id }, data));
|
|
5675
|
-
product.categories = categories && (await this.updateCategories(+id, { categories }))
|
|
5716
|
+
// product.categories = categories && (await this.updateCategories(+id, { categories }))
|
|
5676
5717
|
product.kitProducts = kitProducts && (await this.updateKitProducts(+id, { kitProducts }));
|
|
5677
5718
|
product.reviews = reviews && (await this.updateReviews(+id, { reviews }));
|
|
5678
5719
|
product.metadata = metadata && (await this.updateMetadata(+id, { metadata }));
|
|
@@ -6643,4 +6684,4 @@ class ProductsVertexSearch {
|
|
|
6643
6684
|
}
|
|
6644
6685
|
}
|
|
6645
6686
|
|
|
6646
|
-
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, 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, GenderDestination, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, NotFoundError, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, PersonTypes, Plans, Product, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductReviews, ProductReviewsHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, 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, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, is, isDebuggable, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
|
6687
|
+
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, 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, GenderDestination, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, NotFoundError, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, PersonTypes, Plans, Product, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductReviews, ProductReviewsHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, 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, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, is, isDebuggable, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
package/package.json
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseModel } from '../../generic/model';
|
|
2
|
+
export type CategoryProductIdentifiers = 'productId' | 'categoryId';
|
|
3
|
+
export declare class CategoryProduct extends BaseModel<CategoryProduct, CategoryProductIdentifiers> {
|
|
4
|
+
categoryId: number;
|
|
5
|
+
productId: number;
|
|
6
|
+
order: number;
|
|
7
|
+
static get identifiersFields(): CategoryProductIdentifiers[];
|
|
8
|
+
}
|
|
@@ -2,7 +2,6 @@ export * from './category-condition.type';
|
|
|
2
2
|
export * from './category-images.type';
|
|
3
3
|
export * from './category-metadata.type';
|
|
4
4
|
export * from './category-most-relevant.type';
|
|
5
|
-
export * from './category-product';
|
|
6
5
|
export * from './product-evaluation.type';
|
|
7
6
|
export * from './product-gender.type';
|
|
8
7
|
export * from './product-label.type';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CrudRepository } from '../../generic/repository/crud.repository';
|
|
2
|
+
import { CategoryProduct } from '../models';
|
|
3
|
+
export interface CategoryProductRepository extends CrudRepository<CategoryProduct> {
|
|
4
|
+
removeProductFromCategory(categoryId: string, productId: string): Promise<void>;
|
|
5
|
+
addProductToCategory(categoryId: string, productId: string): Promise<void>;
|
|
6
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './category-collection-children.repository';
|
|
2
2
|
export * from './category-filter.repository';
|
|
3
|
+
export * from './category-product.repository';
|
|
3
4
|
export * from './category.repository';
|
|
4
5
|
export * from './filter-option.repository';
|
|
5
6
|
export * from './filter.repository';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CategoryProduct, CategoryProductRepository } from '../../../../domain';
|
|
2
|
+
import { HasuraConstructorParams } from '../../mixins';
|
|
3
|
+
declare const CategoryProductHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("../..").GraphQLRepository<CategoryProduct> & import("../../../../domain").CrudRepository<CategoryProduct, import("../../../../domain").CrudParams<CategoryProduct>> & import("../../../../domain").UpdateRepository<CategoryProduct, import("../../../../domain").RepositoryUpdateParams<CategoryProduct>> & {
|
|
4
|
+
paramsToPlain(params: import("../../../../domain").RepositoryUpdateParams<CategoryProduct>): Partial<CategoryProduct>;
|
|
5
|
+
}, [HasuraConstructorParams<CategoryProduct> & import("../../mixins").CreateConstructorParams & import("../../mixins").DeleteConstructorParams & import("../../mixins").GetConstructorParams & import("../../mixins").UpdateConstructorParams, ...any[]]>;
|
|
6
|
+
export declare class CategoryProductHasuraGraphQLRepository extends CategoryProductHasuraGraphQLRepository_base implements CategoryProductRepository {
|
|
7
|
+
constructor({ endpoint, authOptions, interceptors, }: Pick<HasuraConstructorParams<CategoryProduct>, 'endpoint' | 'authOptions' | 'interceptors'>);
|
|
8
|
+
removeProductFromCategory(categoryId: string, productId: string): Promise<void>;
|
|
9
|
+
addProductToCategory(categoryId: string, productId: string): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './category-collection-children-hasura-graphql.repository';
|
|
2
2
|
export * from './category-filter-hasura-graphql.repository';
|
|
3
3
|
export * from './category-hasura-graphql.repository';
|
|
4
|
+
export * from './category-product-hasura-graphql.repository';
|
|
4
5
|
export * from './filter-hasura-graphql.repository';
|
|
5
6
|
export * from './filter-option-hasura-graphql.repository';
|
|
6
7
|
export * from './product-hasura-graphql.repository';
|