@dereekb/firebase 13.9.0 → 13.10.1
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 +19 -10
- package/index.esm.js +19 -10
- package/package.json +10 -10
- 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.api.d.ts +2 -2
- 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.api.d.ts +2 -2
- package/src/lib/model/oidcmodel/oidcmodel.d.ts +21 -1
- 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/index.cjs.js +1 -0
- package/test/index.esm.js +1 -0
- package/test/package.json +9 -9
|
@@ -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/index.cjs.js
CHANGED
|
@@ -4882,6 +4882,7 @@ function _async_to_generator$3(fn) {
|
|
|
4882
4882
|
};
|
|
4883
4883
|
}
|
|
4884
4884
|
function _instanceof(left, right) {
|
|
4885
|
+
"@swc/helpers - instanceof";
|
|
4885
4886
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
4886
4887
|
return !!right[Symbol.hasInstance](left);
|
|
4887
4888
|
} else {
|
package/test/index.esm.js
CHANGED
|
@@ -4880,6 +4880,7 @@ function _async_to_generator$3(fn) {
|
|
|
4880
4880
|
};
|
|
4881
4881
|
}
|
|
4882
4882
|
function _instanceof(left, right) {
|
|
4883
|
+
"@swc/helpers - instanceof";
|
|
4883
4884
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
4884
4885
|
return !!right[Symbol.hasInstance](left);
|
|
4885
4886
|
} else {
|
package/test/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase/test",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.10.1",
|
|
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.1",
|
|
6
|
+
"@dereekb/firebase": "13.10.1",
|
|
7
|
+
"@dereekb/model": "13.10.1",
|
|
8
|
+
"@dereekb/rxjs": "13.10.1",
|
|
9
|
+
"@dereekb/util": "13.10.1",
|
|
10
10
|
"@firebase/rules-unit-testing": "5.0.0",
|
|
11
|
-
"date-fns": "^4.
|
|
12
|
-
"firebase": "^12.12.
|
|
13
|
-
"rxjs": "^7.8.
|
|
11
|
+
"date-fns": "^4.1.0",
|
|
12
|
+
"firebase": "^12.12.1",
|
|
13
|
+
"rxjs": "^7.8.2"
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
16
|
"./package.json": "./package.json",
|