@dereekb/firebase 13.11.14 → 13.11.16
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/eslint/index.cjs.default.js +1 -0
- package/eslint/index.cjs.js +2290 -0
- package/eslint/index.cjs.mjs +2 -0
- package/eslint/index.d.ts +1 -0
- package/eslint/index.esm.js +2277 -0
- package/eslint/package.json +24 -0
- package/eslint/src/index.d.ts +1 -0
- package/eslint/src/lib/comments.d.ts +112 -0
- package/eslint/src/lib/dbx-tag-families.d.ts +280 -0
- package/eslint/src/lib/index.d.ts +6 -0
- package/eslint/src/lib/jsdoc-parser.d.ts +116 -0
- package/eslint/src/lib/plugin.d.ts +28 -0
- package/eslint/src/lib/require-dbx-model-firebase-index-companion-tags.rule.d.ts +47 -0
- package/eslint/src/lib/require-dbx-model-firebase-index-query-suffix.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-model-firebase-index-valid-dispatcher.rule.d.ts +54 -0
- package/eslint/src/lib/require-tagged-firestore-constraints.rule.d.ts +46 -0
- package/eslint/src/lib/util.d.ts +107 -0
- package/index.cjs.js +1446 -1137
- package/index.esm.js +1437 -1128
- package/package.json +11 -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
|
@@ -58,10 +58,11 @@ export type FirestoreIdBatchVerifierFactory<T, I extends PrimativeKey> = Factory
|
|
|
58
58
|
* collection, respecting Firestore's `where('in')` limit of {@link FIRESTORE_MAX_WHERE_IN_FILTER_ARGS_COUNT}
|
|
59
59
|
* items per query. This is used for batch ID generation to ensure uniqueness.
|
|
60
60
|
*
|
|
61
|
+
* @param config - Specifies how to query for existing keys (by field or custom constraints)
|
|
62
|
+
* @returns A factory that produces verifiers bound to a specific collection.
|
|
63
|
+
*
|
|
61
64
|
* @template T - The Firestore document data type
|
|
62
65
|
* @template I - The identifier/key type
|
|
63
|
-
* @param config - Specifies how to query for existing keys (by field or custom constraints)
|
|
64
|
-
* @returns A factory that produces verifiers bound to a specific collection
|
|
65
66
|
*
|
|
66
67
|
* @example
|
|
67
68
|
* ```ts
|
|
@@ -73,6 +74,7 @@ export type FirestoreIdBatchVerifierFactory<T, I extends PrimativeKey> = Factory
|
|
|
73
74
|
* const verifier = factory(myCollection);
|
|
74
75
|
* // verifier can now check batches of IDs for uniqueness
|
|
75
76
|
* ```
|
|
77
|
+
*
|
|
76
78
|
* @__NO_SIDE_EFFECTS__
|
|
77
79
|
*/
|
|
78
80
|
export declare function firestoreIdBatchVerifierFactory<T, I extends PrimativeKey>(config: FirestoreIdBatchVerifierFactoryConfig<T, I>): FirestoreIdBatchVerifierFactory<T, I>;
|
|
@@ -40,8 +40,8 @@ export type OnCallTypeModelParamsFunction = <T>(modelTypeInput: FirestoreModelTy
|
|
|
40
40
|
*
|
|
41
41
|
* The returned function builds {@link OnCallTypedModelParams} for any model type.
|
|
42
42
|
*
|
|
43
|
-
* @param call -
|
|
44
|
-
* @returns
|
|
43
|
+
* @param call - The CRUD call type to embed in generated params.
|
|
44
|
+
* @returns An {@link OnCallTypeModelParamsFunction} pre-configured with the given call type.
|
|
45
45
|
* @throws {Error} When `modelType` is not provided or empty.
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
@@ -50,23 +50,10 @@ export type OnCallTypeModelParamsFunction = <T>(modelTypeInput: FirestoreModelTy
|
|
|
50
50
|
* const params = createParams('notification', { title: 'Hello' });
|
|
51
51
|
* // params === { call: 'create', modelType: 'notification', data: { title: 'Hello' } }
|
|
52
52
|
* ```
|
|
53
|
+
*
|
|
53
54
|
* @__NO_SIDE_EFFECTS__
|
|
54
55
|
*/
|
|
55
56
|
export declare function onCallTypedModelParamsFunction(call?: Maybe<OnCallFunctionType>): OnCallTypeModelParamsFunction;
|
|
56
|
-
/**
|
|
57
|
-
* Creates OnCallTypedModelParams for the input.
|
|
58
|
-
*
|
|
59
|
-
* Convenience function for calling onCallTypedModelParamsFunction and executing it with the input.
|
|
60
|
-
*
|
|
61
|
-
* @deprecated Move towards using onCallTypedModelParamsFunction directly with the call type instead of using this function. Will not be removed in the future.
|
|
62
|
-
*
|
|
63
|
-
* @param modelTypeInput - the model type string or ref
|
|
64
|
-
* @param data - the call payload
|
|
65
|
-
* @param specifier - optional sub-function specifier
|
|
66
|
-
* @param call - the CRUD call type
|
|
67
|
-
* @returns the constructed {@link OnCallTypedModelParams}
|
|
68
|
-
*/
|
|
69
|
-
export declare function onCallTypedModelParams<T>(modelTypeInput: FirestoreModelType | FirestoreModelTypeRef, data: T, specifier?: string, call?: OnCallFunctionType): OnCallTypedModelParams<T>;
|
|
70
57
|
/**
|
|
71
58
|
* Pre-configured OnCallTypedModelParamsFunctions for 'create'
|
|
72
59
|
*/
|
|
@@ -193,8 +180,8 @@ export interface OnCallCreateModelResult {
|
|
|
193
180
|
/**
|
|
194
181
|
* Creates an {@link OnCallCreateModelResult} from document references by extracting their paths as model keys.
|
|
195
182
|
*
|
|
196
|
-
* @param result -
|
|
197
|
-
* @returns
|
|
183
|
+
* @param result - Document reference(s) from a create operation.
|
|
184
|
+
* @returns An {@link OnCallCreateModelResult} with model keys extracted from document paths.
|
|
198
185
|
*
|
|
199
186
|
* @example
|
|
200
187
|
* ```ts
|
|
@@ -206,7 +193,21 @@ export declare function onCallCreateModelResultWithDocs(result: ArrayOrValue<Doc
|
|
|
206
193
|
/**
|
|
207
194
|
* Creates an {@link OnCallCreateModelResult} from model key(s), normalizing to an array.
|
|
208
195
|
*
|
|
209
|
-
* @param modelKeys -
|
|
210
|
-
* @returns
|
|
196
|
+
* @param modelKeys - The model key(s) of the created document(s)
|
|
197
|
+
* @returns An {@link OnCallCreateModelResult} containing the keys as an array.
|
|
211
198
|
*/
|
|
212
199
|
export declare function onCallCreateModelResult(modelKeys: ArrayOrValue<FirestoreModelKey>): OnCallCreateModelResult;
|
|
200
|
+
/**
|
|
201
|
+
* Creates OnCallTypedModelParams for the input.
|
|
202
|
+
*
|
|
203
|
+
* Convenience function for calling onCallTypedModelParamsFunction and executing it with the input.
|
|
204
|
+
*
|
|
205
|
+
* @param modelTypeInput - The model type string or ref.
|
|
206
|
+
* @param data - The call payload.
|
|
207
|
+
* @param specifier - Optional sub-function specifier.
|
|
208
|
+
* @param call - The CRUD call type.
|
|
209
|
+
* @returns The constructed {@link OnCallTypedModelParams}
|
|
210
|
+
*
|
|
211
|
+
* @deprecated Move towards using onCallTypedModelParamsFunction directly with the call type instead of using this function. Will not be removed in the future.
|
|
212
|
+
*/
|
|
213
|
+
export declare function onCallTypedModelParams<T>(modelTypeInput: FirestoreModelType | FirestoreModelTypeRef, data: T, specifier?: string, call?: OnCallFunctionType): OnCallTypedModelParams<T>;
|
|
@@ -37,8 +37,8 @@ export interface FirebaseModelLoader<C extends FirebaseModelLoaderContext, T, D
|
|
|
37
37
|
*
|
|
38
38
|
* Automatically uses a transaction accessor when the context has an active transaction.
|
|
39
39
|
*
|
|
40
|
-
* @param getFirestoreCollection -
|
|
41
|
-
* @returns
|
|
40
|
+
* @param getFirestoreCollection - Function to retrieve the Firestore collection from context.
|
|
41
|
+
* @returns A {@link FirebaseModelLoader} that loads document wrappers for given keys.
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
44
|
* ```ts
|
|
@@ -37,8 +37,8 @@ export interface FirebaseModelServiceConfig<C extends FirebaseModelServiceContex
|
|
|
37
37
|
/**
|
|
38
38
|
* Creates a {@link FirebaseModelService} that wires together model loading and permission evaluation.
|
|
39
39
|
*
|
|
40
|
-
* @param config -
|
|
41
|
-
* @returns
|
|
40
|
+
* @param config - Collection loader and role mapping functions.
|
|
41
|
+
* @returns A {@link FirebaseModelService} combining model loading and permission evaluation.
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
44
|
* ```ts
|
|
@@ -47,6 +47,7 @@ export interface FirebaseModelServiceConfig<C extends FirebaseModelServiceContex
|
|
|
47
47
|
* roleMapForModel: (output, context, model) => computeRoles(output, context)
|
|
48
48
|
* });
|
|
49
49
|
* ```
|
|
50
|
+
*
|
|
50
51
|
* @__NO_SIDE_EFFECTS__
|
|
51
52
|
*/
|
|
52
53
|
export declare function firebaseModelService<C extends FirebaseModelServiceContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole>(config: FirebaseModelServiceConfig<C, T, D, R>): FirebaseModelService<C, T, D, R>;
|
|
@@ -57,8 +58,9 @@ export type FirebaseModelServiceFactory<C extends FirebaseModelServiceContext, T
|
|
|
57
58
|
/**
|
|
58
59
|
* Creates a {@link FirebaseModelServiceFactory} that lazily instantiates and caches the service.
|
|
59
60
|
*
|
|
60
|
-
* @param config -
|
|
61
|
-
* @returns
|
|
61
|
+
* @param config - The service configuration.
|
|
62
|
+
* @returns A {@link FirebaseModelServiceFactory} that lazily creates and caches the service.
|
|
63
|
+
*
|
|
62
64
|
* @__NO_SIDE_EFFECTS__
|
|
63
65
|
*/
|
|
64
66
|
export declare function firebaseModelServiceFactory<C extends FirebaseModelServiceContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole>(config: FirebaseModelServiceConfig<C, T, D, R>): FirebaseModelServiceFactory<C, T, D, R>;
|
|
@@ -104,8 +106,9 @@ export type InModelContextFirebaseModelServiceUseFunction<C extends FirebasePerm
|
|
|
104
106
|
* The returned factory, when given a context, produces a callable service that can be invoked
|
|
105
107
|
* with a model or key to perform permission-checked operations.
|
|
106
108
|
*
|
|
107
|
-
* @param factory -
|
|
108
|
-
* @returns
|
|
109
|
+
* @param factory - Lazy getter for the underlying model service.
|
|
110
|
+
* @returns An {@link InContextFirebaseModelServiceFactory} that binds contexts to the service.
|
|
111
|
+
*
|
|
109
112
|
* @__NO_SIDE_EFFECTS__
|
|
110
113
|
*/
|
|
111
114
|
export declare function inContextFirebaseModelServiceFactory<C extends FirebaseModelServiceContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole>(factory: FirebaseModelServiceGetter<C, T, D, R>): InContextFirebaseModelServiceFactory<C, T, D, R>;
|
|
@@ -146,8 +149,9 @@ export type FirebaseModelsServiceTypes<S extends FirebaseModelsService<any, any>
|
|
|
146
149
|
* export const demoFirebaseModelServices = firebaseModelsService<typeof DEMO_FIREBASE_MODEL_SERVICE_FACTORIES, DemoFirebaseBaseContext, DemoFirebaseModelTypes>(DEMO_FIREBASE_MODEL_SERVICE_FACTORIES);
|
|
147
150
|
* export type DemoFirebaseContext = DemoFirebaseBaseContext & { service: typeof demoFirebaseModelServices };
|
|
148
151
|
*
|
|
149
|
-
* @param services -
|
|
150
|
-
* @returns
|
|
152
|
+
* @param services - Map of model service getter factories keyed by model type.
|
|
153
|
+
* @returns Aggregated {@link FirebaseModelsService} that dispatches by model type.
|
|
154
|
+
*
|
|
151
155
|
* @__NO_SIDE_EFFECTS__
|
|
152
156
|
*/
|
|
153
157
|
export declare function firebaseModelsService<X extends FirebaseModelsServiceFactory<C, I>, C extends FirebaseModelServiceContext, I extends FirestoreModelIdentity = FirestoreModelIdentity>(services: X): FirebaseModelsService<X, C>;
|
|
@@ -164,8 +168,9 @@ export type InContextFirebaseModelsServiceFactory<Y> = FirebaseModelsServiceType
|
|
|
164
168
|
*
|
|
165
169
|
* The returned factory binds a context, so callers can then select individual model services by type.
|
|
166
170
|
*
|
|
167
|
-
* @param service -
|
|
168
|
-
* @returns
|
|
171
|
+
* @param service - The multi-model service to wrap.
|
|
172
|
+
* @returns An {@link InContextFirebaseModelsServiceFactory} that binds a context to the service.
|
|
173
|
+
*
|
|
169
174
|
* @__NO_SIDE_EFFECTS__
|
|
170
175
|
*/
|
|
171
176
|
export declare function inContextFirebaseModelsServiceFactory<X extends FirebaseModelsServiceFactory<C, I>, C extends FirebaseModelServiceContext, I extends FirestoreModelIdentity = FirestoreModelIdentity>(service: FirebaseModelsService<X, C>): InContextFirebaseModelsServiceFactory<FirebaseModelsService<X, C>>;
|
|
@@ -187,10 +192,11 @@ export type UseFirebaseModelsServiceSelectionUseFunction<Y extends FirebaseModel
|
|
|
187
192
|
/**
|
|
188
193
|
* Selects a model-bound service instance from a multi-model service by type and key.
|
|
189
194
|
*
|
|
190
|
-
* @param service -
|
|
191
|
-
* @param type -
|
|
192
|
-
* @param select -
|
|
193
|
-
* @returns
|
|
195
|
+
* @param service - The multi-model service.
|
|
196
|
+
* @param type - The model type to select.
|
|
197
|
+
* @param select - Selection params including context and key.
|
|
198
|
+
* @returns The {@link FirebaseModelsServiceSelectionResult} bound to the specified model.
|
|
199
|
+
*
|
|
194
200
|
* @__NO_SIDE_EFFECTS__
|
|
195
201
|
*/
|
|
196
202
|
export declare function selectFromFirebaseModelsService<Y extends FirebaseModelsService<any, any>, T extends FirebaseModelsServiceTypes<Y>>(service: Y, type: T, select: FirebaseModelsServiceSelection<Y, T>): FirebaseModelsServiceSelectionResult<Y, T>;
|
|
@@ -199,10 +205,11 @@ export declare function selectFromFirebaseModelsService<Y extends FirebaseModels
|
|
|
199
205
|
*
|
|
200
206
|
* If roles are provided, uses `requireUse` to assert them. Otherwise, returns the basic `use` function.
|
|
201
207
|
*
|
|
202
|
-
* @param service -
|
|
203
|
-
* @param type -
|
|
204
|
-
* @param select -
|
|
205
|
-
* @returns
|
|
208
|
+
* @param service - The multi-model service.
|
|
209
|
+
* @param type - The model type to select.
|
|
210
|
+
* @param select - Selection params including context, key, and optional role requirements.
|
|
211
|
+
* @returns A {@link UsePromiseFunction} for the resolved roles reader.
|
|
212
|
+
*
|
|
206
213
|
* @__NO_SIDE_EFFECTS__
|
|
207
214
|
*/
|
|
208
215
|
export declare function useFirebaseModelsService<Y extends FirebaseModelsService<any, any>, T extends FirebaseModelsServiceTypes<Y>>(service: Y, type: T, select: UseFirebaseModelsServiceSelection<Y, T>): UseFirebaseModelsServiceSelectionResult<Y, T>;
|
|
@@ -211,8 +218,9 @@ export declare function useFirebaseModelsService<Y extends FirebaseModelsService
|
|
|
211
218
|
*
|
|
212
219
|
* Useful for routing incoming requests to the correct model service by collection path.
|
|
213
220
|
*
|
|
214
|
-
* @param inContextFirebaseModelsService -
|
|
215
|
-
* @returns
|
|
221
|
+
* @param inContextFirebaseModelsService - Context-bound multi-model service.
|
|
222
|
+
* @returns Map keyed by collection type, valued with the matching {@link FirestoreModelIdentity}.
|
|
223
|
+
*
|
|
216
224
|
* @__NO_SIDE_EFFECTS__
|
|
217
225
|
*/
|
|
218
226
|
export declare function buildFirebaseCollectionTypeModelTypeMap<Y extends FirebaseModelsService<any, any>>(inContextFirebaseModelsService: InContextFirebaseModelsService<Y>): import("..").FirestoreModelIdentityTypeMap;
|
|
@@ -34,8 +34,9 @@ export declare class FirebaseModelPermissionServiceInstance<C extends FirebaseMo
|
|
|
34
34
|
/**
|
|
35
35
|
* Creates a {@link FirebaseModelPermissionServiceInstance} from a delegate.
|
|
36
36
|
*
|
|
37
|
-
* @param delegate -
|
|
38
|
-
* @returns
|
|
37
|
+
* @param delegate - Provides model loading and role computation.
|
|
38
|
+
* @returns A {@link FirebaseModelPermissionServiceInstance} configured with the given delegate.
|
|
39
|
+
*
|
|
39
40
|
* @__NO_SIDE_EFFECTS__
|
|
40
41
|
*/
|
|
41
42
|
export declare function firebaseModelPermissionService<C extends FirebaseModelContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends string = string>(delegate: FirebasePermissionServiceInstanceDelegate<C, T, D, R>): FirebaseModelPermissionServiceInstance<C, T, D, R>;
|
|
@@ -8,21 +8,22 @@ import { type UserRelated } from '../../../model/user';
|
|
|
8
8
|
*
|
|
9
9
|
* Returns `false` if no auth is present.
|
|
10
10
|
*
|
|
11
|
-
* @param context -
|
|
12
|
-
* @returns
|
|
11
|
+
* @param context - Firebase model context whose caller is evaluated.
|
|
12
|
+
* @returns Resolves with `true` for an admin caller, otherwise `false`.
|
|
13
13
|
*/
|
|
14
14
|
export declare const isAdminInFirebaseModelContext: AsyncDecisionFunction<FirebaseModelContext>;
|
|
15
15
|
/**
|
|
16
16
|
* Creates a {@link GrantRolesIfFunction} that grants the specified roles when the user is an admin.
|
|
17
17
|
*
|
|
18
|
-
* @param rolesToGrantToAdmin -
|
|
19
|
-
* @returns
|
|
18
|
+
* @param rolesToGrantToAdmin - Roles to grant if the user is an admin.
|
|
19
|
+
* @returns A {@link GrantRolesIfFunction} that grants the given roles when the user is an admin.
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```ts
|
|
23
23
|
* const grantIfAdmin = grantModelRolesIfAdminFunction(fullAccessRoleMap);
|
|
24
24
|
* const roles = await grantIfAdmin(context);
|
|
25
25
|
* ```
|
|
26
|
+
*
|
|
26
27
|
* @__NO_SIDE_EFFECTS__
|
|
27
28
|
*/
|
|
28
29
|
export declare function grantModelRolesIfAdminFunction<R extends string = string>(rolesToGrantToAdmin: GetterOrValue<GrantedRoleMap<R>>): GrantRolesIfFunction<FirebaseModelContext, R>;
|
|
@@ -33,18 +34,19 @@ export declare const grantFullAccessIfAdmin: GeneralGrantRolesIfFunction<Firebas
|
|
|
33
34
|
/**
|
|
34
35
|
* Convenience function that evaluates admin status and grants roles in a single call.
|
|
35
36
|
*
|
|
36
|
-
* @param context -
|
|
37
|
-
* @param rolesToGrantToAdmin -
|
|
38
|
-
* @param otherwise -
|
|
39
|
-
* @returns
|
|
37
|
+
* @param context - Firebase model context whose caller is evaluated.
|
|
38
|
+
* @param rolesToGrantToAdmin - Roles granted when the caller is an admin.
|
|
39
|
+
* @param otherwise - Fallback computation invoked for non-admin callers.
|
|
40
|
+
* @returns Resolves with the granted role map.
|
|
40
41
|
*/
|
|
41
42
|
export declare function grantModelRolesIfAdmin<R extends string = string>(context: FirebaseModelContext, rolesToGrantToAdmin: GetterOrValue<GrantedRoleMap<R>>, otherwise?: GrantRolesOtherwiseFunction<R>): PromiseOrValue<GrantedRoleMap<R>>;
|
|
42
43
|
/**
|
|
43
44
|
* Creates a {@link GrantRolesIfFunction} that grants roles when the user has all specified auth roles in their token.
|
|
44
45
|
*
|
|
45
|
-
* @param authRoles -
|
|
46
|
-
* @param rolesToGrantToAdmin -
|
|
47
|
-
* @returns
|
|
46
|
+
* @param authRoles - The auth roles the user must have.
|
|
47
|
+
* @param rolesToGrantToAdmin - The model roles to grant if the auth roles are present.
|
|
48
|
+
* @returns A {@link GrantRolesIfFunction} that grants the given roles when the user has the required auth roles.
|
|
49
|
+
*
|
|
48
50
|
* @__NO_SIDE_EFFECTS__
|
|
49
51
|
*/
|
|
50
52
|
export declare function grantModelRolesIfHasAuthRolesFunction<R extends string = string>(authRoles: AuthRole[], rolesToGrantToAdmin: GetterOrValue<GrantedRoleMap<R>>): GrantRolesIfFunction<FirebaseModelContext, R>;
|
|
@@ -55,8 +57,9 @@ export type GrantModelRolesIfHasAuthRolesFactory = <R extends string = string>(c
|
|
|
55
57
|
/**
|
|
56
58
|
* Creates a reusable factory pre-configured with specific auth roles to check for.
|
|
57
59
|
*
|
|
58
|
-
* @param authRoles -
|
|
59
|
-
* @returns
|
|
60
|
+
* @param authRoles - The auth roles the user must have.
|
|
61
|
+
* @returns A {@link GrantModelRolesIfHasAuthRolesFactory} pre-configured to check the given auth roles.
|
|
62
|
+
*
|
|
60
63
|
* @__NO_SIDE_EFFECTS__
|
|
61
64
|
*/
|
|
62
65
|
export declare function grantModelRolesIfHasAuthRolesFactory(authRoles: IterableOrValue<AuthRole>): GrantModelRolesIfHasAuthRolesFactory;
|
|
@@ -89,14 +92,15 @@ export declare const isOwnerOfUserRelatedModelInFirebaseModelContext: AsyncDecis
|
|
|
89
92
|
/**
|
|
90
93
|
* Creates a {@link GrantRolesIfFunction} that grants roles when the authenticated user's UID matches the model's `uid` field.
|
|
91
94
|
*
|
|
92
|
-
* @param rolesToGrant -
|
|
93
|
-
* @returns
|
|
95
|
+
* @param rolesToGrant - The roles to grant if the user owns the model.
|
|
96
|
+
* @returns A {@link GrantRolesIfFunction} that grants roles when the authenticated user is the model owner.
|
|
94
97
|
*
|
|
95
98
|
* @example
|
|
96
99
|
* ```ts
|
|
97
100
|
* const grantIfOwner = grantModelRolesIfAuthUserRelatedModelFunction<User>(fullAccessRoleMap);
|
|
98
101
|
* const roles = await grantIfOwner({ model: userData, context });
|
|
99
102
|
* ```
|
|
103
|
+
*
|
|
100
104
|
* @__NO_SIDE_EFFECTS__
|
|
101
105
|
*/
|
|
102
106
|
export declare function grantModelRolesIfAuthUserRelatedModelFunction<T extends UserRelated, R extends string = string>(rolesToGrant: GetterOrValue<GrantedRoleMap<R>>): GrantRolesIfFunction<UserRelatedModelFirebaseModelContext<T>, R>;
|
|
@@ -117,9 +121,10 @@ export type GeneralGrantRolesOnlyIfFunction<C> = <R extends string = string>(con
|
|
|
117
121
|
/**
|
|
118
122
|
* Creates a {@link GrantRolesOnlyIfFunction} with no fallback — returns no-access if the condition is false.
|
|
119
123
|
*
|
|
120
|
-
* @param grantIf -
|
|
121
|
-
* @param grantedRoles -
|
|
122
|
-
* @returns
|
|
124
|
+
* @param grantIf - Decision function to evaluate.
|
|
125
|
+
* @param grantedRoles - Roles to grant if the decision is `true`
|
|
126
|
+
* @returns A {@link GrantRolesOnlyIfFunction} that grants roles or returns no-access with no fallback.
|
|
127
|
+
*
|
|
123
128
|
* @__NO_SIDE_EFFECTS__
|
|
124
129
|
*/
|
|
125
130
|
export declare function grantModelRolesOnlyIfFunction<C, R extends string = string>(grantIf: AsyncDecisionFunction<C>, grantedRoles: GetterOrValue<GrantedRoleMap<R>>): GrantRolesOnlyIfFunction<C, R>;
|
|
@@ -144,9 +149,9 @@ export type GrantRolesOtherwiseFunction<R extends string = string> = Getter<Gran
|
|
|
144
149
|
*
|
|
145
150
|
* This is the core building block for composing permission logic.
|
|
146
151
|
*
|
|
147
|
-
* @param grantIf -
|
|
148
|
-
* @param grantedRoles -
|
|
149
|
-
* @returns
|
|
152
|
+
* @param grantIf - Async decision function to evaluate.
|
|
153
|
+
* @param grantedRoles - Roles to grant if the decision is `true`
|
|
154
|
+
* @returns A {@link GrantRolesIfFunction} that evaluates the condition and grants roles or falls back.
|
|
150
155
|
* @throws {Error} When `grantIf` is not provided.
|
|
151
156
|
*
|
|
152
157
|
* @example
|
|
@@ -157,6 +162,7 @@ export type GrantRolesOtherwiseFunction<R extends string = string> = Getter<Gran
|
|
|
157
162
|
* );
|
|
158
163
|
* const roles = await grantIfOwner(context, () => noAccessRoleMap());
|
|
159
164
|
* ```
|
|
165
|
+
*
|
|
160
166
|
* @__NO_SIDE_EFFECTS__
|
|
161
167
|
*/
|
|
162
168
|
export declare function grantModelRolesIfFunction<C, R extends string = string>(grantIf: AsyncDecisionFunction<C>, grantedRoles: GetterOrValue<GrantedRoleMap<R>>): GrantRolesIfFunction<C, R>;
|
|
@@ -54,22 +54,22 @@ export declare class ContextGrantedModelRolesReaderInstance<C extends FirebasePe
|
|
|
54
54
|
/**
|
|
55
55
|
* Creates a new ContextGrantedModelRolesReader for the input model.
|
|
56
56
|
*
|
|
57
|
-
* @param service -
|
|
58
|
-
* @returns
|
|
57
|
+
* @param service - In-model-context permission service whose role map is fetched.
|
|
58
|
+
* @returns Resolves with a {@link ContextGrantedModelRolesReader} bound to that model.
|
|
59
59
|
*/
|
|
60
60
|
export declare function contextGrantedModelRolesReader<C extends FirebasePermissionErrorContext, T, D extends FirestoreDocument<T> = FirestoreDocument<T>, R extends GrantedRole = GrantedRole>(service: InModelContextFirebaseModelPermissionService<C, T, D, R>): Promise<ContextGrantedModelRolesReader<C, T, D, R>>;
|
|
61
61
|
/**
|
|
62
62
|
* Creates the default permission error message.
|
|
63
63
|
*
|
|
64
|
-
* @param contextGrantedModelRoles -
|
|
65
|
-
* @param roles -
|
|
66
|
-
* @returns
|
|
64
|
+
* @param contextGrantedModelRoles - The granted model roles context to generate the message from.
|
|
65
|
+
* @param roles - The required role(s) that were not satisfied.
|
|
66
|
+
* @returns A human-readable permission error message string.
|
|
67
67
|
*/
|
|
68
68
|
export declare function contextGrantedModelRolesReaderPermissionErrorMessage(contextGrantedModelRoles: FirebaseContextGrantedModelRoles<FirebasePermissionErrorContext, unknown>, roles?: ArrayOrValue<GrantedRole>): string;
|
|
69
69
|
/**
|
|
70
70
|
* Creates the default does not exist error message.
|
|
71
71
|
*
|
|
72
|
-
* @param contextGrantedModelRoles -
|
|
73
|
-
* @returns
|
|
72
|
+
* @param contextGrantedModelRoles - The granted model roles context to generate the message from.
|
|
73
|
+
* @returns A human-readable does-not-exist error message string.
|
|
74
74
|
*/
|
|
75
75
|
export declare function contextGrantedModelRolesReaderDoesNotExistErrorMessage(contextGrantedModelRoles: FirebaseContextGrantedModelRoles<FirebasePermissionErrorContext, unknown>): string;
|
|
@@ -33,8 +33,8 @@ export type ModelStorageSlashPathFactory<T extends object = object> = (input: Re
|
|
|
33
33
|
*
|
|
34
34
|
* The generated paths follow the convention `/model/[basePath/]<modelKey>/[path]`.
|
|
35
35
|
*
|
|
36
|
-
* @param config -
|
|
37
|
-
* @returns
|
|
36
|
+
* @param config - Optional base path to nest under.
|
|
37
|
+
* @returns A {@link ModelStorageSlashPathFactory} that maps Firestore model keys to storage paths.
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* ```ts
|
|
@@ -42,6 +42,7 @@ export type ModelStorageSlashPathFactory<T extends object = object> = (input: Re
|
|
|
42
42
|
* const path = pathFactory(userDocument, 'profile.png');
|
|
43
43
|
* // path === '/model/avatars/users/abc123/profile.png'
|
|
44
44
|
* ```
|
|
45
|
+
*
|
|
45
46
|
* @__NO_SIDE_EFFECTS__
|
|
46
47
|
*/
|
|
47
48
|
export declare function modelStorageSlashPathFactory<T extends object = object>(config?: ModelStorageSlashPathFactoryConfig): ModelStorageSlashPathFactory<T>;
|
|
@@ -39,8 +39,8 @@ export interface FirebaseStorageContextFactoryConfig {
|
|
|
39
39
|
* The returned factory resolves a default bucket (from driver, config, or error) and builds
|
|
40
40
|
* a {@link StoragePathFactory} to normalize all path inputs.
|
|
41
41
|
*
|
|
42
|
-
* @param drivers -
|
|
43
|
-
* @returns
|
|
42
|
+
* @param drivers - The storage driver implementations to use.
|
|
43
|
+
* @returns A {@link FirebaseStorageContextFactory} that creates storage contexts for a given storage instance.
|
|
44
44
|
* @throws {Error} When a default bucket ID cannot be resolved from the driver or config.
|
|
45
45
|
*
|
|
46
46
|
* @example
|
|
@@ -49,6 +49,7 @@ export interface FirebaseStorageContextFactoryConfig {
|
|
|
49
49
|
* const storageContext = factory(firebaseStorage, { defaultBucketId: 'my-bucket' });
|
|
50
50
|
* const file = storageContext.file('uploads/doc.pdf');
|
|
51
51
|
* ```
|
|
52
|
+
*
|
|
52
53
|
* @__NO_SIDE_EFFECTS__
|
|
53
54
|
*/
|
|
54
55
|
export declare function firebaseStorageContextFactory<F extends FirebaseStorage = FirebaseStorage>(drivers: FirebaseStorageDrivers): FirebaseStorageContextFactory<F>;
|
|
@@ -24,13 +24,14 @@ export type IterateStorageListFilesFactory = FetchPageFactory<IterateStorageList
|
|
|
24
24
|
*
|
|
25
25
|
* Wraps the folder's `list()` API with cursor-based pagination via {@link fetchPageFactory}.
|
|
26
26
|
*
|
|
27
|
-
* @param config -
|
|
28
|
-
* @returns
|
|
27
|
+
* @param config - Default listing options (e.g., maxResults)
|
|
28
|
+
* @returns An {@link IterateStorageListFilesFactory} for paginated file listing.
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```ts
|
|
32
32
|
* const factory = iterateStorageListFilesFactory({ maxResults: 100 });
|
|
33
33
|
* ```
|
|
34
|
+
*
|
|
34
35
|
* @__NO_SIDE_EFFECTS__
|
|
35
36
|
*/
|
|
36
37
|
export declare function iterateStorageListFilesFactory(config: IterateStorageListFilesFactoryConfig): IterateStorageListFilesFactory;
|
|
@@ -44,8 +45,8 @@ export type IterateStorageListFilesByEachFileConfig<T, R> = Omit<IterateFetchPag
|
|
|
44
45
|
*
|
|
45
46
|
* Convenience wrapper around {@link iterateFetchPagesByEachItem} pre-configured for storage listing.
|
|
46
47
|
*
|
|
47
|
-
* @param input -
|
|
48
|
-
* @returns
|
|
48
|
+
* @param input - Iteration configuration including folder, listing options, and per-item callback.
|
|
49
|
+
* @returns The result of the paginated per-item iteration.
|
|
49
50
|
*/
|
|
50
51
|
export declare function iterateStorageListFilesByEachFile<T, R>(input: IterateStorageListFilesByEachFileConfig<T, R>): Promise<{
|
|
51
52
|
totalItemsLoaded: number;
|
|
@@ -63,7 +64,7 @@ export type IterateStorageListFilesConfig<R> = Omit<IterateFetchPagesConfigWithF
|
|
|
63
64
|
*
|
|
64
65
|
* Convenience wrapper around {@link iterateFetchPages} pre-configured for storage listing.
|
|
65
66
|
*
|
|
66
|
-
* @param input -
|
|
67
|
-
* @returns
|
|
67
|
+
* @param input - Iteration configuration including folder, listing options, and per-page callback.
|
|
68
|
+
* @returns The result of the paginated page-level iteration.
|
|
68
69
|
*/
|
|
69
70
|
export declare function iterateStorageListFiles<R>(input: IterateStorageListFilesConfig<R>): Promise<import("@dereekb/util/fetch").IterateFetchPagesResult>;
|
|
@@ -6,10 +6,10 @@ import { type FirebaseStorageAccessorFile } from './accessor';
|
|
|
6
6
|
*
|
|
7
7
|
* This is a server-side convenience — most client implementations don't support `uploadStream()`.
|
|
8
8
|
*
|
|
9
|
-
* @param file -
|
|
10
|
-
* @param readableStream -
|
|
11
|
-
* @param options -
|
|
12
|
-
* @returns
|
|
9
|
+
* @param file - Destination file accessor for the upload.
|
|
10
|
+
* @param readableStream - Source stream piped into the upload.
|
|
11
|
+
* @param options - Overrides for content type, metadata, etc., if any.
|
|
12
|
+
* @returns Resolves once the upload stream has finished.
|
|
13
13
|
* @throws {StorageFileUploadStreamUnsupportedError} When the file accessor does not support stream uploads.
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
@@ -5,15 +5,15 @@ import { BaseError } from 'make-error';
|
|
|
5
5
|
*
|
|
6
6
|
* Required when the upload input is a string, since the format (raw, base64, etc.) must be explicit.
|
|
7
7
|
*
|
|
8
|
-
* @param options -
|
|
9
|
-
* @returns
|
|
8
|
+
* @param options - The upload options to extract from.
|
|
9
|
+
* @returns The {@link StorageDataStringType} extracted from the options.
|
|
10
10
|
* @throws {Error} When `stringFormat` is not set in the options.
|
|
11
11
|
*/
|
|
12
12
|
export declare function assertStorageUploadOptionsStringFormat(options?: StorageUploadOptions): StorageDataStringType;
|
|
13
13
|
/**
|
|
14
14
|
* Creates an error indicating that `stringFormat` was missing from upload options.
|
|
15
15
|
*
|
|
16
|
-
* @returns
|
|
16
|
+
* @returns An {@link Error} describing the missing `stringFormat` in upload options.
|
|
17
17
|
*/
|
|
18
18
|
export declare function noStringFormatInStorageUploadOptionsError(): Error;
|
|
19
19
|
/**
|
|
@@ -41,8 +41,8 @@ export type StorageListFilesResultFactory<S, R> = (input: StorageListFilesResult
|
|
|
41
41
|
* The returned factory lazily computes file and folder arrays (via {@link cachedGetter}) and
|
|
42
42
|
* provides cursor-based pagination through the `next()` method.
|
|
43
43
|
*
|
|
44
|
-
* @param delegate -
|
|
45
|
-
* @returns
|
|
44
|
+
* @param delegate - Platform-specific implementation for extracting results.
|
|
45
|
+
* @returns A {@link StorageListFilesResultFactory} that normalizes raw SDK list results.
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
48
|
* ```ts
|
|
@@ -50,12 +50,13 @@ export type StorageListFilesResultFactory<S, R> = (input: StorageListFilesResult
|
|
|
50
50
|
* const result = factory({ storage, folder, options: { maxResults: 50 } }, rawSdkResult);
|
|
51
51
|
* const files = result.files();
|
|
52
52
|
* ```
|
|
53
|
+
*
|
|
53
54
|
* @__NO_SIDE_EFFECTS__
|
|
54
55
|
*/
|
|
55
56
|
export declare function storageListFilesResultFactory<S, R>(delegate: StorageListFilesResultFactoryDelegate<S, R>): StorageListFilesResultFactory<S, R>;
|
|
56
57
|
/**
|
|
57
58
|
* Creates an error thrown when `next()` is called on a list result that has no more pages.
|
|
58
59
|
*
|
|
59
|
-
* @returns
|
|
60
|
+
* @returns An {@link Error} indicating there are no more pages to fetch.
|
|
60
61
|
*/
|
|
61
62
|
export declare function storageListFilesResultHasNoNextError(): Error;
|
|
@@ -45,8 +45,8 @@ export interface StoragePath extends StorageBucketIdRef, StorageSlashPathRef {
|
|
|
45
45
|
*
|
|
46
46
|
* Useful when you need an independent reference that won't be affected by mutations to the original.
|
|
47
47
|
*
|
|
48
|
-
* @param path -
|
|
49
|
-
* @returns
|
|
48
|
+
* @param path - The storage path to copy.
|
|
49
|
+
* @returns A new {@link StoragePath} with the same `bucketId` and `pathString`
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
* ```ts
|
|
@@ -79,8 +79,8 @@ export interface StoragePathFactoryConfig extends StorageBucketIdRef {
|
|
|
79
79
|
* Creates a {@link StoragePathFactory} that normalizes various path inputs into {@link StoragePath} objects
|
|
80
80
|
* with a consistent bucket assignment.
|
|
81
81
|
*
|
|
82
|
-
* @param config -
|
|
83
|
-
* @returns
|
|
82
|
+
* @param config - Bucket and replacement behavior.
|
|
83
|
+
* @returns A {@link StoragePathFactory} that normalizes path inputs with the configured bucket.
|
|
84
84
|
*
|
|
85
85
|
* @example
|
|
86
86
|
* ```ts
|
|
@@ -88,6 +88,7 @@ export interface StoragePathFactoryConfig extends StorageBucketIdRef {
|
|
|
88
88
|
* const path = pathFactory('images/photo.png');
|
|
89
89
|
* // path === { bucketId: 'my-bucket', pathString: 'images/photo.png' }
|
|
90
90
|
* ```
|
|
91
|
+
*
|
|
91
92
|
* @__NO_SIDE_EFFECTS__
|
|
92
93
|
*/
|
|
93
94
|
export declare function storagePathFactory(config: StoragePathFactoryConfig): StoragePathFactory;
|
|
@@ -119,8 +120,8 @@ export type GoogleCloudStorageFilePath<P extends StorageSlashPath = StorageSlash
|
|
|
119
120
|
* If the path has a bucketId, produces a `gs://bucket/path` URI. Otherwise, returns just the relative path
|
|
120
121
|
* (implying the default bucket).
|
|
121
122
|
*
|
|
122
|
-
* @param path -
|
|
123
|
-
* @returns
|
|
123
|
+
* @param path - The storage path to convert.
|
|
124
|
+
* @returns A {@link GoogleCloudStorageFilePath} string (`gs://bucket/path` or a relative path)
|
|
124
125
|
*
|
|
125
126
|
* @example
|
|
126
127
|
* ```ts
|
|
@@ -132,8 +133,8 @@ export declare function firebaseStorageFilePathFromStorageFilePath(path: Storage
|
|
|
132
133
|
/**
|
|
133
134
|
* Returns the `gs://` bucket prefix URI for the given bucket identifier or ref.
|
|
134
135
|
*
|
|
135
|
-
* @param storage -
|
|
136
|
-
* @returns
|
|
136
|
+
* @param storage - Bucket ID string or a {@link StorageBucketIdRef}
|
|
137
|
+
* @returns The `gs://bucket` prefix URI as a {@link GoogleCloudStorageBucketPrefix}
|
|
137
138
|
*
|
|
138
139
|
* @example
|
|
139
140
|
* ```ts
|
|
@@ -362,7 +362,7 @@ export interface StorageMetadata extends ConfigurableStorageMetadata {
|
|
|
362
362
|
* Additional user-defined custom metadata.
|
|
363
363
|
*/
|
|
364
364
|
export type StorageCustomMetadata = {
|
|
365
|
-
readonly [key: string]: string
|
|
365
|
+
readonly [key: string]: Maybe<string>;
|
|
366
366
|
};
|
|
367
367
|
export interface StorageDeleteFileOptions {
|
|
368
368
|
/**
|
|
@@ -303,7 +303,7 @@ export interface CleanupOldNotificationLoggedEventDaysResult {
|
|
|
303
303
|
* Custom (non-CRUD) function type map for notifications. Currently empty — all operations use the CRUD pattern.
|
|
304
304
|
*/
|
|
305
305
|
export type NotificationFunctionTypeMap = {};
|
|
306
|
-
export declare const
|
|
306
|
+
export declare const NOTIFICATION_FUNCTION_TYPE_CONFIG_MAP: FirebaseFunctionTypeConfigMap<NotificationFunctionTypeMap>;
|
|
307
307
|
export type NotificationBoxModelCrudFunctionsConfig = {
|
|
308
308
|
readonly notificationUser: {
|
|
309
309
|
update: {
|
|
@@ -331,7 +331,7 @@ export type NotificationBoxModelCrudFunctionsConfig = {
|
|
|
331
331
|
readonly notificationLoggedEventDay: null;
|
|
332
332
|
readonly notificationLoggedEventDayPage: null;
|
|
333
333
|
};
|
|
334
|
-
export declare const
|
|
334
|
+
export declare const NOTIFICATION_BOX_MODEL_CRUD_FUNCTIONS_CONFIG: ModelFirebaseCrudFunctionConfigMap<NotificationBoxModelCrudFunctionsConfig, NotificationTypes>;
|
|
335
335
|
/**
|
|
336
336
|
* Abstract client-callable function map for notification CRUD operations.
|
|
337
337
|
*
|