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