@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
|
@@ -68,9 +68,9 @@ export type StorageFileGroupCreatedStorageFileKey<P extends StorageFileGroupRela
|
|
|
68
68
|
/**
|
|
69
69
|
* Creates a StorageFileGroupCreatedStorageFileKey from the input StorageFileGroupId and purpose.
|
|
70
70
|
*
|
|
71
|
-
* @param purpose -
|
|
72
|
-
* @param storageFileGroupId -
|
|
73
|
-
* @returns
|
|
71
|
+
* @param purpose - The purpose identifying the type of file within the group.
|
|
72
|
+
* @param storageFileGroupId - The ID of the parent StorageFileGroup.
|
|
73
|
+
* @returns A deterministic FirestoreCollectionModelKey for the storage file.
|
|
74
74
|
*/
|
|
75
75
|
export declare function storageFileGroupCreatedStorageFileKey<P extends StorageFileGroupRelatedStorageFilePurpose>(purpose: P, storageFileGroupId: StorageFileGroupId): StorageFileGroupCreatedStorageFileKey<P>;
|
|
76
76
|
/**
|
|
@@ -80,8 +80,9 @@ export type StorageFileGroupCreateStorageFileKeyFactory<P extends StorageFileGro
|
|
|
80
80
|
/**
|
|
81
81
|
* Creates a factory function for generating StorageFileGroupCreatedStorageFileKey values using the input purpose.
|
|
82
82
|
*
|
|
83
|
-
* @param purpose The purpose of the StorageFileGroupCreatedStorageFileKey.
|
|
83
|
+
* @param purpose - The purpose of the StorageFileGroupCreatedStorageFileKey.
|
|
84
84
|
* @returns A factory function that takes a StorageFileGroupId and returns a StorageFileGroupCreatedStorageFileKey.
|
|
85
|
+
*
|
|
85
86
|
* @__NO_SIDE_EFFECTS__
|
|
86
87
|
*/
|
|
87
88
|
export declare function storageFileGroupCreateStorageFileKeyFactory<P extends StorageFileGroupRelatedStorageFilePurpose>(purpose: P): StorageFileGroupCreateStorageFileKeyFactory<P>;
|
|
@@ -214,8 +215,8 @@ export declare enum StorageFileProcessingState {
|
|
|
214
215
|
* (INIT_OR_NONE, FAILED, or SUCCESS). Files that are already QUEUED/PROCESSING, ARCHIVED,
|
|
215
216
|
* or DO_NOT_PROCESS are not eligible.
|
|
216
217
|
*
|
|
217
|
-
* @param storageFile -
|
|
218
|
-
* @returns
|
|
218
|
+
* @param storageFile - The file's processing state (`ps`) and purpose (`p`) fields.
|
|
219
|
+
* @returns True if the file can be queued for processing.
|
|
219
220
|
*
|
|
220
221
|
* @example
|
|
221
222
|
* ```ts
|
|
@@ -423,13 +424,13 @@ export declare const storageFileConverter: import("../..").SnapshotConverterFunc
|
|
|
423
424
|
/**
|
|
424
425
|
* Returns the raw Firestore CollectionReference for the StorageFile collection.
|
|
425
426
|
*
|
|
427
|
+
* @param context - The Firestore context to use.
|
|
428
|
+
* @returns The CollectionReference for StorageFile documents.
|
|
429
|
+
*
|
|
426
430
|
* @example
|
|
427
431
|
* ```ts
|
|
428
432
|
* const colRef = storageFileCollectionReference(firestoreContext);
|
|
429
433
|
* ```
|
|
430
|
-
*
|
|
431
|
-
* @param context - the Firestore context to use
|
|
432
|
-
* @returns the CollectionReference for StorageFile documents
|
|
433
434
|
*/
|
|
434
435
|
export declare function storageFileCollectionReference(context: FirestoreContext): CollectionReference<StorageFile>;
|
|
435
436
|
/**
|
|
@@ -439,14 +440,14 @@ export type StorageFileFirestoreCollection = FirestoreCollection<StorageFile, St
|
|
|
439
440
|
/**
|
|
440
441
|
* Creates a fully configured {@link StorageFileFirestoreCollection} with snapshot conversion and document factory.
|
|
441
442
|
*
|
|
443
|
+
* @param firestoreContext - The Firestore context to use.
|
|
444
|
+
* @returns A configured StorageFileFirestoreCollection.
|
|
445
|
+
*
|
|
442
446
|
* @example
|
|
443
447
|
* ```ts
|
|
444
448
|
* const collection = storageFileFirestoreCollection(firestoreContext);
|
|
445
449
|
* const doc = collection.documentAccessor().newDocument();
|
|
446
450
|
* ```
|
|
447
|
-
*
|
|
448
|
-
* @param firestoreContext - the Firestore context to use
|
|
449
|
-
* @returns a configured StorageFileFirestoreCollection
|
|
450
451
|
*/
|
|
451
452
|
export declare function storageFileFirestoreCollection(firestoreContext: FirestoreContext): StorageFileFirestoreCollection;
|
|
452
453
|
/**
|
|
@@ -581,13 +582,13 @@ export declare const storageFileGroupConverter: import("../..").SnapshotConverte
|
|
|
581
582
|
/**
|
|
582
583
|
* Returns the raw Firestore CollectionReference for the StorageFileGroup collection.
|
|
583
584
|
*
|
|
585
|
+
* @param context - The Firestore context to use.
|
|
586
|
+
* @returns The CollectionReference for StorageFileGroup documents.
|
|
587
|
+
*
|
|
584
588
|
* @example
|
|
585
589
|
* ```ts
|
|
586
590
|
* const colRef = storageFileGroupCollectionReference(firestoreContext);
|
|
587
591
|
* ```
|
|
588
|
-
*
|
|
589
|
-
* @param context - the Firestore context to use
|
|
590
|
-
* @returns the CollectionReference for StorageFileGroup documents
|
|
591
592
|
*/
|
|
592
593
|
export declare function storageFileGroupCollectionReference(context: FirestoreContext): CollectionReference<StorageFileGroup>;
|
|
593
594
|
/**
|
|
@@ -597,13 +598,13 @@ export type StorageFileGroupFirestoreCollection = FirestoreCollection<StorageFil
|
|
|
597
598
|
/**
|
|
598
599
|
* Creates a fully configured {@link StorageFileGroupFirestoreCollection} with snapshot conversion and document factory.
|
|
599
600
|
*
|
|
601
|
+
* @param firestoreContext - The Firestore context to use.
|
|
602
|
+
* @returns A configured StorageFileGroupFirestoreCollection.
|
|
603
|
+
*
|
|
600
604
|
* @example
|
|
601
605
|
* ```ts
|
|
602
606
|
* const collection = storageFileGroupFirestoreCollection(firestoreContext);
|
|
603
607
|
* const doc = collection.documentAccessor().loadDocumentForId(groupId);
|
|
604
608
|
* ```
|
|
605
|
-
*
|
|
606
|
-
* @param firestoreContext - the Firestore context to use
|
|
607
|
-
* @returns a configured StorageFileGroupFirestoreCollection
|
|
608
609
|
*/
|
|
609
610
|
export declare function storageFileGroupFirestoreCollection(firestoreContext: FirestoreContext): StorageFileGroupFirestoreCollection;
|
|
@@ -60,7 +60,7 @@ export interface StoredFileReader {
|
|
|
60
60
|
*
|
|
61
61
|
* Should only be used server-side, as `copy` may not be available on the client.
|
|
62
62
|
*
|
|
63
|
-
* @returns
|
|
63
|
+
* @returns A factory function that wraps FirebaseStorageAccessorFile instances into StoredFileReader accessors.
|
|
64
64
|
*
|
|
65
65
|
* @example
|
|
66
66
|
* ```ts
|
|
@@ -68,6 +68,7 @@ export interface StoredFileReader {
|
|
|
68
68
|
* const reader = factory(storageAccessorFile);
|
|
69
69
|
* const bytes = await reader.loadFileBytes();
|
|
70
70
|
* ```
|
|
71
|
+
*
|
|
71
72
|
* @__NO_SIDE_EFFECTS__
|
|
72
73
|
*/
|
|
73
74
|
export declare function storedFileReaderFactory(): StoredFileReaderFactory;
|
|
@@ -9,9 +9,9 @@ export declare const STORAGE_FILE_GROUP_ROOT_FOLDER_PATH: SlashPathFolder;
|
|
|
9
9
|
/**
|
|
10
10
|
* Builds the storage folder path for a specific StorageFileGroup, optionally with sub-paths.
|
|
11
11
|
*
|
|
12
|
-
* @param storageFileGroupId -
|
|
13
|
-
* @param subPath -
|
|
14
|
-
* @returns
|
|
12
|
+
* @param storageFileGroupId - The group's document ID.
|
|
13
|
+
* @param subPath - Optional sub-paths to append.
|
|
14
|
+
* @returns The folder path as a SlashPathFolder string.
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```ts
|
|
@@ -30,8 +30,8 @@ export declare const STORAGE_FILE_GROUP_ZIP_FILE_PATH: SlashPathFile;
|
|
|
30
30
|
/**
|
|
31
31
|
* Returns the full storage path for a StorageFileGroup's zip file.
|
|
32
32
|
*
|
|
33
|
-
* @param storageFileGroupId -
|
|
34
|
-
* @returns
|
|
33
|
+
* @param storageFileGroupId - The group's document ID.
|
|
34
|
+
* @returns The full SlashPath to the group's zip archive.
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
* ```ts
|
|
@@ -33,8 +33,8 @@ export type GrantStorageFileRolesForUserAuthFunction = (input: GrantStorageFileR
|
|
|
33
33
|
*
|
|
34
34
|
* Use this within a permission service to define role-based access for StorageFile operations.
|
|
35
35
|
*
|
|
36
|
-
* @param config -
|
|
37
|
-
* @returns
|
|
36
|
+
* @param config - Permission output, auth context, and target document for the grant.
|
|
37
|
+
* @returns Builder that takes role configuration and yields a GrantRolesOtherwiseFunction.
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* ```ts
|
|
@@ -44,6 +44,7 @@ export type GrantStorageFileRolesForUserAuthFunction = (input: GrantStorageFileR
|
|
|
44
44
|
* rolesForStorageFileOwnershipKey: (key) => ({ read: true })
|
|
45
45
|
* });
|
|
46
46
|
* ```
|
|
47
|
+
*
|
|
47
48
|
* @__NO_SIDE_EFFECTS__
|
|
48
49
|
*/
|
|
49
50
|
export declare function grantStorageFileRolesForUserAuthFunction<T extends FirebaseModelContext>(config: GrantStorageFileRolesForUserAuthFunctionConfig<T>): GrantStorageFileRolesForUserAuthFunction;
|
|
@@ -7,13 +7,13 @@ import { type FirebaseAuthUserId } from '../../common/auth/auth';
|
|
|
7
7
|
*
|
|
8
8
|
* Used by the server action service to find files awaiting processing task creation.
|
|
9
9
|
*
|
|
10
|
+
* @returns Firestore query constraints for StorageFiles queued for processing.
|
|
11
|
+
*
|
|
10
12
|
* @example
|
|
11
13
|
* ```ts
|
|
12
14
|
* const constraints = storageFilesQueuedForProcessingQuery();
|
|
13
15
|
* const results = await collection.query(constraints);
|
|
14
16
|
* ```
|
|
15
|
-
*
|
|
16
|
-
* @returns Firestore query constraints for StorageFiles queued for processing
|
|
17
17
|
*/
|
|
18
18
|
export declare function storageFilesQueuedForProcessingQuery(): FirestoreQueryConstraint[];
|
|
19
19
|
/**
|
|
@@ -21,8 +21,8 @@ export declare function storageFilesQueuedForProcessingQuery(): FirestoreQueryCo
|
|
|
21
21
|
*
|
|
22
22
|
* Used by the cleanup service to find files ready for permanent deletion.
|
|
23
23
|
*
|
|
24
|
-
* @param now -
|
|
25
|
-
* @returns Firestore query constraints for StorageFiles whose scheduled delete date has passed
|
|
24
|
+
* @param now - Reference time for comparison; defaults to current time.
|
|
25
|
+
* @returns Firestore query constraints for StorageFiles whose scheduled delete date has passed.
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* ```ts
|
|
@@ -45,11 +45,11 @@ export interface StorageFilePurposeAndUserQueryInput {
|
|
|
45
45
|
* Returns query constraints for StorageFiles matching a specific purpose and user,
|
|
46
46
|
* with optional subgroup filtering.
|
|
47
47
|
*
|
|
48
|
-
* @
|
|
49
|
-
* @
|
|
50
|
-
* @returns Firestore query constraints for the given purpose and user
|
|
48
|
+
* @param input - The user, purpose, and optional subgroup to filter by.
|
|
49
|
+
* @returns Firestore query constraints for the given purpose and user.
|
|
51
50
|
*
|
|
52
51
|
* @example
|
|
52
|
+
* @example
|
|
53
53
|
* ```ts
|
|
54
54
|
* const constraints = storageFilePurposeAndUserQuery({
|
|
55
55
|
* user: 'user123',
|
|
@@ -63,10 +63,10 @@ export declare function storageFilePurposeAndUserQuery(input: StorageFilePurpose
|
|
|
63
63
|
*
|
|
64
64
|
* Used by the sync service to find files whose group memberships need to be propagated.
|
|
65
65
|
*
|
|
66
|
-
* @
|
|
67
|
-
* @returns Firestore query constraints for StorageFiles flagged for group synchronization
|
|
66
|
+
* @returns Firestore query constraints for StorageFiles flagged for group synchronization.
|
|
68
67
|
*
|
|
69
68
|
* @example
|
|
69
|
+
* @example
|
|
70
70
|
* ```ts
|
|
71
71
|
* const constraints = storageFileFlaggedForSyncWithGroupsQuery();
|
|
72
72
|
* ```
|
|
@@ -77,10 +77,10 @@ export declare function storageFileFlaggedForSyncWithGroupsQuery(): FirestoreQue
|
|
|
77
77
|
*
|
|
78
78
|
* Used by the initialization service to find newly-created groups that haven't been synced yet.
|
|
79
79
|
*
|
|
80
|
-
* @
|
|
81
|
-
* @returns Firestore query constraints for StorageFileGroups needing initialization
|
|
80
|
+
* @returns Firestore query constraints for StorageFileGroups needing initialization.
|
|
82
81
|
*
|
|
83
82
|
* @example
|
|
83
|
+
* @example
|
|
84
84
|
* ```ts
|
|
85
85
|
* const constraints = storageFileGroupsFlaggedForNeedsInitializationQuery();
|
|
86
86
|
* ```
|
|
@@ -89,10 +89,10 @@ export declare function storageFileGroupsFlaggedForNeedsInitializationQuery(): F
|
|
|
89
89
|
/**
|
|
90
90
|
* Returns query constraints for StorageFileGroups flagged for content regeneration (`re == true`).
|
|
91
91
|
*
|
|
92
|
-
* @
|
|
93
|
-
* @returns Firestore query constraints for StorageFileGroups flagged for content regeneration
|
|
92
|
+
* @returns Firestore query constraints for StorageFileGroups flagged for content regeneration.
|
|
94
93
|
*
|
|
95
94
|
* @example
|
|
95
|
+
* @example
|
|
96
96
|
* ```ts
|
|
97
97
|
* const constraints = storageFileGroupsFlaggedForContentRegenerationQuery();
|
|
98
98
|
* ```
|
|
@@ -103,10 +103,10 @@ export declare function storageFileGroupsFlaggedForContentRegenerationQuery(): F
|
|
|
103
103
|
*
|
|
104
104
|
* Invalid groups are typically cleaned up (deleted along with their associated files).
|
|
105
105
|
*
|
|
106
|
-
* @
|
|
107
|
-
* @returns Firestore query constraints for StorageFileGroups flagged as invalid
|
|
106
|
+
* @returns Firestore query constraints for StorageFileGroups flagged as invalid.
|
|
108
107
|
*
|
|
109
108
|
* @example
|
|
109
|
+
* @example
|
|
110
110
|
* ```ts
|
|
111
111
|
* const constraints = storageFileGroupsFlaggedInvalidQuery();
|
|
112
112
|
* ```
|
|
@@ -68,8 +68,8 @@ export interface StorageFileProcessingNotificationTaskInput<M extends StorageFil
|
|
|
68
68
|
*
|
|
69
69
|
* The created task is unique per StorageFile (only one processing task at a time).
|
|
70
70
|
*
|
|
71
|
-
* @param input -
|
|
72
|
-
* @returns
|
|
71
|
+
* @param input - The target StorageFileDocument and optional subtask data.
|
|
72
|
+
* @returns A CreateNotificationTaskTemplate for the StorageFile processing task.
|
|
73
73
|
*
|
|
74
74
|
* @example
|
|
75
75
|
* ```ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DEFAULT_AUTH_ROLE_CLAIMS_CLAIM_VALUE, type AuthRoleClaimsFactoryConfigEntrySimpleOptions } from '@dereekb/util';
|
|
2
2
|
/**
|
|
3
3
|
* Claim value type used to restrict file uploads for a user.
|
|
4
4
|
*
|
|
5
5
|
* When set to true in the user's custom claims, the `uploads` role is revoked
|
|
6
6
|
* (inverse claim pattern).
|
|
7
7
|
*/
|
|
8
|
-
export type StorageFileUploadUserRestriction = typeof
|
|
8
|
+
export type StorageFileUploadUserRestriction = typeof DEFAULT_AUTH_ROLE_CLAIMS_CLAIM_VALUE;
|
|
9
9
|
/**
|
|
10
10
|
* Custom claims shape for controlling a user's file upload permission.
|
|
11
11
|
*
|
|
@@ -36,8 +36,8 @@ export declare const STORAGE_FILE_UPLOAD_USER_ROLE = "uploads";
|
|
|
36
36
|
* @example
|
|
37
37
|
* ```ts
|
|
38
38
|
* const claimsConfig = {
|
|
39
|
-
* fr:
|
|
39
|
+
* fr: STORAGE_FILE_UPLOAD_USER_SIMPLE_CLAIMS_CONFIGURATION
|
|
40
40
|
* };
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
|
-
export declare const
|
|
43
|
+
export declare const STORAGE_FILE_UPLOAD_USER_SIMPLE_CLAIMS_CONFIGURATION: AuthRoleClaimsFactoryConfigEntrySimpleOptions<StorageFileUploadUserRestriction>;
|
|
@@ -27,8 +27,8 @@ export type UserUploadsFolderSlashPathFactory = FactoryWithRequiredInput<SlashPa
|
|
|
27
27
|
/**
|
|
28
28
|
* Creates a {@link UserUploadsFolderSlashPathFactory} that generates per-user upload folder paths.
|
|
29
29
|
*
|
|
30
|
-
* @param inputBasePath -
|
|
31
|
-
* @returns
|
|
30
|
+
* @param inputBasePath - Optional custom base path; defaults to {@link ALL_USER_UPLOADS_FOLDER_PATH}
|
|
31
|
+
* @returns A factory function that generates per-user upload folder slash paths.
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* ```ts
|
|
@@ -36,6 +36,7 @@ export type UserUploadsFolderSlashPathFactory = FactoryWithRequiredInput<SlashPa
|
|
|
36
36
|
* const path = factory('user123');
|
|
37
37
|
* // path === '/uploads/u/user123'
|
|
38
38
|
* ```
|
|
39
|
+
*
|
|
39
40
|
* @__NO_SIDE_EFFECTS__
|
|
40
41
|
*/
|
|
41
42
|
export declare function userUploadsFolderSlashPathFactory(inputBasePath?: Maybe<string>): UserUploadsFolderSlashPathFactory;
|
|
@@ -53,10 +54,10 @@ export interface UserUploadsFolderStoragePathFactoryConfig {
|
|
|
53
54
|
/**
|
|
54
55
|
* Creates a {@link UserUploadsFolderStoragePathFactory} that includes the storage bucket ID.
|
|
55
56
|
*
|
|
56
|
-
* @param root0 -
|
|
57
|
-
* @param root0.bucketId -
|
|
58
|
-
* @param root0.basePath -
|
|
59
|
-
* @returns
|
|
57
|
+
* @param root0 - The configuration object.
|
|
58
|
+
* @param root0.bucketId - The storage bucket ID to include in each generated path.
|
|
59
|
+
* @param root0.basePath - Optional custom base path; defaults to {@link ALL_USER_UPLOADS_FOLDER_PATH}
|
|
60
|
+
* @returns A factory function that generates per-user StoragePath values including the bucket ID.
|
|
60
61
|
*
|
|
61
62
|
* @example
|
|
62
63
|
* ```ts
|
|
@@ -64,6 +65,7 @@ export interface UserUploadsFolderStoragePathFactoryConfig {
|
|
|
64
65
|
* const storagePath = factory('user123');
|
|
65
66
|
* // storagePath === { pathString: '/uploads/u/user123', bucketId: 'my-bucket' }
|
|
66
67
|
* ```
|
|
68
|
+
*
|
|
67
69
|
* @__NO_SIDE_EFFECTS__
|
|
68
70
|
*/
|
|
69
71
|
export declare function userUploadsFolderStoragePathFactory({ bucketId, basePath: inputBasePath }: UserUploadsFolderStoragePathFactoryConfig): UserUploadsFolderStoragePathFactory;
|
|
@@ -136,8 +136,8 @@ export interface DetermineByFileNameConfig {
|
|
|
136
136
|
* at {@link EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL}. Otherwise, prefix matching is used
|
|
137
137
|
* (e.g., `image` matches `image.png`, `image-test.jpg`) at {@link HIGH_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL}.
|
|
138
138
|
*
|
|
139
|
-
* @param config -
|
|
140
|
-
* @returns
|
|
139
|
+
* @param config - File type, match string, and optional determination levels.
|
|
140
|
+
* @returns An UploadedFileTypeDeterminer that classifies by file name.
|
|
141
141
|
*
|
|
142
142
|
* @example
|
|
143
143
|
* ```ts
|
|
@@ -164,8 +164,8 @@ export interface DetermineByFolderNameConfig {
|
|
|
164
164
|
* Matches at {@link EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL} when the folder path
|
|
165
165
|
* exactly equals the configured match string.
|
|
166
166
|
*
|
|
167
|
-
* @param config -
|
|
168
|
-
* @returns
|
|
167
|
+
* @param config - File type and folder name to match.
|
|
168
|
+
* @returns An UploadedFileTypeDeterminer that classifies by folder name.
|
|
169
169
|
*
|
|
170
170
|
* @example
|
|
171
171
|
* ```ts
|
|
@@ -207,8 +207,8 @@ export interface DetermineByFilePathConfig {
|
|
|
207
207
|
* Uses {@link slashPathPathMatcher} for path pattern matching. Most flexible of the
|
|
208
208
|
* built-in determiners.
|
|
209
209
|
*
|
|
210
|
-
* @param config -
|
|
211
|
-
* @returns
|
|
210
|
+
* @param config - File type, path match config, optional bucket/file filters.
|
|
211
|
+
* @returns An UploadedFileTypeDeterminer that classifies by storage path.
|
|
212
212
|
*
|
|
213
213
|
* @example
|
|
214
214
|
* ```ts
|
|
@@ -265,8 +265,8 @@ export type DetermineUserByFolderDeterminerWrapperFunction = (determiner: Upload
|
|
|
265
265
|
* Extracts the user ID from a path like `{rootFolder}/{userFolderPrefix}/{userId}/{file}`.
|
|
266
266
|
* If `requireUser` is true, the determination fails when no user can be detected.
|
|
267
267
|
*
|
|
268
|
-
* @param config -
|
|
269
|
-
* @returns
|
|
268
|
+
* @param config - Root folder, user prefix, and matching options.
|
|
269
|
+
* @returns A wrapper function that adds user detection to any UploadedFileTypeDeterminer.
|
|
270
270
|
*
|
|
271
271
|
* @example
|
|
272
272
|
* ```ts
|
|
@@ -276,20 +276,22 @@ export type DetermineUserByFolderDeterminerWrapperFunction = (determiner: Upload
|
|
|
276
276
|
* });
|
|
277
277
|
* const withUser = addUser(myDeterminer);
|
|
278
278
|
* ```
|
|
279
|
+
*
|
|
279
280
|
* @__NO_SIDE_EFFECTS__
|
|
280
281
|
*/
|
|
281
282
|
export declare function determineUserByFolderWrapperFunction(config: DetermineUserByFolderWrapperFunctionConfig): DetermineUserByFolderDeterminerWrapperFunction;
|
|
282
283
|
/**
|
|
283
284
|
* Convenience wrapper pre-configured for the standard uploads folder structure (`uploads/u/{userId}/...`).
|
|
284
285
|
*
|
|
285
|
-
* @param config -
|
|
286
|
-
* @returns
|
|
286
|
+
* @param config - Optional matching options (rootFolder and userFolderPrefix are pre-configured)
|
|
287
|
+
* @returns A wrapper function that adds user detection for the standard uploads folder structure.
|
|
287
288
|
*
|
|
288
289
|
* @example
|
|
289
290
|
* ```ts
|
|
290
291
|
* const addUser = determineUserByUserUploadsFolderWrapperFunction();
|
|
291
292
|
* const withUser = addUser(myDeterminer);
|
|
292
293
|
* ```
|
|
294
|
+
*
|
|
293
295
|
* @__NO_SIDE_EFFECTS__
|
|
294
296
|
*/
|
|
295
297
|
export declare function determineUserByUserUploadsFolderWrapperFunction(config?: Omit<DetermineUserByFolderWrapperFunctionConfig, 'rootFolder' | 'userFolderPrefix'>): DetermineUserByFolderDeterminerWrapperFunction;
|
|
@@ -305,7 +307,7 @@ export interface DetermineUserByFolderFunctionConfig extends DetermineUserByFold
|
|
|
305
307
|
/**
|
|
306
308
|
* Convenience function for using determineUserByFolderWrapperFunction directly on a pre-set determiner.
|
|
307
309
|
*
|
|
308
|
-
* @param config Configuration.
|
|
310
|
+
* @param config - Configuration.
|
|
309
311
|
* @returns The wrapped UploadedFileTypeDeterminer.
|
|
310
312
|
*/
|
|
311
313
|
export declare function determineUserByFolder(config: DetermineUserByFolderFunctionConfig): UploadedFileTypeDeterminer;
|
|
@@ -327,9 +329,9 @@ export interface LimitUploadFileTypeDeterminerConfig {
|
|
|
327
329
|
*
|
|
328
330
|
* Useful for scoping a broad determiner to a subset of types in a specific context.
|
|
329
331
|
*
|
|
330
|
-
* @param determiner -
|
|
331
|
-
* @param types -
|
|
332
|
-
* @returns
|
|
332
|
+
* @param determiner - The determiner to filter.
|
|
333
|
+
* @param types - Allowed file type identifier(s)
|
|
334
|
+
* @returns An UploadedFileTypeDeterminer that only returns results for the specified file types.
|
|
333
335
|
*
|
|
334
336
|
* @example
|
|
335
337
|
* ```ts
|
|
@@ -364,8 +366,8 @@ export interface CombineUploadFileTypeDeterminerConfig {
|
|
|
364
366
|
* If only one determiner is provided, it is returned unwrapped. The search can be
|
|
365
367
|
* short-circuited via `completeSearchOnFirstMatch` or `completeSearchAtLevel`.
|
|
366
368
|
*
|
|
367
|
-
* @param config -
|
|
368
|
-
* @returns
|
|
369
|
+
* @param config - Determiners to combine and optional early-exit settings.
|
|
370
|
+
* @returns A combined UploadedFileTypeDeterminer that returns the highest-confidence match.
|
|
369
371
|
*
|
|
370
372
|
* @example
|
|
371
373
|
* ```ts
|
|
@@ -26,10 +26,10 @@ export interface StorageFileGroupDocumentReferencePair {
|
|
|
26
26
|
* If a document is provided directly, it is returned as-is. Otherwise, the related model key
|
|
27
27
|
* is converted to a group ID via {@link storageFileGroupIdForModel} and loaded from the accessor.
|
|
28
28
|
*
|
|
29
|
-
* @param input -
|
|
30
|
-
* @param accessor -
|
|
31
|
-
* @returns
|
|
32
|
-
* @throws {Error} When neither storageFileGroupDocument nor storageFileGroupRelatedModelKey is provided
|
|
29
|
+
* @param input - Reference pair containing either a document or a related model key.
|
|
30
|
+
* @param accessor - Document accessor used to load the group document by ID.
|
|
31
|
+
* @returns The resolved StorageFileGroupDocument.
|
|
32
|
+
* @throws {Error} When neither storageFileGroupDocument nor storageFileGroupRelatedModelKey is provided.
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
35
35
|
* ```ts
|
|
@@ -65,8 +65,8 @@ export interface CalculateStorageFileGroupEmbeddedFileUpdateInput {
|
|
|
65
65
|
* with existing ones by StorageFile ID. Automatically flags regeneration when files are removed
|
|
66
66
|
* or when new files haven't been added to the zip yet.
|
|
67
67
|
*
|
|
68
|
-
* @param input -
|
|
69
|
-
* @returns
|
|
68
|
+
* @param input - Current group state, files to insert/remove, and regeneration options.
|
|
69
|
+
* @returns Updated `f` (embedded files) and `re` (regeneration flag)
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
72
72
|
* ```ts
|
|
@@ -108,8 +108,8 @@ export interface CalculateStorageFileGroupRegenerationResult {
|
|
|
108
108
|
* - The zip has never been generated (`zat` is unset) and files exist
|
|
109
109
|
* - Any embedded file has never been included in the zip (`zat` is unset on the entry)
|
|
110
110
|
*
|
|
111
|
-
* @param input -
|
|
112
|
-
* @returns
|
|
111
|
+
* @param input - Group state and optional force flag.
|
|
112
|
+
* @returns The regeneration result indicating whether the zip or other derived files need to be regenerated.
|
|
113
113
|
*
|
|
114
114
|
* @example
|
|
115
115
|
* ```ts
|
|
@@ -95,13 +95,13 @@ export declare const systemStateConverter: import("../..").SnapshotConverterFunc
|
|
|
95
95
|
/**
|
|
96
96
|
* Returns the raw Firestore CollectionReference for the SystemState collection.
|
|
97
97
|
*
|
|
98
|
+
* @param context - The Firestore context to use.
|
|
99
|
+
* @returns The CollectionReference for SystemState documents.
|
|
100
|
+
*
|
|
98
101
|
* @example
|
|
99
102
|
* ```ts
|
|
100
103
|
* const colRef = systemStateCollectionReference(firestoreContext);
|
|
101
104
|
* ```
|
|
102
|
-
*
|
|
103
|
-
* @param context - the Firestore context to use
|
|
104
|
-
* @returns the CollectionReference for SystemState documents
|
|
105
105
|
*/
|
|
106
106
|
export declare function systemStateCollectionReference(context: FirestoreContext): CollectionReference<SystemState>;
|
|
107
107
|
export type SystemStateFirestoreCollection<T extends SystemStateStoredData = SystemStateStoredData> = FirestoreCollection<SystemState<T>, SystemStateDocument<T>>;
|
|
@@ -128,9 +128,9 @@ export type SystemStateStoredDataConverterMap = {
|
|
|
128
128
|
* converter based on the document ID (which is the {@link SystemStateTypeIdentifier}).
|
|
129
129
|
* Documents with no matching converter use the default pass-through converter.
|
|
130
130
|
*
|
|
131
|
-
* @param firestoreContext -
|
|
132
|
-
* @param converters -
|
|
133
|
-
* @returns
|
|
131
|
+
* @param firestoreContext - The Firestore context.
|
|
132
|
+
* @param converters - Map of type identifiers to their data field converters.
|
|
133
|
+
* @returns A configured SystemStateFirestoreCollection with per-type data converters.
|
|
134
134
|
*
|
|
135
135
|
* @example
|
|
136
136
|
* ```ts
|