@dereekb/firebase 13.11.14 → 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
|
@@ -154,10 +154,11 @@ export type FirestoreModelTypes<I extends FirestoreModelIdentity> = I extends Fi
|
|
|
154
154
|
/**
|
|
155
155
|
* Creates a FirestoreModelIdentity value.
|
|
156
156
|
*
|
|
157
|
-
* @param parentOrModelName
|
|
158
|
-
* @param collectionNameOrModelName
|
|
159
|
-
* @param
|
|
160
|
-
* @
|
|
157
|
+
* @param parentOrModelName Parent identity when nested, otherwise the model name.
|
|
158
|
+
* @param collectionNameOrModelName Collection name when a parent is provided, otherwise the model name.
|
|
159
|
+
* @param modelName Model name when a parent and collection name are both supplied.
|
|
160
|
+
* @param inputCollectionName Explicit collection name; only meaningful alongside a parent.
|
|
161
|
+
* @returns Identity value describing the model and its collection placement.
|
|
161
162
|
* @__NO_SIDE_EFFECTS__
|
|
162
163
|
*/
|
|
163
164
|
export declare function firestoreModelIdentity<M extends FirestoreModelType>(modelName: M): RootFirestoreModelIdentity<M, FirestoreModelDefaultCollectionName<M>>;
|
|
@@ -188,8 +189,10 @@ export interface FirestoreModelTypeRef<M extends FirestoreModelType = FirestoreM
|
|
|
188
189
|
/**
|
|
189
190
|
* Reads the FirestoreModelType from a FirestoreModelType or FirestoreModelTypeRef.
|
|
190
191
|
*
|
|
191
|
-
* @param modelTypeInput
|
|
192
|
-
* @returns
|
|
192
|
+
* @param modelTypeInput - Either a raw `FirestoreModelType` string or an object exposing one via `.modelType`.
|
|
193
|
+
* @returns The resolved `FirestoreModelType` string.
|
|
194
|
+
* @throws {Error} When the resolved model type is empty.
|
|
195
|
+
*
|
|
193
196
|
* @__NO_SIDE_EFFECTS__
|
|
194
197
|
*/
|
|
195
198
|
export declare function firestoreModelType(modelTypeInput: FirestoreModelType | FirestoreModelTypeRef): FirestoreModelType;
|
|
@@ -305,8 +308,8 @@ export declare const FIRESTORE_MODEL_ID_REGEX: RegExp;
|
|
|
305
308
|
/**
|
|
306
309
|
* Returns true if the input string is a FirestoreModelId.
|
|
307
310
|
*
|
|
308
|
-
* @param input -
|
|
309
|
-
* @returns True
|
|
311
|
+
* @param input - Candidate identifier to validate.
|
|
312
|
+
* @returns True when the input matches the Firestore ID format.
|
|
310
313
|
*/
|
|
311
314
|
export declare function isFirestoreModelId(input: string | FirestoreModelId): input is FirestoreModelId;
|
|
312
315
|
/**
|
|
@@ -349,15 +352,15 @@ export declare const FIRESTORE_MODEL_KEY_REGEX_STRICT: RegExp;
|
|
|
349
352
|
/**
|
|
350
353
|
* Returns true if the input string is a FirestoreModelKey.
|
|
351
354
|
*
|
|
352
|
-
* @param input -
|
|
353
|
-
* @returns True
|
|
355
|
+
* @param input - Candidate path to validate.
|
|
356
|
+
* @returns True when the input matches the Firestore key format.
|
|
354
357
|
*/
|
|
355
358
|
export declare function isFirestoreModelKey(input: string | FirestoreModelKey): input is FirestoreModelKey;
|
|
356
359
|
/**
|
|
357
360
|
* Returns true if the input string is a FirestoreModelId or a FirestoreModelKey.
|
|
358
361
|
*
|
|
359
|
-
* @param input -
|
|
360
|
-
* @returns True
|
|
362
|
+
* @param input - Candidate identifier or path to validate.
|
|
363
|
+
* @returns True when the input matches either the ID or key format.
|
|
361
364
|
*/
|
|
362
365
|
export declare function isFirestoreModelIdOrKey(input: string | FirestoreModelId | FirestoreModelKey): input is FirestoreModelId | FirestoreModelKey;
|
|
363
366
|
/**
|
|
@@ -370,11 +373,12 @@ export type FirestoreModelKeyPart<C extends FirestoreCollectionName = FirestoreC
|
|
|
370
373
|
export type FirestoreCollectionModelKeyPart<N extends FirestoreCollectionNameRef = FirestoreCollectionNameRef, K extends FirestoreModelId = FirestoreModelId> = N extends FirestoreCollectionNameRef<infer C> ? FirestoreModelKeyPart<C, K> : never;
|
|
371
374
|
export type FirestoreCollectionModelKey<N extends FirestoreCollectionNameRef = FirestoreCollectionNameRef, K extends FirestoreModelId = FirestoreModelId> = FirestoreCollectionModelKeyPart<N, K>;
|
|
372
375
|
/**
|
|
373
|
-
* Creates a firestoreModelKeyPart
|
|
376
|
+
* Creates a firestoreModelKeyPart.
|
|
374
377
|
*
|
|
375
378
|
* @param identity
|
|
376
379
|
* @param id
|
|
377
380
|
* @returns
|
|
381
|
+
*
|
|
378
382
|
* @__NO_SIDE_EFFECTS__
|
|
379
383
|
*/
|
|
380
384
|
export declare function firestoreModelKeyPart<N extends FirestoreCollectionNameRef, K extends FirestoreModelId = FirestoreModelId>(identity: N, id: K): FirestoreCollectionModelKeyPart<N, K>;
|
|
@@ -393,8 +397,9 @@ export type FirestoreModelKeyFactory<I extends RootFirestoreModelIdentity, K ext
|
|
|
393
397
|
/**
|
|
394
398
|
* Creates a FirestoreModelKeyFactory for the input root identity.
|
|
395
399
|
*
|
|
396
|
-
* @param identity - The root FirestoreModelIdentity to bind the factory to
|
|
397
|
-
* @returns A factory function that creates FirestoreModelKey values for the given identity and a provided id
|
|
400
|
+
* @param identity - The root FirestoreModelIdentity to bind the factory to.
|
|
401
|
+
* @returns A factory function that creates FirestoreModelKey values for the given identity and a provided id.
|
|
402
|
+
*
|
|
398
403
|
* @__NO_SIDE_EFFECTS__
|
|
399
404
|
*/
|
|
400
405
|
export declare function firestoreModelKeyFactory<I extends RootFirestoreModelIdentity, K extends FirestoreModelId = FirestoreModelId>(identity: I): (id: K) => FirestoreCollectionModelKeyPart<I, K>;
|
|
@@ -445,8 +450,9 @@ export type FirestoreModelCollectionAndIdPairObject = Record<FirestoreCollection
|
|
|
445
450
|
/**
|
|
446
451
|
* Converts a FirestoreModelKey or reference into a record mapping each collection name to its document id.
|
|
447
452
|
*
|
|
448
|
-
* @param input - The FirestoreModelKey, DocumentReferenceRef, or FirestoreModelKeyRef to convert
|
|
449
|
-
* @returns An object mapping collection names to document ids, or undefined if the key is unavailable
|
|
453
|
+
* @param input - The FirestoreModelKey, DocumentReferenceRef, or FirestoreModelKeyRef to convert.
|
|
454
|
+
* @returns An object mapping collection names to document ids, or undefined if the key is unavailable.
|
|
455
|
+
*
|
|
450
456
|
* @__NO_SIDE_EFFECTS__
|
|
451
457
|
*/
|
|
452
458
|
export declare function firestoreModelKeyPairObject(input: FirestoreModelKey | DocumentReferenceRef<unknown> | FirestoreModelKeyRef): Maybe<FirestoreModelCollectionAndIdPairObject>;
|
|
@@ -464,26 +470,29 @@ export type FirestoreModelCollectionTypeArrayName = string;
|
|
|
464
470
|
/**
|
|
465
471
|
* Returns the FirestoreCollectionType derived from the input FirestoreModelKey.
|
|
466
472
|
*
|
|
467
|
-
* @param input - The key or reference to extract the collection type from
|
|
468
|
-
* @returns The FirestoreCollectionType string, or undefined if the key is unavailable
|
|
473
|
+
* @param input - The key or reference to extract the collection type from.
|
|
474
|
+
* @returns The FirestoreCollectionType string, or undefined if the key is unavailable.
|
|
475
|
+
*
|
|
469
476
|
* @__NO_SIDE_EFFECTS__
|
|
470
477
|
*/
|
|
471
478
|
export declare function firestoreModelKeyCollectionType<T = unknown>(input: ReadFirestoreModelKeyInput<T>): Maybe<FirestoreCollectionType>;
|
|
472
479
|
/**
|
|
473
480
|
* Returns the collection type array name string derived from the input key, joined by the given separator.
|
|
474
481
|
*
|
|
475
|
-
* @param input - The key or reference to extract collection names from
|
|
476
|
-
* @param separator - The separator to join collection names with; defaults to the Firestore collection name separator
|
|
477
|
-
* @returns The joined collection type array name string, or undefined if the key is unavailable
|
|
482
|
+
* @param input - The key or reference to extract collection names from.
|
|
483
|
+
* @param separator - The separator to join collection names with; defaults to the Firestore collection name separator.
|
|
484
|
+
* @returns The joined collection type array name string, or undefined if the key is unavailable.
|
|
485
|
+
*
|
|
478
486
|
* @__NO_SIDE_EFFECTS__
|
|
479
487
|
*/
|
|
480
488
|
export declare function firestoreModelKeyCollectionTypeArrayName<T = unknown>(input: ReadFirestoreModelKeyInput<T>, separator?: string): Maybe<FirestoreModelCollectionTypeArrayName>;
|
|
481
489
|
/**
|
|
482
490
|
* Returns the collection type array name string derived from a FirestoreModelIdentity, joined by the given separator.
|
|
483
491
|
*
|
|
484
|
-
* @param input - The FirestoreModelIdentity to derive collection names from
|
|
485
|
-
* @param separator - The separator to join collection names with; defaults to the Firestore collection name separator
|
|
486
|
-
* @returns The joined collection type array name string
|
|
492
|
+
* @param input - The FirestoreModelIdentity to derive collection names from.
|
|
493
|
+
* @param separator - The separator to join collection names with; defaults to the Firestore collection name separator.
|
|
494
|
+
* @returns The joined collection type array name string.
|
|
495
|
+
*
|
|
487
496
|
* @__NO_SIDE_EFFECTS__
|
|
488
497
|
*/
|
|
489
498
|
export declare function firestoreIdentityTypeArrayName(input: FirestoreModelIdentity, separator?: string): FirestoreModelCollectionTypeArrayName;
|
|
@@ -491,16 +500,19 @@ export type FirestoreModelCollectionTypeArray = FirestoreCollectionName[];
|
|
|
491
500
|
/**
|
|
492
501
|
* Returns an ordered array of collection names derived from a FirestoreModelIdentity, from root to leaf.
|
|
493
502
|
*
|
|
494
|
-
* @param input -
|
|
495
|
-
* @returns
|
|
503
|
+
* @param input - Identity whose ancestor chain is walked.
|
|
504
|
+
* @returns Collection names ordered from root to leaf.
|
|
505
|
+
*
|
|
496
506
|
* @__NO_SIDE_EFFECTS__
|
|
497
507
|
*/
|
|
498
508
|
export declare function firestoreIdentityTypeArray(input: FirestoreModelIdentity): FirestoreModelCollectionTypeArray;
|
|
499
509
|
/**
|
|
500
510
|
* Returns an ordered array of collection names derived from the input FirestoreModelKey.
|
|
501
511
|
*
|
|
502
|
-
* @param input -
|
|
503
|
-
* @returns
|
|
512
|
+
* @param input - Key or reference whose path segments are parsed.
|
|
513
|
+
* @returns Collection names extracted from the key, or undefined when no key is available.
|
|
514
|
+
* @throws {Error} When the decoded key has an odd number of path segments (e.g. a collection ref instead of a document ref).
|
|
515
|
+
*
|
|
504
516
|
* @__NO_SIDE_EFFECTS__
|
|
505
517
|
*/
|
|
506
518
|
export declare function firestoreModelKeyCollectionTypeArray<T = unknown>(input: ReadFirestoreModelKeyInput<T>): Maybe<FirestoreModelCollectionTypeArray>;
|
|
@@ -509,26 +521,29 @@ export interface FirestoreModelCollectionAndIdPair extends FirestoreModelIdRef,
|
|
|
509
521
|
/**
|
|
510
522
|
* Returns the collection name of the input key.
|
|
511
523
|
*
|
|
512
|
-
* @param input - The key or reference to extract the collection name from
|
|
513
|
-
* @returns The FirestoreCollectionName from the deepest key pair, or undefined if unavailable
|
|
524
|
+
* @param input - The key or reference to extract the collection name from.
|
|
525
|
+
* @returns The FirestoreCollectionName from the deepest key pair, or undefined if unavailable.
|
|
526
|
+
*
|
|
514
527
|
* @__NO_SIDE_EFFECTS__
|
|
515
528
|
*/
|
|
516
529
|
export declare function firestoreModelKeyCollectionName<T = unknown>(input: ReadFirestoreModelKeyInput<T>): Maybe<FirestoreCollectionName>;
|
|
517
530
|
/**
|
|
518
531
|
* Returns the parent model key from up the specified amount of levels.
|
|
519
532
|
*
|
|
520
|
-
* @param input -
|
|
521
|
-
* @param maxLevelsUp -
|
|
522
|
-
* @returns
|
|
533
|
+
* @param input - Key or reference whose ancestor is located.
|
|
534
|
+
* @param maxLevelsUp - How many hierarchy levels to climb; defaults to 1.
|
|
535
|
+
* @returns Parent key, or undefined when no parent exists at that depth.
|
|
536
|
+
*
|
|
523
537
|
* @__NO_SIDE_EFFECTS__
|
|
524
538
|
*/
|
|
525
539
|
export declare function firestoreModelKeyParentKey<T = unknown>(input: ReadFirestoreModelKeyInput<T>, maxLevelsUp?: number): Maybe<FirestoreModelKey>;
|
|
526
540
|
/**
|
|
527
541
|
* Returns the collection/id pair array truncated by the specified number of levels from the end.
|
|
528
542
|
*
|
|
529
|
-
* @param input -
|
|
530
|
-
* @param maxLevelsUp -
|
|
531
|
-
* @returns
|
|
543
|
+
* @param input - Key or reference whose pair list is truncated.
|
|
544
|
+
* @param maxLevelsUp - How many trailing pairs to drop; defaults to 1.
|
|
545
|
+
* @returns Pair list down to the requested ancestor level, or undefined when unavailable.
|
|
546
|
+
*
|
|
532
547
|
* @__NO_SIDE_EFFECTS__
|
|
533
548
|
*/
|
|
534
549
|
export declare function firestoreModelKeyParentKeyPartPairs<T = unknown>(input: ReadFirestoreModelKeyInput<T>, maxLevelsUp?: number): Maybe<FirestoreModelCollectionAndIdPair[]>;
|
|
@@ -543,8 +558,10 @@ export declare function firestoreModelKeyTypePair<T = unknown>(input: ReadFirest
|
|
|
543
558
|
/**
|
|
544
559
|
* Parses a FirestoreModelKey into an ordered array of collection/id pair objects.
|
|
545
560
|
*
|
|
546
|
-
* @param input -
|
|
547
|
-
* @returns
|
|
561
|
+
* @param input - Key or reference whose path segments are decoded.
|
|
562
|
+
* @returns Ordered collection/id pairs decoded from the key, or undefined when no key is available.
|
|
563
|
+
* @throws {Error} When the decoded key has an odd number of path segments (e.g. a collection ref instead of a document ref).
|
|
564
|
+
*
|
|
548
565
|
* @__NO_SIDE_EFFECTS__
|
|
549
566
|
*/
|
|
550
567
|
export declare function firestoreModelKeyPartPairs<T = unknown>(input: ReadFirestoreModelKeyInput<T>): Maybe<FirestoreModelCollectionAndIdPair[]>;
|
|
@@ -588,7 +605,8 @@ export type FirestoreDummyModelKey = typeof FIRESTORE_DUMMY_MODEL_KEY;
|
|
|
588
605
|
* It's useful in testing scenarios or when initializing structures that
|
|
589
606
|
* require a key before one is available.
|
|
590
607
|
*
|
|
591
|
-
* @returns The dummy model key constant
|
|
608
|
+
* @returns The dummy model key constant.
|
|
609
|
+
*
|
|
592
610
|
* @__NO_SIDE_EFFECTS__
|
|
593
611
|
*/
|
|
594
612
|
export declare function firestoreDummyKey(): FirestoreDummyModelKey;
|
|
@@ -663,10 +681,12 @@ export interface FirestoreCollectionRef<T, D extends FirestoreDocument<T> = Fire
|
|
|
663
681
|
* 3. Query factory for building typed queries
|
|
664
682
|
* 4. Iteration utilities for paginated access
|
|
665
683
|
*
|
|
684
|
+
* @param inputConfig - Configuration for the collection.
|
|
685
|
+
* @returns A fully configured FirestoreCollection instance.
|
|
686
|
+
*
|
|
666
687
|
* @template T - The data type of documents in the collection
|
|
667
688
|
* @template D - The FirestoreDocument type that wraps the data
|
|
668
|
-
*
|
|
669
|
-
* @returns A fully configured FirestoreCollection instance
|
|
689
|
+
*
|
|
670
690
|
* @__NO_SIDE_EFFECTS__
|
|
671
691
|
*/
|
|
672
692
|
export declare function makeFirestoreCollection<T, D extends FirestoreDocument<T>>(inputConfig: FirestoreCollectionConfig<T, D>): FirestoreCollection<T, D>;
|
|
@@ -48,10 +48,12 @@ export interface FirestoreCollectionGroup<T, D extends FirestoreDocument<T> = Fi
|
|
|
48
48
|
* which is particularly useful for modeling relationships that can exist at different points
|
|
49
49
|
* in the document hierarchy.
|
|
50
50
|
*
|
|
51
|
+
* @param config - Configuration for the collection group.
|
|
52
|
+
* @returns A fully configured FirestoreCollectionGroup instance.
|
|
53
|
+
*
|
|
51
54
|
* @template T - The data type of the documents in the collection group
|
|
52
55
|
* @template D - The FirestoreDocument type that wraps the data
|
|
53
|
-
*
|
|
54
|
-
* @returns A fully configured FirestoreCollectionGroup instance
|
|
56
|
+
*
|
|
55
57
|
* @__NO_SIDE_EFFECTS__
|
|
56
58
|
*/
|
|
57
59
|
export declare function makeFirestoreCollectionGroup<T, D extends FirestoreDocument<T>>(config: FirestoreCollectionGroupConfig<T, D>): FirestoreCollectionGroup<T, D>;
|
|
@@ -191,23 +191,26 @@ export interface FirestoreCollectionQueryFactory<T, D extends FirestoreDocument<
|
|
|
191
191
|
* by wrapping standard query operations with document loading capabilities. It transforms
|
|
192
192
|
* query results from raw Firestore snapshots into fully-typed document model instances.
|
|
193
193
|
*
|
|
194
|
+
* @param queryFactory - The base query factory for creating raw Firestore queries.
|
|
195
|
+
* @param accessorContext - The document accessor context for loading and converting documents.
|
|
196
|
+
* @returns A collection query factory for creating document-aware queries.
|
|
197
|
+
*
|
|
194
198
|
* @template T - The data type of the documents
|
|
195
199
|
* @template D - The FirestoreDocument type that wraps the data
|
|
196
|
-
* @param queryFactory - The base query factory for creating raw Firestore queries
|
|
197
|
-
* @param accessorContext - The document accessor context for loading and converting documents
|
|
198
|
-
* @returns A collection query factory for creating document-aware queries
|
|
199
200
|
*
|
|
200
201
|
* @example
|
|
202
|
+
* ```ts
|
|
201
203
|
* // Creating a collection query factory
|
|
202
204
|
* const userQueryFactory = firestoreCollectionQueryFactory(
|
|
203
205
|
* userQueryFactory, // Base query factory
|
|
204
206
|
* userAccessorContext // Document accessor context
|
|
205
207
|
* );
|
|
206
|
-
*
|
|
207
208
|
* // Using the factory to create and execute a query
|
|
208
209
|
* const activeUsers = await userQueryFactory
|
|
209
210
|
* .queryDocument(where('status', '==', 'active'))
|
|
210
211
|
* .getDocs();
|
|
212
|
+
* ```
|
|
213
|
+
*
|
|
211
214
|
* @__NO_SIDE_EFFECTS__
|
|
212
215
|
*/
|
|
213
216
|
export declare function firestoreCollectionQueryFactory<T, D extends FirestoreDocument<T>>(queryFactory: FirestoreQueryFactory<T>, accessorContext: LimitedFirestoreDocumentAccessorContextExtension<T, D>): FirestoreCollectionQueryFactory<T, D>;
|
|
@@ -43,10 +43,12 @@ export interface RootSingleItemFirestoreCollection<T, D extends FirestoreDocumen
|
|
|
43
43
|
* with a single document. Useful for application settings, configuration,
|
|
44
44
|
* or any singleton-like data structures that are stored in Firestore.
|
|
45
45
|
*
|
|
46
|
+
* @param config - Configuration for the single document collection.
|
|
47
|
+
* @returns A RootSingleItemFirestoreCollection instance configured for the specified document.
|
|
48
|
+
*
|
|
46
49
|
* @template T - The data type of the document
|
|
47
50
|
* @template D - The FirestoreDocument type, defaults to FirestoreDocument<T>
|
|
48
|
-
*
|
|
49
|
-
* @returns A RootSingleItemFirestoreCollection instance configured for the specified document
|
|
51
|
+
*
|
|
50
52
|
* @__NO_SIDE_EFFECTS__
|
|
51
53
|
*/
|
|
52
54
|
export declare function makeRootSingleItemFirestoreCollection<T, D extends FirestoreDocument<T> = FirestoreDocument<T>>(config: RootSingleItemFirestoreCollectionConfig<T, D>): RootSingleItemFirestoreCollection<T, D>;
|
|
@@ -7,14 +7,15 @@ import { type FirestoreModelId } from './collection';
|
|
|
7
7
|
* that satisfies Firestore's document ID constraints. This encoding is one-way; the
|
|
8
8
|
* original email cannot be recovered from the result.
|
|
9
9
|
*
|
|
10
|
-
* @param emailAddress - The email address to convert
|
|
11
|
-
* @returns A Firestore-safe document ID derived from the email
|
|
10
|
+
* @param emailAddress - The email address to convert.
|
|
11
|
+
* @returns A Firestore-safe document ID derived from the email.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
15
15
|
* const id = firestoreModelIdFromEmail('user@example.com');
|
|
16
16
|
* // id === 'userAAAexamplecom'
|
|
17
17
|
* ```
|
|
18
|
+
*
|
|
18
19
|
* @__NO_SIDE_EFFECTS__
|
|
19
20
|
*/
|
|
20
21
|
export declare function firestoreModelIdFromEmail(emailAddress: EmailAddress): FirestoreModelId;
|
|
@@ -91,12 +91,14 @@ export type FirestoreCollectionWithParentFactory<T, PT, D extends FirestoreDocum
|
|
|
91
91
|
* parent document. The subcollection inherits all the capabilities of a standard
|
|
92
92
|
* collection while also providing access to its parent document context.
|
|
93
93
|
*
|
|
94
|
+
* @param config - Configuration for the subcollection, including the parent document reference.
|
|
95
|
+
* @returns A subcollection instance linked to the specified parent document.
|
|
96
|
+
*
|
|
94
97
|
* @template T - The data type of documents in the subcollection
|
|
95
98
|
* @template PT - The data type of the parent document
|
|
96
99
|
* @template D - The document type for documents in the subcollection, defaults to FirestoreDocument<T>
|
|
97
100
|
* @template PD - The document type for the parent document, defaults to FirestoreDocument<PT>
|
|
98
|
-
*
|
|
99
|
-
* @returns A subcollection instance linked to the specified parent document
|
|
101
|
+
*
|
|
100
102
|
* @__NO_SIDE_EFFECTS__
|
|
101
103
|
*/
|
|
102
104
|
export declare function makeFirestoreCollectionWithParent<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>>(config: FirestoreCollectionWithParentConfig<T, PT, D, PD>): FirestoreCollectionWithParent<T, PT, D, PD>;
|
|
@@ -199,8 +199,10 @@ export interface PagedItemFirestoreCollection<T, PT, D extends FirestoreDocument
|
|
|
199
199
|
* handled by the paged accessor's {@link PagedItemConverter}) and `c` is the
|
|
200
200
|
* denormalized count.
|
|
201
201
|
*
|
|
202
|
+
* @returns A snapshot converter for {@link PagedItemPageData}<T>.
|
|
203
|
+
*
|
|
202
204
|
* @template T - The item type stored across pages
|
|
203
|
-
*
|
|
205
|
+
*
|
|
204
206
|
* @__NO_SIDE_EFFECTS__
|
|
205
207
|
*/
|
|
206
208
|
export declare function defaultPagedItemPageDataConverter<T>(): SnapshotConverterFunctions<PagedItemPageData<T>>;
|
|
@@ -215,12 +217,14 @@ export declare function defaultPagedItemPageDataConverter<T>(): SnapshotConverte
|
|
|
215
217
|
* default {@link defaultPagedItemPageDataConverter} is used so consumers don't
|
|
216
218
|
* have to model the envelope shape themselves.
|
|
217
219
|
*
|
|
220
|
+
* @param config - Paged collection configuration.
|
|
221
|
+
* @returns A configured paged subcollection.
|
|
222
|
+
*
|
|
218
223
|
* @template T - The item type stored across pages
|
|
219
224
|
* @template PT - The parent document data type
|
|
220
225
|
* @template D - The page document type
|
|
221
226
|
* @template PD - The parent document type
|
|
222
|
-
*
|
|
223
|
-
* @returns A configured paged subcollection
|
|
227
|
+
*
|
|
224
228
|
* @__NO_SIDE_EFFECTS__
|
|
225
229
|
*/
|
|
226
230
|
export declare function makePagedItemFirestoreCollection<T, PT, D extends FirestoreDocument<PagedItemPageData<T>> = FirestoreDocument<PagedItemPageData<T>>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>>(config: PagedItemFirestoreCollectionConfig<T, PT, D, PD>): PagedItemFirestoreCollection<T, PT, D, PD>;
|
|
@@ -44,12 +44,14 @@ export interface SingleItemFirestoreCollection<T, PT, D extends FirestoreDocumen
|
|
|
44
44
|
* a specific document. It combines the hierarchical relationship of parent-child documents
|
|
45
45
|
* with the convenience of direct access to a single, known document in the subcollection.
|
|
46
46
|
*
|
|
47
|
+
* @param config - Configuration for the single document subcollection.
|
|
48
|
+
* @returns A subcollection instance with specialized accessors for the single document.
|
|
49
|
+
*
|
|
47
50
|
* @template T - The data type of the subcollection document
|
|
48
51
|
* @template PT - The data type of the parent document
|
|
49
52
|
* @template D - The document type for the subcollection document, defaults to FirestoreDocument<T>
|
|
50
53
|
* @template PD - The document type for the parent document, defaults to FirestoreDocument<PT>
|
|
51
|
-
*
|
|
52
|
-
* @returns A subcollection instance with specialized accessors for the single document
|
|
54
|
+
*
|
|
53
55
|
* @__NO_SIDE_EFFECTS__
|
|
54
56
|
*/
|
|
55
57
|
export declare function makeSingleItemFirestoreCollection<T, PT, D extends FirestoreDocument<T> = FirestoreDocument<T>, PD extends FirestoreDocument<PT> = FirestoreDocument<PT>>(config: SingleItemFirestoreCollectionConfig<T, PT, D, PD>): SingleItemFirestoreCollection<T, PT, D, PD>;
|
|
@@ -236,9 +236,11 @@ export type FirestoreContextFactory<F extends Firestore = Firestore> = (firestor
|
|
|
236
236
|
* create FirestoreContext instances for specific Firestore instances. The resulting contexts
|
|
237
237
|
* will use the provided drivers for all Firestore operations.
|
|
238
238
|
*
|
|
239
|
+
* @param drivers - The Firestore drivers to use in created contexts.
|
|
240
|
+
* @returns A factory function that creates FirestoreContext instances.
|
|
241
|
+
*
|
|
239
242
|
* @template F - The Firestore implementation type
|
|
240
|
-
*
|
|
241
|
-
* @returns A factory function that creates FirestoreContext instances
|
|
243
|
+
*
|
|
242
244
|
* @__NO_SIDE_EFFECTS__
|
|
243
245
|
*/
|
|
244
246
|
export declare function firestoreContextFactory<F extends Firestore = Firestore>(drivers: FirestoreDrivers): FirestoreContextFactory<F>;
|
|
@@ -29,11 +29,12 @@ export interface MakeFirestoreQueryConstraintFunctionsDriver<B> extends Omit<Fir
|
|
|
29
29
|
* handlers declaratively. The returned driver applies constraints sequentially using the
|
|
30
30
|
* registered handlers and throws if an unsupported constraint type is encountered.
|
|
31
31
|
*
|
|
32
|
+
* @param config - The handler map configuration.
|
|
33
|
+
* @returns A fully configured constraint functions driver.
|
|
34
|
+
* @throws {Error} When a query uses a constraint type not present in the handler map.
|
|
35
|
+
*
|
|
32
36
|
* @template B - The platform-specific query builder type
|
|
33
|
-
* @param config - The handler map configuration
|
|
34
|
-
* @returns A fully configured constraint functions driver
|
|
35
37
|
*
|
|
36
|
-
* @throws {Error} When a query uses a constraint type not present in the handler map
|
|
37
38
|
* @__NO_SIDE_EFFECTS__
|
|
38
39
|
*/
|
|
39
40
|
export declare function makeFirestoreQueryConstraintFunctionsDriver<B>(config: MakeFirestoreQueryConstraintFunctionsDriver<B>): FirestoreQueryConstraintFunctionsDriver;
|
|
@@ -3,8 +3,8 @@ import { type UpdateData } from 'firebase/firestore';
|
|
|
3
3
|
* Throws an error indicating the current Firestore driver does not support the called function.
|
|
4
4
|
* Used by driver implementations to reject unsupported operations at runtime.
|
|
5
5
|
*
|
|
6
|
-
* @param message - Optional custom error message
|
|
7
|
-
* @throws {Error} Always throws
|
|
6
|
+
* @param message - Optional custom error message.
|
|
7
|
+
* @throws {Error} Always throws.
|
|
8
8
|
*/
|
|
9
9
|
export declare function unsupportedFirestoreDriverFunctionError(message?: string): void;
|
|
10
10
|
/**
|
|
@@ -14,14 +14,15 @@ export declare function unsupportedFirestoreDriverFunctionError(message?: string
|
|
|
14
14
|
* does not. This assertion normalizes behavior across both platforms so that empty updates
|
|
15
15
|
* are caught early regardless of which driver is in use.
|
|
16
16
|
*
|
|
17
|
-
* @param data - The update data to validate
|
|
18
|
-
* @throws {Error} When the data object has no keys
|
|
17
|
+
* @param data - The update data to validate.
|
|
18
|
+
* @throws {Error} When the data object has no keys.
|
|
19
19
|
*/
|
|
20
20
|
export declare function assertFirestoreUpdateHasData(data: UpdateData<object>): void;
|
|
21
21
|
/**
|
|
22
22
|
* Creates and throws an error for empty update data passed to a {@link FirestoreDocumentDataAccessor}'s `update()` method.
|
|
23
23
|
*
|
|
24
|
-
* @throws {Error} Always throws
|
|
24
|
+
* @throws {Error} Always throws.
|
|
25
|
+
*
|
|
25
26
|
* @__NO_SIDE_EFFECTS__
|
|
26
27
|
*/
|
|
27
28
|
export declare function firestoreUpdateWithNoDataError(): void;
|