@dereekb/dbx-firebase 13.0.5 → 13.0.7
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/package.json +11 -11
- package/types/dereekb-dbx-firebase.d.ts +143 -0
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/dbx-firebase",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.7",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^21.0.0",
|
|
6
6
|
"@angular/core": "^21.0.0",
|
|
7
7
|
"@angular/fire": "21.0.0-rc.0-canary.ac3dd7c",
|
|
8
8
|
"@angular/material": "^21.0.0",
|
|
9
|
-
"@dereekb/date": "13.0.
|
|
10
|
-
"@dereekb/dbx-analytics": "13.0.
|
|
11
|
-
"@dereekb/dbx-core": "13.0.
|
|
12
|
-
"@dereekb/dbx-form": "13.0.
|
|
13
|
-
"@dereekb/dbx-web": "13.0.
|
|
14
|
-
"@dereekb/firebase": "13.0.
|
|
15
|
-
"@dereekb/model": "13.0.
|
|
16
|
-
"@dereekb/rxjs": "13.0.
|
|
17
|
-
"@dereekb/util": "13.0.
|
|
9
|
+
"@dereekb/date": "13.0.7",
|
|
10
|
+
"@dereekb/dbx-analytics": "13.0.7",
|
|
11
|
+
"@dereekb/dbx-core": "13.0.7",
|
|
12
|
+
"@dereekb/dbx-form": "13.0.7",
|
|
13
|
+
"@dereekb/dbx-web": "13.0.7",
|
|
14
|
+
"@dereekb/firebase": "13.0.7",
|
|
15
|
+
"@dereekb/model": "13.0.7",
|
|
16
|
+
"@dereekb/rxjs": "13.0.7",
|
|
17
|
+
"@dereekb/util": "13.0.7",
|
|
18
18
|
"@ngrx/component-store": "^21.0.0",
|
|
19
19
|
"@ngx-formly/core": "git+https://git@github.com/dereekb/ngx-formly#996d1041c8d2afbe429985a5ad394e59327bfa1d",
|
|
20
20
|
"firebase": "^12.0.0",
|
|
21
21
|
"make-error": "^1.3.0",
|
|
22
|
-
"ng-overlay-container": "
|
|
22
|
+
"ng-overlay-container": "^21.0.1",
|
|
23
23
|
"rxjs": "^7.8.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
@@ -1851,43 +1851,186 @@ declare function dbxFirebaseSourceSelectLoadSource<M>(config: DbxFirebaseSourceS
|
|
|
1851
1851
|
|
|
1852
1852
|
/**
|
|
1853
1853
|
* Provides read-only accessors to a single model/document.
|
|
1854
|
+
*
|
|
1855
|
+
* Fields follow two naming conventions:
|
|
1856
|
+
* - `current*` fields emit {@link Maybe} values (including `undefined` when no value is present).
|
|
1857
|
+
* - Non-prefixed fields filter out `null`/`undefined` and only emit when a value is defined.
|
|
1858
|
+
* - `input*` fields reflect the raw identifier set by the caller (via `setId`, `setKey`, or `setRef`).
|
|
1859
|
+
* - Non-`input` identity fields (e.g., `id$`, `key$`) are derived from the resolved {@link FirestoreDocument}.
|
|
1854
1860
|
*/
|
|
1855
1861
|
interface DbxFirebaseDocumentReadOnlyStore<T, D extends FirestoreDocument<T> = FirestoreDocument<T>> {
|
|
1856
1862
|
/**
|
|
1857
1863
|
* String used to identify the store. Typically only for debugging UI purposes.
|
|
1858
1864
|
*/
|
|
1859
1865
|
readonly storeName$: Observable<Maybe<string>>;
|
|
1866
|
+
/**
|
|
1867
|
+
* The {@link FirestoreCollectionLike} used to resolve documents.
|
|
1868
|
+
*
|
|
1869
|
+
* If a {@link FirestoreCollection} is set, it takes priority over a {@link FirestoreCollectionLike}.
|
|
1870
|
+
* Only emits when a collection is available.
|
|
1871
|
+
*/
|
|
1860
1872
|
readonly firestoreCollectionLike$: Observable<FirestoreCollectionLike<T, D>>;
|
|
1873
|
+
/**
|
|
1874
|
+
* The {@link FirestoreCollection} used to resolve documents.
|
|
1875
|
+
*
|
|
1876
|
+
* Only emits when a strict {@link FirestoreCollection} (not just a {@link FirestoreCollectionLike}) is set.
|
|
1877
|
+
* Required for resolving documents by id (as opposed to key or ref).
|
|
1878
|
+
*/
|
|
1861
1879
|
readonly firestoreCollection$: Observable<FirestoreCollection<T, D>>;
|
|
1880
|
+
/**
|
|
1881
|
+
* The raw document id string set by the caller via `setId()`.
|
|
1882
|
+
*
|
|
1883
|
+
* Emits `undefined` when no id has been set. Setting a key or ref clears the id (they are mutually exclusive).
|
|
1884
|
+
*/
|
|
1862
1885
|
readonly currentInputId$: Observable<Maybe<FirestoreModelId>>;
|
|
1886
|
+
/**
|
|
1887
|
+
* Non-nullable version of {@link currentInputId$}. Only emits when a defined id is set.
|
|
1888
|
+
*/
|
|
1863
1889
|
readonly inputId$: Observable<FirestoreModelId>;
|
|
1890
|
+
/**
|
|
1891
|
+
* The raw Firestore key path set by the caller via `setKey()`.
|
|
1892
|
+
*
|
|
1893
|
+
* Emits `undefined` when no key has been set.
|
|
1894
|
+
*/
|
|
1864
1895
|
readonly currentInputKey$: Observable<Maybe<FirestoreModelKey>>;
|
|
1896
|
+
/**
|
|
1897
|
+
* Non-nullable version of {@link currentInputKey$}. Only emits when a defined key is set.
|
|
1898
|
+
*/
|
|
1865
1899
|
readonly inputKey$: Observable<FirestoreModelKey>;
|
|
1900
|
+
/**
|
|
1901
|
+
* The raw {@link DocumentReference} set by the caller via `setRef()`.
|
|
1902
|
+
*
|
|
1903
|
+
* Emits `undefined` when no ref has been set.
|
|
1904
|
+
*/
|
|
1866
1905
|
readonly currentInputRef$: Observable<Maybe<DocumentReference<T>>>;
|
|
1906
|
+
/**
|
|
1907
|
+
* Non-nullable version of {@link currentInputRef$}. Only emits when a defined ref is set.
|
|
1908
|
+
*/
|
|
1867
1909
|
readonly inputRef$: Observable<DocumentReference<T>>;
|
|
1910
|
+
/**
|
|
1911
|
+
* The current {@link FirestoreAccessorStreamMode} used when streaming snapshots.
|
|
1912
|
+
*
|
|
1913
|
+
* Defaults to `STREAM` (realtime `onSnapshot` subscriptions). Affects how {@link snapshot$} fetches data.
|
|
1914
|
+
*/
|
|
1868
1915
|
readonly streamMode$: Observable<FirestoreAccessorStreamMode>;
|
|
1916
|
+
/**
|
|
1917
|
+
* The resolved {@link FirestoreDocument} based on the current input (id, key, or ref).
|
|
1918
|
+
*
|
|
1919
|
+
* Resolution priority: `ref > key > id`. Emits `undefined` when no input is set.
|
|
1920
|
+
* This represents the document accessor object, not the fetched Firestore data.
|
|
1921
|
+
*/
|
|
1869
1922
|
readonly currentDocument$: Observable<Maybe<D>>;
|
|
1923
|
+
/**
|
|
1924
|
+
* Non-nullable version of {@link currentDocument$}. Only emits once a document has been resolved.
|
|
1925
|
+
*/
|
|
1870
1926
|
readonly document$: Observable<D>;
|
|
1927
|
+
/**
|
|
1928
|
+
* The document id derived from the resolved {@link FirestoreDocument}.
|
|
1929
|
+
*
|
|
1930
|
+
* Unlike {@link currentInputId$}, this is available regardless of whether the input was an id, key, or ref.
|
|
1931
|
+
*/
|
|
1871
1932
|
readonly currentId$: Observable<Maybe<FirestoreModelId>>;
|
|
1933
|
+
/**
|
|
1934
|
+
* The full Firestore key path derived from the resolved {@link FirestoreDocument}.
|
|
1935
|
+
*
|
|
1936
|
+
* Unlike {@link currentInputKey$}, this is available regardless of whether the input was an id, key, or ref.
|
|
1937
|
+
*/
|
|
1872
1938
|
readonly currentKey$: Observable<Maybe<FirestoreModelKey>>;
|
|
1939
|
+
/**
|
|
1940
|
+
* Non-nullable version of {@link currentId$}. Only emits once a document has been resolved.
|
|
1941
|
+
*/
|
|
1873
1942
|
readonly id$: Observable<FirestoreModelId>;
|
|
1943
|
+
/**
|
|
1944
|
+
* Non-nullable version of {@link currentKey$}. Only emits once a document has been resolved.
|
|
1945
|
+
*/
|
|
1874
1946
|
readonly key$: Observable<FirestoreModelKey>;
|
|
1947
|
+
/**
|
|
1948
|
+
* The {@link DocumentReference} from the resolved document. Only emits once a document has been resolved.
|
|
1949
|
+
*/
|
|
1875
1950
|
readonly ref$: Observable<DocumentReference<T>>;
|
|
1951
|
+
/**
|
|
1952
|
+
* Whether the store currently points to a resolved document with a non-null reference.
|
|
1953
|
+
*/
|
|
1876
1954
|
readonly hasRef$: Observable<boolean>;
|
|
1955
|
+
/**
|
|
1956
|
+
* A flat (slash-replaced) string representation of the document key. Useful for URLs or flat identifiers.
|
|
1957
|
+
*/
|
|
1877
1958
|
readonly flatKey$: Observable<FlatFirestoreModelKey>;
|
|
1959
|
+
/**
|
|
1960
|
+
* A reversible flat string representation of the document key.
|
|
1961
|
+
*/
|
|
1878
1962
|
readonly twoWayFlatKey$: Observable<TwoWayFlatFirestoreModelKey>;
|
|
1963
|
+
/**
|
|
1964
|
+
* All id segments extracted from the document key path.
|
|
1965
|
+
*
|
|
1966
|
+
* For nested collections, this includes the full ancestor id chain.
|
|
1967
|
+
*/
|
|
1879
1968
|
readonly keyModelIds$: Observable<FirestoreModelId[]>;
|
|
1969
|
+
/**
|
|
1970
|
+
* Collection-and-id pairs for each segment in the document key path.
|
|
1971
|
+
*/
|
|
1880
1972
|
readonly keyPairs$: Observable<FirestoreModelCollectionAndIdPair[]>;
|
|
1973
|
+
/**
|
|
1974
|
+
* Collection-and-id pairs as a named object keyed by collection name.
|
|
1975
|
+
*/
|
|
1881
1976
|
readonly keyPairObject$: Observable<FirestoreModelCollectionAndIdPairObject>;
|
|
1977
|
+
/**
|
|
1978
|
+
* {@link LoadingState} wrapper around the resolved document.
|
|
1979
|
+
*
|
|
1980
|
+
* Emits a loading state when no document is resolved yet, and a success state once a document object exists.
|
|
1981
|
+
* This reflects document resolution, not whether Firestore data has been fetched.
|
|
1982
|
+
*/
|
|
1882
1983
|
readonly documentLoadingState$: Observable<LoadingState<D>>;
|
|
1984
|
+
/**
|
|
1985
|
+
* Live Firestore snapshot stream for the resolved document.
|
|
1986
|
+
*
|
|
1987
|
+
* Uses the current {@link streamMode$} to determine streaming behavior (realtime vs one-shot).
|
|
1988
|
+
* Resubscribes when the document or stream mode changes.
|
|
1989
|
+
*/
|
|
1883
1990
|
readonly snapshot$: Observable<DocumentSnapshot<T>>;
|
|
1991
|
+
/**
|
|
1992
|
+
* {@link LoadingState} wrapper around {@link snapshot$}.
|
|
1993
|
+
*
|
|
1994
|
+
* Resets to loading when the document changes, then emits success with the snapshot.
|
|
1995
|
+
* Permission errors are caught and wrapped as error states.
|
|
1996
|
+
*/
|
|
1884
1997
|
readonly snapshotLoadingState$: Observable<LoadingState<DocumentSnapshot<T>>>;
|
|
1998
|
+
/**
|
|
1999
|
+
* The current document data extracted from the snapshot, or `undefined` while loading or on error.
|
|
2000
|
+
*/
|
|
1885
2001
|
readonly currentData$: Observable<Maybe<DocumentDataWithIdAndKey<T>>>;
|
|
2002
|
+
/**
|
|
2003
|
+
* Non-nullable version of {@link currentData$}. Only emits once Firestore data has arrived.
|
|
2004
|
+
*
|
|
2005
|
+
* Resets when the document changes and waits for the new document's data before emitting again.
|
|
2006
|
+
*/
|
|
1886
2007
|
readonly data$: Observable<DocumentDataWithIdAndKey<T>>;
|
|
2008
|
+
/**
|
|
2009
|
+
* {@link LoadingState} wrapper around the document data.
|
|
2010
|
+
*
|
|
2011
|
+
* If the snapshot exists but the document is not found in Firestore, emits an error state.
|
|
2012
|
+
*/
|
|
1887
2013
|
readonly dataLoadingState$: Observable<LoadingState<DocumentDataWithIdAndKey<T>>>;
|
|
2014
|
+
/**
|
|
2015
|
+
* Whether the dataLoadingState$ is currently loading.
|
|
2016
|
+
*/
|
|
1888
2017
|
readonly isLoadingData$: Observable<boolean>;
|
|
2018
|
+
/**
|
|
2019
|
+
* Whether the document exists in Firestore.
|
|
2020
|
+
*
|
|
2021
|
+
* Returns `false` while no document reference is set (via {@link hasRef$}), then delegates to {@link exists$}.
|
|
2022
|
+
* Prevents stale `true` values while transitioning between documents.
|
|
2023
|
+
*/
|
|
1889
2024
|
readonly currentExists$: Observable<boolean>;
|
|
2025
|
+
/**
|
|
2026
|
+
* Whether the document exists in Firestore.
|
|
2027
|
+
*
|
|
2028
|
+
* `true` if the document has data, `false` if not found. Permission-denied errors are treated as non-existent.
|
|
2029
|
+
*/
|
|
1890
2030
|
readonly exists$: Observable<boolean>;
|
|
2031
|
+
/**
|
|
2032
|
+
* The static {@link FirestoreModelIdentity} (type/collection metadata) from the collection, not from any specific document.
|
|
2033
|
+
*/
|
|
1891
2034
|
readonly modelIdentity$: Observable<FirestoreModelIdentity>;
|
|
1892
2035
|
}
|
|
1893
2036
|
/**
|