@infrab4a/connect 4.14.0-beta.5 → 4.14.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 +2 -155
- package/index.esm.js +3 -154
- package/package.json +1 -1
- package/src/domain/catalog/models/product-base.d.ts +2 -1
- package/src/domain/catalog/models/types/index.d.ts +1 -0
- package/src/domain/catalog/models/types/product-label.type.d.ts +1 -0
- package/src/domain/general/index.d.ts +0 -1
- package/src/infra/elasticsearch/indexes/products-index.d.ts +1 -36
- package/src/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +1 -1
- package/src/infra/index.d.ts +0 -1
- package/src/domain/general/search/index.d.ts +0 -1
- package/src/domain/general/search/product-search-index.d.ts +0 -3
- package/src/infra/vertex-ai/adapters/index.d.ts +0 -2
- package/src/infra/vertex-ai/adapters/vertex-ai-search.adapter.d.ts +0 -9
- package/src/infra/vertex-ai/adapters/vertex-axios.adapter.d.ts +0 -14
- package/src/infra/vertex-ai/index.d.ts +0 -3
- package/src/infra/vertex-ai/indexes/index.d.ts +0 -1
- package/src/infra/vertex-ai/indexes/products-vertex-search.d.ts +0 -13
- package/src/infra/vertex-ai/types/axios-vertex-search-config.d.ts +0 -4
- package/src/infra/vertex-ai/types/index.d.ts +0 -2
- package/src/infra/vertex-ai/types/product-search.d.ts +0 -21
package/index.cjs.js
CHANGED
|
@@ -2596,9 +2596,7 @@ class ProductsIndex {
|
|
|
2596
2596
|
RoundProductPricesHelper.roundProductPrices(hit._source);
|
|
2597
2597
|
return hit;
|
|
2598
2598
|
});
|
|
2599
|
-
return search
|
|
2600
|
-
return Object.assign(Object.assign({}, hit._source), { stock: hit._source.stock.quantity });
|
|
2601
|
-
});
|
|
2599
|
+
return search;
|
|
2602
2600
|
}
|
|
2603
2601
|
async save(product) {
|
|
2604
2602
|
try {
|
|
@@ -5449,6 +5447,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5449
5447
|
{ subscriberPrice: { columnName: 'subscriber_price' } },
|
|
5450
5448
|
'published',
|
|
5451
5449
|
'outlet',
|
|
5450
|
+
'label',
|
|
5452
5451
|
'sku',
|
|
5453
5452
|
{
|
|
5454
5453
|
stock: {
|
|
@@ -6402,156 +6401,6 @@ tslib.__decorate([
|
|
|
6402
6401
|
tslib.__metadata("design:returntype", Promise)
|
|
6403
6402
|
], WishlistHasuraGraphQLRepository.prototype, "findBfluOrGlamgirlWishlists", null);
|
|
6404
6403
|
|
|
6405
|
-
class VertexAxiosAdapter {
|
|
6406
|
-
constructor(config) {
|
|
6407
|
-
this.config = config;
|
|
6408
|
-
this.logger = DebugHelper.from(this);
|
|
6409
|
-
}
|
|
6410
|
-
async query(term, total, gender) {
|
|
6411
|
-
const logger = this.logger.with('query');
|
|
6412
|
-
const req = {
|
|
6413
|
-
url: `${this.config.url}/search`,
|
|
6414
|
-
method: 'POST',
|
|
6415
|
-
responseType: 'json',
|
|
6416
|
-
headers: {
|
|
6417
|
-
Accept: 'application/json',
|
|
6418
|
-
},
|
|
6419
|
-
data: { term, total, gender },
|
|
6420
|
-
};
|
|
6421
|
-
try {
|
|
6422
|
-
const { data } = await axios__default["default"](req);
|
|
6423
|
-
return data;
|
|
6424
|
-
}
|
|
6425
|
-
catch (error) {
|
|
6426
|
-
logger.error({ req, res: error });
|
|
6427
|
-
throw error;
|
|
6428
|
-
}
|
|
6429
|
-
}
|
|
6430
|
-
async get(id) {
|
|
6431
|
-
const logger = this.logger.with('update');
|
|
6432
|
-
const req = {
|
|
6433
|
-
url: `${this.config.url}/${id}`,
|
|
6434
|
-
method: 'GET',
|
|
6435
|
-
responseType: 'json',
|
|
6436
|
-
headers: {
|
|
6437
|
-
Accept: 'application/json',
|
|
6438
|
-
},
|
|
6439
|
-
};
|
|
6440
|
-
try {
|
|
6441
|
-
const { data } = await axios__default["default"](req);
|
|
6442
|
-
return data;
|
|
6443
|
-
}
|
|
6444
|
-
catch (error) {
|
|
6445
|
-
logger.error({ req, res: error });
|
|
6446
|
-
throw error;
|
|
6447
|
-
}
|
|
6448
|
-
}
|
|
6449
|
-
async save(data) {
|
|
6450
|
-
const logger = this.logger.with('save');
|
|
6451
|
-
const req = {
|
|
6452
|
-
url: `${this.config.url}/sync`,
|
|
6453
|
-
method: 'POST',
|
|
6454
|
-
responseType: 'json',
|
|
6455
|
-
headers: {
|
|
6456
|
-
Accept: 'application/json',
|
|
6457
|
-
},
|
|
6458
|
-
data,
|
|
6459
|
-
};
|
|
6460
|
-
try {
|
|
6461
|
-
const { data } = await axios__default["default"](req);
|
|
6462
|
-
return data;
|
|
6463
|
-
}
|
|
6464
|
-
catch (error) {
|
|
6465
|
-
logger.error({ req, res: error });
|
|
6466
|
-
throw error;
|
|
6467
|
-
}
|
|
6468
|
-
}
|
|
6469
|
-
async update(id, data) {
|
|
6470
|
-
const logger = this.logger.with('update');
|
|
6471
|
-
const req = {
|
|
6472
|
-
url: `${this.config.url}/${id}`,
|
|
6473
|
-
method: 'PUT',
|
|
6474
|
-
responseType: 'json',
|
|
6475
|
-
headers: {
|
|
6476
|
-
Accept: 'application/json',
|
|
6477
|
-
},
|
|
6478
|
-
data,
|
|
6479
|
-
};
|
|
6480
|
-
try {
|
|
6481
|
-
const { data } = await axios__default["default"](req);
|
|
6482
|
-
return data;
|
|
6483
|
-
}
|
|
6484
|
-
catch (error) {
|
|
6485
|
-
logger.error({ req, res: error });
|
|
6486
|
-
throw error;
|
|
6487
|
-
}
|
|
6488
|
-
}
|
|
6489
|
-
async delete(id) {
|
|
6490
|
-
const logger = this.logger.with('delete');
|
|
6491
|
-
const req = {
|
|
6492
|
-
url: `${this.config.url}/${id}`,
|
|
6493
|
-
method: 'DELETE',
|
|
6494
|
-
responseType: 'json',
|
|
6495
|
-
headers: {
|
|
6496
|
-
Accept: 'application/json',
|
|
6497
|
-
},
|
|
6498
|
-
};
|
|
6499
|
-
try {
|
|
6500
|
-
const { data } = await axios__default["default"](req);
|
|
6501
|
-
return data;
|
|
6502
|
-
}
|
|
6503
|
-
catch (error) {
|
|
6504
|
-
logger.error({ req, res: error });
|
|
6505
|
-
throw error;
|
|
6506
|
-
}
|
|
6507
|
-
}
|
|
6508
|
-
}
|
|
6509
|
-
|
|
6510
|
-
class ProductsVertexSearch {
|
|
6511
|
-
constructor(adapter) {
|
|
6512
|
-
this.adapter = adapter;
|
|
6513
|
-
}
|
|
6514
|
-
async getById(id) {
|
|
6515
|
-
const data = await this.adapter.get(id);
|
|
6516
|
-
return data;
|
|
6517
|
-
}
|
|
6518
|
-
async search(searchTerm, total, gender) {
|
|
6519
|
-
try {
|
|
6520
|
-
const result = await this.adapter.query(searchTerm, total, gender);
|
|
6521
|
-
return result;
|
|
6522
|
-
}
|
|
6523
|
-
catch (error) {
|
|
6524
|
-
console.error(error);
|
|
6525
|
-
}
|
|
6526
|
-
}
|
|
6527
|
-
async save(product) {
|
|
6528
|
-
try {
|
|
6529
|
-
const _a = product.toPlain(), { createdAt, updatedAt, kitProducts } = _a, data = tslib.__rest(_a, ["createdAt", "updatedAt", "kitProducts"]);
|
|
6530
|
-
const newProduct = Product.toInstance(data);
|
|
6531
|
-
await this.adapter.save(newProduct);
|
|
6532
|
-
}
|
|
6533
|
-
catch (error) {
|
|
6534
|
-
console.error(error);
|
|
6535
|
-
}
|
|
6536
|
-
}
|
|
6537
|
-
async update(product) {
|
|
6538
|
-
try {
|
|
6539
|
-
await this.adapter.update(product.id, product);
|
|
6540
|
-
}
|
|
6541
|
-
catch (error) {
|
|
6542
|
-
console.error(error);
|
|
6543
|
-
}
|
|
6544
|
-
}
|
|
6545
|
-
async delete(id) {
|
|
6546
|
-
try {
|
|
6547
|
-
await this.adapter.delete(id);
|
|
6548
|
-
}
|
|
6549
|
-
catch (error) {
|
|
6550
|
-
console.error(error);
|
|
6551
|
-
}
|
|
6552
|
-
}
|
|
6553
|
-
}
|
|
6554
|
-
|
|
6555
6404
|
Object.defineProperty(exports, 'add', {
|
|
6556
6405
|
enumerable: true,
|
|
6557
6406
|
get: function () { return dateFns.add; }
|
|
@@ -6741,7 +6590,6 @@ exports.ProductStockNotification = ProductStockNotification;
|
|
|
6741
6590
|
exports.ProductStockNotificationHasuraGraphQLRepository = ProductStockNotificationHasuraGraphQLRepository;
|
|
6742
6591
|
exports.ProductVariantFirestoreRepository = ProductVariantFirestoreRepository;
|
|
6743
6592
|
exports.ProductsIndex = ProductsIndex;
|
|
6744
|
-
exports.ProductsVertexSearch = ProductsVertexSearch;
|
|
6745
6593
|
exports.RecoveryPassword = RecoveryPassword;
|
|
6746
6594
|
exports.ReflectHelper = ReflectHelper;
|
|
6747
6595
|
exports.Register = Register;
|
|
@@ -6780,7 +6628,6 @@ exports.UserPaymentMethodFirestoreRepository = UserPaymentMethodFirestoreReposit
|
|
|
6780
6628
|
exports.Variant = Variant;
|
|
6781
6629
|
exports.VariantHasuraGraphQL = VariantHasuraGraphQL;
|
|
6782
6630
|
exports.VariantHasuraGraphQLRepository = VariantHasuraGraphQLRepository;
|
|
6783
|
-
exports.VertexAxiosAdapter = VertexAxiosAdapter;
|
|
6784
6631
|
exports.WeakPasswordError = WeakPasswordError;
|
|
6785
6632
|
exports.Wishlist = Wishlist;
|
|
6786
6633
|
exports.WishlistHasuraGraphQLRepository = WishlistHasuraGraphQLRepository;
|
package/index.esm.js
CHANGED
|
@@ -2590,9 +2590,7 @@ class ProductsIndex {
|
|
|
2590
2590
|
RoundProductPricesHelper.roundProductPrices(hit._source);
|
|
2591
2591
|
return hit;
|
|
2592
2592
|
});
|
|
2593
|
-
return search
|
|
2594
|
-
return Object.assign(Object.assign({}, hit._source), { stock: hit._source.stock.quantity });
|
|
2595
|
-
});
|
|
2593
|
+
return search;
|
|
2596
2594
|
}
|
|
2597
2595
|
async save(product) {
|
|
2598
2596
|
try {
|
|
@@ -5443,6 +5441,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5443
5441
|
{ subscriberPrice: { columnName: 'subscriber_price' } },
|
|
5444
5442
|
'published',
|
|
5445
5443
|
'outlet',
|
|
5444
|
+
'label',
|
|
5446
5445
|
'sku',
|
|
5447
5446
|
{
|
|
5448
5447
|
stock: {
|
|
@@ -6396,154 +6395,4 @@ __decorate([
|
|
|
6396
6395
|
__metadata("design:returntype", Promise)
|
|
6397
6396
|
], WishlistHasuraGraphQLRepository.prototype, "findBfluOrGlamgirlWishlists", null);
|
|
6398
6397
|
|
|
6399
|
-
|
|
6400
|
-
constructor(config) {
|
|
6401
|
-
this.config = config;
|
|
6402
|
-
this.logger = DebugHelper.from(this);
|
|
6403
|
-
}
|
|
6404
|
-
async query(term, total, gender) {
|
|
6405
|
-
const logger = this.logger.with('query');
|
|
6406
|
-
const req = {
|
|
6407
|
-
url: `${this.config.url}/search`,
|
|
6408
|
-
method: 'POST',
|
|
6409
|
-
responseType: 'json',
|
|
6410
|
-
headers: {
|
|
6411
|
-
Accept: 'application/json',
|
|
6412
|
-
},
|
|
6413
|
-
data: { term, total, gender },
|
|
6414
|
-
};
|
|
6415
|
-
try {
|
|
6416
|
-
const { data } = await axios(req);
|
|
6417
|
-
return data;
|
|
6418
|
-
}
|
|
6419
|
-
catch (error) {
|
|
6420
|
-
logger.error({ req, res: error });
|
|
6421
|
-
throw error;
|
|
6422
|
-
}
|
|
6423
|
-
}
|
|
6424
|
-
async get(id) {
|
|
6425
|
-
const logger = this.logger.with('update');
|
|
6426
|
-
const req = {
|
|
6427
|
-
url: `${this.config.url}/${id}`,
|
|
6428
|
-
method: 'GET',
|
|
6429
|
-
responseType: 'json',
|
|
6430
|
-
headers: {
|
|
6431
|
-
Accept: 'application/json',
|
|
6432
|
-
},
|
|
6433
|
-
};
|
|
6434
|
-
try {
|
|
6435
|
-
const { data } = await axios(req);
|
|
6436
|
-
return data;
|
|
6437
|
-
}
|
|
6438
|
-
catch (error) {
|
|
6439
|
-
logger.error({ req, res: error });
|
|
6440
|
-
throw error;
|
|
6441
|
-
}
|
|
6442
|
-
}
|
|
6443
|
-
async save(data) {
|
|
6444
|
-
const logger = this.logger.with('save');
|
|
6445
|
-
const req = {
|
|
6446
|
-
url: `${this.config.url}/sync`,
|
|
6447
|
-
method: 'POST',
|
|
6448
|
-
responseType: 'json',
|
|
6449
|
-
headers: {
|
|
6450
|
-
Accept: 'application/json',
|
|
6451
|
-
},
|
|
6452
|
-
data,
|
|
6453
|
-
};
|
|
6454
|
-
try {
|
|
6455
|
-
const { data } = await axios(req);
|
|
6456
|
-
return data;
|
|
6457
|
-
}
|
|
6458
|
-
catch (error) {
|
|
6459
|
-
logger.error({ req, res: error });
|
|
6460
|
-
throw error;
|
|
6461
|
-
}
|
|
6462
|
-
}
|
|
6463
|
-
async update(id, data) {
|
|
6464
|
-
const logger = this.logger.with('update');
|
|
6465
|
-
const req = {
|
|
6466
|
-
url: `${this.config.url}/${id}`,
|
|
6467
|
-
method: 'PUT',
|
|
6468
|
-
responseType: 'json',
|
|
6469
|
-
headers: {
|
|
6470
|
-
Accept: 'application/json',
|
|
6471
|
-
},
|
|
6472
|
-
data,
|
|
6473
|
-
};
|
|
6474
|
-
try {
|
|
6475
|
-
const { data } = await axios(req);
|
|
6476
|
-
return data;
|
|
6477
|
-
}
|
|
6478
|
-
catch (error) {
|
|
6479
|
-
logger.error({ req, res: error });
|
|
6480
|
-
throw error;
|
|
6481
|
-
}
|
|
6482
|
-
}
|
|
6483
|
-
async delete(id) {
|
|
6484
|
-
const logger = this.logger.with('delete');
|
|
6485
|
-
const req = {
|
|
6486
|
-
url: `${this.config.url}/${id}`,
|
|
6487
|
-
method: 'DELETE',
|
|
6488
|
-
responseType: 'json',
|
|
6489
|
-
headers: {
|
|
6490
|
-
Accept: 'application/json',
|
|
6491
|
-
},
|
|
6492
|
-
};
|
|
6493
|
-
try {
|
|
6494
|
-
const { data } = await axios(req);
|
|
6495
|
-
return data;
|
|
6496
|
-
}
|
|
6497
|
-
catch (error) {
|
|
6498
|
-
logger.error({ req, res: error });
|
|
6499
|
-
throw error;
|
|
6500
|
-
}
|
|
6501
|
-
}
|
|
6502
|
-
}
|
|
6503
|
-
|
|
6504
|
-
class ProductsVertexSearch {
|
|
6505
|
-
constructor(adapter) {
|
|
6506
|
-
this.adapter = adapter;
|
|
6507
|
-
}
|
|
6508
|
-
async getById(id) {
|
|
6509
|
-
const data = await this.adapter.get(id);
|
|
6510
|
-
return data;
|
|
6511
|
-
}
|
|
6512
|
-
async search(searchTerm, total, gender) {
|
|
6513
|
-
try {
|
|
6514
|
-
const result = await this.adapter.query(searchTerm, total, gender);
|
|
6515
|
-
return result;
|
|
6516
|
-
}
|
|
6517
|
-
catch (error) {
|
|
6518
|
-
console.error(error);
|
|
6519
|
-
}
|
|
6520
|
-
}
|
|
6521
|
-
async save(product) {
|
|
6522
|
-
try {
|
|
6523
|
-
const _a = product.toPlain(), { createdAt, updatedAt, kitProducts } = _a, data = __rest(_a, ["createdAt", "updatedAt", "kitProducts"]);
|
|
6524
|
-
const newProduct = Product.toInstance(data);
|
|
6525
|
-
await this.adapter.save(newProduct);
|
|
6526
|
-
}
|
|
6527
|
-
catch (error) {
|
|
6528
|
-
console.error(error);
|
|
6529
|
-
}
|
|
6530
|
-
}
|
|
6531
|
-
async update(product) {
|
|
6532
|
-
try {
|
|
6533
|
-
await this.adapter.update(product.id, product);
|
|
6534
|
-
}
|
|
6535
|
-
catch (error) {
|
|
6536
|
-
console.error(error);
|
|
6537
|
-
}
|
|
6538
|
-
}
|
|
6539
|
-
async delete(id) {
|
|
6540
|
-
try {
|
|
6541
|
-
await this.adapter.delete(id);
|
|
6542
|
-
}
|
|
6543
|
-
catch (error) {
|
|
6544
|
-
console.error(error);
|
|
6545
|
-
}
|
|
6546
|
-
}
|
|
6547
|
-
}
|
|
6548
|
-
|
|
6549
|
-
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, 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, is, isDebuggable, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
|
6398
|
+
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, OrderBlocked, OrderBlockedFirestoreRepository, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, PersonTypes, 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseModel, GenericIdentifier, ModelBaseStructure } from '../../generic/model';
|
|
2
|
-
import { ProductEvaluation, ProductGender, ProductMetadata, ProductReview, ShopDescription, ShopPrice, Stock } from './types';
|
|
2
|
+
import { ProductEvaluation, ProductGender, ProductLabel, ProductMetadata, ProductReview, ShopDescription, ShopPrice, Stock } from './types';
|
|
3
3
|
import { Variant } from './variant';
|
|
4
4
|
export declare class ProductBase<ChildProduct extends ModelBaseStructure<ChildProduct, Identifiers>, Identifiers = ChildProduct['identifiersFields']> extends BaseModel<ChildProduct, Identifiers> {
|
|
5
5
|
id: string;
|
|
@@ -34,6 +34,7 @@ export declare class ProductBase<ChildProduct extends ModelBaseStructure<ChildPr
|
|
|
34
34
|
shoppingCount?: number;
|
|
35
35
|
metadata: ProductMetadata;
|
|
36
36
|
outlet?: boolean;
|
|
37
|
+
label?: ProductLabel;
|
|
37
38
|
private reviewsTotal?;
|
|
38
39
|
get evaluation(): ProductEvaluation;
|
|
39
40
|
set evaluation(evaluation: ProductEvaluation);
|
|
@@ -5,6 +5,7 @@ export * from './category-most-relevant.type';
|
|
|
5
5
|
export * from './category-product';
|
|
6
6
|
export * from './product-evaluation.type';
|
|
7
7
|
export * from './product-gender.type';
|
|
8
|
+
export * from './product-label.type';
|
|
8
9
|
export * from './product-metadata.type';
|
|
9
10
|
export * from './product-review.type';
|
|
10
11
|
export * from './report-stock-notification.type';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ProductLabel = 'outlet' | 'on-sale' | 'last-units' | 'glamstar';
|
|
@@ -6,42 +6,7 @@ export declare class ProductsIndex {
|
|
|
6
6
|
private index;
|
|
7
7
|
constructor(adapter: ElasticSearchAdapter<Product>);
|
|
8
8
|
getById(id: string): Promise<Product>;
|
|
9
|
-
search(searchTerm: string, total: number, shop?: string): Promise<
|
|
10
|
-
stock: number;
|
|
11
|
-
category: import("../../../domain/catalog/models/category-for-product").CategoryForProduct;
|
|
12
|
-
kitProducts?: import("../../../domain").KitProduct[];
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
slug: string;
|
|
16
|
-
description: import("../../../domain").ShopDescription;
|
|
17
|
-
sku: string;
|
|
18
|
-
price: import("../../../domain").ShopPrice;
|
|
19
|
-
hasVariants: boolean;
|
|
20
|
-
NCM: string;
|
|
21
|
-
EAN: string;
|
|
22
|
-
CEST: string;
|
|
23
|
-
weight: number;
|
|
24
|
-
costPrice: number;
|
|
25
|
-
images?: string[];
|
|
26
|
-
miniatures?: string[];
|
|
27
|
-
published: boolean;
|
|
28
|
-
createdAt?: Date;
|
|
29
|
-
updatedAt?: Date;
|
|
30
|
-
brand: string;
|
|
31
|
-
tags?: string[];
|
|
32
|
-
filters?: string[];
|
|
33
|
-
type?: string;
|
|
34
|
-
categories?: string[];
|
|
35
|
-
reviews?: import("../../../domain").ProductReview[];
|
|
36
|
-
variants?: import("../../../domain").Variant[];
|
|
37
|
-
video?: string;
|
|
38
|
-
isKit?: boolean;
|
|
39
|
-
rate?: number;
|
|
40
|
-
gender?: import("../../../domain").ProductGender;
|
|
41
|
-
shoppingCount?: number;
|
|
42
|
-
metadata: import("../../../domain").ProductMetadata;
|
|
43
|
-
outlet?: boolean;
|
|
44
|
-
}[]>;
|
|
9
|
+
search(searchTerm: string, total: number, shop?: string): Promise<import("..").ElasticSearchResult<Product>>;
|
|
45
10
|
save(product: ProductHasuraGraphQL): Promise<void>;
|
|
46
11
|
update(product: ProductHasuraGraphQL): Promise<void>;
|
|
47
12
|
delete(id: string): Promise<void>;
|
|
@@ -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;
|
package/src/infra/index.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './product-search-index';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Product } from '../../../domain';
|
|
2
|
-
import { ProductSearch } from '../types';
|
|
3
|
-
export interface VertexSearchAdapter<T> {
|
|
4
|
-
query(searchTerm: string, total: number, gender?: String): Promise<ProductSearch[]>;
|
|
5
|
-
get(id: string): Promise<T>;
|
|
6
|
-
save(data: Product): Promise<any>;
|
|
7
|
-
update(id: string, data: Product): Promise<any>;
|
|
8
|
-
delete(id: string): Promise<void>;
|
|
9
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Product } from '../../../domain';
|
|
2
|
-
import { ProductSearch } from '../types';
|
|
3
|
-
import { VertexSearchConfig } from '../types/axios-vertex-search-config';
|
|
4
|
-
import { VertexSearchAdapter } from './vertex-ai-search.adapter';
|
|
5
|
-
export declare class VertexAxiosAdapter implements VertexSearchAdapter<ProductSearch> {
|
|
6
|
-
private readonly config;
|
|
7
|
-
private logger;
|
|
8
|
-
constructor(config: VertexSearchConfig);
|
|
9
|
-
query(term: string, total: number, gender?: String): Promise<ProductSearch[]>;
|
|
10
|
-
get(id: string): Promise<ProductSearch>;
|
|
11
|
-
save(data: Product): Promise<any>;
|
|
12
|
-
update(id: string, data: Product): Promise<any>;
|
|
13
|
-
delete(id: string): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './products-vertex-search';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ProductSearchIndex } from '../../../domain';
|
|
2
|
-
import { ProductHasuraGraphQL } from '../../hasura-graphql';
|
|
3
|
-
import { VertexSearchAdapter } from '../adapters';
|
|
4
|
-
import { ProductSearch } from '../types';
|
|
5
|
-
export declare class ProductsVertexSearch implements ProductSearchIndex {
|
|
6
|
-
private readonly adapter;
|
|
7
|
-
constructor(adapter: VertexSearchAdapter<ProductSearch>);
|
|
8
|
-
getById(id: string): Promise<ProductSearch>;
|
|
9
|
-
search<ProductSearch>(searchTerm: string, total: number, gender?: String): Promise<ProductSearch[]>;
|
|
10
|
-
save(product: ProductHasuraGraphQL): Promise<void>;
|
|
11
|
-
update(product: ProductHasuraGraphQL): Promise<void>;
|
|
12
|
-
delete(id: string): Promise<void>;
|
|
13
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type ProductSearch = {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
ean?: string;
|
|
5
|
-
sku: string;
|
|
6
|
-
icon?: string;
|
|
7
|
-
miniatures?: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
slug: string;
|
|
10
|
-
brand: string;
|
|
11
|
-
published: boolean;
|
|
12
|
-
gender: string;
|
|
13
|
-
shoppingCount: number;
|
|
14
|
-
stock: number;
|
|
15
|
-
rating: number;
|
|
16
|
-
fullPrice: number;
|
|
17
|
-
price: number;
|
|
18
|
-
subscriberPrice: number;
|
|
19
|
-
outlet: boolean;
|
|
20
|
-
createdAt: Date;
|
|
21
|
-
};
|