@infrab4a/connect 4.4.0-beta4 → 4.4.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 +66 -18
- package/index.esm.js +66 -19
- package/package.json +1 -1
- package/src/domain/shop-settings/models/shop-menu.d.ts +2 -0
- package/src/domain/shop-settings/models/shop-settings.d.ts +1 -0
- package/src/domain/shop-settings/models/types/menu-nav.type.d.ts +2 -1
- package/src/domain/shopping/models/payment.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/teste2.d.ts +0 -1
package/index.cjs.js
CHANGED
|
@@ -562,6 +562,10 @@ tslib_1.__decorate([
|
|
|
562
562
|
classTransformer.Expose({ name: 'paid_amount' }),
|
|
563
563
|
tslib_1.__metadata("design:type", Number)
|
|
564
564
|
], Payment.prototype, "paidAmount", void 0);
|
|
565
|
+
tslib_1.__decorate([
|
|
566
|
+
classTransformer.Expose({ name: 'paid_at' }),
|
|
567
|
+
tslib_1.__metadata("design:type", String)
|
|
568
|
+
], Payment.prototype, "paidAt", void 0);
|
|
565
569
|
tslib_1.__decorate([
|
|
566
570
|
classTransformer.Expose({ name: 'refunded_amount' }),
|
|
567
571
|
tslib_1.__metadata("design:type", Number)
|
|
@@ -2602,21 +2606,37 @@ class ProductsIndex {
|
|
|
2602
2606
|
_source: fields,
|
|
2603
2607
|
query: {
|
|
2604
2608
|
bool: {
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2609
|
+
should: [
|
|
2610
|
+
{
|
|
2611
|
+
multi_match: {
|
|
2612
|
+
query: `${searchTerm}`,
|
|
2613
|
+
fields: ['name', 'name.folded', 'name.search'],
|
|
2614
|
+
operator: 'AND',
|
|
2615
|
+
},
|
|
2610
2616
|
},
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2617
|
+
{
|
|
2618
|
+
match_phrase: {
|
|
2619
|
+
name: {
|
|
2620
|
+
query: `${searchTerm}`,
|
|
2621
|
+
boost: 2,
|
|
2622
|
+
},
|
|
2623
|
+
},
|
|
2624
|
+
},
|
|
2625
|
+
{
|
|
2626
|
+
match: {
|
|
2627
|
+
brand: {
|
|
2628
|
+
query: `${searchTerm}`,
|
|
2629
|
+
},
|
|
2630
|
+
},
|
|
2631
|
+
},
|
|
2632
|
+
{
|
|
2633
|
+
multi_match: {
|
|
2615
2634
|
query: `${searchTerm}`,
|
|
2616
|
-
|
|
2635
|
+
fields: ['name', 'name.folded', 'name.search'],
|
|
2636
|
+
operator: 'OR',
|
|
2617
2637
|
},
|
|
2618
2638
|
},
|
|
2619
|
-
|
|
2639
|
+
],
|
|
2620
2640
|
filter,
|
|
2621
2641
|
},
|
|
2622
2642
|
},
|
|
@@ -3621,6 +3641,22 @@ class ShopSettingsFirestoreRepository extends withCrudFirestore(withHelpers(with
|
|
|
3621
3641
|
}
|
|
3622
3642
|
}
|
|
3623
3643
|
|
|
3644
|
+
class ConnectBaseDocumentSnapshot {
|
|
3645
|
+
constructor(connectDocumentSnapshot) {
|
|
3646
|
+
this.connectDocumentSnapshot = connectDocumentSnapshot;
|
|
3647
|
+
this.id = connectDocumentSnapshot.id;
|
|
3648
|
+
}
|
|
3649
|
+
isNotEmpty() {
|
|
3650
|
+
return this.connectDocumentSnapshot.exists();
|
|
3651
|
+
}
|
|
3652
|
+
data(options) {
|
|
3653
|
+
return this.connectDocumentSnapshot.data(options);
|
|
3654
|
+
}
|
|
3655
|
+
get(fieldPath) {
|
|
3656
|
+
return this.connectDocumentSnapshot.get(fieldPath);
|
|
3657
|
+
}
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3624
3660
|
class ConnectDocumentService {
|
|
3625
3661
|
constructor(path, firestore$1) {
|
|
3626
3662
|
this.path = path;
|
|
@@ -3633,7 +3669,7 @@ class ConnectDocumentService {
|
|
|
3633
3669
|
});
|
|
3634
3670
|
}
|
|
3635
3671
|
async get() {
|
|
3636
|
-
return await firestore.getDoc(this.reference);
|
|
3672
|
+
return new ConnectBaseDocumentSnapshot(await firestore.getDoc(this.reference));
|
|
3637
3673
|
}
|
|
3638
3674
|
getId() {
|
|
3639
3675
|
return this.reference.id;
|
|
@@ -3650,7 +3686,10 @@ class ConnectDocumentService {
|
|
|
3650
3686
|
await firestore.deleteDoc(this.reference);
|
|
3651
3687
|
}
|
|
3652
3688
|
withConverter(params) {
|
|
3653
|
-
this.reference.withConverter(
|
|
3689
|
+
this.reference = this.reference.withConverter({
|
|
3690
|
+
toFirestore: (data) => params.toFirestore(data),
|
|
3691
|
+
fromFirestore: (snapshot, options) => params.fromFirestore(new ConnectBaseDocumentSnapshot(snapshot), options),
|
|
3692
|
+
});
|
|
3654
3693
|
return this;
|
|
3655
3694
|
}
|
|
3656
3695
|
}
|
|
@@ -3669,7 +3708,7 @@ class ConnectCollectionService {
|
|
|
3669
3708
|
}
|
|
3670
3709
|
async add(data, id) {
|
|
3671
3710
|
const newDoc = await this.save(data, id);
|
|
3672
|
-
return new ConnectDocumentService(newDoc.path, this.firestore);
|
|
3711
|
+
return new ConnectDocumentService(newDoc.path, this.firestore).withConverter(this.converter);
|
|
3673
3712
|
}
|
|
3674
3713
|
async getDocs() {
|
|
3675
3714
|
const constraints = [
|
|
@@ -3680,10 +3719,14 @@ class ConnectCollectionService {
|
|
|
3680
3719
|
...(this.statingAt ? [this.statingAt] : []),
|
|
3681
3720
|
...(this.startingAfter ? [this.startingAfter] : []),
|
|
3682
3721
|
];
|
|
3683
|
-
return firestore.getDocs(firestore.query(this.reference, ...constraints))
|
|
3722
|
+
return firestore.getDocs(firestore.query(this.reference, ...constraints)).then((docs) => ({
|
|
3723
|
+
empty: docs.empty,
|
|
3724
|
+
size: docs.size,
|
|
3725
|
+
docs: docs.docs.map((doc) => new ConnectBaseDocumentSnapshot(doc)),
|
|
3726
|
+
}));
|
|
3684
3727
|
}
|
|
3685
3728
|
getDoc(id) {
|
|
3686
|
-
return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore);
|
|
3729
|
+
return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore).withConverter(this.converter);
|
|
3687
3730
|
}
|
|
3688
3731
|
where(attribute, operator, value) {
|
|
3689
3732
|
this.wheres.push(firestore.where(attribute, operator, value));
|
|
@@ -3710,7 +3753,11 @@ class ConnectCollectionService {
|
|
|
3710
3753
|
return this;
|
|
3711
3754
|
}
|
|
3712
3755
|
withConverter(params) {
|
|
3713
|
-
this.
|
|
3756
|
+
this.converter = params;
|
|
3757
|
+
this.reference = this.reference.withConverter({
|
|
3758
|
+
toFirestore: (data) => params.toFirestore(data),
|
|
3759
|
+
fromFirestore: (snapshot, options) => params.fromFirestore(new ConnectBaseDocumentSnapshot(snapshot), options),
|
|
3760
|
+
});
|
|
3714
3761
|
return this;
|
|
3715
3762
|
}
|
|
3716
3763
|
async save(data, id) {
|
|
@@ -4878,7 +4925,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4878
4925
|
}
|
|
4879
4926
|
}
|
|
4880
4927
|
async getChildren(parentId) {
|
|
4881
|
-
const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id'], {
|
|
4928
|
+
const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id', 'slug', 'reference'], {
|
|
4882
4929
|
args: {
|
|
4883
4930
|
type: 'category_tree_args',
|
|
4884
4931
|
value: { parentid: parentId },
|
|
@@ -6000,6 +6047,7 @@ exports.CheckoutFirestoreRepository = CheckoutFirestoreRepository;
|
|
|
6000
6047
|
exports.CheckoutSubscription = CheckoutSubscription;
|
|
6001
6048
|
exports.CheckoutSubscriptionFirestoreRepository = CheckoutSubscriptionFirestoreRepository;
|
|
6002
6049
|
exports.ClassNameHelper = ClassNameHelper;
|
|
6050
|
+
exports.ConnectBaseDocumentSnapshot = ConnectBaseDocumentSnapshot;
|
|
6003
6051
|
exports.ConnectCollectionService = ConnectCollectionService;
|
|
6004
6052
|
exports.ConnectDocumentService = ConnectDocumentService;
|
|
6005
6053
|
exports.ConnectFirestoreService = ConnectFirestoreService;
|
package/index.esm.js
CHANGED
|
@@ -538,6 +538,10 @@ __decorate([
|
|
|
538
538
|
Expose({ name: 'paid_amount' }),
|
|
539
539
|
__metadata("design:type", Number)
|
|
540
540
|
], Payment.prototype, "paidAmount", void 0);
|
|
541
|
+
__decorate([
|
|
542
|
+
Expose({ name: 'paid_at' }),
|
|
543
|
+
__metadata("design:type", String)
|
|
544
|
+
], Payment.prototype, "paidAt", void 0);
|
|
541
545
|
__decorate([
|
|
542
546
|
Expose({ name: 'refunded_amount' }),
|
|
543
547
|
__metadata("design:type", Number)
|
|
@@ -2578,21 +2582,37 @@ class ProductsIndex {
|
|
|
2578
2582
|
_source: fields,
|
|
2579
2583
|
query: {
|
|
2580
2584
|
bool: {
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2585
|
+
should: [
|
|
2586
|
+
{
|
|
2587
|
+
multi_match: {
|
|
2588
|
+
query: `${searchTerm}`,
|
|
2589
|
+
fields: ['name', 'name.folded', 'name.search'],
|
|
2590
|
+
operator: 'AND',
|
|
2591
|
+
},
|
|
2586
2592
|
},
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2593
|
+
{
|
|
2594
|
+
match_phrase: {
|
|
2595
|
+
name: {
|
|
2596
|
+
query: `${searchTerm}`,
|
|
2597
|
+
boost: 2,
|
|
2598
|
+
},
|
|
2599
|
+
},
|
|
2600
|
+
},
|
|
2601
|
+
{
|
|
2602
|
+
match: {
|
|
2603
|
+
brand: {
|
|
2604
|
+
query: `${searchTerm}`,
|
|
2605
|
+
},
|
|
2606
|
+
},
|
|
2607
|
+
},
|
|
2608
|
+
{
|
|
2609
|
+
multi_match: {
|
|
2591
2610
|
query: `${searchTerm}`,
|
|
2592
|
-
|
|
2611
|
+
fields: ['name', 'name.folded', 'name.search'],
|
|
2612
|
+
operator: 'OR',
|
|
2593
2613
|
},
|
|
2594
2614
|
},
|
|
2595
|
-
|
|
2615
|
+
],
|
|
2596
2616
|
filter,
|
|
2597
2617
|
},
|
|
2598
2618
|
},
|
|
@@ -3597,6 +3617,22 @@ class ShopSettingsFirestoreRepository extends withCrudFirestore(withHelpers(with
|
|
|
3597
3617
|
}
|
|
3598
3618
|
}
|
|
3599
3619
|
|
|
3620
|
+
class ConnectBaseDocumentSnapshot {
|
|
3621
|
+
constructor(connectDocumentSnapshot) {
|
|
3622
|
+
this.connectDocumentSnapshot = connectDocumentSnapshot;
|
|
3623
|
+
this.id = connectDocumentSnapshot.id;
|
|
3624
|
+
}
|
|
3625
|
+
isNotEmpty() {
|
|
3626
|
+
return this.connectDocumentSnapshot.exists();
|
|
3627
|
+
}
|
|
3628
|
+
data(options) {
|
|
3629
|
+
return this.connectDocumentSnapshot.data(options);
|
|
3630
|
+
}
|
|
3631
|
+
get(fieldPath) {
|
|
3632
|
+
return this.connectDocumentSnapshot.get(fieldPath);
|
|
3633
|
+
}
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3600
3636
|
class ConnectDocumentService {
|
|
3601
3637
|
constructor(path, firestore) {
|
|
3602
3638
|
this.path = path;
|
|
@@ -3609,7 +3645,7 @@ class ConnectDocumentService {
|
|
|
3609
3645
|
});
|
|
3610
3646
|
}
|
|
3611
3647
|
async get() {
|
|
3612
|
-
return await getDoc(this.reference);
|
|
3648
|
+
return new ConnectBaseDocumentSnapshot(await getDoc(this.reference));
|
|
3613
3649
|
}
|
|
3614
3650
|
getId() {
|
|
3615
3651
|
return this.reference.id;
|
|
@@ -3626,7 +3662,10 @@ class ConnectDocumentService {
|
|
|
3626
3662
|
await deleteDoc(this.reference);
|
|
3627
3663
|
}
|
|
3628
3664
|
withConverter(params) {
|
|
3629
|
-
this.reference.withConverter(
|
|
3665
|
+
this.reference = this.reference.withConverter({
|
|
3666
|
+
toFirestore: (data) => params.toFirestore(data),
|
|
3667
|
+
fromFirestore: (snapshot, options) => params.fromFirestore(new ConnectBaseDocumentSnapshot(snapshot), options),
|
|
3668
|
+
});
|
|
3630
3669
|
return this;
|
|
3631
3670
|
}
|
|
3632
3671
|
}
|
|
@@ -3645,7 +3684,7 @@ class ConnectCollectionService {
|
|
|
3645
3684
|
}
|
|
3646
3685
|
async add(data, id) {
|
|
3647
3686
|
const newDoc = await this.save(data, id);
|
|
3648
|
-
return new ConnectDocumentService(newDoc.path, this.firestore);
|
|
3687
|
+
return new ConnectDocumentService(newDoc.path, this.firestore).withConverter(this.converter);
|
|
3649
3688
|
}
|
|
3650
3689
|
async getDocs() {
|
|
3651
3690
|
const constraints = [
|
|
@@ -3656,10 +3695,14 @@ class ConnectCollectionService {
|
|
|
3656
3695
|
...(this.statingAt ? [this.statingAt] : []),
|
|
3657
3696
|
...(this.startingAfter ? [this.startingAfter] : []),
|
|
3658
3697
|
];
|
|
3659
|
-
return getDocs(query(this.reference, ...constraints))
|
|
3698
|
+
return getDocs(query(this.reference, ...constraints)).then((docs) => ({
|
|
3699
|
+
empty: docs.empty,
|
|
3700
|
+
size: docs.size,
|
|
3701
|
+
docs: docs.docs.map((doc) => new ConnectBaseDocumentSnapshot(doc)),
|
|
3702
|
+
}));
|
|
3660
3703
|
}
|
|
3661
3704
|
getDoc(id) {
|
|
3662
|
-
return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore);
|
|
3705
|
+
return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore).withConverter(this.converter);
|
|
3663
3706
|
}
|
|
3664
3707
|
where(attribute, operator, value) {
|
|
3665
3708
|
this.wheres.push(where(attribute, operator, value));
|
|
@@ -3686,7 +3729,11 @@ class ConnectCollectionService {
|
|
|
3686
3729
|
return this;
|
|
3687
3730
|
}
|
|
3688
3731
|
withConverter(params) {
|
|
3689
|
-
this.
|
|
3732
|
+
this.converter = params;
|
|
3733
|
+
this.reference = this.reference.withConverter({
|
|
3734
|
+
toFirestore: (data) => params.toFirestore(data),
|
|
3735
|
+
fromFirestore: (snapshot, options) => params.fromFirestore(new ConnectBaseDocumentSnapshot(snapshot), options),
|
|
3736
|
+
});
|
|
3690
3737
|
return this;
|
|
3691
3738
|
}
|
|
3692
3739
|
async save(data, id) {
|
|
@@ -4854,7 +4901,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4854
4901
|
}
|
|
4855
4902
|
}
|
|
4856
4903
|
async getChildren(parentId) {
|
|
4857
|
-
const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id'], {
|
|
4904
|
+
const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id', 'slug', 'reference'], {
|
|
4858
4905
|
args: {
|
|
4859
4906
|
type: 'category_tree_args',
|
|
4860
4907
|
value: { parentid: parentId },
|
|
@@ -5831,4 +5878,4 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5831
5878
|
}
|
|
5832
5879
|
}
|
|
5833
5880
|
|
|
5834
|
-
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 };
|
|
5881
|
+
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
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { Shops } from '../../catalog';
|
|
1
2
|
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
3
|
import { MenuNav } from './types/menu-nav.type';
|
|
3
4
|
export declare class ShopMenu extends BaseModel<ShopMenu> {
|
|
4
5
|
menuNav: MenuNav[];
|
|
6
|
+
shop: Shops;
|
|
5
7
|
id: string;
|
|
6
8
|
static get identifiersFields(): GenericIdentifier[];
|
|
7
9
|
}
|
|
@@ -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';
|
package/teste2.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|