@dereekb/firebase 13.11.13 → 13.11.15
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 +1446 -1137
- package/index.esm.js +1437 -1128
- package/package.json +5 -5
- package/src/lib/client/error/error.d.ts +1 -1
- package/src/lib/client/firestore/array.d.ts +3 -2
- package/src/lib/client/firestore/driver.accessor.batch.d.ts +5 -4
- package/src/lib/client/firestore/driver.accessor.create.d.ts +4 -3
- package/src/lib/client/firestore/driver.accessor.d.ts +2 -1
- package/src/lib/client/firestore/driver.accessor.default.d.ts +5 -3
- package/src/lib/client/firestore/driver.accessor.transaction.d.ts +7 -5
- package/src/lib/client/firestore/driver.d.ts +1 -1
- package/src/lib/client/firestore/driver.query.d.ts +5 -5
- package/src/lib/client/firestore/increment.d.ts +3 -2
- package/src/lib/client/function/development.function.factory.d.ts +3 -2
- package/src/lib/client/function/error.d.ts +2 -2
- package/src/lib/client/function/function.callable.d.ts +5 -5
- package/src/lib/client/function/function.factory.d.ts +6 -4
- package/src/lib/client/function/model.function.factory.d.ts +9 -8
- package/src/lib/client/storage/driver.accessor.d.ts +14 -14
- package/src/lib/client/storage/driver.d.ts +1 -1
- package/src/lib/common/auth/auth.error.d.ts +2 -2
- package/src/lib/common/development/function.d.ts +5 -5
- package/src/lib/common/firestore/accessor/accessor.d.ts +22 -16
- package/src/lib/common/firestore/accessor/accessor.wrap.d.ts +33 -29
- package/src/lib/common/firestore/accessor/accessor.wrap.modify.d.ts +11 -7
- package/src/lib/common/firestore/accessor/array.d.ts +3 -2
- package/src/lib/common/firestore/accessor/document.d.ts +27 -24
- package/src/lib/common/firestore/accessor/document.paged.d.ts +2 -2
- package/src/lib/common/firestore/accessor/document.rxjs.d.ts +15 -12
- package/src/lib/common/firestore/accessor/document.utility.d.ts +81 -72
- package/src/lib/common/firestore/accessor/increment.d.ts +3 -2
- package/src/lib/common/firestore/cache/cache.d.ts +8 -7
- package/src/lib/common/firestore/cache/cache.memory.d.ts +13 -10
- package/src/lib/common/firestore/collection/collection.d.ts +62 -42
- package/src/lib/common/firestore/collection/collection.group.d.ts +4 -2
- package/src/lib/common/firestore/collection/collection.query.d.ts +7 -4
- package/src/lib/common/firestore/collection/collection.single.d.ts +4 -2
- package/src/lib/common/firestore/collection/collection.util.d.ts +3 -2
- package/src/lib/common/firestore/collection/subcollection.d.ts +4 -2
- package/src/lib/common/firestore/collection/subcollection.paged.d.ts +7 -3
- package/src/lib/common/firestore/collection/subcollection.single.d.ts +4 -2
- package/src/lib/common/firestore/context.d.ts +4 -2
- package/src/lib/common/firestore/driver/query.handler.d.ts +4 -3
- package/src/lib/common/firestore/error.d.ts +6 -5
- package/src/lib/common/firestore/query/constraint.d.ts +56 -36
- package/src/lib/common/firestore/query/constraint.template.d.ts +15 -7
- package/src/lib/common/firestore/query/iterator.d.ts +20 -13
- package/src/lib/common/firestore/query/query.d.ts +6 -4
- package/src/lib/common/firestore/query/query.iterate.array.d.ts +10 -6
- package/src/lib/common/firestore/query/query.iterate.d.ts +8 -8
- package/src/lib/common/firestore/query/query.util.d.ts +11 -7
- package/src/lib/common/firestore/query/watcher.d.ts +9 -7
- package/src/lib/common/firestore/snapshot/snapshot.d.ts +6 -3
- package/src/lib/common/firestore/snapshot/snapshot.field.d.ts +230 -132
- package/src/lib/common/firestore/util/id.batch.d.ts +4 -2
- package/src/lib/common/model/function.d.ts +21 -20
- package/src/lib/common/model/model/model.loader.d.ts +2 -2
- package/src/lib/common/model/model.service.d.ts +28 -20
- package/src/lib/common/model/permission/permission.service.d.ts +3 -2
- package/src/lib/common/model/permission/permission.service.grant.d.ts +27 -21
- package/src/lib/common/model/permission/permission.service.role.d.ts +7 -7
- package/src/lib/common/storage/accessor/path.model.d.ts +3 -2
- package/src/lib/common/storage/context.d.ts +3 -2
- package/src/lib/common/storage/driver/accessor.iterate.d.ts +7 -6
- package/src/lib/common/storage/driver/accessor.util.d.ts +4 -4
- package/src/lib/common/storage/driver/error.d.ts +3 -3
- package/src/lib/common/storage/driver/list.d.ts +4 -3
- package/src/lib/common/storage/storage.d.ts +9 -8
- package/src/lib/common/storage/types.d.ts +1 -1
- package/src/lib/model/notification/notification.api.d.ts +2 -2
- package/src/lib/model/notification/notification.api.util.d.ts +16 -16
- package/src/lib/model/notification/notification.config.d.ts +35 -34
- package/src/lib/model/notification/notification.create.d.ts +17 -15
- package/src/lib/model/notification/notification.create.loggedevent.d.ts +3 -2
- package/src/lib/model/notification/notification.create.task.d.ts +3 -2
- package/src/lib/model/notification/notification.d.ts +53 -45
- package/src/lib/model/notification/notification.details.d.ts +5 -4
- package/src/lib/model/notification/notification.id.d.ts +8 -8
- package/src/lib/model/notification/notification.item.d.ts +3 -3
- package/src/lib/model/notification/notification.loggedevent.loader.d.ts +2 -2
- package/src/lib/model/notification/notification.message.d.ts +6 -4
- package/src/lib/model/notification/notification.query.d.ts +12 -12
- package/src/lib/model/notification/notification.send.d.ts +3 -3
- package/src/lib/model/notification/notification.task.d.ts +15 -15
- package/src/lib/model/notification/notification.task.subtask.d.ts +3 -3
- package/src/lib/model/notification/notification.util.d.ts +29 -29
- package/src/lib/model/oidcmodel/oidcmodel.api.d.ts +2 -2
- package/src/lib/model/oidcmodel/oidcmodel.d.ts +6 -6
- package/src/lib/model/oidcmodel/oidcmodel.query.d.ts +18 -18
- package/src/lib/model/storagefile/storagefile.api.d.ts +2 -2
- package/src/lib/model/storagefile/storagefile.create.d.ts +8 -7
- package/src/lib/model/storagefile/storagefile.d.ts +19 -18
- package/src/lib/model/storagefile/storagefile.file.d.ts +2 -1
- package/src/lib/model/storagefile/storagefile.group.d.ts +5 -5
- package/src/lib/model/storagefile/storagefile.permission.d.ts +3 -2
- package/src/lib/model/storagefile/storagefile.query.d.ts +15 -15
- package/src/lib/model/storagefile/storagefile.task.d.ts +2 -2
- package/src/lib/model/storagefile/storagefile.upload.claims.d.ts +4 -4
- package/src/lib/model/storagefile/storagefile.upload.d.ts +8 -6
- package/src/lib/model/storagefile/storagefile.upload.determiner.d.ts +18 -16
- package/src/lib/model/storagefile/storagefile.util.d.ts +8 -8
- package/src/lib/model/system/system.d.ts +6 -6
- package/test/index.cjs.js +43 -43
- package/test/index.esm.js +38 -38
- package/test/package.json +6 -6
- package/test/src/lib/client/firebase.d.ts +1 -1
- package/test/src/lib/common/firestore/firestore.d.ts +3 -3
- package/test/src/lib/common/mock/mock.item.collection.fixture.d.ts +3 -3
- package/test/src/lib/common/mock/mock.item.d.ts +16 -16
- package/test/src/lib/common/mock/mock.item.query.d.ts +4 -4
- package/test/src/lib/common/mock/mock.item.storage.fixture.d.ts +3 -3
- package/test/src/lib/common/storage/storage.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase",
|
|
3
|
-
"version": "13.11.
|
|
3
|
+
"version": "13.11.15",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"exports": {
|
|
6
6
|
"./test": {
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@dereekb/util": "13.11.
|
|
22
|
-
"@dereekb/date": "13.11.
|
|
23
|
-
"@dereekb/model": "13.11.
|
|
24
|
-
"@dereekb/rxjs": "13.11.
|
|
21
|
+
"@dereekb/util": "13.11.15",
|
|
22
|
+
"@dereekb/date": "13.11.15",
|
|
23
|
+
"@dereekb/model": "13.11.15",
|
|
24
|
+
"@dereekb/rxjs": "13.11.15",
|
|
25
25
|
"@firebase/rules-unit-testing": "5.0.0",
|
|
26
26
|
"arktype": "^2.2.0",
|
|
27
27
|
"date-fns": "^4.1.0",
|
|
@@ -6,7 +6,7 @@ import { type FirebaseError } from 'firebase/app';
|
|
|
6
6
|
* for the `FirebaseError` name and a string `code` property. Used by {@link convertHttpsCallableErrorToReadableError}
|
|
7
7
|
* to determine the appropriate error wrapping strategy.
|
|
8
8
|
*
|
|
9
|
-
* @param error -
|
|
9
|
+
* @param error - The value to check.
|
|
10
10
|
* @returns `true` if the input matches the shape of a client-side `FirebaseError`
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
@@ -7,8 +7,8 @@ import { type UpdateData } from '../../common/firestore/types';
|
|
|
7
7
|
* Processes both `union` (add elements) and `remove` (delete elements) operations,
|
|
8
8
|
* spreading array values as individual arguments since Firestore does not allow nested arrays.
|
|
9
9
|
*
|
|
10
|
-
* @param input -
|
|
11
|
-
* @returns Firestore `UpdateData` with `FieldValue.arrayUnion()`/`FieldValue.arrayRemove()` sentinels
|
|
10
|
+
* @param input - Object with `union` and/or `remove` maps from field names to arrays of values.
|
|
11
|
+
* @returns Firestore `UpdateData` with `FieldValue.arrayUnion()`/`FieldValue.arrayRemove()` sentinels.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
@@ -18,6 +18,7 @@ import { type UpdateData } from '../../common/firestore/types';
|
|
|
18
18
|
* });
|
|
19
19
|
* await updateDoc(docRef, updateData);
|
|
20
20
|
* ```
|
|
21
|
+
*
|
|
21
22
|
* @__NO_SIDE_EFFECTS__
|
|
22
23
|
*/
|
|
23
24
|
export declare function firestoreClientArrayUpdateToUpdateData<T extends object>(input: FirestoreAccessorArrayUpdate<T>): UpdateData<T>;
|
|
@@ -21,8 +21,8 @@ export declare class WriteBatchFirestoreDocumentDataAccessor<T> extends DefaultF
|
|
|
21
21
|
* instances bound to the given `WriteBatch`. All write operations from these accessors are queued
|
|
22
22
|
* into the same batch.
|
|
23
23
|
*
|
|
24
|
-
* @param writeBatch -
|
|
25
|
-
* @returns
|
|
24
|
+
* @param writeBatch - The Firestore `WriteBatch` to queue operations into.
|
|
25
|
+
* @returns A factory that creates write-batch-backed document data accessors for any document reference.
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* ```ts
|
|
@@ -32,6 +32,7 @@ export declare class WriteBatchFirestoreDocumentDataAccessor<T> extends DefaultF
|
|
|
32
32
|
* await accessor.set(data);
|
|
33
33
|
* await batch.commit();
|
|
34
34
|
* ```
|
|
35
|
+
*
|
|
35
36
|
* @__NO_SIDE_EFFECTS__
|
|
36
37
|
*/
|
|
37
38
|
export declare function writeBatchAccessorFactory<T>(writeBatch: FirebaseFirestoreWriteBatch): FirestoreDocumentDataAccessorFactory<T>;
|
|
@@ -51,8 +52,8 @@ export declare class WriteBatchFirestoreDocumentContext<T> implements FirestoreD
|
|
|
51
52
|
/**
|
|
52
53
|
* Factory function that creates a {@link WriteBatchFirestoreDocumentContext} for the given batch.
|
|
53
54
|
*
|
|
54
|
-
* @param batch -
|
|
55
|
-
* @returns
|
|
55
|
+
* @param batch - The Firestore `WriteBatch` to use for all document operations.
|
|
56
|
+
* @returns A new {@link WriteBatchFirestoreDocumentContext} bound to the given batch.
|
|
56
57
|
*
|
|
57
58
|
* @example
|
|
58
59
|
* ```ts
|
|
@@ -6,15 +6,16 @@ import { type WithFieldValue, type WriteResult } from '../../common/firestore/ty
|
|
|
6
6
|
* Used by client-side accessor implementations (default, transaction) as their `create()` method.
|
|
7
7
|
* Checks for document existence first, then calls `set()` if the document is absent.
|
|
8
8
|
*
|
|
9
|
-
* @param accessor -
|
|
10
|
-
* @returns
|
|
11
|
-
* @throws {Error} When the document already exists at the reference path
|
|
9
|
+
* @param accessor - Accessor used to check for existence and write the new document.
|
|
10
|
+
* @returns Create function that writes the document or throws when it already exists.
|
|
11
|
+
* @throws {Error} When the document already exists at the reference path.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
15
15
|
* const create = createWithAccessor(accessor);
|
|
16
16
|
* await create({ name: 'New Item' }); // throws if document already exists
|
|
17
17
|
* ```
|
|
18
|
+
*
|
|
18
19
|
* @__NO_SIDE_EFFECTS__
|
|
19
20
|
*/
|
|
20
21
|
export declare function createWithAccessor<T>(accessor: FirestoreDocumentDataAccessor<T>): (data: WithFieldValue<T>) => Promise<void | WriteResult>;
|
|
@@ -8,13 +8,14 @@ import { type FirestoreAccessorDriver } from '../../common/firestore/driver/acce
|
|
|
8
8
|
* - Transaction and write batch context factories for atomic operations
|
|
9
9
|
* - A default (non-transactional) document context
|
|
10
10
|
*
|
|
11
|
-
* @returns
|
|
11
|
+
* @returns A {@link FirestoreAccessorDriver} backed by the `firebase/firestore` client SDK.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
15
15
|
* const driver = firestoreClientAccessorDriver();
|
|
16
16
|
* // Used internally by firebaseFirestoreClientDrivers()
|
|
17
17
|
* ```
|
|
18
|
+
*
|
|
18
19
|
* @__NO_SIDE_EFFECTS__
|
|
19
20
|
*/
|
|
20
21
|
export declare function firestoreClientAccessorDriver(): FirestoreAccessorDriver;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type DocumentReference, type DocumentSnapshot, type UpdateData, type WithFieldValue } from 'firebase/firestore';
|
|
2
|
+
import type { Maybe } from '@dereekb/util';
|
|
2
3
|
import { type Observable } from 'rxjs';
|
|
3
4
|
import { type DocumentData, type FirestoreAccessorArrayUpdate, type FirestoreAccessorIncrementUpdate, type FirestoreDataConverter, type FirestoreDocumentContext, type FirestoreDocumentDataAccessor, type FirestoreDocumentDataAccessorFactory, type SetOptions, type WriteResult } from '../../common/firestore';
|
|
4
5
|
/**
|
|
@@ -18,7 +19,7 @@ export declare class DefaultFirestoreDocumentDataAccessor<T> implements Firestor
|
|
|
18
19
|
create(data: WithFieldValue<T>): Promise<void>;
|
|
19
20
|
exists(): Promise<boolean>;
|
|
20
21
|
get(): Promise<DocumentSnapshot<T>>;
|
|
21
|
-
getWithConverter<U = DocumentData>(converter:
|
|
22
|
+
getWithConverter<U = DocumentData>(converter: Maybe<FirestoreDataConverter<U>>): Promise<DocumentSnapshot<U>>;
|
|
22
23
|
delete(): Promise<void>;
|
|
23
24
|
set(data: WithFieldValue<T>, options?: SetOptions): Promise<void>;
|
|
24
25
|
increment(data: FirestoreAccessorIncrementUpdate<T>): Promise<void | WriteResult>;
|
|
@@ -29,7 +30,7 @@ export declare class DefaultFirestoreDocumentDataAccessor<T> implements Firestor
|
|
|
29
30
|
* Creates a {@link FirestoreDocumentDataAccessorFactory} that produces {@link DefaultFirestoreDocumentDataAccessor} instances
|
|
30
31
|
* for direct (non-batched, non-transactional) Firestore operations.
|
|
31
32
|
*
|
|
32
|
-
* @returns
|
|
33
|
+
* @returns A factory that creates default (non-transactional) document data accessors.
|
|
33
34
|
*
|
|
34
35
|
* @example
|
|
35
36
|
* ```ts
|
|
@@ -37,6 +38,7 @@ export declare class DefaultFirestoreDocumentDataAccessor<T> implements Firestor
|
|
|
37
38
|
* const accessor = factory.accessorFor(documentRef);
|
|
38
39
|
* const snapshot = await accessor.get();
|
|
39
40
|
* ```
|
|
41
|
+
*
|
|
40
42
|
* @__NO_SIDE_EFFECTS__
|
|
41
43
|
*/
|
|
42
44
|
export declare function defaultFirestoreAccessorFactory<T>(): FirestoreDocumentDataAccessorFactory<T>;
|
|
@@ -46,7 +48,7 @@ export declare function defaultFirestoreAccessorFactory<T>(): FirestoreDocumentD
|
|
|
46
48
|
* The context type is {@link FirestoreDocumentContextType.NONE}, meaning operations execute immediately
|
|
47
49
|
* against Firestore without transaction or batch grouping.
|
|
48
50
|
*
|
|
49
|
-
* @returns
|
|
51
|
+
* @returns A default {@link FirestoreDocumentContext} with no transaction or batch semantics.
|
|
50
52
|
*
|
|
51
53
|
* @example
|
|
52
54
|
* ```ts
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type DocumentReference, type DocumentSnapshot, type Transaction as FirebaseFirestoreTransaction, type UpdateData, type WithFieldValue } from 'firebase/firestore';
|
|
2
|
+
import type { Maybe } from '@dereekb/util';
|
|
2
3
|
import { type Observable } from 'rxjs';
|
|
3
4
|
import { type FirestoreDocumentDataAccessor, type FirestoreDocumentDataAccessorFactory, type FirestoreDocumentContext, FirestoreDocumentContextType, type SetOptions, type DocumentData, type FirestoreDataConverter, type WriteResult, type FirestoreAccessorIncrementUpdate, type FirestoreAccessorArrayUpdate } from '../../common/firestore';
|
|
4
5
|
/**
|
|
@@ -18,7 +19,7 @@ export declare class TransactionFirestoreDocumentDataAccessor<T> implements Fire
|
|
|
18
19
|
create(data: WithFieldValue<T>): Promise<void>;
|
|
19
20
|
exists(): Promise<boolean>;
|
|
20
21
|
get(): Promise<DocumentSnapshot<T>>;
|
|
21
|
-
getWithConverter<U extends DocumentData = DocumentData>(converter:
|
|
22
|
+
getWithConverter<U extends DocumentData = DocumentData>(converter: Maybe<FirestoreDataConverter<U>>): Promise<DocumentSnapshot<DocumentData, U>>;
|
|
22
23
|
delete(): Promise<void>;
|
|
23
24
|
set(data: WithFieldValue<T>, options?: SetOptions): Promise<void>;
|
|
24
25
|
increment(data: FirestoreAccessorIncrementUpdate<T>): Promise<void | WriteResult>;
|
|
@@ -29,8 +30,8 @@ export declare class TransactionFirestoreDocumentDataAccessor<T> implements Fire
|
|
|
29
30
|
* Creates a {@link FirestoreDocumentDataAccessorFactory} that produces {@link TransactionFirestoreDocumentDataAccessor}
|
|
30
31
|
* instances bound to the given transaction. All operations from these accessors participate in the same transaction.
|
|
31
32
|
*
|
|
32
|
-
* @param transaction -
|
|
33
|
-
* @returns
|
|
33
|
+
* @param transaction - The Firestore `Transaction` to bind operations to.
|
|
34
|
+
* @returns A factory that creates transaction-backed document data accessors for any document reference.
|
|
34
35
|
*
|
|
35
36
|
* @example
|
|
36
37
|
* ```ts
|
|
@@ -41,6 +42,7 @@ export declare class TransactionFirestoreDocumentDataAccessor<T> implements Fire
|
|
|
41
42
|
* // ... modify and set
|
|
42
43
|
* });
|
|
43
44
|
* ```
|
|
45
|
+
*
|
|
44
46
|
* @__NO_SIDE_EFFECTS__
|
|
45
47
|
*/
|
|
46
48
|
export declare function transactionAccessorFactory<T>(transaction: FirebaseFirestoreTransaction): FirestoreDocumentDataAccessorFactory<T>;
|
|
@@ -60,8 +62,8 @@ export declare class TransactionFirestoreDocumentContext<T> implements Firestore
|
|
|
60
62
|
/**
|
|
61
63
|
* Factory function that creates a {@link TransactionFirestoreDocumentContext} for the given transaction.
|
|
62
64
|
*
|
|
63
|
-
* @param transaction -
|
|
64
|
-
* @returns
|
|
65
|
+
* @param transaction - The Firestore `Transaction` to use for all document operations.
|
|
66
|
+
* @returns A new {@link TransactionFirestoreDocumentContext} bound to the given transaction.
|
|
65
67
|
*
|
|
66
68
|
* @example
|
|
67
69
|
* ```ts
|
|
@@ -10,7 +10,7 @@ export type FirebaseFirestoreClientDrivers = FirestoreDrivers;
|
|
|
10
10
|
* Provides accessor drivers (default, batch, transaction) and query drivers for use
|
|
11
11
|
* with {@link clientFirebaseFirestoreContextFactory}.
|
|
12
12
|
*
|
|
13
|
-
* @returns
|
|
13
|
+
* @returns The client-side {@link FirebaseFirestoreClientDrivers} for the `firebase/firestore` SDK.
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```ts
|
|
@@ -16,9 +16,9 @@ export interface FirebaseFirestoreQueryBuilder {
|
|
|
16
16
|
/**
|
|
17
17
|
* Appends one or more `QueryConstraint` values to the builder, returning a new builder instance.
|
|
18
18
|
*
|
|
19
|
-
* @param builder -
|
|
20
|
-
* @param constraint -
|
|
21
|
-
* @returns
|
|
19
|
+
* @param builder - Current query builder state.
|
|
20
|
+
* @param constraint - Constraint(s) to append.
|
|
21
|
+
* @returns A new {@link FirebaseFirestoreQueryBuilder} with the added constraint(s)
|
|
22
22
|
*/
|
|
23
23
|
export declare function addConstraintToBuilder(builder: FirebaseFirestoreQueryBuilder, constraint: ArrayOrValue<QueryConstraint>): FirebaseFirestoreQueryBuilder;
|
|
24
24
|
/**
|
|
@@ -33,7 +33,7 @@ export declare const FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING: FullFire
|
|
|
33
33
|
* Converts abstract query constraints into `firebase/firestore` `QueryConstraint` objects
|
|
34
34
|
* and composes them into an executable `Query`.
|
|
35
35
|
*
|
|
36
|
-
* @returns
|
|
36
|
+
* @returns A {@link FirestoreQueryConstraintFunctionsDriver} backed by the `firebase/firestore` client SDK.
|
|
37
37
|
*/
|
|
38
38
|
export declare function firebaseFirestoreQueryConstraintFunctionsDriver(): FirestoreQueryConstraintFunctionsDriver;
|
|
39
39
|
/**
|
|
@@ -43,7 +43,7 @@ export declare function firebaseFirestoreQueryConstraintFunctionsDriver(): Fires
|
|
|
43
43
|
* Note: Transactions are not supported for queries on the client; passing a `transaction` to `getDocs`
|
|
44
44
|
* will throw an error.
|
|
45
45
|
*
|
|
46
|
-
* @returns
|
|
46
|
+
* @returns A {@link FirestoreQueryDriver} backed by the `firebase/firestore` client SDK.
|
|
47
47
|
*
|
|
48
48
|
* @example
|
|
49
49
|
* ```ts
|
|
@@ -6,14 +6,15 @@ import { type FirestoreAccessorIncrementUpdate } from '../../common/firestore/ac
|
|
|
6
6
|
*
|
|
7
7
|
* Maps each field in the input to an `increment()` call, defaulting to 0 for `undefined` values.
|
|
8
8
|
*
|
|
9
|
-
* @param input -
|
|
10
|
-
* @returns Firestore `UpdateData` with `FieldValue.increment()` sentinels
|
|
9
|
+
* @param input - Object mapping field names to their increment amounts.
|
|
10
|
+
* @returns Firestore `UpdateData` with `FieldValue.increment()` sentinels.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
14
14
|
* const updateData = firestoreClientIncrementUpdateToUpdateData<MyModel>({ viewCount: 1, likeCount: -1 });
|
|
15
15
|
* await updateDoc(docRef, updateData);
|
|
16
16
|
* ```
|
|
17
|
+
*
|
|
17
18
|
* @__NO_SIDE_EFFECTS__
|
|
18
19
|
*/
|
|
19
20
|
export declare function firestoreClientIncrementUpdateToUpdateData<T extends object>(input: FirestoreAccessorIncrementUpdate<T>): UpdateData<T>;
|
|
@@ -24,8 +24,8 @@ export type DevelopmentFirebaseFunctionMapFactory<M extends DevelopmentFirebaseF
|
|
|
24
24
|
* Similar to {@link callModelFirebaseFunctionMapFactory}, all development functions are multiplexed
|
|
25
25
|
* through a single endpoint. The function specifier and data are wrapped via {@link onCallDevelopmentParams}.
|
|
26
26
|
*
|
|
27
|
-
* @param configMap -
|
|
28
|
-
* @returns
|
|
27
|
+
* @param configMap - Maps each development function key to optional configuration.
|
|
28
|
+
* @returns A factory that creates a {@link DevelopmentFirebaseFunctionMap} for a given `Functions` instance.
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```ts
|
|
@@ -36,6 +36,7 @@ export type DevelopmentFirebaseFunctionMapFactory<M extends DevelopmentFirebaseF
|
|
|
36
36
|
* const devFns = factory(getFunctions());
|
|
37
37
|
* await devFns.resetData();
|
|
38
38
|
* ```
|
|
39
|
+
*
|
|
39
40
|
* @__NO_SIDE_EFFECTS__
|
|
40
41
|
*/
|
|
41
42
|
export declare function developmentFirebaseFunctionMapFactory<M extends DevelopmentFirebaseFunctionTypeMap>(configMap: DevelopmentFirebaseFunctionConfigMap<M>): DevelopmentFirebaseFunctionMapFactory<M>;
|
|
@@ -27,8 +27,8 @@ export declare class FirebaseServerError<T extends ServerErrorResponseData = Ser
|
|
|
27
27
|
* Creates a {@link FirebaseServerError} from a raw {@link FirebaseError}, extracting
|
|
28
28
|
* structured error details from the error's `details` property if available.
|
|
29
29
|
*
|
|
30
|
-
* @param error -
|
|
31
|
-
* @returns
|
|
30
|
+
* @param error - The Firebase error from an `HttpsCallable` failure.
|
|
31
|
+
* @returns A new {@link FirebaseServerError} wrapping the given Firebase error with structured server error details.
|
|
32
32
|
*/
|
|
33
33
|
static fromFirebaseError(error: FirebaseError): FirebaseServerError;
|
|
34
34
|
constructor(firebaseError: FirebaseError, serverError: ServerError<T>);
|
|
@@ -47,14 +47,14 @@ export declare function mapHttpsCallable<I, O, A, B = unknown>(callable: HttpsCa
|
|
|
47
47
|
* Unwraps an `HttpsCallable` so it returns the response data directly (`O`) instead of
|
|
48
48
|
* `HttpsCallableResult<O>`. Simplifies consumption when only the data payload is needed.
|
|
49
49
|
*/
|
|
50
|
-
export type DirectDataHttpsCallable<C extends HttpsCallable<any, any>> = C extends HttpsCallable<infer I, infer O> ? (data?: I
|
|
50
|
+
export type DirectDataHttpsCallable<C extends HttpsCallable<any, any>> = C extends HttpsCallable<infer I, infer O> ? (data?: Maybe<I>) => Promise<O> : never;
|
|
51
51
|
/**
|
|
52
52
|
* Wraps an `HttpsCallable` to return the data payload directly, stripping the `HttpsCallableResult` wrapper.
|
|
53
53
|
*
|
|
54
54
|
* Errors are converted to readable errors via {@link convertHttpsCallableErrorToReadableError}.
|
|
55
55
|
*
|
|
56
|
-
* @param callable -
|
|
57
|
-
* @returns
|
|
56
|
+
* @param callable - The `HttpsCallable` to wrap.
|
|
57
|
+
* @returns A {@link DirectDataHttpsCallable} that resolves to the response data directly.
|
|
58
58
|
*
|
|
59
59
|
* @example
|
|
60
60
|
* ```ts
|
|
@@ -69,7 +69,7 @@ export declare function directDataHttpsCallable<I, O, C extends HttpsCallable<I,
|
|
|
69
69
|
* If the error is a client-side {@link FirebaseError} with `details`, wraps it as a {@link FirebaseServerError}
|
|
70
70
|
* to preserve server-side error context. Otherwise, converts it to a generic readable error via `toReadableError`.
|
|
71
71
|
*
|
|
72
|
-
* @param error -
|
|
73
|
-
* @returns
|
|
72
|
+
* @param error - The caught error from an `HttpsCallable` invocation.
|
|
73
|
+
* @returns A {@link FirebaseServerError} if the error has structured details, or a generic readable error otherwise.
|
|
74
74
|
*/
|
|
75
75
|
export declare function convertHttpsCallableErrorToReadableError(error: unknown): unknown;
|
|
@@ -27,8 +27,8 @@ export type FirebaseFunctionMapFactory<M extends FirebaseFunctionTypeMap> = (fun
|
|
|
27
27
|
* Each key in the config map becomes an `HttpsCallable` function wrapped with {@link directDataHttpsCallable}
|
|
28
28
|
* for direct data access. Per-key options (e.g., timeout) are applied if provided.
|
|
29
29
|
*
|
|
30
|
-
* @param configMap -
|
|
31
|
-
* @returns
|
|
30
|
+
* @param configMap - Maps function keys to their optional configuration.
|
|
31
|
+
* @returns A {@link FirebaseFunctionMapFactory} that creates a typed callable function map for a given `Functions` instance.
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* ```ts
|
|
@@ -39,6 +39,7 @@ export type FirebaseFunctionMapFactory<M extends FirebaseFunctionTypeMap> = (fun
|
|
|
39
39
|
* const functions = factory(getFunctions());
|
|
40
40
|
* const result = await functions.createUser({ name: 'Alice' });
|
|
41
41
|
* ```
|
|
42
|
+
*
|
|
42
43
|
* @__NO_SIDE_EFFECTS__
|
|
43
44
|
*/
|
|
44
45
|
export declare function firebaseFunctionMapFactory<M extends FirebaseFunctionTypeMap>(configMap: FirebaseFunctionTypeConfigMap<M>): FirebaseFunctionMapFactory<M>;
|
|
@@ -97,8 +98,8 @@ export type LazyFirebaseFunctions<M extends FirebaseFunctionsMap> = {
|
|
|
97
98
|
* Each function group is lazily initialized on first access using `cachedGetter`,
|
|
98
99
|
* so `httpsCallable` instances are only created when actually needed.
|
|
99
100
|
*
|
|
100
|
-
* @param configMap -
|
|
101
|
-
* @returns
|
|
101
|
+
* @param configMap - Maps each function group key to its `[ClassType, Factory]` tuple.
|
|
102
|
+
* @returns A {@link LazyFirebaseFunctionsFactory} that creates a lazy-loaded function map for a given `Functions` instance.
|
|
102
103
|
*
|
|
103
104
|
* @example
|
|
104
105
|
* ```ts
|
|
@@ -110,6 +111,7 @@ export type LazyFirebaseFunctions<M extends FirebaseFunctionsMap> = {
|
|
|
110
111
|
* const lazyFns = factory(getFunctions());
|
|
111
112
|
* const notifFns = lazyFns.notificationFunctions(); // initialized on first call
|
|
112
113
|
* ```
|
|
114
|
+
*
|
|
113
115
|
* @__NO_SIDE_EFFECTS__
|
|
114
116
|
*/
|
|
115
117
|
export declare function lazyFirebaseFunctionsFactory<M extends FirebaseFunctionsMap, C extends FirebaseFunctionsConfigMap<M> = FirebaseFunctionsConfigMap<M>>(configMap: C): LazyFirebaseFunctionsFactory<M>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type MaybeNot, type ValuesTypesAsArray, type CommaSeparatedKeysOfObject } from '@dereekb/util';
|
|
2
2
|
import { type Functions } from 'firebase/functions';
|
|
3
|
-
import { type
|
|
3
|
+
import { type OmitNeverProperties } from 'ts-essentials';
|
|
4
4
|
import { type FirestoreModelIdentity, type FirestoreModelTypes } from '../../common/firestore/collection';
|
|
5
5
|
import { type FirebaseFunctionTypeMap, type FirebaseFunctionMap, type FirebaseFunction } from './function';
|
|
6
6
|
import { type FirebaseFunctionTypeConfigMap } from './function.factory';
|
|
@@ -86,8 +86,8 @@ export type ModelFirebaseCrudFunctionQueryTypeConfig = {
|
|
|
86
86
|
* Default specifier string (`'_'`) used when a CRUD operation has specifiers but one
|
|
87
87
|
* should map to the base function name without a specifier suffix.
|
|
88
88
|
*/
|
|
89
|
-
export declare const
|
|
90
|
-
export type ModelFirebaseCrudFunctionSpecifierDefault = typeof
|
|
89
|
+
export declare const DEFAULT_MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER = "_";
|
|
90
|
+
export type ModelFirebaseCrudFunctionSpecifierDefault = typeof DEFAULT_MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER;
|
|
91
91
|
/**
|
|
92
92
|
* Separator character (`','`) used to split multiple specifier keys in a config string.
|
|
93
93
|
* For example, `'update:status,config'` defines two update specifiers: `status` and `config`.
|
|
@@ -100,7 +100,7 @@ export type ModelFirebaseCrudFunctionSpecifierSplitter = typeof MODEL_FUNCTION_F
|
|
|
100
100
|
* The {@link FirestoreModelIdentity} type parameter `T` constrains which model type keys are
|
|
101
101
|
* valid, providing compile-time safety. Entries are string arrays like `['create', 'update:status,config']`.
|
|
102
102
|
*/
|
|
103
|
-
export type ModelFirebaseCrudFunctionConfigMap<C extends ModelFirebaseCrudFunctionTypeMap<T>, T extends FirestoreModelIdentity> =
|
|
103
|
+
export type ModelFirebaseCrudFunctionConfigMap<C extends ModelFirebaseCrudFunctionTypeMap<T>, T extends FirestoreModelIdentity> = OmitNeverProperties<{
|
|
104
104
|
[K in FirestoreModelTypes<T>]: C[K] extends null ? never : ModelFirebaseCrudFunctionConfigMapEntry<C[K]>;
|
|
105
105
|
}>;
|
|
106
106
|
export type ModelFirebaseCrudFunctionConfigMapEntry<T> = ValuesTypesAsArray<{
|
|
@@ -108,7 +108,7 @@ export type ModelFirebaseCrudFunctionConfigMapEntry<T> = ValuesTypesAsArray<{
|
|
|
108
108
|
}>;
|
|
109
109
|
export type ModelFirebaseCrudFunctionConfigMapEntrySpecifier<K extends string, M extends object> = `${K}:${CommaSeparatedKeysOfObject<M>}`;
|
|
110
110
|
export type ModelFirebaseCrudFunctionMap<C extends ModelFirebaseCrudFunctionTypeMap> = ModelFirebaseCrudFunctionRawMap<C>;
|
|
111
|
-
export type ModelFirebaseCrudFunctionRawMap<C extends ModelFirebaseCrudFunctionTypeMap> =
|
|
111
|
+
export type ModelFirebaseCrudFunctionRawMap<C extends ModelFirebaseCrudFunctionTypeMap> = OmitNeverProperties<{
|
|
112
112
|
[K in keyof C]: K extends string ? ModelFirebaseCrudFunctionMapEntry<K, C[K]> : never;
|
|
113
113
|
}>;
|
|
114
114
|
export type ModelFirebaseCrudFunctionName<MODEL extends string, CRUD extends string> = `${CRUD}${Capitalize<MODEL>}`;
|
|
@@ -145,9 +145,9 @@ export type ModelFirebaseFunctionMapFactory<M extends FirebaseFunctionTypeMap, U
|
|
|
145
145
|
*
|
|
146
146
|
* Custom (non-CRUD) functions from `configMap` get their own individual `HttpsCallable` instances.
|
|
147
147
|
*
|
|
148
|
-
* @param configMap -
|
|
149
|
-
* @param crudConfigMap -
|
|
150
|
-
* @returns
|
|
148
|
+
* @param configMap - Configuration for custom (non-CRUD) functions.
|
|
149
|
+
* @param crudConfigMap - Configuration for model CRUD functions with optional specifiers.
|
|
150
|
+
* @returns A {@link ModelFirebaseFunctionMapFactory} that creates a combined custom and CRUD function map for a given `Functions` instance.
|
|
151
151
|
*
|
|
152
152
|
* @example
|
|
153
153
|
* ```ts
|
|
@@ -159,6 +159,7 @@ export type ModelFirebaseFunctionMapFactory<M extends FirebaseFunctionTypeMap, U
|
|
|
159
159
|
* await fns.createNotification(data);
|
|
160
160
|
* await fns.updateNotificationStatus(data);
|
|
161
161
|
* ```
|
|
162
|
+
*
|
|
162
163
|
* @__NO_SIDE_EFFECTS__
|
|
163
164
|
*/
|
|
164
165
|
export declare function callModelFirebaseFunctionMapFactory<M extends FirebaseFunctionTypeMap, U extends ModelFirebaseCrudFunctionTypeMap>(configMap: FirebaseFunctionTypeConfigMap<M>, crudConfigMap: ModelFirebaseCrudFunctionConfigMap<U, FirestoreModelIdentity>): ModelFirebaseFunctionMapFactory<M, U>;
|
|
@@ -8,8 +8,8 @@ import { type ErrorInput, type Maybe } from '@dereekb/util';
|
|
|
8
8
|
* Useful for distinguishing missing-file errors from other storage failures,
|
|
9
9
|
* e.g., to silently handle deletion of already-deleted files.
|
|
10
10
|
*
|
|
11
|
-
* @param input -
|
|
12
|
-
* @returns `true` if the error message contains `'storage/object-not-found'`, `false` otherwise
|
|
11
|
+
* @param input - The error or error message to check.
|
|
12
|
+
* @returns `true` if the error message contains `'storage/object-not-found'`, `false` otherwise.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```ts
|
|
@@ -26,9 +26,9 @@ export declare function isFirebaseStorageObjectNotFoundError(input: Maybe<ErrorI
|
|
|
26
26
|
/**
|
|
27
27
|
* Creates a `StorageReference` from an abstract {@link StoragePath} using the client `firebase/storage` SDK.
|
|
28
28
|
*
|
|
29
|
-
* @param storage -
|
|
30
|
-
* @param path -
|
|
31
|
-
* @returns
|
|
29
|
+
* @param storage - The client Firebase Storage instance.
|
|
30
|
+
* @param path - Abstract storage path to resolve.
|
|
31
|
+
* @returns A `StorageReference` pointing to the resolved storage path.
|
|
32
32
|
*/
|
|
33
33
|
export declare function firebaseStorageRefForStorageFilePath(storage: ClientFirebaseStorage, path: StoragePath): StorageReference;
|
|
34
34
|
/**
|
|
@@ -36,8 +36,8 @@ export declare function firebaseStorageRefForStorageFilePath(storage: ClientFire
|
|
|
36
36
|
*
|
|
37
37
|
* Returns `true` if metadata is successfully retrieved, `false` for any error (including permission errors).
|
|
38
38
|
*
|
|
39
|
-
* @param ref -
|
|
40
|
-
* @returns
|
|
39
|
+
* @param ref - Storage reference whose metadata is probed.
|
|
40
|
+
* @returns Resolves with `true` when metadata exists, otherwise `false`.
|
|
41
41
|
*/
|
|
42
42
|
export declare function firebaseStorageFileExists(ref: StorageReference): Promise<boolean>;
|
|
43
43
|
/**
|
|
@@ -50,9 +50,9 @@ export type FirebaseStorageClientAccessorFile = FirebaseStorageAccessorFile<Stor
|
|
|
50
50
|
* Provides all file operations (upload, download, metadata, delete, resumable upload) backed by
|
|
51
51
|
* the `firebase/storage` SDK. Resumable uploads expose an Observable stream of upload progress snapshots.
|
|
52
52
|
*
|
|
53
|
-
* @param storage -
|
|
54
|
-
* @param storagePath -
|
|
55
|
-
* @returns
|
|
53
|
+
* @param storage - The client Firebase Storage instance.
|
|
54
|
+
* @param storagePath - The abstract storage path for the file.
|
|
55
|
+
* @returns A {@link FirebaseStorageClientAccessorFile} providing CRUD and upload operations for the given path.
|
|
56
56
|
*
|
|
57
57
|
* @example
|
|
58
58
|
* ```ts
|
|
@@ -87,9 +87,9 @@ export declare const firebaseStorageClientListFilesResultFactory: import("../.."
|
|
|
87
87
|
* Supports existence checks, paginated file/folder listing, and recursive nested listing
|
|
88
88
|
* when `includeNestedResults` is enabled.
|
|
89
89
|
*
|
|
90
|
-
* @param storage -
|
|
91
|
-
* @param storagePath -
|
|
92
|
-
* @returns
|
|
90
|
+
* @param storage - The client Firebase Storage instance.
|
|
91
|
+
* @param storagePath - The abstract storage path for the folder.
|
|
92
|
+
* @returns A {@link FirebaseStorageClientAccessorFolder} providing listing and existence operations for the given path.
|
|
93
93
|
*
|
|
94
94
|
* @example
|
|
95
95
|
* ```ts
|
|
@@ -106,7 +106,7 @@ export declare function firebaseStorageClientAccessorFolder(storage: ClientFireb
|
|
|
106
106
|
* Provides file and folder accessor factories and default bucket resolution.
|
|
107
107
|
* Used internally by {@link firebaseStorageClientDrivers}.
|
|
108
108
|
*
|
|
109
|
-
* @returns
|
|
109
|
+
* @returns A {@link FirebaseStorageAccessorDriver} backed by the `firebase/storage` client SDK.
|
|
110
110
|
*
|
|
111
111
|
* @example
|
|
112
112
|
* ```ts
|
|
@@ -9,7 +9,7 @@ export type FirebaseStorageClientDrivers = FirebaseStorageDrivers;
|
|
|
9
9
|
*
|
|
10
10
|
* Provides file and folder accessor operations for use with {@link clientFirebaseStorageContextFactory}.
|
|
11
11
|
*
|
|
12
|
-
* @returns
|
|
12
|
+
* @returns The client-side {@link FirebaseStorageClientDrivers} for the `firebase/storage` SDK.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```ts
|
|
@@ -61,8 +61,8 @@ export declare const FIREBASE_AUTH_QUOTA_EXCEEDED_ERROR = "auth/quota-exceeded";
|
|
|
61
61
|
* Maps known error codes (wrong password, user not found, network errors) to contextual messages
|
|
62
62
|
* suitable for display in the UI.
|
|
63
63
|
*
|
|
64
|
-
* @param inputError -
|
|
65
|
-
* @returns
|
|
64
|
+
* @param inputError - The Firebase Auth error to convert.
|
|
65
|
+
* @returns A {@link ReadableError} with a human-readable message suitable for display.
|
|
66
66
|
*
|
|
67
67
|
* @example
|
|
68
68
|
* ```ts
|
|
@@ -21,15 +21,15 @@ export type DevelopmentFirebaseFunctionSpecifierRef = {
|
|
|
21
21
|
* Routes the call to a specific function via `specifier` and passes arbitrary data.
|
|
22
22
|
*/
|
|
23
23
|
export interface OnCallDevelopmentParams<T = unknown> {
|
|
24
|
-
specifier: string;
|
|
25
|
-
data: T;
|
|
24
|
+
readonly specifier: string;
|
|
25
|
+
readonly data: T;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Creates an {@link OnCallDevelopmentParams} envelope for a development function call.
|
|
29
29
|
*
|
|
30
|
-
* @param specifier -
|
|
31
|
-
* @param data -
|
|
32
|
-
* @returns
|
|
30
|
+
* @param specifier - The development function to invoke.
|
|
31
|
+
* @param data - The call payload.
|
|
32
|
+
* @returns An {@link OnCallDevelopmentParams} envelope ready to send to the dev endpoint.
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
35
35
|
* ```ts
|
|
@@ -84,7 +84,7 @@ export interface FirestoreDocumentDataAccessor<T, D = DocumentData> extends Docu
|
|
|
84
84
|
* @param converter
|
|
85
85
|
*/
|
|
86
86
|
getWithConverter(converter: null): Promise<DocumentSnapshot<DocumentData>>;
|
|
87
|
-
getWithConverter<U = DocumentData>(converter:
|
|
87
|
+
getWithConverter<U = DocumentData>(converter: Maybe<FirestoreDataConverter<U>>): Promise<DocumentSnapshot<U>>;
|
|
88
88
|
/**
|
|
89
89
|
* Whether or not the target object currently exists.
|
|
90
90
|
*/
|
|
@@ -178,20 +178,22 @@ export declare enum FirestoreAccessorStreamMode {
|
|
|
178
178
|
/**
|
|
179
179
|
* Creates an Observable that emits the document data from snapshots based on the specified stream mode.
|
|
180
180
|
*
|
|
181
|
+
* @param accessor - The document accessor to retrieve snapshots from.
|
|
182
|
+
* @param mode - Whether to use a one-time GET or continuous STREAM mode.
|
|
183
|
+
* @param options - Options for how to format the document data.
|
|
184
|
+
* @returns An Observable that emits the document data or undefined if the document doesn't exist.
|
|
185
|
+
*
|
|
181
186
|
* @template T - The document data type
|
|
182
|
-
* @param accessor - The document accessor to retrieve snapshots from
|
|
183
|
-
* @param mode - Whether to use a one-time GET or continuous STREAM mode
|
|
184
|
-
* @param options - Options for how to format the document data
|
|
185
|
-
* @returns An Observable that emits the document data or undefined if the document doesn't exist
|
|
186
187
|
*/
|
|
187
188
|
export declare function snapshotStreamDataForAccessor<T>(accessor: FirestoreDocumentDataAccessor<T>, mode: FirestoreAccessorStreamMode, options?: SnapshotOptions): Observable<Maybe<T>>;
|
|
188
189
|
/**
|
|
189
190
|
* Creates an Observable that emits DocumentSnapshots based on the specified stream mode.
|
|
190
191
|
*
|
|
192
|
+
* @param accessor - The document accessor to retrieve snapshots from.
|
|
193
|
+
* @param mode - Whether to use a one-time GET or continuous STREAM mode.
|
|
194
|
+
* @returns An Observable that emits DocumentSnapshots.
|
|
195
|
+
*
|
|
191
196
|
* @template T - The document data type
|
|
192
|
-
* @param accessor - The document accessor to retrieve snapshots from
|
|
193
|
-
* @param mode - Whether to use a one-time GET or continuous STREAM mode
|
|
194
|
-
* @returns An Observable that emits DocumentSnapshots
|
|
195
197
|
*/
|
|
196
198
|
export declare function snapshotStreamForAccessor<T>(accessor: FirestoreDocumentDataAccessor<T>, mode: FirestoreAccessorStreamMode): Observable<DocumentSnapshot<T>>;
|
|
197
199
|
/**
|
|
@@ -199,18 +201,20 @@ export declare function snapshotStreamForAccessor<T>(accessor: FirestoreDocument
|
|
|
199
201
|
*
|
|
200
202
|
* Filters out null/undefined values from the stream (documents that don't exist).
|
|
201
203
|
*
|
|
204
|
+
* @param stream - Observable that emits DocumentSnapshots.
|
|
205
|
+
* @param options - Options for how to format the document data.
|
|
206
|
+
* @returns An Observable that emits document data, filtering out non-existent documents.
|
|
207
|
+
*
|
|
202
208
|
* @template T - The document data type
|
|
203
|
-
* @param stream - Observable that emits DocumentSnapshots
|
|
204
|
-
* @param options - Options for how to format the document data
|
|
205
|
-
* @returns An Observable that emits document data, filtering out non-existent documents
|
|
206
209
|
*/
|
|
207
210
|
export declare function dataFromSnapshotStream<T>(stream: Observable<DocumentSnapshot<T>>, options?: SnapshotOptions): Observable<T>;
|
|
208
211
|
/**
|
|
209
212
|
* Creates an RxJS operator that transforms DocumentSnapshots into their data.
|
|
210
213
|
*
|
|
211
|
-
* @
|
|
212
|
-
* @param options - Options for how to format the document data
|
|
214
|
+
* @param options - Options for how to format the document data.
|
|
213
215
|
* @returns An operator that transforms DocumentSnapshots into document data (or undefined if the document doesn't exist)
|
|
216
|
+
*
|
|
217
|
+
* @template T - The document data type
|
|
214
218
|
*/
|
|
215
219
|
export declare function mapDataFromSnapshot<T>(options?: SnapshotOptions): OperatorFunction<DocumentSnapshot<T>, Maybe<T>>;
|
|
216
220
|
/**
|
|
@@ -238,10 +242,12 @@ export type UpdateWithAccessorUpdateAndConverterFunction<T> = (data: Partial<T>,
|
|
|
238
242
|
* - Skips the update if the resulting data is empty
|
|
239
243
|
* - Applies any provided preconditions to the update
|
|
240
244
|
*
|
|
245
|
+
* @param accessor - Accessor used to apply the underlying update.
|
|
246
|
+
* @param converter - Converter that normalizes input data into Firestore format.
|
|
247
|
+
* @returns Update function that converts then writes the partial data.
|
|
248
|
+
*
|
|
241
249
|
* @template T - The document data type
|
|
242
|
-
*
|
|
243
|
-
* @param converter - The data converter to transform input data to Firestore format
|
|
244
|
-
* @returns A function that updates the document with converted data
|
|
250
|
+
*
|
|
245
251
|
* @__NO_SIDE_EFFECTS__
|
|
246
252
|
*/
|
|
247
253
|
export declare function updateWithAccessorUpdateAndConverterFunction<T>(accessor: FirestoreDocumentDataAccessor<T>, converter: FirestoreDataConverter<T>): UpdateWithAccessorUpdateAndConverterFunction<T>;
|