@infrab4a/connect 4.4.0-beta.7 → 4.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 +61 -19
- package/index.esm.js +61 -20
- package/package.json +1 -1
- package/src/domain/shop-settings/models/shop-settings.d.ts +1 -0
- package/src/domain/shopping/models/subscription/checkout.d.ts +1 -0
- package/src/infra/firebase/firestore/index.d.ts +1 -0
- package/src/infra/firebase/firestore/services/connect-collection-reference.d.ts +4 -4
- package/src/infra/firebase/firestore/services/connect-collection.service.d.ts +5 -5
- package/src/infra/firebase/firestore/services/connect-document-reference.d.ts +3 -3
- package/src/infra/firebase/firestore/services/connect-document.service.d.ts +3 -3
- package/src/infra/firebase/firestore/types/connect-firestore/{connect-document-snapshop.type.d.ts → connect-document-snapshot.type.d.ts} +5 -2
- package/src/infra/firebase/firestore/types/connect-firestore/connect-query-snapshot.type.d.ts +2 -2
- package/src/infra/firebase/firestore/types/connect-firestore/index.d.ts +1 -1
- package/src/infra/firebase/firestore/vo/connectBaseDocumentSnapshot.vo.d.ts +10 -0
- package/src/infra/firebase/firestore/vo/index.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -2602,21 +2602,37 @@ class ProductsIndex {
|
|
|
2602
2602
|
_source: fields,
|
|
2603
2603
|
query: {
|
|
2604
2604
|
bool: {
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2605
|
+
should: [
|
|
2606
|
+
{
|
|
2607
|
+
multi_match: {
|
|
2608
|
+
query: `${searchTerm}`,
|
|
2609
|
+
fields: ['name', 'name.folded', 'name.search'],
|
|
2610
|
+
operator: 'AND',
|
|
2611
|
+
},
|
|
2610
2612
|
},
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2613
|
+
{
|
|
2614
|
+
match_phrase: {
|
|
2615
|
+
name: {
|
|
2616
|
+
query: `${searchTerm}`,
|
|
2617
|
+
boost: 2,
|
|
2618
|
+
},
|
|
2619
|
+
},
|
|
2620
|
+
},
|
|
2621
|
+
{
|
|
2622
|
+
match: {
|
|
2623
|
+
brand: {
|
|
2624
|
+
query: `${searchTerm}`,
|
|
2625
|
+
},
|
|
2626
|
+
},
|
|
2627
|
+
},
|
|
2628
|
+
{
|
|
2629
|
+
multi_match: {
|
|
2615
2630
|
query: `${searchTerm}`,
|
|
2616
|
-
|
|
2631
|
+
fields: ['name', 'name.folded', 'name.search'],
|
|
2632
|
+
operator: 'OR',
|
|
2617
2633
|
},
|
|
2618
2634
|
},
|
|
2619
|
-
|
|
2635
|
+
],
|
|
2620
2636
|
filter,
|
|
2621
2637
|
},
|
|
2622
2638
|
},
|
|
@@ -3621,6 +3637,22 @@ class ShopSettingsFirestoreRepository extends withCrudFirestore(withHelpers(with
|
|
|
3621
3637
|
}
|
|
3622
3638
|
}
|
|
3623
3639
|
|
|
3640
|
+
class ConnectBaseDocumentSnapshot {
|
|
3641
|
+
constructor(connectDocumentSnapshot) {
|
|
3642
|
+
this.connectDocumentSnapshot = connectDocumentSnapshot;
|
|
3643
|
+
this.id = connectDocumentSnapshot.id;
|
|
3644
|
+
}
|
|
3645
|
+
isNotEmpty() {
|
|
3646
|
+
return this.connectDocumentSnapshot.exists();
|
|
3647
|
+
}
|
|
3648
|
+
data(options) {
|
|
3649
|
+
return this.connectDocumentSnapshot.data(options);
|
|
3650
|
+
}
|
|
3651
|
+
get(fieldPath) {
|
|
3652
|
+
return this.connectDocumentSnapshot.get(fieldPath);
|
|
3653
|
+
}
|
|
3654
|
+
}
|
|
3655
|
+
|
|
3624
3656
|
class ConnectDocumentService {
|
|
3625
3657
|
constructor(path, firestore$1) {
|
|
3626
3658
|
this.path = path;
|
|
@@ -3633,13 +3665,12 @@ class ConnectDocumentService {
|
|
|
3633
3665
|
});
|
|
3634
3666
|
}
|
|
3635
3667
|
async get() {
|
|
3636
|
-
return await firestore.getDoc(this.reference);
|
|
3668
|
+
return new ConnectBaseDocumentSnapshot(await firestore.getDoc(this.reference));
|
|
3637
3669
|
}
|
|
3638
3670
|
getId() {
|
|
3639
3671
|
return this.reference.id;
|
|
3640
3672
|
}
|
|
3641
3673
|
async save(data) {
|
|
3642
|
-
console.log('save ConnectDocumentService', data);
|
|
3643
3674
|
const doc = await firestore.getDoc(this.reference);
|
|
3644
3675
|
if (doc.exists())
|
|
3645
3676
|
await firestore.updateDoc(this.reference, data);
|
|
@@ -3651,7 +3682,10 @@ class ConnectDocumentService {
|
|
|
3651
3682
|
await firestore.deleteDoc(this.reference);
|
|
3652
3683
|
}
|
|
3653
3684
|
withConverter(params) {
|
|
3654
|
-
this.reference = this.reference.withConverter(
|
|
3685
|
+
this.reference = this.reference.withConverter({
|
|
3686
|
+
toFirestore: (data) => params.toFirestore(data),
|
|
3687
|
+
fromFirestore: (snapshot, options) => params.fromFirestore(new ConnectBaseDocumentSnapshot(snapshot), options),
|
|
3688
|
+
});
|
|
3655
3689
|
return this;
|
|
3656
3690
|
}
|
|
3657
3691
|
}
|
|
@@ -3670,7 +3704,7 @@ class ConnectCollectionService {
|
|
|
3670
3704
|
}
|
|
3671
3705
|
async add(data, id) {
|
|
3672
3706
|
const newDoc = await this.save(data, id);
|
|
3673
|
-
return new ConnectDocumentService(newDoc.path, this.firestore);
|
|
3707
|
+
return new ConnectDocumentService(newDoc.path, this.firestore).withConverter(this.converter);
|
|
3674
3708
|
}
|
|
3675
3709
|
async getDocs() {
|
|
3676
3710
|
const constraints = [
|
|
@@ -3681,10 +3715,14 @@ class ConnectCollectionService {
|
|
|
3681
3715
|
...(this.statingAt ? [this.statingAt] : []),
|
|
3682
3716
|
...(this.startingAfter ? [this.startingAfter] : []),
|
|
3683
3717
|
];
|
|
3684
|
-
return firestore.getDocs(firestore.query(this.reference, ...constraints))
|
|
3718
|
+
return firestore.getDocs(firestore.query(this.reference, ...constraints)).then((docs) => ({
|
|
3719
|
+
empty: docs.empty,
|
|
3720
|
+
size: docs.size,
|
|
3721
|
+
docs: docs.docs.map((doc) => new ConnectBaseDocumentSnapshot(doc)),
|
|
3722
|
+
}));
|
|
3685
3723
|
}
|
|
3686
3724
|
getDoc(id) {
|
|
3687
|
-
return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore).withConverter(this.
|
|
3725
|
+
return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore).withConverter(this.converter);
|
|
3688
3726
|
}
|
|
3689
3727
|
where(attribute, operator, value) {
|
|
3690
3728
|
this.wheres.push(firestore.where(attribute, operator, value));
|
|
@@ -3711,11 +3749,14 @@ class ConnectCollectionService {
|
|
|
3711
3749
|
return this;
|
|
3712
3750
|
}
|
|
3713
3751
|
withConverter(params) {
|
|
3714
|
-
this.
|
|
3752
|
+
this.converter = params;
|
|
3753
|
+
this.reference = this.reference.withConverter({
|
|
3754
|
+
toFirestore: (data) => params.toFirestore(data),
|
|
3755
|
+
fromFirestore: (snapshot, options) => params.fromFirestore(new ConnectBaseDocumentSnapshot(snapshot), options),
|
|
3756
|
+
});
|
|
3715
3757
|
return this;
|
|
3716
3758
|
}
|
|
3717
3759
|
async save(data, id) {
|
|
3718
|
-
console.log('save ConnectCollectionService', data, id);
|
|
3719
3760
|
if (lodash.isEmpty(id))
|
|
3720
3761
|
return firestore.addDoc(this.reference, data);
|
|
3721
3762
|
const docRef = firestore.doc(this.reference, id);
|
|
@@ -6002,6 +6043,7 @@ exports.CheckoutFirestoreRepository = CheckoutFirestoreRepository;
|
|
|
6002
6043
|
exports.CheckoutSubscription = CheckoutSubscription;
|
|
6003
6044
|
exports.CheckoutSubscriptionFirestoreRepository = CheckoutSubscriptionFirestoreRepository;
|
|
6004
6045
|
exports.ClassNameHelper = ClassNameHelper;
|
|
6046
|
+
exports.ConnectBaseDocumentSnapshot = ConnectBaseDocumentSnapshot;
|
|
6005
6047
|
exports.ConnectCollectionService = ConnectCollectionService;
|
|
6006
6048
|
exports.ConnectDocumentService = ConnectDocumentService;
|
|
6007
6049
|
exports.ConnectFirestoreService = ConnectFirestoreService;
|
package/index.esm.js
CHANGED
|
@@ -2578,21 +2578,37 @@ class ProductsIndex {
|
|
|
2578
2578
|
_source: fields,
|
|
2579
2579
|
query: {
|
|
2580
2580
|
bool: {
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2581
|
+
should: [
|
|
2582
|
+
{
|
|
2583
|
+
multi_match: {
|
|
2584
|
+
query: `${searchTerm}`,
|
|
2585
|
+
fields: ['name', 'name.folded', 'name.search'],
|
|
2586
|
+
operator: 'AND',
|
|
2587
|
+
},
|
|
2586
2588
|
},
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2589
|
+
{
|
|
2590
|
+
match_phrase: {
|
|
2591
|
+
name: {
|
|
2592
|
+
query: `${searchTerm}`,
|
|
2593
|
+
boost: 2,
|
|
2594
|
+
},
|
|
2595
|
+
},
|
|
2596
|
+
},
|
|
2597
|
+
{
|
|
2598
|
+
match: {
|
|
2599
|
+
brand: {
|
|
2600
|
+
query: `${searchTerm}`,
|
|
2601
|
+
},
|
|
2602
|
+
},
|
|
2603
|
+
},
|
|
2604
|
+
{
|
|
2605
|
+
multi_match: {
|
|
2591
2606
|
query: `${searchTerm}`,
|
|
2592
|
-
|
|
2607
|
+
fields: ['name', 'name.folded', 'name.search'],
|
|
2608
|
+
operator: 'OR',
|
|
2593
2609
|
},
|
|
2594
2610
|
},
|
|
2595
|
-
|
|
2611
|
+
],
|
|
2596
2612
|
filter,
|
|
2597
2613
|
},
|
|
2598
2614
|
},
|
|
@@ -3597,6 +3613,22 @@ class ShopSettingsFirestoreRepository extends withCrudFirestore(withHelpers(with
|
|
|
3597
3613
|
}
|
|
3598
3614
|
}
|
|
3599
3615
|
|
|
3616
|
+
class ConnectBaseDocumentSnapshot {
|
|
3617
|
+
constructor(connectDocumentSnapshot) {
|
|
3618
|
+
this.connectDocumentSnapshot = connectDocumentSnapshot;
|
|
3619
|
+
this.id = connectDocumentSnapshot.id;
|
|
3620
|
+
}
|
|
3621
|
+
isNotEmpty() {
|
|
3622
|
+
return this.connectDocumentSnapshot.exists();
|
|
3623
|
+
}
|
|
3624
|
+
data(options) {
|
|
3625
|
+
return this.connectDocumentSnapshot.data(options);
|
|
3626
|
+
}
|
|
3627
|
+
get(fieldPath) {
|
|
3628
|
+
return this.connectDocumentSnapshot.get(fieldPath);
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
|
|
3600
3632
|
class ConnectDocumentService {
|
|
3601
3633
|
constructor(path, firestore) {
|
|
3602
3634
|
this.path = path;
|
|
@@ -3609,13 +3641,12 @@ class ConnectDocumentService {
|
|
|
3609
3641
|
});
|
|
3610
3642
|
}
|
|
3611
3643
|
async get() {
|
|
3612
|
-
return await getDoc(this.reference);
|
|
3644
|
+
return new ConnectBaseDocumentSnapshot(await getDoc(this.reference));
|
|
3613
3645
|
}
|
|
3614
3646
|
getId() {
|
|
3615
3647
|
return this.reference.id;
|
|
3616
3648
|
}
|
|
3617
3649
|
async save(data) {
|
|
3618
|
-
console.log('save ConnectDocumentService', data);
|
|
3619
3650
|
const doc = await getDoc(this.reference);
|
|
3620
3651
|
if (doc.exists())
|
|
3621
3652
|
await updateDoc(this.reference, data);
|
|
@@ -3627,7 +3658,10 @@ class ConnectDocumentService {
|
|
|
3627
3658
|
await deleteDoc(this.reference);
|
|
3628
3659
|
}
|
|
3629
3660
|
withConverter(params) {
|
|
3630
|
-
this.reference = this.reference.withConverter(
|
|
3661
|
+
this.reference = this.reference.withConverter({
|
|
3662
|
+
toFirestore: (data) => params.toFirestore(data),
|
|
3663
|
+
fromFirestore: (snapshot, options) => params.fromFirestore(new ConnectBaseDocumentSnapshot(snapshot), options),
|
|
3664
|
+
});
|
|
3631
3665
|
return this;
|
|
3632
3666
|
}
|
|
3633
3667
|
}
|
|
@@ -3646,7 +3680,7 @@ class ConnectCollectionService {
|
|
|
3646
3680
|
}
|
|
3647
3681
|
async add(data, id) {
|
|
3648
3682
|
const newDoc = await this.save(data, id);
|
|
3649
|
-
return new ConnectDocumentService(newDoc.path, this.firestore);
|
|
3683
|
+
return new ConnectDocumentService(newDoc.path, this.firestore).withConverter(this.converter);
|
|
3650
3684
|
}
|
|
3651
3685
|
async getDocs() {
|
|
3652
3686
|
const constraints = [
|
|
@@ -3657,10 +3691,14 @@ class ConnectCollectionService {
|
|
|
3657
3691
|
...(this.statingAt ? [this.statingAt] : []),
|
|
3658
3692
|
...(this.startingAfter ? [this.startingAfter] : []),
|
|
3659
3693
|
];
|
|
3660
|
-
return getDocs(query(this.reference, ...constraints))
|
|
3694
|
+
return getDocs(query(this.reference, ...constraints)).then((docs) => ({
|
|
3695
|
+
empty: docs.empty,
|
|
3696
|
+
size: docs.size,
|
|
3697
|
+
docs: docs.docs.map((doc) => new ConnectBaseDocumentSnapshot(doc)),
|
|
3698
|
+
}));
|
|
3661
3699
|
}
|
|
3662
3700
|
getDoc(id) {
|
|
3663
|
-
return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore).withConverter(this.
|
|
3701
|
+
return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore).withConverter(this.converter);
|
|
3664
3702
|
}
|
|
3665
3703
|
where(attribute, operator, value) {
|
|
3666
3704
|
this.wheres.push(where(attribute, operator, value));
|
|
@@ -3687,11 +3725,14 @@ class ConnectCollectionService {
|
|
|
3687
3725
|
return this;
|
|
3688
3726
|
}
|
|
3689
3727
|
withConverter(params) {
|
|
3690
|
-
this.
|
|
3728
|
+
this.converter = params;
|
|
3729
|
+
this.reference = this.reference.withConverter({
|
|
3730
|
+
toFirestore: (data) => params.toFirestore(data),
|
|
3731
|
+
fromFirestore: (snapshot, options) => params.fromFirestore(new ConnectBaseDocumentSnapshot(snapshot), options),
|
|
3732
|
+
});
|
|
3691
3733
|
return this;
|
|
3692
3734
|
}
|
|
3693
3735
|
async save(data, id) {
|
|
3694
|
-
console.log('save ConnectCollectionService', data, id);
|
|
3695
3736
|
if (isEmpty(id))
|
|
3696
3737
|
return addDoc(this.reference, data);
|
|
3697
3738
|
const docRef = doc(this.reference, id);
|
|
@@ -5833,4 +5874,4 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5833
5874
|
}
|
|
5834
5875
|
}
|
|
5835
5876
|
|
|
5836
|
-
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, 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 };
|
|
5877
|
+
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 };
|
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ export declare class CheckoutSubscription extends BaseModel<CheckoutSubscription
|
|
|
11
11
|
userId?: string;
|
|
12
12
|
discount?: number;
|
|
13
13
|
subTotalPrice?: number;
|
|
14
|
+
shippingPrice?: number;
|
|
14
15
|
totalPrice?: number;
|
|
15
16
|
shippingAddress: UserAddress;
|
|
16
17
|
billingAddress?: UserAddress;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConnectQuerySnapshot, ConnectWhereOption } from '../types';
|
|
2
2
|
import { ConnectDocumentData } from '../types/connect-firestore/connect-document-data.type';
|
|
3
|
-
import { ConnectDocumentSnapshot } from '../types/connect-firestore/connect-document-
|
|
3
|
+
import { ConnectDocumentSnapshot, ConnectSnapshotOptions } from '../types/connect-firestore/connect-document-snapshot.type';
|
|
4
4
|
import { ConnectDocumentReference } from './connect-document-reference';
|
|
5
5
|
export interface ConnectCollectionReference<T extends ConnectDocumentData> {
|
|
6
6
|
add(data: Partial<T>, id?: string): Promise<ConnectDocumentReference<T>>;
|
|
@@ -14,8 +14,8 @@ export interface ConnectCollectionReference<T extends ConnectDocumentData> {
|
|
|
14
14
|
fromStartAfter(startAt: ConnectDocumentReference<T>): ConnectCollectionReference<T>;
|
|
15
15
|
withConverter(converter: {
|
|
16
16
|
toFirestore: (data: T) => ConnectDocumentData<T>;
|
|
17
|
-
fromFirestore: (
|
|
17
|
+
fromFirestore: (snapshot: ConnectDocumentSnapshot<T>, options?: ConnectSnapshotOptions) => T;
|
|
18
18
|
}): ConnectCollectionReference<T>;
|
|
19
19
|
getDoc(id?: string): ConnectDocumentReference<T>;
|
|
20
|
-
getDocs(): Promise<
|
|
20
|
+
getDocs(): Promise<ConnectQuerySnapshot<T>>;
|
|
21
21
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Firestore } from 'firebase/firestore';
|
|
2
|
-
import { ConnectDocumentData,
|
|
3
|
-
import { ConnectDocumentSnapshot } from '../types/connect-firestore/connect-document-snapshop.type';
|
|
2
|
+
import { ConnectDocumentData, ConnectDocumentSnapshot, ConnectQuerySnapshot, ConnectSnapshotOptions, ConnectWhereOption } from '../types';
|
|
4
3
|
import { ConnectCollectionReference } from './connect-collection-reference';
|
|
5
4
|
import { ConnectDocumentReference } from './connect-document-reference';
|
|
6
5
|
export declare class ConnectCollectionService<T extends ConnectDocumentData> implements ConnectCollectionReference<T> {
|
|
@@ -12,9 +11,10 @@ export declare class ConnectCollectionService<T extends ConnectDocumentData> imp
|
|
|
12
11
|
private offsetBy;
|
|
13
12
|
private statingAt;
|
|
14
13
|
private startingAfter;
|
|
14
|
+
private converter;
|
|
15
15
|
constructor(path: string, firestore: Firestore);
|
|
16
16
|
add(data: T, id?: string): Promise<ConnectDocumentReference<T>>;
|
|
17
|
-
getDocs(): Promise<
|
|
17
|
+
getDocs(): Promise<ConnectQuerySnapshot<T>>;
|
|
18
18
|
getDoc(id?: string): ConnectDocumentReference<T>;
|
|
19
19
|
where(attribute: string, operator: ConnectWhereOption, value: any): ConnectCollectionReference<T>;
|
|
20
20
|
order(attribute: string, order: 'asc' | 'desc'): ConnectCollectionReference<T>;
|
|
@@ -25,8 +25,8 @@ export declare class ConnectCollectionService<T extends ConnectDocumentData> imp
|
|
|
25
25
|
fromStartAfter(startingAt: number): ConnectCollectionReference<T>;
|
|
26
26
|
fromStartAfter(startingAt: ConnectDocumentReference<T>): ConnectCollectionReference<T>;
|
|
27
27
|
withConverter(params: {
|
|
28
|
-
toFirestore: (data: T) => T
|
|
29
|
-
fromFirestore: (snapshot: ConnectDocumentSnapshot<T
|
|
28
|
+
toFirestore: (data: T) => ConnectDocumentData<T>;
|
|
29
|
+
fromFirestore: (snapshot: ConnectDocumentSnapshot<T>, options?: ConnectSnapshotOptions) => T;
|
|
30
30
|
}): ConnectCollectionReference<T>;
|
|
31
31
|
private save;
|
|
32
32
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ConnectDocumentData } from '../types/connect-firestore/connect-document-data.type';
|
|
2
|
-
import { ConnectDocumentSnapshot } from '../types/connect-firestore/connect-document-
|
|
2
|
+
import { ConnectDocumentSnapshot, ConnectSnapshotOptions } from '../types/connect-firestore/connect-document-snapshot.type';
|
|
3
3
|
export interface ConnectDocumentReference<T extends ConnectDocumentData> {
|
|
4
4
|
get(): Promise<ConnectDocumentSnapshot<T>>;
|
|
5
5
|
getId(): string;
|
|
6
6
|
save(data: T): Promise<ConnectDocumentReference<T>>;
|
|
7
7
|
delete(): Promise<void>;
|
|
8
8
|
withConverter(converter: {
|
|
9
|
-
toFirestore: (data: T) => T
|
|
10
|
-
fromFirestore: (
|
|
9
|
+
toFirestore: (data: T) => ConnectDocumentData<T>;
|
|
10
|
+
fromFirestore: (snapshot: ConnectDocumentSnapshot<T>, options?: ConnectSnapshotOptions) => T;
|
|
11
11
|
}): ConnectDocumentReference<T>;
|
|
12
12
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Firestore } from 'firebase/firestore';
|
|
2
|
-
import { ConnectDocumentData, ConnectDocumentSnapshot } from '../types';
|
|
2
|
+
import { ConnectDocumentData, ConnectDocumentSnapshot, ConnectSnapshotOptions } from '../types';
|
|
3
3
|
import { ConnectDocumentReference } from './connect-document-reference';
|
|
4
4
|
export declare class ConnectDocumentService<T extends ConnectDocumentData> implements ConnectDocumentReference<T> {
|
|
5
5
|
private path;
|
|
@@ -11,7 +11,7 @@ export declare class ConnectDocumentService<T extends ConnectDocumentData> imple
|
|
|
11
11
|
save(data: T): Promise<ConnectDocumentReference<T>>;
|
|
12
12
|
delete(): Promise<void>;
|
|
13
13
|
withConverter(params: {
|
|
14
|
-
toFirestore: (data: T) => T
|
|
15
|
-
fromFirestore: (snapshot: ConnectDocumentSnapshot<T
|
|
14
|
+
toFirestore: (data: T) => ConnectDocumentData<T>;
|
|
15
|
+
fromFirestore: (snapshot: ConnectDocumentSnapshot<T>, options?: ConnectSnapshotOptions) => T;
|
|
16
16
|
}): ConnectDocumentReference<T>;
|
|
17
17
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ConnectDocumentData } from './connect-document-data.type';
|
|
2
|
+
export type ConnectSnapshotOptions = {
|
|
3
|
+
serverTimestamps?: 'estimate' | 'previous' | 'none';
|
|
4
|
+
};
|
|
2
5
|
export type ConnectDocumentSnapshot<T extends ConnectDocumentData = ConnectDocumentData> = {
|
|
3
|
-
|
|
4
|
-
data(): T
|
|
6
|
+
isNotEmpty(): boolean;
|
|
7
|
+
data(options?: ConnectSnapshotOptions): T;
|
|
5
8
|
get(fieldPath: string): any;
|
|
6
9
|
id: string;
|
|
7
10
|
};
|
package/src/infra/firebase/firestore/types/connect-firestore/connect-query-snapshot.type.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConnectDocumentData } from './connect-document-data.type';
|
|
2
|
-
import { ConnectDocumentSnapshot } from './connect-document-
|
|
3
|
-
export type
|
|
2
|
+
import { ConnectDocumentSnapshot } from './connect-document-snapshot.type';
|
|
3
|
+
export type ConnectQuerySnapshot<T extends ConnectDocumentData> = {
|
|
4
4
|
docs: ConnectDocumentSnapshot<T>[];
|
|
5
5
|
size: number;
|
|
6
6
|
empty: boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DocumentSnapshot } from 'firebase/firestore';
|
|
2
|
+
import { ConnectDocumentData, ConnectDocumentSnapshot, ConnectSnapshotOptions } from '../types';
|
|
3
|
+
export declare class ConnectBaseDocumentSnapshot<T extends ConnectDocumentData = ConnectDocumentData> implements ConnectDocumentSnapshot<T> {
|
|
4
|
+
private readonly connectDocumentSnapshot;
|
|
5
|
+
id: string;
|
|
6
|
+
constructor(connectDocumentSnapshot: DocumentSnapshot<T>);
|
|
7
|
+
isNotEmpty(): boolean;
|
|
8
|
+
data(options?: ConnectSnapshotOptions): T;
|
|
9
|
+
get(fieldPath: string): any;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './connectBaseDocumentSnapshot.vo';
|