@dereekb/firebase 13.9.0 → 13.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +8 -0
- package/index.esm.js +8 -0
- package/package.json +5 -5
- package/src/lib/client/function/function.d.ts +5 -0
- package/src/lib/client/function/function.factory.d.ts +5 -0
- package/src/lib/client/function/model.function.factory.d.ts +5 -0
- package/src/lib/common/auth/auth.d.ts +14 -0
- package/src/lib/common/development/function.d.ts +5 -0
- package/src/lib/common/firestore/accessor/document.d.ts +8 -0
- package/src/lib/common/firestore/collection/collection.d.ts +15 -0
- package/src/lib/common/firestore/driver/driver.d.ts +5 -0
- package/src/lib/common/firestore/query/constraint.d.ts +5 -0
- package/src/lib/common/storage/driver/accessor.d.ts +13 -0
- package/src/lib/common/storage/driver/driver.d.ts +5 -0
- package/src/lib/common/storage/storage.d.ts +5 -0
- package/src/lib/common/storage/types.d.ts +29 -0
- package/src/lib/model/notification/notification.d.ts +103 -0
- package/src/lib/model/notification/notification.id.d.ts +10 -0
- package/src/lib/model/notification/notification.message.d.ts +10 -0
- package/src/lib/model/notification/notification.task.subtask.d.ts +4 -0
- package/src/lib/model/oidcmodel/oidcmodel.d.ts +20 -0
- package/src/lib/model/oidcmodel/oidcmodel.id.d.ts +5 -0
- package/src/lib/model/oidcmodel/oidcmodel.interaction.d.ts +14 -0
- package/src/lib/model/storagefile/storagefile.d.ts +68 -1
- package/src/lib/model/storagefile/storagefile.id.d.ts +10 -0
- package/src/lib/model/storagefile/storagefile.upload.d.ts +5 -0
- package/src/lib/model/storagefile/storagefile.upload.determiner.d.ts +4 -0
- package/src/lib/model/system/system.d.ts +13 -0
- package/test/package.json +6 -6
package/index.cjs.js
CHANGED
|
@@ -13682,6 +13682,8 @@ function _is_native_reflect_construct$3() {
|
|
|
13682
13682
|
* Used by both client and server code to access notification documents.
|
|
13683
13683
|
*
|
|
13684
13684
|
* @see `NotificationServerActions` in `@dereekb/firebase-server/model` for server-side action processing
|
|
13685
|
+
*
|
|
13686
|
+
* @dbxModelGroup Notification
|
|
13685
13687
|
*/ var NotificationFirestoreCollections = function NotificationFirestoreCollections() {
|
|
13686
13688
|
_class_call_check$7(this, NotificationFirestoreCollections);
|
|
13687
13689
|
};
|
|
@@ -16207,6 +16209,8 @@ function _is_native_reflect_construct$2() {
|
|
|
16207
16209
|
* Used by both client and server code to access oidc model documents.
|
|
16208
16210
|
*
|
|
16209
16211
|
* @see `OidcModelServerActions` in `@dereekb/firebase-server/oidc` for server-side action processing
|
|
16212
|
+
*
|
|
16213
|
+
* @dbxModelGroup OidcModel
|
|
16210
16214
|
*/ var OidcModelFirestoreCollections = function OidcModelFirestoreCollections() {
|
|
16211
16215
|
_class_call_check$4(this, OidcModelFirestoreCollections);
|
|
16212
16216
|
};
|
|
@@ -16668,6 +16672,8 @@ function _is_native_reflect_construct$1() {
|
|
|
16668
16672
|
* Abstract base providing access to StorageFile and StorageFileGroup Firestore collections.
|
|
16669
16673
|
*
|
|
16670
16674
|
* Implement this in your app module to wire up the collections for dependency injection.
|
|
16675
|
+
*
|
|
16676
|
+
* @dbxModelGroup StorageFile
|
|
16671
16677
|
*/ var StorageFileFirestoreCollections = function StorageFileFirestoreCollections() {
|
|
16672
16678
|
_class_call_check$1(this, StorageFileFirestoreCollections);
|
|
16673
16679
|
};
|
|
@@ -18798,6 +18804,8 @@ function _is_native_reflect_construct() {
|
|
|
18798
18804
|
* Abstract base providing access to the SystemState Firestore collection.
|
|
18799
18805
|
*
|
|
18800
18806
|
* Implement this in your app module to wire up dependency injection.
|
|
18807
|
+
*
|
|
18808
|
+
* @dbxModelGroup SystemState
|
|
18801
18809
|
*/ var SystemStateFirestoreCollections = function SystemStateFirestoreCollections() {
|
|
18802
18810
|
_class_call_check(this, SystemStateFirestoreCollections);
|
|
18803
18811
|
};
|
package/index.esm.js
CHANGED
|
@@ -13680,6 +13680,8 @@ function _is_native_reflect_construct$3() {
|
|
|
13680
13680
|
* Used by both client and server code to access notification documents.
|
|
13681
13681
|
*
|
|
13682
13682
|
* @see `NotificationServerActions` in `@dereekb/firebase-server/model` for server-side action processing
|
|
13683
|
+
*
|
|
13684
|
+
* @dbxModelGroup Notification
|
|
13683
13685
|
*/ var NotificationFirestoreCollections = function NotificationFirestoreCollections() {
|
|
13684
13686
|
_class_call_check$7(this, NotificationFirestoreCollections);
|
|
13685
13687
|
};
|
|
@@ -16205,6 +16207,8 @@ function _is_native_reflect_construct$2() {
|
|
|
16205
16207
|
* Used by both client and server code to access oidc model documents.
|
|
16206
16208
|
*
|
|
16207
16209
|
* @see `OidcModelServerActions` in `@dereekb/firebase-server/oidc` for server-side action processing
|
|
16210
|
+
*
|
|
16211
|
+
* @dbxModelGroup OidcModel
|
|
16208
16212
|
*/ var OidcModelFirestoreCollections = function OidcModelFirestoreCollections() {
|
|
16209
16213
|
_class_call_check$4(this, OidcModelFirestoreCollections);
|
|
16210
16214
|
};
|
|
@@ -16666,6 +16670,8 @@ function _is_native_reflect_construct$1() {
|
|
|
16666
16670
|
* Abstract base providing access to StorageFile and StorageFileGroup Firestore collections.
|
|
16667
16671
|
*
|
|
16668
16672
|
* Implement this in your app module to wire up the collections for dependency injection.
|
|
16673
|
+
*
|
|
16674
|
+
* @dbxModelGroup StorageFile
|
|
16669
16675
|
*/ var StorageFileFirestoreCollections = function StorageFileFirestoreCollections() {
|
|
16670
16676
|
_class_call_check$1(this, StorageFileFirestoreCollections);
|
|
16671
16677
|
};
|
|
@@ -18796,6 +18802,8 @@ function _is_native_reflect_construct() {
|
|
|
18796
18802
|
* Abstract base providing access to the SystemState Firestore collection.
|
|
18797
18803
|
*
|
|
18798
18804
|
* Implement this in your app module to wire up dependency injection.
|
|
18805
|
+
*
|
|
18806
|
+
* @dbxModelGroup SystemState
|
|
18799
18807
|
*/ var SystemStateFirestoreCollections = function SystemStateFirestoreCollections() {
|
|
18800
18808
|
_class_call_check(this, SystemStateFirestoreCollections);
|
|
18801
18809
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.10.0",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./test": {
|
|
6
6
|
"module": "./test/index.esm.js",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@dereekb/util": "13.
|
|
21
|
-
"@dereekb/date": "13.
|
|
22
|
-
"@dereekb/model": "13.
|
|
23
|
-
"@dereekb/rxjs": "13.
|
|
20
|
+
"@dereekb/util": "13.10.0",
|
|
21
|
+
"@dereekb/date": "13.10.0",
|
|
22
|
+
"@dereekb/model": "13.10.0",
|
|
23
|
+
"@dereekb/rxjs": "13.10.0",
|
|
24
24
|
"@firebase/rules-unit-testing": "5.0.0",
|
|
25
25
|
"arktype": "^2.2.0",
|
|
26
26
|
"date-fns": "^4.0.0",
|
|
@@ -43,6 +43,11 @@ export type FirebaseFunctionMapFactory<M extends FirebaseFunctionTypeMap> = (fun
|
|
|
43
43
|
export declare function firebaseFunctionMapFactory<M extends FirebaseFunctionTypeMap>(configMap: FirebaseFunctionTypeConfigMap<M>): FirebaseFunctionMapFactory<M>;
|
|
44
44
|
/**
|
|
45
45
|
* String key used to identify a function group in the app-level functions map.
|
|
46
|
+
*
|
|
47
|
+
* @semanticType
|
|
48
|
+
* @semanticTopic identifier
|
|
49
|
+
* @semanticTopic string
|
|
50
|
+
* @semanticTopic dereekb-firebase:functions
|
|
46
51
|
*/
|
|
47
52
|
export type FirebaseFunctionMapKey = string;
|
|
48
53
|
/**
|
|
@@ -9,6 +9,11 @@ import { type OnCallCreateModelResult } from '../../common/model/function';
|
|
|
9
9
|
* String identifier that routes a CRUD request to a specific sub-handler within a model's
|
|
10
10
|
* CRUD function. For example, a model's `update` might have specifiers like `'status'` or `'config'`
|
|
11
11
|
* to target different update behaviors.
|
|
12
|
+
*
|
|
13
|
+
* @semanticType
|
|
14
|
+
* @semanticTopic identifier
|
|
15
|
+
* @semanticTopic string
|
|
16
|
+
* @semanticTopic dereekb-firebase:functions
|
|
12
17
|
*/
|
|
13
18
|
export type ModelFirebaseCrudFunctionSpecifier = string;
|
|
14
19
|
/**
|
|
@@ -13,6 +13,11 @@ export declare const FIREBASE_AUTH_PASSWORD_MIN_LENGTH = 6;
|
|
|
13
13
|
export declare const FIREBASE_AUTH_PASSWORD_MAX_LENGTH = 128;
|
|
14
14
|
/**
|
|
15
15
|
* Unique identifier for a Firebase Authentication user (the `uid` from Firebase Auth).
|
|
16
|
+
*
|
|
17
|
+
* @semanticType
|
|
18
|
+
* @semanticTopic identifier
|
|
19
|
+
* @semanticTopic string
|
|
20
|
+
* @semanticTopic dereekb-firebase:auth
|
|
16
21
|
*/
|
|
17
22
|
export type FirebaseAuthUserId = string;
|
|
18
23
|
/**
|
|
@@ -25,6 +30,10 @@ export interface FirebaseAuthUserIdRef {
|
|
|
25
30
|
* Raw encoded JWT for Firebase Auth.
|
|
26
31
|
*
|
|
27
32
|
* Corresponds with IdToken type in Firebase Auth.
|
|
33
|
+
*
|
|
34
|
+
* @semanticType
|
|
35
|
+
* @semanticTopic string
|
|
36
|
+
* @semanticTopic dereekb-firebase:auth
|
|
28
37
|
*/
|
|
29
38
|
export type FirebaseAuthIdToken = string;
|
|
30
39
|
/**
|
|
@@ -65,6 +74,11 @@ export interface FirebaseAuthDetails extends FirebaseAuthToken, Readonly<Firebas
|
|
|
65
74
|
* A string key used to test for ownership of a particular set of objects.
|
|
66
75
|
*
|
|
67
76
|
* For instance, a database model (or its parent) may have an ownership key associated with it that is compared with the user's current claims.
|
|
77
|
+
*
|
|
78
|
+
* @semanticType
|
|
79
|
+
* @semanticTopic identifier
|
|
80
|
+
* @semanticTopic string
|
|
81
|
+
* @semanticTopic dereekb-firebase:auth
|
|
68
82
|
*/
|
|
69
83
|
export type FirebaseAuthOwnershipKey = string;
|
|
70
84
|
/**
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* Identifies a specific development function endpoint to route requests to.
|
|
3
3
|
*
|
|
4
4
|
* Used in dev/test environments to invoke specific server-side functions by name.
|
|
5
|
+
*
|
|
6
|
+
* @semanticType
|
|
7
|
+
* @semanticTopic identifier
|
|
8
|
+
* @semanticTopic string
|
|
9
|
+
* @semanticTopic dereekb-firebase:functions
|
|
5
10
|
*/
|
|
6
11
|
export type DevelopmentFirebaseFunctionSpecifier = string;
|
|
7
12
|
/**
|
|
@@ -405,6 +405,14 @@ export declare function firestoreSingleDocumentAccessor<T, D extends FirestoreDo
|
|
|
405
405
|
* Default document ID used for single-document collections. The document is stored at path `<collection>/0`.
|
|
406
406
|
*/
|
|
407
407
|
export declare const DEFAULT_SINGLE_ITEM_FIRESTORE_COLLECTION_DOCUMENT_IDENTIFIER = "0";
|
|
408
|
+
/**
|
|
409
|
+
* Document ID used for the single document in a single-item Firestore collection.
|
|
410
|
+
*
|
|
411
|
+
* @semanticType
|
|
412
|
+
* @semanticTopic identifier
|
|
413
|
+
* @semanticTopic string
|
|
414
|
+
* @semanticTopic dereekb-firebase:firestore
|
|
415
|
+
*/
|
|
408
416
|
export type SingleItemFirestoreCollectionDocumentIdentifier = string;
|
|
409
417
|
export interface SingleItemFirestoreCollectionDocumentIdentifierRef {
|
|
410
418
|
/**
|
|
@@ -26,6 +26,11 @@ export type FirestoreModelType = ModelTypeString;
|
|
|
26
26
|
* with the same name to be returned regardless of their location in the document hierarchy.
|
|
27
27
|
*
|
|
28
28
|
* @example 'u', 'ps', 'or'
|
|
29
|
+
*
|
|
30
|
+
* @semanticType
|
|
31
|
+
* @semanticTopic identifier
|
|
32
|
+
* @semanticTopic string
|
|
33
|
+
* @semanticTopic dereekb-firebase:firestore
|
|
29
34
|
*/
|
|
30
35
|
export type FirestoreCollectionName = string;
|
|
31
36
|
/**
|
|
@@ -218,6 +223,11 @@ export interface FirestoreModelIdentityRef<I extends FirestoreModelIdentity = Fi
|
|
|
218
223
|
* Example:
|
|
219
224
|
*
|
|
220
225
|
* 12345
|
|
226
|
+
*
|
|
227
|
+
* @semanticType
|
|
228
|
+
* @semanticTopic identifier
|
|
229
|
+
* @semanticTopic string
|
|
230
|
+
* @semanticTopic dereekb-firebase:firestore
|
|
221
231
|
*/
|
|
222
232
|
export type FirestoreModelId = string;
|
|
223
233
|
/**
|
|
@@ -431,6 +441,11 @@ export declare function firestoreModelKeyPairObject(input: FirestoreModelKey | D
|
|
|
431
441
|
* String that is composed of the FirestoreCollectionNames derived from an input FirestoreModelKey and joined together via a separator.
|
|
432
442
|
*
|
|
433
443
|
* Is equivalent to a FirestoreCollectionType if the FIRESTORE_COLLECTION_NAME_SEPARATOR is used as the separator.
|
|
444
|
+
*
|
|
445
|
+
* @semanticType
|
|
446
|
+
* @semanticTopic identifier
|
|
447
|
+
* @semanticTopic string
|
|
448
|
+
* @semanticTopic dereekb-firebase:firestore
|
|
434
449
|
*/
|
|
435
450
|
export type FirestoreModelCollectionTypeArrayName = string;
|
|
436
451
|
/**
|
|
@@ -2,6 +2,11 @@ import { type FirestoreAccessorDriverRef } from './accessor';
|
|
|
2
2
|
import { type FirestoreQueryDriverRef } from './query';
|
|
3
3
|
/**
|
|
4
4
|
* Optional human-readable identifier for the Firestore driver (e.g., 'firebase-admin', 'firebase-web', 'testing').
|
|
5
|
+
*
|
|
6
|
+
* @semanticType
|
|
7
|
+
* @semanticTopic identifier
|
|
8
|
+
* @semanticTopic string
|
|
9
|
+
* @semanticTopic dereekb-firebase:firestore
|
|
5
10
|
*/
|
|
6
11
|
export type FirestoreDriverIdentifier = string;
|
|
7
12
|
/**
|
|
@@ -5,6 +5,11 @@ import { type ArrayOrValue, type SeparateResult, type SortingOrder, type Maybe,
|
|
|
5
5
|
*
|
|
6
6
|
* Used to uniquely identify different types of query constraints, such as
|
|
7
7
|
* where, limit, orderBy, etc.
|
|
8
|
+
*
|
|
9
|
+
* @semanticType
|
|
10
|
+
* @semanticTopic identifier
|
|
11
|
+
* @semanticTopic string
|
|
12
|
+
* @semanticTopic dereekb-firebase:firestore
|
|
8
13
|
*/
|
|
9
14
|
export type FirestoreQueryConstraintType = string;
|
|
10
15
|
/**
|
|
@@ -146,6 +146,11 @@ export interface StorageGetAclsResult {
|
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* String used as a cursor for iterating pages of file results.
|
|
149
|
+
*
|
|
150
|
+
* @semanticType
|
|
151
|
+
* @semanticTopic identifier
|
|
152
|
+
* @semanticTopic string
|
|
153
|
+
* @semanticTopic dereekb-firebase:storage
|
|
149
154
|
*/
|
|
150
155
|
export type StorageListFilesPageToken = string;
|
|
151
156
|
export interface StorageListFilesOptions {
|
|
@@ -192,6 +197,14 @@ export interface StorageListFileResult extends StorageListItemResult {
|
|
|
192
197
|
*/
|
|
193
198
|
file(): FirebaseStorageAccessorFile;
|
|
194
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Token returned with a list-files result for resuming pagination on the next call.
|
|
202
|
+
*
|
|
203
|
+
* @semanticType
|
|
204
|
+
* @semanticTopic identifier
|
|
205
|
+
* @semanticTopic string
|
|
206
|
+
* @semanticTopic dereekb-firebase:storage
|
|
207
|
+
*/
|
|
195
208
|
export type StorageListFileResultNextPageToken = string;
|
|
196
209
|
export interface StorageListFilesResult<R = unknown> {
|
|
197
210
|
/**
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { type FirebaseStorageAccessorDriverRef } from './accessor';
|
|
2
2
|
/**
|
|
3
3
|
* Unique identifier string for a storage driver implementation.
|
|
4
|
+
*
|
|
5
|
+
* @semanticType
|
|
6
|
+
* @semanticTopic identifier
|
|
7
|
+
* @semanticTopic string
|
|
8
|
+
* @semanticTopic dereekb-firebase:storage
|
|
4
9
|
*/
|
|
5
10
|
export type FirebaseStorageDriverIdentifier = string;
|
|
6
11
|
/**
|
|
@@ -3,6 +3,11 @@ import { type SlashPath, type FactoryWithRequiredInput } from '@dereekb/util';
|
|
|
3
3
|
* Storage bucket identifier for Firebase Cloud Storage.
|
|
4
4
|
*
|
|
5
5
|
* Should contain no slashes — just the bucket name (e.g., `"my-app.appspot.com"`).
|
|
6
|
+
*
|
|
7
|
+
* @semanticType
|
|
8
|
+
* @semanticTopic identifier
|
|
9
|
+
* @semanticTopic string
|
|
10
|
+
* @semanticTopic dereekb-firebase:storage
|
|
6
11
|
*/
|
|
7
12
|
export type StorageBucketId = string;
|
|
8
13
|
/**
|
|
@@ -31,10 +31,20 @@ export type GoogleCloudLikeStorage = {
|
|
|
31
31
|
export type FirebaseStorage = FirebaseStorageLikeStorage | GoogleCloudLikeStorage;
|
|
32
32
|
/**
|
|
33
33
|
* The public storage url link.
|
|
34
|
+
*
|
|
35
|
+
* @semanticType
|
|
36
|
+
* @semanticTopic url
|
|
37
|
+
* @semanticTopic string
|
|
38
|
+
* @semanticTopic dereekb-firebase:storage
|
|
34
39
|
*/
|
|
35
40
|
export type StorageDownloadUrl = string;
|
|
36
41
|
/**
|
|
37
42
|
* A signed download link.
|
|
43
|
+
*
|
|
44
|
+
* @semanticType
|
|
45
|
+
* @semanticTopic url
|
|
46
|
+
* @semanticTopic string
|
|
47
|
+
* @semanticTopic dereekb-firebase:storage
|
|
38
48
|
*/
|
|
39
49
|
export type StorageSignedDownloadUrl = string;
|
|
40
50
|
/**
|
|
@@ -79,6 +89,10 @@ export interface StorageSignedDownloadUrlConfig {
|
|
|
79
89
|
/**
|
|
80
90
|
* Example:
|
|
81
91
|
* 'Hello! \\ud83d\\ude0a';
|
|
92
|
+
*
|
|
93
|
+
* @semanticType
|
|
94
|
+
* @semanticTopic string
|
|
95
|
+
* @semanticTopic dereekb-firebase:storage
|
|
82
96
|
*/
|
|
83
97
|
export type StorageRawDataString = string;
|
|
84
98
|
/**
|
|
@@ -92,6 +106,11 @@ export type StorageRawDataStringType = 'raw';
|
|
|
92
106
|
/**
|
|
93
107
|
* Example:
|
|
94
108
|
* '5b6p5Y+344GX44G+44GX44Gf77yB44GK44KB44Gn44Go44GG77yB';
|
|
109
|
+
*
|
|
110
|
+
* @semanticType
|
|
111
|
+
* @semanticTopic string
|
|
112
|
+
* @semanticTopic dereekb-firebase:storage
|
|
113
|
+
* @semanticTopic dereekb-firebase:encoding
|
|
95
114
|
*/
|
|
96
115
|
export type StorageBase64DataString = string;
|
|
97
116
|
/**
|
|
@@ -104,6 +123,11 @@ export type StorageBase64DataStringType = 'base64';
|
|
|
104
123
|
/**
|
|
105
124
|
* Example:
|
|
106
125
|
* '5b6p5Y-344GX44G-44GX44Gf77yB44GK44KB44Gn44Go44GG77yB';
|
|
126
|
+
*
|
|
127
|
+
* @semanticType
|
|
128
|
+
* @semanticTopic string
|
|
129
|
+
* @semanticTopic dereekb-firebase:storage
|
|
130
|
+
* @semanticTopic dereekb-firebase:encoding
|
|
107
131
|
*/
|
|
108
132
|
export type StorageBase64UrlDataString = string;
|
|
109
133
|
/**
|
|
@@ -116,6 +140,11 @@ export type StorageBase64UrlDataStringType = 'base64url';
|
|
|
116
140
|
/**
|
|
117
141
|
* Example:
|
|
118
142
|
* 'data:text/plain;base64,5b6p5Y+344GX44G+44GX44Gf77yB44GK44KB44Gn44Go44GG77yB'
|
|
143
|
+
*
|
|
144
|
+
* @semanticType
|
|
145
|
+
* @semanticTopic url
|
|
146
|
+
* @semanticTopic string
|
|
147
|
+
* @semanticTopic dereekb-firebase:storage
|
|
119
148
|
*/
|
|
120
149
|
export type StorageDataUrlString = string;
|
|
121
150
|
/**
|
|
@@ -30,6 +30,8 @@ import { type NotificationItem } from './notification.item';
|
|
|
30
30
|
* Used by both client and server code to access notification documents.
|
|
31
31
|
*
|
|
32
32
|
* @see `NotificationServerActions` in `@dereekb/firebase-server/model` for server-side action processing
|
|
33
|
+
*
|
|
34
|
+
* @dbxModelGroup Notification
|
|
33
35
|
*/
|
|
34
36
|
export declare abstract class NotificationFirestoreCollections {
|
|
35
37
|
abstract readonly notificationUserCollection: NotificationUserFirestoreCollection;
|
|
@@ -54,6 +56,8 @@ export interface InitializedNotificationModel {
|
|
|
54
56
|
* True if this model needs to be sync'd/initialized with the original model.
|
|
55
57
|
*
|
|
56
58
|
* Is set false if/when "fi" is set true.
|
|
59
|
+
*
|
|
60
|
+
* @dbxModelVariable needsSync
|
|
57
61
|
*/
|
|
58
62
|
s?: Maybe<NeedsSyncBoolean>;
|
|
59
63
|
/**
|
|
@@ -62,6 +66,8 @@ export interface InitializedNotificationModel {
|
|
|
62
66
|
* This is for cases where the model cannot be properly initiialized.
|
|
63
67
|
*
|
|
64
68
|
* NOTE: The server can also be configured to automatically delete these models instead of marking them as invalid.
|
|
69
|
+
*
|
|
70
|
+
* @dbxModelVariable flaggedInvalid
|
|
65
71
|
*/
|
|
66
72
|
fi?: Maybe<SavedToFirestoreIfTrue>;
|
|
67
73
|
}
|
|
@@ -79,10 +85,14 @@ export declare const notificationUserIdentity: import("../..").RootFirestoreMode
|
|
|
79
85
|
*
|
|
80
86
|
* @see {@link NotificationBoxRecipient} for the per-box recipient entry that mirrors these configs
|
|
81
87
|
* @see `NotificationServerActions.updateNotificationUser` in `@dereekb/firebase-server/model` for server-side sync logic
|
|
88
|
+
*
|
|
89
|
+
* @dbxModel
|
|
82
90
|
*/
|
|
83
91
|
export interface NotificationUser extends UserRelated, UserRelatedById {
|
|
84
92
|
/**
|
|
85
93
|
* Notification box IDs this user is subscribed to. Managed by the server — not directly editable by clients.
|
|
94
|
+
*
|
|
95
|
+
* @dbxModelVariable boxes
|
|
86
96
|
*/
|
|
87
97
|
b: NotificationBoxId[];
|
|
88
98
|
/**
|
|
@@ -93,28 +103,38 @@ export interface NotificationUser extends UserRelated, UserRelatedById {
|
|
|
93
103
|
* Exclusions are synced to the corresponding `bc` configs, which then propagate to the NotificationBoxes.
|
|
94
104
|
*
|
|
95
105
|
* Non-matching entries (where the user isn't associated with a matching box) are automatically removed.
|
|
106
|
+
*
|
|
107
|
+
* @dbxModelVariable boxExclusions
|
|
96
108
|
*/
|
|
97
109
|
x: NotificationBoxSendExclusionList;
|
|
98
110
|
/**
|
|
99
111
|
* Global config override. Overrides all other configs (both per-box `bc` and direct/default `dc`) at send time.
|
|
100
112
|
*
|
|
101
113
|
* Unlike `dc`/`bc`, changes to `gc` are NOT copied to other config fields — they apply as a final override during notification delivery.
|
|
114
|
+
*
|
|
115
|
+
* @dbxModelVariable globalConfig
|
|
102
116
|
*/
|
|
103
117
|
gc: NotificationUserDefaultNotificationBoxRecipientConfig;
|
|
104
118
|
/**
|
|
105
119
|
* Direct/default config. Used when a recipient is added ad-hoc (by uid) to a notification that isn't associated with any of their subscribed boxes.
|
|
106
120
|
*
|
|
107
121
|
* Acts as the fallback config when no per-box config (`bc`) matches.
|
|
122
|
+
*
|
|
123
|
+
* @dbxModelVariable defaultConfig
|
|
108
124
|
*/
|
|
109
125
|
dc: NotificationUserDefaultNotificationBoxRecipientConfig;
|
|
110
126
|
/**
|
|
111
127
|
* Per-box recipient configurations. Each entry corresponds to one of the user's subscribed notification boxes.
|
|
112
128
|
*
|
|
113
129
|
* These configs are synced bidirectionally with the {@link NotificationBoxRecipient} entries on the corresponding {@link NotificationBox}.
|
|
130
|
+
*
|
|
131
|
+
* @dbxModelVariable boxConfigs
|
|
114
132
|
*/
|
|
115
133
|
bc: NotificationUserNotificationBoxRecipientConfig[];
|
|
116
134
|
/**
|
|
117
135
|
* Whether one or more configs need to be synced to their corresponding NotificationBox recipients.
|
|
136
|
+
*
|
|
137
|
+
* @dbxModelVariable needsConfigSync
|
|
118
138
|
*/
|
|
119
139
|
ns?: Maybe<NeedsSyncBoolean>;
|
|
120
140
|
}
|
|
@@ -168,34 +188,50 @@ export declare const NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_MESSAGE_MAX
|
|
|
168
188
|
* Items are capped at {@link NOTIFICATION_SUMMARY_ITEM_LIMIT} entries.
|
|
169
189
|
*
|
|
170
190
|
* Implements {@link InitializedNotificationModel} — requires server-side initialization to populate the owner (`o`) field.
|
|
191
|
+
*
|
|
192
|
+
* @dbxModel
|
|
171
193
|
*/
|
|
172
194
|
export interface NotificationSummary extends InitializedNotificationModel {
|
|
173
195
|
/**
|
|
174
196
|
* Creation date of this summary document.
|
|
197
|
+
*
|
|
198
|
+
* @dbxModelVariable createdAt
|
|
175
199
|
*/
|
|
176
200
|
cat: Date;
|
|
177
201
|
/**
|
|
178
202
|
* Model key of the model this summary represents (e.g., `'project/abc123'`).
|
|
203
|
+
*
|
|
204
|
+
* @dbxModelVariable modelKey
|
|
179
205
|
*/
|
|
180
206
|
m: FirestoreModelKey;
|
|
181
207
|
/**
|
|
182
208
|
* Owner model key. Set to a dummy value on creation and populated during server-side initialization.
|
|
209
|
+
*
|
|
210
|
+
* @dbxModelVariable ownerKey
|
|
183
211
|
*/
|
|
184
212
|
o: FirestoreModelKey;
|
|
185
213
|
/**
|
|
186
214
|
* Embedded notification items, sorted ascending by date (newest at end).
|
|
215
|
+
*
|
|
216
|
+
* @dbxModelVariable notifications
|
|
187
217
|
*/
|
|
188
218
|
n: NotificationItem[];
|
|
189
219
|
/**
|
|
190
220
|
* Timestamp of the most recently added notification item.
|
|
221
|
+
*
|
|
222
|
+
* @dbxModelVariable lastNotificationAt
|
|
191
223
|
*/
|
|
192
224
|
lat?: Maybe<Date>;
|
|
193
225
|
/**
|
|
194
226
|
* Timestamp of when the user last read this summary. Items with dates after this are considered unread.
|
|
227
|
+
*
|
|
228
|
+
* @dbxModelVariable lastReadAt
|
|
195
229
|
*/
|
|
196
230
|
rat?: Maybe<Date>;
|
|
197
231
|
/**
|
|
198
232
|
* Whether this summary needs server-side sync/initialization with its source model.
|
|
233
|
+
*
|
|
234
|
+
* @dbxModelVariable needsSync
|
|
199
235
|
*/
|
|
200
236
|
s?: Maybe<NeedsSyncBoolean>;
|
|
201
237
|
}
|
|
@@ -246,39 +282,55 @@ export declare const notificationBoxIdentity: import("../..").RootFirestoreModel
|
|
|
246
282
|
*
|
|
247
283
|
* @see {@link NotificationBoxRecipient} for per-recipient configuration embedded in this document
|
|
248
284
|
* @see `NotificationServerActions.createNotificationBox` in `@dereekb/firebase-server/model` for creation logic
|
|
285
|
+
*
|
|
286
|
+
* @dbxModel
|
|
249
287
|
*/
|
|
250
288
|
export interface NotificationBox extends InitializedNotificationModel {
|
|
251
289
|
/**
|
|
252
290
|
* Creation date of this NotificationBox document.
|
|
291
|
+
*
|
|
292
|
+
* @dbxModelVariable createdAt
|
|
253
293
|
*/
|
|
254
294
|
cat: Date;
|
|
255
295
|
/**
|
|
256
296
|
* Model key of the model this box is assigned to (e.g., `'project/abc123'`).
|
|
297
|
+
*
|
|
298
|
+
* @dbxModelVariable modelKey
|
|
257
299
|
*/
|
|
258
300
|
m: FirestoreModelKey;
|
|
259
301
|
/**
|
|
260
302
|
* Owner model key. Set to a dummy value on creation and populated during server-side initialization.
|
|
303
|
+
*
|
|
304
|
+
* @dbxModelVariable ownerKey
|
|
261
305
|
*/
|
|
262
306
|
o: FirestoreModelKey;
|
|
263
307
|
/**
|
|
264
308
|
* Embedded recipient entries. Each entry represents a user who can receive notifications from this box.
|
|
265
309
|
*
|
|
266
310
|
* Synced from the corresponding {@link NotificationUser} `bc` configs.
|
|
311
|
+
*
|
|
312
|
+
* @dbxModelVariable recipients
|
|
267
313
|
*/
|
|
268
314
|
r: NotificationBoxRecipient[];
|
|
269
315
|
/**
|
|
270
316
|
* Year-week code of the latest {@link NotificationWeek} subcollection document.
|
|
317
|
+
*
|
|
318
|
+
* @dbxModelVariable latestWeek
|
|
271
319
|
*/
|
|
272
320
|
w: YearWeekCode;
|
|
273
321
|
/**
|
|
274
322
|
* Whether this box needs server-side sync/initialization with its source model.
|
|
275
323
|
* Cleared when `fi` is set true (flagged invalid).
|
|
324
|
+
*
|
|
325
|
+
* @dbxModelVariable needsSync
|
|
276
326
|
*/
|
|
277
327
|
s?: Maybe<NeedsSyncBoolean>;
|
|
278
328
|
/**
|
|
279
329
|
* Flagged invalid — set when the box cannot be properly initialized (e.g., source model deleted).
|
|
280
330
|
*
|
|
281
331
|
* The server can be configured to either flag or auto-delete invalid boxes.
|
|
332
|
+
*
|
|
333
|
+
* @dbxModelVariable flaggedInvalid
|
|
282
334
|
*/
|
|
283
335
|
fi?: Maybe<SavedToFirestoreIfTrue>;
|
|
284
336
|
}
|
|
@@ -426,27 +478,42 @@ export declare enum NotificationRecipientSendFlag {
|
|
|
426
478
|
export interface NotificationSendFlags {
|
|
427
479
|
/**
|
|
428
480
|
* Text/SMS send state.
|
|
481
|
+
*
|
|
482
|
+
* @dbxModelVariable textSendState
|
|
429
483
|
*/
|
|
430
484
|
ts: NotificationSendState;
|
|
431
485
|
/**
|
|
432
486
|
* Email send state.
|
|
487
|
+
*
|
|
488
|
+
* @dbxModelVariable emailSendState
|
|
433
489
|
*/
|
|
434
490
|
es: NotificationSendState;
|
|
435
491
|
/**
|
|
436
492
|
* Push notification send state.
|
|
493
|
+
*
|
|
494
|
+
* @dbxModelVariable pushSendState
|
|
437
495
|
*/
|
|
438
496
|
ps: NotificationSendState;
|
|
439
497
|
/**
|
|
440
498
|
* In-app notification summary send state (delivery to {@link NotificationSummary}).
|
|
499
|
+
*
|
|
500
|
+
* @dbxModelVariable summarySendState
|
|
441
501
|
*/
|
|
442
502
|
ns: NotificationSendState;
|
|
443
503
|
/**
|
|
444
504
|
* Recipient send flag controlling who receives this notification and whether it should be archived to {@link NotificationWeek} after delivery.
|
|
505
|
+
*
|
|
506
|
+
* @dbxModelVariable recipientSendFlag
|
|
445
507
|
*/
|
|
446
508
|
rf?: Maybe<NotificationRecipientSendFlag>;
|
|
447
509
|
}
|
|
448
510
|
/**
|
|
449
511
|
* Arbitrary unique string that denotes checkpoint progress for a multi-step task.
|
|
512
|
+
*
|
|
513
|
+
* @semanticType
|
|
514
|
+
* @semanticTopic identifier
|
|
515
|
+
* @semanticTopic string
|
|
516
|
+
* @semanticTopic dereekb-firebase:notification
|
|
450
517
|
*/
|
|
451
518
|
export type NotificationTaskCheckpointString = string;
|
|
452
519
|
/**
|
|
@@ -458,16 +525,22 @@ export type NotificationTaskCheckpointString = string;
|
|
|
458
525
|
export interface NotificationSendCheckpoints {
|
|
459
526
|
/**
|
|
460
527
|
* Phone numbers that have already received the text/SMS for this notification.
|
|
528
|
+
*
|
|
529
|
+
* @dbxModelVariable textRecipients
|
|
461
530
|
*/
|
|
462
531
|
tsr: E164PhoneNumber[];
|
|
463
532
|
/**
|
|
464
533
|
* Email addresses that have already received the email for this notification.
|
|
534
|
+
*
|
|
535
|
+
* @dbxModelVariable emailRecipients
|
|
465
536
|
*/
|
|
466
537
|
esr: EmailAddress[];
|
|
467
538
|
/**
|
|
468
539
|
* Completed checkpoint strings for multi-step task notifications.
|
|
469
540
|
*
|
|
470
541
|
* @see {@link NotificationTaskCheckpointString}
|
|
542
|
+
*
|
|
543
|
+
* @dbxModelVariable taskCheckpoints
|
|
471
544
|
*/
|
|
472
545
|
tpr: NotificationTaskCheckpointString[];
|
|
473
546
|
}
|
|
@@ -484,18 +557,26 @@ export interface NotificationSendCheckpoints {
|
|
|
484
557
|
* @see {@link NotificationSendFlags} for per-channel delivery state
|
|
485
558
|
* @see {@link NotificationSendCheckpoints} for idempotent retry tracking
|
|
486
559
|
* @see `NotificationServerActions.sendQueuedNotifications` in `@dereekb/firebase-server/model` for the send pipeline
|
|
560
|
+
*
|
|
561
|
+
* @dbxModel
|
|
487
562
|
*/
|
|
488
563
|
export interface Notification extends NotificationSendFlags, NotificationSendCheckpoints {
|
|
489
564
|
/**
|
|
490
565
|
* Creation timestamp.
|
|
566
|
+
*
|
|
567
|
+
* @dbxModelVariable createdAt
|
|
491
568
|
*/
|
|
492
569
|
cat: Date;
|
|
493
570
|
/**
|
|
494
571
|
* Send type controlling how this notification interacts with its parent NotificationBox.
|
|
572
|
+
*
|
|
573
|
+
* @dbxModelVariable sendType
|
|
495
574
|
*/
|
|
496
575
|
st: NotificationSendType;
|
|
497
576
|
/**
|
|
498
577
|
* Embedded notification content (subject, message, template type, metadata).
|
|
578
|
+
*
|
|
579
|
+
* @dbxModelVariable notificationItem
|
|
499
580
|
*/
|
|
500
581
|
n: NotificationItem;
|
|
501
582
|
/**
|
|
@@ -504,12 +585,16 @@ export interface Notification extends NotificationSendFlags, NotificationSendChe
|
|
|
504
585
|
* Any `NotificationBoxRecipientTemplateConfig` values on these recipients affect opt-in/opt-out resolution.
|
|
505
586
|
* For example, setting `st: true` opts a user into text/SMS for this notification's template type,
|
|
506
587
|
* unless overridden by the user's own {@link NotificationUser} config.
|
|
588
|
+
*
|
|
589
|
+
* @dbxModelVariable recipients
|
|
507
590
|
*/
|
|
508
591
|
r: NotificationRecipientWithConfig[];
|
|
509
592
|
/**
|
|
510
593
|
* Explicit opt-in send only. When true, only sends to users who have explicitly opted in for each channel.
|
|
511
594
|
*
|
|
512
595
|
* Overrides the system-level default for this notification's template type.
|
|
596
|
+
*
|
|
597
|
+
* @dbxModelVariable optInSendOnly
|
|
513
598
|
*/
|
|
514
599
|
ois?: Maybe<SavedToFirestoreIfTrue>;
|
|
515
600
|
/**
|
|
@@ -517,6 +602,8 @@ export interface Notification extends NotificationSendFlags, NotificationSendChe
|
|
|
517
602
|
* (still respects explicit opt-outs).
|
|
518
603
|
*
|
|
519
604
|
* Overrides the system-level default for this notification's template type.
|
|
605
|
+
*
|
|
606
|
+
* @dbxModelVariable optInTextSend
|
|
520
607
|
*/
|
|
521
608
|
ots?: Maybe<SavedToFirestoreIfFalse>;
|
|
522
609
|
/**
|
|
@@ -524,22 +611,30 @@ export interface Notification extends NotificationSendFlags, NotificationSendChe
|
|
|
524
611
|
*
|
|
525
612
|
* Also serves as a lock mechanism: during active sending, `sat` is pushed forward by a few minutes
|
|
526
613
|
* and the attempt counter is incremented, preventing concurrent send attempts.
|
|
614
|
+
*
|
|
615
|
+
* @dbxModelVariable sendAt
|
|
527
616
|
*/
|
|
528
617
|
sat: Date;
|
|
529
618
|
/**
|
|
530
619
|
* Total error attempt count. Incremented only when sending encounters an error (not on success).
|
|
620
|
+
*
|
|
621
|
+
* @dbxModelVariable attempts
|
|
531
622
|
*/
|
|
532
623
|
a: number;
|
|
533
624
|
/**
|
|
534
625
|
* Current task attempt count for the active checkpoint. Incremented on delay or failure responses.
|
|
535
626
|
*
|
|
536
627
|
* Reset to 0 when a checkpoint completes successfully or when a new checkpoint begins.
|
|
628
|
+
*
|
|
629
|
+
* @dbxModelVariable taskAttempts
|
|
537
630
|
*/
|
|
538
631
|
at?: Maybe<number>;
|
|
539
632
|
/**
|
|
540
633
|
* Delivery complete flag. When true, content has been delivered and is ready to archive to {@link NotificationWeek}.
|
|
541
634
|
*
|
|
542
635
|
* For task-type notifications this is always false — tasks are deleted upon completion instead of archived.
|
|
636
|
+
*
|
|
637
|
+
* @dbxModelVariable done
|
|
543
638
|
*/
|
|
544
639
|
d: boolean;
|
|
545
640
|
/**
|
|
@@ -548,6 +643,8 @@ export interface Notification extends NotificationSendFlags, NotificationSendChe
|
|
|
548
643
|
* When true, the server re-reads the document and compares `cat` before committing a task step.
|
|
549
644
|
* If `cat` has changed (indicating the task was replaced), the step is abandoned silently.
|
|
550
645
|
* This prevents stale task executions when a unique task ID is reused.
|
|
646
|
+
*
|
|
647
|
+
* @dbxModelVariable uniqueTask
|
|
551
648
|
*/
|
|
552
649
|
ut?: Maybe<SavedToFirestoreIfTrue>;
|
|
553
650
|
}
|
|
@@ -615,14 +712,20 @@ export declare const NOTIFICATION_WEEK_NOTIFICATION_ITEM_LIMIT = 5000;
|
|
|
615
712
|
* a {@link Notification} completes delivery and is cleaned up. Capped at {@link NOTIFICATION_WEEK_NOTIFICATION_ITEM_LIMIT} items.
|
|
616
713
|
*
|
|
617
714
|
* Used for historical browsing of past notifications per box.
|
|
715
|
+
*
|
|
716
|
+
* @dbxModel
|
|
618
717
|
*/
|
|
619
718
|
export interface NotificationWeek {
|
|
620
719
|
/**
|
|
621
720
|
* Year-week code identifying this week. Matches the document ID.
|
|
721
|
+
*
|
|
722
|
+
* @dbxModelVariable yearWeek
|
|
622
723
|
*/
|
|
623
724
|
w: YearWeekCode;
|
|
624
725
|
/**
|
|
625
726
|
* Archived notification items delivered during this week.
|
|
727
|
+
*
|
|
728
|
+
* @dbxModelVariable notifications
|
|
626
729
|
*/
|
|
627
730
|
n: NotificationItem[];
|
|
628
731
|
}
|
|
@@ -150,12 +150,22 @@ export declare const DEFAULT_NOTIFICATION_TASK_NOTIFICATION_MODEL_KEY: Firestore
|
|
|
150
150
|
* Types are generally intended to be handled case-insensitively by notification services.
|
|
151
151
|
*
|
|
152
152
|
* Ideally type values are shorter to reduce database size impact.
|
|
153
|
+
*
|
|
154
|
+
* @semanticType
|
|
155
|
+
* @semanticTopic identifier
|
|
156
|
+
* @semanticTopic string
|
|
157
|
+
* @semanticTopic dereekb-firebase:notification
|
|
153
158
|
*/
|
|
154
159
|
export type NotificationTemplateType = string;
|
|
155
160
|
/**
|
|
156
161
|
* Task type identifier of the notification, which is used to pass this task to the appropriate handler.
|
|
157
162
|
*
|
|
158
163
|
* Ideally type values are shorter to reduce database size impact.
|
|
164
|
+
*
|
|
165
|
+
* @semanticType
|
|
166
|
+
* @semanticTopic identifier
|
|
167
|
+
* @semanticTopic string
|
|
168
|
+
* @semanticTopic dereekb-firebase:notification
|
|
159
169
|
*/
|
|
160
170
|
export type NotificationTaskType = string;
|
|
161
171
|
/**
|
|
@@ -27,10 +27,20 @@ export interface NotificationMessageInputContext {
|
|
|
27
27
|
* Arbitrary key used by the sending configuration service for choosing a pre-configured entity.
|
|
28
28
|
*
|
|
29
29
|
* Typically used for customizing the "from" or "replyTo" addresses while maintaining a separation of concerns.
|
|
30
|
+
*
|
|
31
|
+
* @semanticType
|
|
32
|
+
* @semanticTopic identifier
|
|
33
|
+
* @semanticTopic string
|
|
34
|
+
* @semanticTopic dereekb-firebase:notification
|
|
30
35
|
*/
|
|
31
36
|
export type NotificationMessageEntityKey = string;
|
|
32
37
|
/**
|
|
33
38
|
* Arbitrary template name/key that is used to configure which template to use by the sending service.
|
|
39
|
+
*
|
|
40
|
+
* @semanticType
|
|
41
|
+
* @semanticTopic identifier
|
|
42
|
+
* @semanticTopic string
|
|
43
|
+
* @semanticTopic dereekb-firebase:notification
|
|
34
44
|
*/
|
|
35
45
|
export type NotificationSendMessageTemplateName = string;
|
|
36
46
|
/**
|
|
@@ -15,6 +15,10 @@ import { type NotificationItemMetadata } from './notification.item';
|
|
|
15
15
|
import { type NotificationTaskServiceHandleNotificationTaskResult } from './notification.task';
|
|
16
16
|
/**
|
|
17
17
|
* Discriminator string that routes the subtask to the correct processing configuration.
|
|
18
|
+
*
|
|
19
|
+
* @semanticType
|
|
20
|
+
* @semanticTopic string
|
|
21
|
+
* @semanticTopic dereekb-firebase:notification
|
|
18
22
|
*/
|
|
19
23
|
export type NotificationTaskSubtaskTarget = string;
|
|
20
24
|
/**
|
|
@@ -12,6 +12,8 @@ export type OidcModelTypes = typeof oidcEntryIdentity;
|
|
|
12
12
|
* Used by both client and server code to access oidc model documents.
|
|
13
13
|
*
|
|
14
14
|
* @see `OidcModelServerActions` in `@dereekb/firebase-server/oidc` for server-side action processing
|
|
15
|
+
*
|
|
16
|
+
* @dbxModelGroup OidcModel
|
|
15
17
|
*/
|
|
16
18
|
export declare abstract class OidcModelFirestoreCollections {
|
|
17
19
|
abstract readonly oidcEntryCollection: OidcEntryFirestoreCollection;
|
|
@@ -42,10 +44,14 @@ export declare const OIDC_ENTRY_CLIENT_TYPE: OidcEntryType;
|
|
|
42
44
|
*
|
|
43
45
|
* The {@link o} ownership field enables Firestore security rules to restrict reads to the owning user
|
|
44
46
|
* (used primarily for Client entries so users can query their own registered OAuth clients).
|
|
47
|
+
*
|
|
48
|
+
* @dbxModel
|
|
45
49
|
*/
|
|
46
50
|
export interface OidcEntry {
|
|
47
51
|
/**
|
|
48
52
|
* The oidc-provider model type (e.g., 'Session', 'AccessToken', 'Client').
|
|
53
|
+
*
|
|
54
|
+
* @dbxModelVariable type
|
|
49
55
|
*/
|
|
50
56
|
type: OidcEntryType;
|
|
51
57
|
/**
|
|
@@ -53,6 +59,8 @@ export interface OidcEntry {
|
|
|
53
59
|
*
|
|
54
60
|
* The payload structure varies by model type. Sensitive fields may be
|
|
55
61
|
* selectively encrypted (prefixed with `$`) when encryption is configured.
|
|
62
|
+
*
|
|
63
|
+
* @dbxModelVariable payload
|
|
56
64
|
*/
|
|
57
65
|
payload: JsonSerializableObject;
|
|
58
66
|
/**
|
|
@@ -60,26 +68,38 @@ export interface OidcEntry {
|
|
|
60
68
|
*
|
|
61
69
|
* Set to the Firebase Auth UID of the user who created this entry.
|
|
62
70
|
* Used primarily on Client entries to allow users to query their own OAuth clients.
|
|
71
|
+
*
|
|
72
|
+
* @dbxModelVariable ownerKey
|
|
63
73
|
*/
|
|
64
74
|
o?: Maybe<FirebaseAuthOwnershipKey>;
|
|
65
75
|
/**
|
|
66
76
|
* User identifier. Extracted from the payload for indexed queries.
|
|
77
|
+
*
|
|
78
|
+
* @dbxModelVariable uid
|
|
67
79
|
*/
|
|
68
80
|
uid?: Maybe<FirebaseAuthUserId>;
|
|
69
81
|
/**
|
|
70
82
|
* Grant identifier for revocation support. Extracted from the payload for indexed queries.
|
|
83
|
+
*
|
|
84
|
+
* @dbxModelVariable grantId
|
|
71
85
|
*/
|
|
72
86
|
grantId?: Maybe<string>;
|
|
73
87
|
/**
|
|
74
88
|
* User code for device flow. Extracted from the payload for indexed queries.
|
|
89
|
+
*
|
|
90
|
+
* @dbxModelVariable userCode
|
|
75
91
|
*/
|
|
76
92
|
userCode?: Maybe<string>;
|
|
77
93
|
/**
|
|
78
94
|
* Epoch timestamp when this entry was consumed. Extracted from the payload for indexed queries.
|
|
95
|
+
*
|
|
96
|
+
* @dbxModelVariable consumedAt
|
|
79
97
|
*/
|
|
80
98
|
consumed?: Maybe<number>;
|
|
81
99
|
/**
|
|
82
100
|
* When this entry expires.
|
|
101
|
+
*
|
|
102
|
+
* @dbxModelVariable expiresAt
|
|
83
103
|
*/
|
|
84
104
|
expiresAt?: Maybe<Date>;
|
|
85
105
|
}
|
|
@@ -14,5 +14,10 @@ export type OidcEntryId = FirestoreModelId;
|
|
|
14
14
|
export type OidcEntryKey = FirestoreModelKey;
|
|
15
15
|
/**
|
|
16
16
|
* Unique client identifier for an OIDC client registration.
|
|
17
|
+
*
|
|
18
|
+
* @semanticType
|
|
19
|
+
* @semanticTopic identifier
|
|
20
|
+
* @semanticTopic string
|
|
21
|
+
* @semanticTopic dereekb-firebase:oidc
|
|
17
22
|
*/
|
|
18
23
|
export type OidcEntryClientId = string;
|
|
@@ -5,6 +5,11 @@ import { type LabeledValue, type LabeledValueWithDescription } from '@dereekb/ut
|
|
|
5
5
|
* Generated by the provider when user interaction is needed (login/consent).
|
|
6
6
|
* Used to look up the interaction session via cookies and to build
|
|
7
7
|
* backend interaction endpoint URLs (e.g., `/interaction/${uid}/login`).
|
|
8
|
+
*
|
|
9
|
+
* @semanticType
|
|
10
|
+
* @semanticTopic identifier
|
|
11
|
+
* @semanticTopic string
|
|
12
|
+
* @semanticTopic dereekb-firebase:oidc
|
|
8
13
|
*/
|
|
9
14
|
export type OidcInteractionUid = string;
|
|
10
15
|
/**
|
|
@@ -17,6 +22,10 @@ export type OidcInteractionUid = string;
|
|
|
17
22
|
* ```typescript
|
|
18
23
|
* type MyScopes = 'openid' | 'profile' | 'email';
|
|
19
24
|
* ```
|
|
25
|
+
*
|
|
26
|
+
* @semanticType
|
|
27
|
+
* @semanticTopic string
|
|
28
|
+
* @semanticTopic dereekb-firebase:oidc
|
|
20
29
|
*/
|
|
21
30
|
export type OidcScope = string;
|
|
22
31
|
/**
|
|
@@ -27,6 +36,11 @@ export type OidcScopeDetails<T extends OidcScope = OidcScope> = LabeledValueWith
|
|
|
27
36
|
* A redirect URI registered to an OIDC client.
|
|
28
37
|
*
|
|
29
38
|
* Must be a valid absolute URL (e.g. `https://myapp.example.com/callback`).
|
|
39
|
+
*
|
|
40
|
+
* @semanticType
|
|
41
|
+
* @semanticTopic url
|
|
42
|
+
* @semanticTopic string
|
|
43
|
+
* @semanticTopic dereekb-firebase:oidc
|
|
30
44
|
*/
|
|
31
45
|
export type OidcRedirectUri = string;
|
|
32
46
|
/**
|
|
@@ -22,6 +22,8 @@ import { type NotificationKey } from '../notification';
|
|
|
22
22
|
* Abstract base providing access to StorageFile and StorageFileGroup Firestore collections.
|
|
23
23
|
*
|
|
24
24
|
* Implement this in your app module to wire up the collections for dependency injection.
|
|
25
|
+
*
|
|
26
|
+
* @dbxModelGroup StorageFile
|
|
25
27
|
*/
|
|
26
28
|
export declare abstract class StorageFileFirestoreCollections {
|
|
27
29
|
abstract readonly storageFileCollection: StorageFileFirestoreCollection;
|
|
@@ -41,6 +43,8 @@ export interface InitializedStorageFileModel {
|
|
|
41
43
|
* True if this model needs to be sync'd/initialized with the original model.
|
|
42
44
|
*
|
|
43
45
|
* Is set false if/when "fi" is set true.
|
|
46
|
+
*
|
|
47
|
+
* @dbxModelVariable needsSync
|
|
44
48
|
*/
|
|
45
49
|
s?: Maybe<NeedsSyncBoolean>;
|
|
46
50
|
/**
|
|
@@ -49,6 +53,8 @@ export interface InitializedStorageFileModel {
|
|
|
49
53
|
* This is for cases where the model cannot be properly initiialized.
|
|
50
54
|
*
|
|
51
55
|
* Typically this results in this model and related data being deleted.
|
|
56
|
+
*
|
|
57
|
+
* @dbxModelVariable flaggedInvalid
|
|
52
58
|
*/
|
|
53
59
|
fi?: Maybe<SavedToFirestoreIfTrue>;
|
|
54
60
|
}
|
|
@@ -254,10 +260,13 @@ export type StorageFileDownloadUrl = StorageFilePublicDownloadUrl | StorageFileS
|
|
|
254
260
|
* `StorageFileActionServerActions` in `@dereekb/firebase-server/model`.
|
|
255
261
|
*
|
|
256
262
|
* @template M - type of the arbitrary metadata stored in the `d` field
|
|
263
|
+
* @dbxModel
|
|
257
264
|
*/
|
|
258
265
|
export interface StorageFile<M extends StorageFileMetadata = StorageFileMetadata> extends StoragePath {
|
|
259
266
|
/**
|
|
260
267
|
* Created at date.
|
|
268
|
+
*
|
|
269
|
+
* @dbxModelVariable createdAt
|
|
261
270
|
*/
|
|
262
271
|
cat: Date;
|
|
263
272
|
/**
|
|
@@ -265,14 +274,20 @@ export interface StorageFile<M extends StorageFileMetadata = StorageFileMetadata
|
|
|
265
274
|
*
|
|
266
275
|
* This name is used in StorageFileGroup composite file generations, instead
|
|
267
276
|
* of the file's normal path file name, if available.
|
|
277
|
+
*
|
|
278
|
+
* @dbxModelVariable displayName
|
|
268
279
|
*/
|
|
269
280
|
n?: Maybe<StorageFileDisplayName>;
|
|
270
281
|
/**
|
|
271
282
|
* Type of creation.
|
|
283
|
+
*
|
|
284
|
+
* @dbxModelVariable creationType
|
|
272
285
|
*/
|
|
273
286
|
ct?: Maybe<StorageFileCreationType>;
|
|
274
287
|
/**
|
|
275
288
|
* State of the storage file.
|
|
289
|
+
*
|
|
290
|
+
* @dbxModelVariable fileState
|
|
276
291
|
*/
|
|
277
292
|
fs: StorageFileState;
|
|
278
293
|
/**
|
|
@@ -281,6 +296,8 @@ export interface StorageFile<M extends StorageFileMetadata = StorageFileMetadata
|
|
|
281
296
|
* The state is important for managing the processing of the StorageFile.
|
|
282
297
|
*
|
|
283
298
|
* Once processing is finished, the state determines whether or not the StorageFile can be processed again.
|
|
299
|
+
*
|
|
300
|
+
* @dbxModelVariable processingState
|
|
284
301
|
*/
|
|
285
302
|
ps: StorageFileProcessingState;
|
|
286
303
|
/**
|
|
@@ -289,50 +306,70 @@ export interface StorageFile<M extends StorageFileMetadata = StorageFileMetadata
|
|
|
289
306
|
* Set only if the StorageFile has an associated NotificationTask.
|
|
290
307
|
*
|
|
291
308
|
* Cleared once the processing stage is no longer PROCESSING.
|
|
309
|
+
*
|
|
310
|
+
* @dbxModelVariable processingNotificationKey
|
|
292
311
|
*/
|
|
293
312
|
pn?: Maybe<NotificationKey>;
|
|
294
313
|
/**
|
|
295
314
|
* The date that state was last updated to PROCESSING.
|
|
296
315
|
*
|
|
297
316
|
* Is used as a way to track if processing should be checked on.
|
|
317
|
+
*
|
|
318
|
+
* @dbxModelVariable processingAt
|
|
298
319
|
*/
|
|
299
320
|
pat?: Maybe<Date>;
|
|
300
321
|
/**
|
|
301
322
|
* The date that the cleanup step of the processing task was run, and the notification ended.
|
|
323
|
+
*
|
|
324
|
+
* @dbxModelVariable processingCleanupAt
|
|
302
325
|
*/
|
|
303
326
|
pcat?: Maybe<Date>;
|
|
304
327
|
/**
|
|
305
328
|
* User this file is associated with, if applicable.
|
|
329
|
+
*
|
|
330
|
+
* @dbxModelVariable userId
|
|
306
331
|
*/
|
|
307
332
|
u?: Maybe<FirebaseAuthUserId>;
|
|
308
333
|
/**
|
|
309
334
|
* User who uploaded this file, if applicable.
|
|
335
|
+
*
|
|
336
|
+
* @dbxModelVariable uploadedBy
|
|
310
337
|
*/
|
|
311
338
|
uby?: Maybe<FirebaseAuthUserId>;
|
|
312
339
|
/**
|
|
313
340
|
* Ownership key, if applicable.
|
|
341
|
+
*
|
|
342
|
+
* @dbxModelVariable ownerKey
|
|
314
343
|
*/
|
|
315
344
|
o?: Maybe<FirebaseAuthOwnershipKey>;
|
|
316
345
|
/**
|
|
317
346
|
* Purpose of the file, if applicable.
|
|
318
347
|
*
|
|
319
348
|
* Is required for processing a StorageFile.
|
|
349
|
+
*
|
|
350
|
+
* @dbxModelVariable purpose
|
|
320
351
|
*/
|
|
321
352
|
p?: Maybe<StorageFilePurpose>;
|
|
322
353
|
/**
|
|
323
354
|
* Subgroup of the purpose of the file, if applicable.
|
|
324
355
|
*
|
|
325
356
|
* If a StorageFilePurpose should have subgroups, then all StorageFiles should have subgroups too.
|
|
357
|
+
*
|
|
358
|
+
* @dbxModelVariable purposeSubgroup
|
|
326
359
|
*/
|
|
327
360
|
pg?: Maybe<StorageFilePurposeSubgroup>;
|
|
328
361
|
/**
|
|
329
362
|
* Arbitrary metadata attached to the StorageFile.
|
|
363
|
+
*
|
|
364
|
+
* @dbxModelVariable data
|
|
330
365
|
*/
|
|
331
366
|
d?: Maybe<M>;
|
|
332
367
|
/**
|
|
333
368
|
* Scheduled delete at date. The StorageFile cannot be deleted before this set time.
|
|
334
369
|
*
|
|
335
370
|
* Is the main trigger for determining a StorageFile should be deleted.
|
|
371
|
+
*
|
|
372
|
+
* @dbxModelVariable scheduledDeleteAt
|
|
336
373
|
*/
|
|
337
374
|
sdat?: Maybe<Date>;
|
|
338
375
|
/**
|
|
@@ -346,10 +383,14 @@ export interface StorageFile<M extends StorageFileMetadata = StorageFileMetadata
|
|
|
346
383
|
* but there is no gurantee about timeliness when this will happen. StorageFiles, when deleted, are removed from StorageFileGroups immediately, which are flagged for another regeneration automatically.
|
|
347
384
|
*
|
|
348
385
|
* In cases where you need to have the StorageFileGroup be updated promptly, you should manually handle those cases.
|
|
386
|
+
*
|
|
387
|
+
* @dbxModelVariable groupIds
|
|
349
388
|
*/
|
|
350
389
|
g: StorageFileGroupId[];
|
|
351
390
|
/**
|
|
352
391
|
* If true, this file should be re-synced with each StorageFileGroup that it references.
|
|
392
|
+
*
|
|
393
|
+
* @dbxModelVariable groupsNeedSync
|
|
353
394
|
*/
|
|
354
395
|
gs?: Maybe<NeedsSyncBoolean>;
|
|
355
396
|
}
|
|
@@ -416,20 +457,28 @@ export declare const storageFileGroupIdentity: import("../..").RootFirestoreMode
|
|
|
416
457
|
*/
|
|
417
458
|
export interface StorageFileGroupEmbeddedFile {
|
|
418
459
|
/**
|
|
419
|
-
* StorageFile id
|
|
460
|
+
* StorageFile id.
|
|
461
|
+
*
|
|
462
|
+
* @dbxModelVariable storageFileId
|
|
420
463
|
*/
|
|
421
464
|
s: StorageFileId;
|
|
422
465
|
/**
|
|
423
466
|
* Overrides the display name for this file within the group when generating
|
|
424
467
|
* a composite file (zip, etc.).
|
|
468
|
+
*
|
|
469
|
+
* @dbxModelVariable displayName
|
|
425
470
|
*/
|
|
426
471
|
n?: Maybe<StorageFileDisplayName>;
|
|
427
472
|
/**
|
|
428
473
|
* The time number it was added to the group.
|
|
474
|
+
*
|
|
475
|
+
* @dbxModelVariable addedAt
|
|
429
476
|
*/
|
|
430
477
|
sat: Date;
|
|
431
478
|
/**
|
|
432
479
|
* The first time the StorageFile's file was added to the zip, if applicable.
|
|
480
|
+
*
|
|
481
|
+
* @dbxModelVariable zippedAt
|
|
433
482
|
*/
|
|
434
483
|
zat?: Maybe<Date>;
|
|
435
484
|
}
|
|
@@ -447,42 +496,60 @@ export declare const storageFileGroupEmbeddedFile: import("../..").FirestoreSubO
|
|
|
447
496
|
*
|
|
448
497
|
* Implements {@link InitializedStorageFileModel} for async initialization tracking —
|
|
449
498
|
* the `s` (needs sync) flag is set on creation and cleared once initialized.
|
|
499
|
+
*
|
|
500
|
+
* @dbxModel
|
|
450
501
|
*/
|
|
451
502
|
export interface StorageFileGroup extends InitializedStorageFileModel {
|
|
452
503
|
/**
|
|
453
504
|
* List of embedded files in this group currently.
|
|
505
|
+
*
|
|
506
|
+
* @dbxModelVariable files
|
|
454
507
|
*/
|
|
455
508
|
f: StorageFileGroupEmbeddedFile[];
|
|
456
509
|
/**
|
|
457
510
|
* Created at date.
|
|
511
|
+
*
|
|
512
|
+
* @dbxModelVariable createdAt
|
|
458
513
|
*/
|
|
459
514
|
cat: Date;
|
|
460
515
|
/**
|
|
461
516
|
* Ownership key, if applicable.
|
|
517
|
+
*
|
|
518
|
+
* @dbxModelVariable ownerKey
|
|
462
519
|
*/
|
|
463
520
|
o?: Maybe<FirebaseAuthOwnershipKey>;
|
|
464
521
|
/**
|
|
465
522
|
* True if a zip file should be generated for this group.
|
|
466
523
|
*
|
|
467
524
|
* This should remain true while a zip file
|
|
525
|
+
*
|
|
526
|
+
* @dbxModelVariable shouldZip
|
|
468
527
|
*/
|
|
469
528
|
z?: Maybe<SavedToFirestoreIfTrue>;
|
|
470
529
|
/**
|
|
471
530
|
* StorageFile that contains the zip file for this group.
|
|
531
|
+
*
|
|
532
|
+
* @dbxModelVariable zipStorageFileId
|
|
472
533
|
*/
|
|
473
534
|
zsf?: Maybe<StorageFileId>;
|
|
474
535
|
/**
|
|
475
536
|
* The last date the zip file was regenerated for this group.
|
|
537
|
+
*
|
|
538
|
+
* @dbxModelVariable zippedAt
|
|
476
539
|
*/
|
|
477
540
|
zat?: Maybe<Date>;
|
|
478
541
|
/**
|
|
479
542
|
* True if this StorageFileGroup should flag regeneration of output StorageFiles/content.
|
|
543
|
+
*
|
|
544
|
+
* @dbxModelVariable shouldRegenerate
|
|
480
545
|
*/
|
|
481
546
|
re?: Maybe<SavedToFirestoreIfTrue>;
|
|
482
547
|
/**
|
|
483
548
|
* True if this StorageFileGroup should clean up file references.
|
|
484
549
|
*
|
|
485
550
|
* This cleanup process will occur during the next regeneration.
|
|
551
|
+
*
|
|
552
|
+
* @dbxModelVariable shouldCleanup
|
|
486
553
|
*/
|
|
487
554
|
c?: Maybe<SavedToFirestoreIfTrue>;
|
|
488
555
|
}
|
|
@@ -26,6 +26,11 @@ export type StorageFileKey = FirestoreModelKey;
|
|
|
26
26
|
* set on files that do not get processed.
|
|
27
27
|
*
|
|
28
28
|
* Can be used for querying.
|
|
29
|
+
*
|
|
30
|
+
* @semanticType
|
|
31
|
+
* @semanticTopic identifier
|
|
32
|
+
* @semanticTopic string
|
|
33
|
+
* @semanticTopic dereekb-firebase:storage-file
|
|
29
34
|
*/
|
|
30
35
|
export type StorageFilePurpose = string;
|
|
31
36
|
/**
|
|
@@ -34,6 +39,11 @@ export type StorageFilePurpose = string;
|
|
|
34
39
|
* This is useful for being able to query StorageFiles that have a specific purpose and purpose subgroup.
|
|
35
40
|
*
|
|
36
41
|
* Example use case: Documents with the same StorageFilePurpose/processing, but should only have a single StorageFile per subgroup.
|
|
42
|
+
*
|
|
43
|
+
* @semanticType
|
|
44
|
+
* @semanticTopic identifier
|
|
45
|
+
* @semanticTopic string
|
|
46
|
+
* @semanticTopic dereekb-firebase:storage-file
|
|
37
47
|
*/
|
|
38
48
|
export type StorageFilePurposeSubgroup = string;
|
|
39
49
|
/**
|
|
@@ -75,6 +75,11 @@ export declare function userUploadsFolderStoragePathFactory({ bucketId, basePath
|
|
|
75
75
|
* - folder name: A specific folder name (e.g. 'photos' in 'photos/12345.png')
|
|
76
76
|
* - metadata: specific metadata value in the uploaded file's custom metadata
|
|
77
77
|
* - data: specific data in the uploaded file
|
|
78
|
+
*
|
|
79
|
+
* @semanticType
|
|
80
|
+
* @semanticTopic identifier
|
|
81
|
+
* @semanticTopic string
|
|
82
|
+
* @semanticTopic dereekb-firebase:storage-file
|
|
78
83
|
*/
|
|
79
84
|
export type UploadedFileTypeIdentifier = string;
|
|
80
85
|
/**
|
|
@@ -33,6 +33,10 @@ import { type StoredFileReader } from './storagefile.file';
|
|
|
33
33
|
* it is processed properly.
|
|
34
34
|
*
|
|
35
35
|
* In the ideal case there generally shouldn't be two determiners that could potentially match the same file.
|
|
36
|
+
*
|
|
37
|
+
* @semanticType
|
|
38
|
+
* @semanticTopic numeric
|
|
39
|
+
* @semanticTopic dereekb-firebase:storage-file
|
|
36
40
|
*/
|
|
37
41
|
export type UploadedFileTypeDeterminationLevel = number;
|
|
38
42
|
/**
|
|
@@ -20,6 +20,8 @@ import { type ModelFieldMapFunctionsConfig } from '@dereekb/util';
|
|
|
20
20
|
* Abstract base providing access to the SystemState Firestore collection.
|
|
21
21
|
*
|
|
22
22
|
* Implement this in your app module to wire up dependency injection.
|
|
23
|
+
*
|
|
24
|
+
* @dbxModelGroup SystemState
|
|
23
25
|
*/
|
|
24
26
|
export declare abstract class SystemStateFirestoreCollections {
|
|
25
27
|
abstract readonly systemStateCollection: SystemStateFirestoreCollection;
|
|
@@ -34,6 +36,11 @@ export type SystemStateTypes = typeof systemStateIdentity;
|
|
|
34
36
|
export declare const systemStateIdentity: import("../..").RootFirestoreModelIdentity<"systemState", "sys">;
|
|
35
37
|
/**
|
|
36
38
|
* Used to identify a SystemStateId.
|
|
39
|
+
*
|
|
40
|
+
* @semanticType
|
|
41
|
+
* @semanticTopic identifier
|
|
42
|
+
* @semanticTopic string
|
|
43
|
+
* @semanticTopic dereekb-firebase:system-state
|
|
37
44
|
*/
|
|
38
45
|
export type SystemStateTypeIdentifier = string;
|
|
39
46
|
/**
|
|
@@ -52,8 +59,14 @@ export type SystemStateStoredData = Record<string, any>;
|
|
|
52
59
|
* or any system-wide state that needs persistence.
|
|
53
60
|
*
|
|
54
61
|
* @template T - shape of the stored data record
|
|
62
|
+
* @dbxModel
|
|
55
63
|
*/
|
|
56
64
|
export interface SystemState<T extends SystemStateStoredData = SystemStateStoredData> {
|
|
65
|
+
/**
|
|
66
|
+
* Arbitrary persisted data for this system state singleton.
|
|
67
|
+
*
|
|
68
|
+
* @dbxModelVariable data
|
|
69
|
+
*/
|
|
57
70
|
data: T;
|
|
58
71
|
}
|
|
59
72
|
/**
|
package/test/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase/test",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.10.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/date": "13.
|
|
6
|
-
"@dereekb/firebase": "13.
|
|
7
|
-
"@dereekb/model": "13.
|
|
8
|
-
"@dereekb/rxjs": "13.
|
|
9
|
-
"@dereekb/util": "13.
|
|
5
|
+
"@dereekb/date": "13.10.0",
|
|
6
|
+
"@dereekb/firebase": "13.10.0",
|
|
7
|
+
"@dereekb/model": "13.10.0",
|
|
8
|
+
"@dereekb/rxjs": "13.10.0",
|
|
9
|
+
"@dereekb/util": "13.10.0",
|
|
10
10
|
"@firebase/rules-unit-testing": "5.0.0",
|
|
11
11
|
"date-fns": "^4.0.0",
|
|
12
12
|
"firebase": "^12.12.0",
|