@dereekb/firebase-server 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.
Files changed (102) hide show
  1. package/index.cjs.js +229 -199
  2. package/index.esm.js +230 -200
  3. package/mailgun/package.json +9 -9
  4. package/model/index.cjs.js +259 -270
  5. package/model/index.esm.js +259 -270
  6. package/model/package.json +9 -9
  7. package/model/src/lib/mailgun/notification.send.service.mailgun.d.ts +3 -3
  8. package/model/src/lib/notification/notification.action.server.d.ts +34 -34
  9. package/model/src/lib/notification/notification.action.server.init.d.ts +17 -17
  10. package/model/src/lib/notification/notification.config.service.d.ts +7 -7
  11. package/model/src/lib/notification/notification.create.run.d.ts +3 -3
  12. package/model/src/lib/notification/notification.error.d.ts +14 -14
  13. package/model/src/lib/notification/notification.expedite.service.d.ts +7 -7
  14. package/model/src/lib/notification/notification.module.d.ts +13 -13
  15. package/model/src/lib/notification/notification.send.service.notificationsummary.d.ts +2 -2
  16. package/model/src/lib/notification/notification.send.service.text.d.ts +1 -1
  17. package/model/src/lib/notification/notification.task.service.handler.d.ts +2 -2
  18. package/model/src/lib/notification/notification.task.service.util.d.ts +3 -3
  19. package/model/src/lib/notification/notification.task.subtask.handler.d.ts +3 -3
  20. package/model/src/lib/notification/notification.util.d.ts +8 -8
  21. package/model/src/lib/storagefile/storagefile.action.server.d.ts +43 -44
  22. package/model/src/lib/storagefile/storagefile.action.server.init.d.ts +11 -11
  23. package/model/src/lib/storagefile/storagefile.error.d.ts +15 -15
  24. package/model/src/lib/storagefile/storagefile.module.d.ts +10 -10
  25. package/model/src/lib/storagefile/storagefile.task.service.handler.d.ts +6 -6
  26. package/model/src/lib/storagefile/storagefile.upload.service.initializer.d.ts +5 -5
  27. package/model/src/lib/storagefile/storagefile.util.d.ts +2 -2
  28. package/oidc/index.cjs.js +225 -219
  29. package/oidc/index.esm.js +225 -219
  30. package/oidc/package.json +10 -10
  31. package/oidc/src/lib/controller/oidc.interaction.controller.d.ts +44 -25
  32. package/oidc/src/lib/controller/oidc.provider.controller.d.ts +1 -1
  33. package/oidc/src/lib/controller/oidc.wellknown.controller.d.ts +3 -3
  34. package/oidc/src/lib/middleware/oauth-cors.module.d.ts +1 -1
  35. package/oidc/src/lib/model/jwks/jwks.d.ts +6 -6
  36. package/oidc/src/lib/model/jwks/jwks.query.d.ts +11 -5
  37. package/oidc/src/lib/model/oidc/oidcmodel.action.server.d.ts +12 -12
  38. package/oidc/src/lib/model/oidc/oidcmodel.module.d.ts +5 -5
  39. package/oidc/src/lib/oidc.config.d.ts +1 -1
  40. package/oidc/src/lib/oidc.module.d.ts +8 -8
  41. package/oidc/src/lib/service/oidc.account.service.d.ts +4 -4
  42. package/oidc/src/lib/service/oidc.adapter.service.d.ts +4 -4
  43. package/oidc/src/lib/service/oidc.client.service.d.ts +3 -3
  44. package/oidc/src/lib/service/oidc.config.service.d.ts +1 -1
  45. package/oidc/src/lib/service/oidc.encryption.service.d.ts +4 -4
  46. package/oidc/src/lib/service/oidc.interaction.service.d.ts +14 -14
  47. package/oidc/src/lib/service/oidc.jwks.service.d.ts +6 -6
  48. package/oidc/src/lib/service/oidc.service.d.ts +5 -5
  49. package/package.json +10 -10
  50. package/src/lib/auth/auth.service.d.ts +8 -8
  51. package/src/lib/auth/auth.util.d.ts +1 -1
  52. package/src/lib/env/env.config.d.ts +5 -4
  53. package/src/lib/firestore/driver.accessor.batch.d.ts +2 -1
  54. package/src/lib/firestore/driver.accessor.d.ts +1 -1
  55. package/src/lib/firestore/driver.accessor.default.d.ts +2 -1
  56. package/src/lib/firestore/driver.accessor.transaction.d.ts +2 -1
  57. package/src/lib/firestore/snapshot/snapshot.field.encrypt.d.ts +10 -6
  58. package/src/lib/function/type.d.ts +4 -4
  59. package/src/lib/nest/analytics/analytics.module.d.ts +6 -5
  60. package/src/lib/nest/app.d.ts +4 -4
  61. package/src/lib/nest/app.module.d.ts +3 -2
  62. package/src/lib/nest/auth/auth.module.d.ts +4 -3
  63. package/src/lib/nest/controller/model/model.api.controller.d.ts +1 -0
  64. package/src/lib/nest/controller/model/model.api.get.service.d.ts +1 -1
  65. package/src/lib/nest/controller/model/model.api.module.d.ts +4 -3
  66. package/src/lib/nest/development/development.function.d.ts +1 -1
  67. package/src/lib/nest/development/development.schedule.function.error.d.ts +2 -2
  68. package/src/lib/nest/env/env.util.d.ts +2 -2
  69. package/src/lib/nest/firestore/firestore.module.d.ts +16 -15
  70. package/src/lib/nest/function/call.d.ts +6 -6
  71. package/src/lib/nest/function/context.d.ts +7 -6
  72. package/src/lib/nest/function/v2/blocking.d.ts +8 -6
  73. package/src/lib/nest/function/v2/call.d.ts +7 -5
  74. package/src/lib/nest/function/v2/event.d.ts +3 -2
  75. package/src/lib/nest/function/v2/schedule.d.ts +3 -2
  76. package/src/lib/nest/function/v2/taskqueue.d.ts +2 -1
  77. package/src/lib/nest/model/analytics.emit.d.ts +5 -5
  78. package/src/lib/nest/model/api.details.d.ts +4 -4
  79. package/src/lib/nest/model/query.model.function.d.ts +3 -3
  80. package/src/lib/nest/nest.provider.d.ts +7 -7
  81. package/src/lib/nest/storage/storage.module.d.ts +6 -5
  82. package/src/lib/storage/driver.accessor.d.ts +10 -10
  83. package/test/index.cjs.js +48 -57
  84. package/test/index.esm.js +48 -57
  85. package/test/package.json +11 -11
  86. package/test/src/lib/firebase/firebase.admin.auth.d.ts +18 -18
  87. package/test/src/lib/firebase/firebase.admin.collection.d.ts +7 -7
  88. package/test/src/lib/firebase/firebase.admin.d.ts +2 -2
  89. package/test/src/lib/firebase/firebase.admin.function.d.ts +2 -2
  90. package/test/src/lib/firebase/firebase.admin.nest.function.callable.context.d.ts +1 -1
  91. package/test/src/lib/firebase/firebase.admin.nest.function.cloud.context.d.ts +3 -3
  92. package/test/src/lib/firebase/firebase.d.ts +6 -5
  93. package/test/src/lib/firebase/firebase.function.d.ts +31 -31
  94. package/test/src/lib/firestore/firestore.d.ts +2 -2
  95. package/test/src/lib/oidc/oidc.test.fixture.d.ts +1 -1
  96. package/test/src/lib/oidc/oidc.test.flow.d.ts +1 -1
  97. package/test/src/lib/storage/storage.d.ts +2 -2
  98. package/zoho/index.cjs.js +2 -2
  99. package/zoho/index.esm.js +2 -2
  100. package/zoho/package.json +9 -9
  101. package/zoho/src/lib/zoho.accounts.firebase.d.ts +1 -1
  102. package/zoho/src/lib/zoho.accounts.firebase.system.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/firebase-server",
3
- "version": "13.11.14",
3
+ "version": "13.11.16",
4
4
  "sideEffects": false,
5
5
  "exports": {
6
6
  "./test": {
@@ -44,15 +44,15 @@
44
44
  "main": "./index.cjs.js",
45
45
  "types": "./src/index.d.ts",
46
46
  "peerDependencies": {
47
- "@dereekb/analytics": "13.11.14",
48
- "@dereekb/date": "13.11.14",
49
- "@dereekb/dbx-core": "13.11.14",
50
- "@dereekb/firebase": "13.11.14",
51
- "@dereekb/model": "13.11.14",
52
- "@dereekb/nestjs": "13.11.14",
53
- "@dereekb/rxjs": "13.11.14",
54
- "@dereekb/util": "13.11.14",
55
- "@dereekb/zoho": "13.11.14",
47
+ "@dereekb/analytics": "13.11.16",
48
+ "@dereekb/date": "13.11.16",
49
+ "@dereekb/dbx-core": "13.11.16",
50
+ "@dereekb/firebase": "13.11.16",
51
+ "@dereekb/model": "13.11.16",
52
+ "@dereekb/nestjs": "13.11.16",
53
+ "@dereekb/rxjs": "13.11.16",
54
+ "@dereekb/util": "13.11.16",
55
+ "@dereekb/zoho": "13.11.16",
56
56
  "@google-cloud/firestore": "^7.11.6",
57
57
  "@google-cloud/storage": "^7.19.0",
58
58
  "@nestjs/common": "^11.1.19",
@@ -56,13 +56,13 @@ export interface FirebaseServerAuthUserContext extends FirebaseServerAuthUserIde
56
56
  /**
57
57
  * Loads the full Firebase Auth {@link admin.auth.UserRecord} for this user.
58
58
  *
59
- * @throws Throws if the user does not exist.
59
+ * @throws {Error} Throws if the user does not exist.
60
60
  */
61
61
  loadRecord(): Promise<admin.auth.UserRecord>;
62
62
  /**
63
63
  * Loads a normalized {@link FirebaseAuthDetails} snapshot of the user's auth profile.
64
64
  *
65
- * @throws Throws if the user does not exist.
65
+ * @throws {Error} Throws if the user does not exist.
66
66
  */
67
67
  loadDetails(): Promise<FirebaseAuthDetails>;
68
68
  /**
@@ -124,7 +124,7 @@ export interface FirebaseServerAuthUserContext extends FirebaseServerAuthUserIde
124
124
  /**
125
125
  * Loads the user's raw custom claims object from their Firebase Auth record.
126
126
  *
127
- * @throws Throws if the user does not exist.
127
+ * @throws {Error} Throws if the user does not exist.
128
128
  */
129
129
  loadClaims<T extends AuthClaimsObject = AuthClaimsObject>(): Promise<AuthClaims<T>>;
130
130
  /**
@@ -218,7 +218,7 @@ export declare abstract class AbstractFirebaseServerAuthUserContext<S extends Fi
218
218
  loadClaims<T extends AuthClaimsObject = AuthClaimsObject>(): Promise<AuthClaims<T>>;
219
219
  updateClaims<T extends AuthClaimsObject = AuthClaimsObject>(claims: AuthClaimsUpdate<T>): Promise<void>;
220
220
  clearClaims(): Promise<void>;
221
- setClaims<T extends AuthClaimsObject = AuthClaimsObject>(claims: AuthClaimsUpdate<T> | null): Promise<void>;
221
+ setClaims<T extends AuthClaimsObject = AuthClaimsObject>(claims: Maybe<AuthClaimsUpdate<T>>): Promise<void>;
222
222
  }
223
223
  /**
224
224
  * Read-only auth context derived from a Firebase callable function request.
@@ -436,7 +436,7 @@ export interface FirebaseServerNewUserService<D = unknown, U extends FirebaseSer
436
436
  * when explicitly requested via the input flags.
437
437
  *
438
438
  * @param input - Configuration for the new user and setup content delivery.
439
- * @throws Throws if neither email, phone, nor uid is provided.
439
+ * @throws {Error} Throws if neither email, phone, nor uid is provided.
440
440
  */
441
441
  initializeNewUser(input: FirebaseServerAuthInitializeNewUser<D>): Promise<admin.auth.UserRecord>;
442
442
  /**
@@ -556,7 +556,7 @@ export declare abstract class AbstractFirebaseServerNewUserService<U extends Fir
556
556
  *
557
557
  * @param input - The initialization configuration for the new user.
558
558
  * @returns The created user record and the setup password used.
559
- * @throws Throws if the Firebase Admin SDK rejects the user creation.
559
+ * @throws {Error} Throws if the Firebase Admin SDK rejects the user creation.
560
560
  */
561
561
  protected createNewUser(input: FirebaseServerAuthInitializeNewUser<D>): Promise<FirebaseServerAuthCreateNewUserResult>;
562
562
  protected generateRandomSetupPassword(): FirebaseAuthSetupPassword;
@@ -707,7 +707,7 @@ export interface FirebaseServerUserPasswordResetService<D = unknown, U extends F
707
707
  * may throw the same errors (throttle, send-once, no-config) depending on the configuration.
708
708
  *
709
709
  * @param input - Configuration for the reset, including user identification and send options.
710
- * @throws Throws if neither uid nor email is provided.
710
+ * @throws {Error} Throws if neither uid nor email is provided.
711
711
  * @throws {FirebaseServerAuthPasswordResetThrottleError} When send is throttled and `sendResetThrowErrors` is true.
712
712
  * @throws {FirebaseServerAuthPasswordResetSendOnceError} When already sent and `sendResetDetailsOnce` + `sendResetThrowErrors` are true.
713
713
  * @throws {FirebaseServerAuthPasswordResetNoResetConfigError} When no reset claims exist and `sendResetThrowErrors` is true.
@@ -848,7 +848,7 @@ export declare abstract class FirebaseServerAuthService<U extends FirebaseServer
848
848
  * Asserts that the request contains valid auth data (a UID is present).
849
849
  *
850
850
  * @param context - The callable function context from a Firebase function invocation.
851
- * @throws Throws if the context does not contain authenticated user data.
851
+ * @throws {Error} Throws if the context does not contain authenticated user data.
852
852
  */
853
853
  abstract context(context: CallableContext): C;
854
854
  /**
@@ -6,7 +6,7 @@ import type * as admin from 'firebase-admin';
6
6
  *
7
7
  * Any error other than {@link FIREBASE_AUTH_USER_NOT_FOUND_ERROR} is re-thrown.
8
8
  *
9
- * @param promise - A promise resolving to a UserRecord (e.g., from `auth.getUser(uid)`).
9
+ * @param promise - Promise resolving to a UserRecord (e.g., from `auth.getUser(uid)`).
10
10
  * @returns The user record, or `undefined` if the user does not exist.
11
11
  *
12
12
  * @example
@@ -50,14 +50,15 @@ export declare function firebaseServerEnvTokenProvider<T extends FirebaseServerE
50
50
  * Use this when the NestJS app needs the config accessible via either token.
51
51
  *
52
52
  * @param env - The Firebase server environment configuration.
53
- * @returns An array of providers binding the config to both Firebase and base server env tokens.
53
+ * @returns The providers binding the config to both Firebase and base server env tokens.
54
54
  *
55
- * @example
56
- * ```typescript
57
- * @Module({
55
+ * @Module ({
58
56
  * providers: [...firebaseServerEnvTokenProviders(myEnvConfig)]
59
57
  * })
60
58
  * export class AppModule {}
61
59
  * ```
60
+ *
61
+ * @example
62
+ * ```typescript
62
63
  */
63
64
  export declare function firebaseServerEnvTokenProviders<T extends FirebaseServerEnvironmentConfig = FirebaseServerEnvironmentConfig>(env: T): Provider[];
@@ -1,4 +1,5 @@
1
1
  import { type DocumentReference, type WriteBatch as GoogleCloudWriteBatch, type DocumentSnapshot } from '@google-cloud/firestore';
2
+ import type { Maybe } from '@dereekb/util';
2
3
  import { type Observable } from 'rxjs';
3
4
  import { type WithFieldValue, type FirestoreDocumentContext, FirestoreDocumentContextType, type FirestoreDocumentDataAccessor, type FirestoreDocumentDataAccessorFactory, type FirestoreDocumentDeleteParams, type FirestoreDocumentUpdateParams, type UpdateData, type DocumentData, type FirestoreDataConverter, type FirestoreAccessorIncrementUpdate, type FirestoreAccessorArrayUpdate } from '@dereekb/firebase';
4
5
  /**
@@ -17,7 +18,7 @@ export declare class WriteBatchFirestoreDocumentDataAccessor<T> implements Fires
17
18
  create(data: WithFieldValue<T>): Promise<void>;
18
19
  exists(): Promise<boolean>;
19
20
  get(): Promise<DocumentSnapshot<T>>;
20
- getWithConverter<U = DocumentData>(converter: null | FirestoreDataConverter<U>): Promise<DocumentSnapshot<U>>;
21
+ getWithConverter<U = DocumentData>(converter: Maybe<FirestoreDataConverter<U>>): Promise<DocumentSnapshot<U>>;
21
22
  delete(params?: FirestoreDocumentDeleteParams): Promise<void>;
22
23
  set(data: WithFieldValue<T>): Promise<void>;
23
24
  increment(data: FirestoreAccessorIncrementUpdate<T>, params?: FirestoreDocumentUpdateParams): Promise<void>;
@@ -14,7 +14,7 @@ interface CollectionRefForPathInput {
14
14
  * @param path - The initial collection path.
15
15
  * @param pathSegments - Optional pairs of [docId, collectionName] for subcollection traversal.
16
16
  * @returns The resolved {@link CollectionReference} at the given path.
17
- * @throws Error if pathSegments length is odd (segments must come in pairs).
17
+ * @throws {Error} If pathSegments length is odd (segments must come in pairs).
18
18
  *
19
19
  * @example
20
20
  * ```typescript
@@ -1,4 +1,5 @@
1
1
  import { type DocumentReference, type WriteResult as GoogleCloudWriteResult, type DocumentSnapshot } from '@google-cloud/firestore';
2
+ import type { Maybe } from '@dereekb/util';
2
3
  import { type Observable } from 'rxjs';
3
4
  import { type WithFieldValue, type UpdateData, type FirestoreDocumentContext, type FirestoreDocumentDataAccessor, type FirestoreDocumentDataAccessorFactory, type FirestoreDocumentDeleteParams, type FirestoreDocumentUpdateParams, type SetOptions, type FirestoreDataConverter, type DocumentData, type FirestoreAccessorIncrementUpdate, type FirestoreAccessorArrayUpdate } from '@dereekb/firebase';
4
5
  /**
@@ -15,7 +16,7 @@ export declare class DefaultFirestoreDocumentDataAccessor<T> implements Firestor
15
16
  create(data: T): Promise<GoogleCloudWriteResult>;
16
17
  exists(): Promise<boolean>;
17
18
  get(): Promise<DocumentSnapshot<T>>;
18
- getWithConverter<U = DocumentData>(converter: null | FirestoreDataConverter<U>): Promise<DocumentSnapshot<U>>;
19
+ getWithConverter<U = DocumentData>(converter: Maybe<FirestoreDataConverter<U>>): Promise<DocumentSnapshot<U>>;
19
20
  delete(params?: FirestoreDocumentDeleteParams): Promise<GoogleCloudWriteResult>;
20
21
  set(data: WithFieldValue<T>, options?: SetOptions): Promise<GoogleCloudWriteResult>;
21
22
  increment(data: FirestoreAccessorIncrementUpdate<T>, params?: FirestoreDocumentUpdateParams): Promise<GoogleCloudWriteResult>;
@@ -1,4 +1,5 @@
1
1
  import { type DocumentReference, type DocumentSnapshot, type Transaction as GoogleCloudTransaction, type SetOptions } from '@google-cloud/firestore';
2
+ import type { Maybe } from '@dereekb/util';
2
3
  import { type Observable } from 'rxjs';
3
4
  import { type WithFieldValue, type UpdateData, type FirestoreDocumentDataAccessor, type FirestoreDocumentDataAccessorFactory, type FirestoreDocumentContext, FirestoreDocumentContextType, type FirestoreDocumentUpdateParams, type FirestoreDataConverter, type DocumentData, type FirestoreAccessorIncrementUpdate, type FirestoreAccessorArrayUpdate } from '@dereekb/firebase';
4
5
  /**
@@ -18,7 +19,7 @@ export declare class TransactionFirestoreDocumentDataAccessor<T> implements Fire
18
19
  create(data: WithFieldValue<T>): Promise<void>;
19
20
  exists(): Promise<boolean>;
20
21
  get(): Promise<DocumentSnapshot<T>>;
21
- getWithConverter<U = DocumentData>(converter: null | FirestoreDataConverter<U>): Promise<DocumentSnapshot<U>>;
22
+ getWithConverter<U = DocumentData>(converter: Maybe<FirestoreDataConverter<U>>): Promise<DocumentSnapshot<U>>;
22
23
  delete(): Promise<void>;
23
24
  set(data: WithFieldValue<T>, options?: SetOptions): Promise<void>;
24
25
  increment(data: FirestoreAccessorIncrementUpdate<T>, params?: FirestoreDocumentUpdateParams): Promise<void>;
@@ -33,6 +33,11 @@ export interface OptionalFirestoreEncryptedFieldConfig<T> {
33
33
  * The encryption key is resolved from the configured secret source on each read/write,
34
34
  * allowing for key rotation via environment variable changes.
35
35
  *
36
+ * @param config - Encryption field configuration.
37
+ * @returns A field mapping configuration for encrypted values.
38
+ *
39
+ * @template T - The JSON-serializable value type.
40
+ *
36
41
  * @example
37
42
  * ```typescript
38
43
  * const jwksField = firestoreEncryptedField<JWKSet>({
@@ -41,9 +46,6 @@ export interface OptionalFirestoreEncryptedFieldConfig<T> {
41
46
  * });
42
47
  * ```
43
48
  *
44
- * @template T - The JSON-serializable value type.
45
- * @param config - Encryption field configuration.
46
- * @returns A field mapping configuration for encrypted values.
47
49
  * @__NO_SIDE_EFFECTS__
48
50
  */
49
51
  export declare function firestoreEncryptedField<T>(config: FirestoreEncryptedFieldConfig<T>): FirestoreModelFieldMapFunctionsConfig<T, string>;
@@ -53,6 +55,11 @@ export declare function firestoreEncryptedField<T>(config: FirestoreEncryptedFie
53
55
  * When the value is null/undefined, it is stored/read as null. When present, it is
54
56
  * encrypted/decrypted using AES-256-GCM.
55
57
  *
58
+ * @param config - Encryption field configuration.
59
+ * @returns A field mapping configuration for optional encrypted values.
60
+ *
61
+ * @template T - The JSON-serializable value type.
62
+ *
56
63
  * @example
57
64
  * ```typescript
58
65
  * const optionalSecretField = optionalFirestoreEncryptedField<OAuthClientSecret>({
@@ -60,9 +67,6 @@ export declare function firestoreEncryptedField<T>(config: FirestoreEncryptedFie
60
67
  * });
61
68
  * ```
62
69
  *
63
- * @template T - The JSON-serializable value type.
64
- * @param config - Encryption field configuration.
65
- * @returns A field mapping configuration for optional encrypted values.
66
70
  * @__NO_SIDE_EFFECTS__
67
71
  */
68
72
  export declare function optionalFirestoreEncryptedField<T>(config: OptionalFirestoreEncryptedFieldConfig<T>): FirestoreModelFieldMapFunctionsConfig<Maybe<T>, Maybe<string>>;
@@ -1,6 +1,10 @@
1
1
  import { type PromiseOrValue } from '@dereekb/util';
2
2
  import { type Runnable, type HttpsFunction } from 'firebase-functions/v1';
3
3
  import { type CallableFunction } from 'firebase-functions/v2/https';
4
+ /**
5
+ * Firebase Functions V2 - CallableFunction with output as an optional type.
6
+ */
7
+ export type CallableHttpFunction<I, O = unknown> = CallableFunction<I, PromiseOrValue<O>>;
4
8
  /**
5
9
  * Firebase Functions V1 - Union of firebase-functions HttpsFunction and Runnable.
6
10
  *
@@ -9,7 +13,3 @@ import { type CallableFunction } from 'firebase-functions/v2/https';
9
13
  * @see CallableHttpFunction
10
14
  */
11
15
  export type RunnableHttpFunction<I> = HttpsFunction & Runnable<I>;
12
- /**
13
- * Firebase Functions V2 - CallableFunction with output as an optional type.
14
- */
15
- export type CallableHttpFunction<I, O = unknown> = CallableFunction<I, PromiseOrValue<O>>;
@@ -24,15 +24,16 @@ export interface ProvideAppAnalyticsMetadataConfig extends Pick<ModuleMetadata,
24
24
  * Provides {@link FirebaseServerAnalyticsService} and registers it as the
25
25
  * {@link ON_CALL_MODEL_ANALYTICS_SERVICE} token for the onCall dispatch chain.
26
26
  *
27
- * @param config - the configuration including an optional dependency module and additional providers
28
- * @returns module metadata ready for use with `@Module()`
27
+ * @param config - The configuration including an optional dependency module and additional providers.
28
+ * @returns Module metadata ready for use with `@Module()`
29
29
  *
30
- * @example
31
- * ```ts
32
- * @Module(appAnalyticsModuleMetadata({
30
+ * @Module (appAnalyticsModuleMetadata({
33
31
  * dependencyModule: FirebaseServerAnalyticsSegmentModule
34
32
  * }))
35
33
  * export class AppAnalyticsModule {}
36
34
  * ```
35
+ *
36
+ * @example
37
+ * ```ts
37
38
  */
38
39
  export declare function appAnalyticsModuleMetadata(config: ProvideAppAnalyticsMetadataConfig): ModuleMetadata;
@@ -73,10 +73,6 @@ export interface NestServerInstanceConfig<T> extends Omit<NestServerRootModuleCo
73
73
  export interface NestFirebaseServerEnvironmentConfig {
74
74
  readonly environment: FirebaseServerEnvironmentConfig;
75
75
  }
76
- /**
77
- * @deprecated Use NestFirebaseServerEnvironmentConfig instead.
78
- */
79
- export type NestServerEnvironmentConfig = NestFirebaseServerEnvironmentConfig;
80
76
  /**
81
77
  * Creates a {@link NestServerInstance} that manages NestJS server lifecycle within Firebase Cloud Functions.
82
78
  *
@@ -94,3 +90,7 @@ export type NestServerEnvironmentConfig = NestFirebaseServerEnvironmentConfig;
94
90
  * ```
95
91
  */
96
92
  export declare function nestServerInstance<T>(config: NestServerInstanceConfig<T>): NestServerInstance<T>;
93
+ /**
94
+ * @deprecated Use NestFirebaseServerEnvironmentConfig instead.
95
+ */
96
+ export type NestServerEnvironmentConfig = NestFirebaseServerEnvironmentConfig;
@@ -119,8 +119,9 @@ export interface NestServerRootModuleResult {
119
119
  * - `GlobalRoutePrefixConfig` token
120
120
  * - Optional webhook and AppCheck middleware modules
121
121
  *
122
- * @param config - Shared configuration
123
- * @returns The root module and resolved prefix config
122
+ * @param config - Shared configuration.
123
+ * @returns The root module and resolved prefix config.
124
+ *
124
125
  * @__NO_SIDE_EFFECTS__
125
126
  */
126
127
  export declare function buildNestServerRootModule(config: NestServerRootModuleConfig): NestServerRootModuleResult;
@@ -51,12 +51,13 @@ export interface FirebaseServerAuthModuleMetadataConfig<T extends FirebaseServer
51
51
  * @param config - The module metadata configuration including the service provider.
52
52
  * @returns The merged NestJS module metadata.
53
53
  *
54
- * @example
55
- * ```typescript
56
- * @Module(firebaseServerAuthModuleMetadata({
54
+ * @Module (firebaseServerAuthModuleMetadata({
57
55
  * serviceProvider: { provide: MyAuthService, useFactory: (auth) => new MyAuthService(auth) }
58
56
  * }))
59
57
  * export class AppAuthModule {}
60
58
  * ```
59
+ *
60
+ * @example
61
+ * ```typescript
61
62
  */
62
63
  export declare function firebaseServerAuthModuleMetadata<T extends FirebaseServerAuthService>(config: FirebaseServerAuthModuleMetadataConfig<T>): ModuleMetadata;
@@ -85,6 +85,7 @@ export declare class ModelApiController {
85
85
  *
86
86
  * @param req - The Express request containing wildcard path params.
87
87
  * @returns Parsed path components with modelType, call, and specifier (defaults to '_').
88
+ * @throws {HttpException} `400 BAD_REQUEST` when `modelType` or `call` is missing from the path.
88
89
  */
89
90
  private _parsePath;
90
91
  private _dispatch;
@@ -46,7 +46,7 @@ export declare class ModelApiGetService {
46
46
  * @param key - The full Firestore model key (e.g., 'pr/abc123').
47
47
  * @param auth - The authenticated user's auth data from the request.
48
48
  * @returns The document key and data.
49
- * @throws Permission or not-found errors from useModel.
49
+ * @throws {Error} Permission or not-found errors from useModel.
50
50
  */
51
51
  readDocument(modelType: FirestoreModelType, key: FirestoreModelKey, auth: Maybe<FirebaseServerAuthData>): Promise<ModelAccessReadResult>;
52
52
  /**
@@ -21,12 +21,13 @@ export interface ModelApiModuleMetadataConfig extends Pick<ModuleMetadata, 'impo
21
21
  * @param metadataConfig - Configuration including the dependency module.
22
22
  * @returns NestJS module metadata with the Model API controller, dispatch service, and app context provider.
23
23
  *
24
- * @example
25
- * ```typescript
26
- * @Module(modelApiModuleMetadata({
24
+ * @Module (modelApiModuleMetadata({
27
25
  * dependencyModule: DemoModelApiDependencyModule
28
26
  * }))
29
27
  * export class DemoModelApiModule {}
30
28
  * ```
29
+ *
30
+ * @example
31
+ * ```typescript
31
32
  */
32
33
  export declare function modelApiModuleMetadata(metadataConfig: ModelApiModuleMetadataConfig): ModuleMetadata;
@@ -59,7 +59,7 @@ export declare function onCallDevelopmentFunction<N>(map: OnCallDevelopmentFunct
59
59
  /**
60
60
  * Creates a bad-request error indicating the provided development function specifier is not recognized.
61
61
  *
62
- * @param specifier - the unrecognized specifier string from the client request.
62
+ * @param specifier - The unrecognized specifier string from the client request.
63
63
  * @returns A bad-request error with the unknown specifier details.
64
64
  */
65
65
  export declare function developmentUnknownSpecifierError(specifier: DevelopmentFirebaseFunctionSpecifier): import("firebase-functions/https").HttpsError;
@@ -18,7 +18,7 @@ export declare const UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_NAME_CODE =
18
18
  * Creates a bad-request error for when the requested scheduled function name
19
19
  * is not found in the registered function map.
20
20
  *
21
- * @param name - the unrecognized function name from the client request.
21
+ * @param name - The unrecognized function name from the client request.
22
22
  * @returns A bad-request error with the unknown function name details.
23
23
  */
24
24
  export declare function unknownScheduledFunctionDevelopmentFunctionName(name: unknown): import("firebase-functions/https").HttpsError;
@@ -30,7 +30,7 @@ export declare const UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_TYPE_CODE =
30
30
  * Creates a bad-request error for when the request `type` field does not match
31
31
  * any supported operation ('run' or 'list').
32
32
  *
33
- * @param type - the unrecognized type value from the client request.
33
+ * @param type - The unrecognized type value from the client request.
34
34
  * @returns A bad-request error with the unknown type details.
35
35
  */
36
36
  export declare function unknownScheduledFunctionDevelopmentFunctionType(type: unknown): import("firebase-functions/https").HttpsError;
@@ -5,7 +5,7 @@ import { type NestAppPromiseGetter } from '../app';
5
5
  *
6
6
  * Useful for conditionally enabling production-only Cloud Functions (e.g., scheduled tasks).
7
7
  *
8
- * @param nest - getter for the NestJS application context promise.
8
+ * @param nest - Getter for the NestJS application context promise.
9
9
  * @returns An async decision function that resolves to `true` in production.
10
10
  *
11
11
  * @example
@@ -20,7 +20,7 @@ export declare function nestAppIsProductionEnvironment(nest: NestAppPromiseGette
20
20
  *
21
21
  * The development scheduler is enabled in non-production, non-testing environments.
22
22
  *
23
- * @param nest - getter for the NestJS application context promise.
23
+ * @param nest - Getter for the NestJS application context promise.
24
24
  * @returns An async decision function that resolves to `true` when the development scheduler is enabled.
25
25
  */
26
26
  export declare function nestAppHasDevelopmentSchedulerEnabled(nest: NestAppPromiseGetter): AsyncDecisionFunction<void>;
@@ -39,16 +39,17 @@ export interface FirebaseServerFirestoreContextModuleConfig {
39
39
  *
40
40
  * If caching is not needed, use {@link FirebaseServerFirestoreContextModule} directly instead.
41
41
  *
42
- * @param config - Configuration including the cache factory
43
- * @returns Module metadata ready for the `@Module()` decorator
42
+ * @param config - Configuration including the cache factory.
43
+ * @returns Module metadata ready for the `@Module()` decorator.
44
44
  *
45
- * @example
46
- * ```typescript
47
- * @Module(firebaseServerFirestoreContextModuleMetadata({
45
+ * @Module (firebaseServerFirestoreContextModuleMetadata({
48
46
  * firestoreContextCacheFactory: inMemoryFirestoreContextCacheFactory()
49
47
  * }))
50
48
  * export class AppFirestoreContextModule {}
51
49
  * ```
50
+ *
51
+ * @example
52
+ * ```typescript
52
53
  */
53
54
  export declare function firebaseServerFirestoreContextModuleMetadata(config: FirebaseServerFirestoreContextModuleConfig): ModuleMetadata;
54
55
  /**
@@ -59,8 +60,8 @@ export type ProvideAppFirestoreCollectionsFactory<T> = (context: FirestoreContex
59
60
  * Configuration for providing an app's Firestore collections class via NestJS DI.
60
61
  */
61
62
  export interface ProvideAppFirestoreCollectionsConfig<T> {
62
- provide: ClassLikeType<T>;
63
- useFactory: ProvideAppFirestoreCollectionsFactory<T>;
63
+ readonly provide: ClassLikeType<T>;
64
+ readonly useFactory: ProvideAppFirestoreCollectionsFactory<T>;
64
65
  }
65
66
  /**
66
67
  * Creates a NestJS provider that initializes a Firestore collections instance from the app's {@link FirestoreContext}.
@@ -93,24 +94,24 @@ export interface ProvideAppFirestoreModuleMetadataConfig<T> extends ProvideAppFi
93
94
  * @param config - The Firestore collections config plus optional additional module metadata.
94
95
  * @returns NestJS module metadata ready to be passed to the `@Module()` decorator.
95
96
  *
96
- * @example
97
- * ```typescript
98
- * @Module(appFirestoreModuleMetadata({
97
+ * @Module (appFirestoreModuleMetadata({
99
98
  * provide: DemoFirestoreCollections,
100
99
  * useFactory: (context) => new DemoFirestoreCollections(context)
101
100
  * }))
102
101
  * export class AppFirestoreModule {}
103
102
  * ```
104
- *
105
- * @example
106
- * ```typescript
107
- * // With caching
108
- * @Module(appFirestoreModuleMetadata({
103
+ * @Module (appFirestoreModuleMetadata({
109
104
  * provide: DemoFirestoreCollections,
110
105
  * useFactory: (context) => new DemoFirestoreCollections(context),
111
106
  * firestoreContextCacheFactory: inMemoryFirestoreContextCacheFactory()
112
107
  * }))
113
108
  * export class AppFirestoreModule {}
114
109
  * ```
110
+ *
111
+ * @example
112
+ * ```typescript
113
+ * @example
114
+ * ```typescript
115
+ * // With caching
115
116
  */
116
117
  export declare function appFirestoreModuleMetadata<T>(config: ProvideAppFirestoreModuleMetadataConfig<T>): ModuleMetadata;
@@ -65,6 +65,9 @@ export type OnCallWithOptionalAuthorizedNestContext<N, I = unknown, O = unknown>
65
65
  * By default, callable functions with auth-aware nest context require auth. Use this wrapper to
66
66
  * explicitly opt out of that requirement for endpoints that should be publicly accessible.
67
67
  *
68
+ * @param fn - The callable function handler to wrap.
69
+ * @returns A new handler flagged with `_requireAuth: false`.
70
+ *
68
71
  * @example
69
72
  * ```ts
70
73
  * const handler = optionalAuthContext<MyContext, Input, Output>((request) => {
@@ -72,9 +75,6 @@ export type OnCallWithOptionalAuthorizedNestContext<N, I = unknown, O = unknown>
72
75
  * return doSomething(request);
73
76
  * });
74
77
  * ```
75
- *
76
- * @param fn - The callable function handler to wrap.
77
- * @returns A new handler flagged with `_requireAuth: false`.
78
78
  */
79
79
  export declare function optionalAuthContext<N, I, O>(fn: OnCallWithNestContext<N, I, O>): OnCallWithOptionalAuthorizedNestContext<N, I, O>;
80
80
  /**
@@ -107,6 +107,9 @@ export declare function assertRequestRequiresAuthForFunction(fn: OnCallWithAuthA
107
107
  * The wrapper calls {@link assertIsContextWithAuthData} before invoking the handler, ensuring that
108
108
  * unauthenticated requests are rejected with an appropriate error before reaching handler logic.
109
109
  *
110
+ * @param fn - The authorized handler to wrap with auth assertion.
111
+ * @returns A general {@link OnCallWithNestContext} handler that asserts auth before delegating.
112
+ *
110
113
  * @example
111
114
  * ```ts
112
115
  * const secureHandler = inAuthContext<MyContext, Input, Output>((request) => {
@@ -114,8 +117,5 @@ export declare function assertRequestRequiresAuthForFunction(fn: OnCallWithAuthA
114
117
  * return processAuthenticatedRequest(request);
115
118
  * });
116
119
  * ```
117
- *
118
- * @param fn - The authorized handler to wrap with auth assertion.
119
- * @returns A general {@link OnCallWithNestContext} handler that asserts auth before delegating.
120
120
  */
121
121
  export declare function inAuthContext<N, I, O>(fn: OnCallWithAuthorizedNestContext<N, I, O>): OnCallWithNestContext<N, I, O>;
@@ -21,13 +21,13 @@ export type FirebaseServerActionsContextOptions = FirebaseServerActionsTransform
21
21
  /**
22
22
  * Creates a {@link FirebaseServerActionsContext} with the default transform and validation factories.
23
23
  *
24
+ * @param options - Optional configuration for error logging behavior.
25
+ * @returns A fully configured actions context.
26
+ *
24
27
  * @example
25
28
  * ```ts
26
29
  * const context = firebaseServerActionsContext({ logError: true });
27
30
  * ```
28
- *
29
- * @param options - Optional configuration for error logging behavior.
30
- * @returns A fully configured actions context.
31
31
  */
32
32
  export declare function firebaseServerActionsContext(options?: FirebaseServerActionsContextOptions): FirebaseServerActionsContext;
33
33
  /**
@@ -44,7 +44,7 @@ export type FirebaseServerActionsTransformFactoryLogErrorFunctionInput = Firebas
44
44
  * Default error logger that writes validation error details to the console.
45
45
  * Used when `logError` is `true` or omitted in the factory options.
46
46
  *
47
- * @param details - the validation error details to log.
47
+ * @param details - The validation error details to log.
48
48
  */
49
49
  export declare const defaultFirebaseServerActionsTransformFactoryLogErrorFunction: FirebaseServerActionsTransformFactoryLogErrorFunction;
50
50
  /**
@@ -115,6 +115,9 @@ export interface FirebaseServerActionsTransformFactoryOptions {
115
115
  *
116
116
  * Validation errors are optionally logged before the error is thrown, controlled by the `logError` option.
117
117
  *
118
+ * @param options - Optional configuration for error logging behavior.
119
+ * @returns A factory that creates type-safe transform functions from ArkType schemas.
120
+ *
118
121
  * @example
119
122
  * ```ts
120
123
  * const transformFactory = firebaseServerActionsTransformFactory({ logError: true });
@@ -122,8 +125,6 @@ export interface FirebaseServerActionsTransformFactoryOptions {
122
125
  * const validated = await transform(rawInput);
123
126
  * ```
124
127
  *
125
- * @param options - Optional configuration for error logging behavior.
126
- * @returns A factory that creates type-safe transform functions from ArkType schemas.
127
128
  * @__NO_SIDE_EFFECTS__
128
129
  */
129
130
  export declare function firebaseServerActionsTransformFactory(options?: FirebaseServerActionsTransformFactoryOptions): TransformAndValidateObjectFactory;
@@ -60,6 +60,11 @@ export interface BlockingFunctionBuilder<E extends object, O> {
60
60
  * The attached `__handler` enables direct handler invocation in tests without triggering
61
61
  * the full Firebase blocking function infrastructure.
62
62
  *
63
+ * @param blockingFunctionBuilder - The Firebase blocking function constructor (e.g., `beforeUserCreated`).
64
+ * @param handler - The handler logic to execute on each event.
65
+ * @param opts - Optional {@link BlockingOptions} passed to the builder.
66
+ * @returns A {@link BlockingFunctionWithHandler} with the handler accessible via `__handler`.
67
+ *
63
68
  * @example
64
69
  * ```ts
65
70
  * const fn = makeBlockingFunctionWithHandler(
@@ -70,10 +75,6 @@ export interface BlockingFunctionBuilder<E extends object, O> {
70
75
  * // In tests: fn.__handler(mockEvent)
71
76
  * ```
72
77
  *
73
- * @param blockingFunctionBuilder - The Firebase blocking function constructor (e.g., `beforeUserCreated`).
74
- * @param handler - The handler logic to execute on each event.
75
- * @param opts - Optional {@link BlockingOptions} passed to the builder.
76
- * @returns A {@link BlockingFunctionWithHandler} with the handler accessible via `__handler`.
77
78
  * @__NO_SIDE_EFFECTS__
78
79
  */
79
80
  export declare function makeBlockingFunctionWithHandler<E extends object, O>(blockingFunctionBuilder: BlockingFunctionBuilder<E, O>, handler: BlockingFunctionHandler<E, O>, opts?: Maybe<BlockingOptions>): BlockingFunctionWithHandler<E, O>;
@@ -116,6 +117,9 @@ export type BlockingFunctionHandlerWithNestContextFactory<N> = <E extends object
116
117
  * The returned factory lazily resolves the NestJS application on each invocation, injects the
117
118
  * typed context into the event, and delegates to the handler.
118
119
  *
120
+ * @param makeNestContext - Factory that creates the typed context from the NestJS application context.
121
+ * @returns A factory for creating nest-context-aware blocking function handlers.
122
+ *
119
123
  * @example
120
124
  * ```ts
121
125
  * const factory = blockingFunctionHandlerWithNestContextFactory(makeMyContext);
@@ -127,8 +131,6 @@ export type BlockingFunctionHandlerWithNestContextFactory<N> = <E extends object
127
131
  * );
128
132
  * ```
129
133
  *
130
- * @param makeNestContext - Factory that creates the typed context from the NestJS application context.
131
- * @returns A factory for creating nest-context-aware blocking function handlers.
132
134
  * @__NO_SIDE_EFFECTS__
133
135
  */
134
136
  export declare function blockingFunctionHandlerWithNestContextFactory<N>(makeNestContext: MakeNestContext<N>): BlockingFunctionHandlerWithNestContextFactory<N>;
@@ -20,6 +20,9 @@ export type OnCallHandlerWithNestApplicationFactory = <I = unknown, O = unknown>
20
20
  * The `defaultOpts` are merged with per-function options, allowing shared configuration (e.g., CORS settings,
21
21
  * memory allocation) to be set once at the factory level.
22
22
  *
23
+ * @param defaultOpts - Default {@link https.CallableOptions} applied to all functions created by this factory.
24
+ * @returns A factory that creates nest-application-aware callable functions.
25
+ *
23
26
  * @example
24
27
  * ```ts
25
28
  * const callFactory = onCallHandlerWithNestApplicationFactory({ cors: true });
@@ -29,8 +32,6 @@ export type OnCallHandlerWithNestApplicationFactory = <I = unknown, O = unknown>
29
32
  * );
30
33
  * ```
31
34
  *
32
- * @param defaultOpts - Default {@link https.CallableOptions} applied to all functions created by this factory.
33
- * @returns A factory that creates nest-application-aware callable functions.
34
35
  * @__NO_SIDE_EFFECTS__
35
36
  */
36
37
  export declare function onCallHandlerWithNestApplicationFactory(defaultOpts?: https.CallableOptions): OnCallHandlerWithNestApplicationFactory;
@@ -45,6 +46,10 @@ export type OnCallHandlerWithNestContextFactory<C> = <I = unknown, O = unknown>(
45
46
  * This is the standard way to create callable functions that receive a domain-specific context
46
47
  * (e.g., `MyApiNestContext`) rather than the raw NestJS application context.
47
48
  *
49
+ * @param appFactory - The base application-level callable factory.
50
+ * @param makeNestContext - Factory that creates the typed context from the application context.
51
+ * @returns A factory that creates typed-context-aware callable functions.
52
+ *
48
53
  * @example
49
54
  * ```ts
50
55
  * const appFactory = onCallHandlerWithNestApplicationFactory();
@@ -55,9 +60,6 @@ export type OnCallHandlerWithNestContextFactory<C> = <I = unknown, O = unknown>(
55
60
  * });
56
61
  * ```
57
62
  *
58
- * @param appFactory - The base application-level callable factory.
59
- * @param makeNestContext - Factory that creates the typed context from the application context.
60
- * @returns A factory that creates typed-context-aware callable functions.
61
63
  * @__NO_SIDE_EFFECTS__
62
64
  */
63
65
  export declare function onCallHandlerWithNestContextFactory<C>(appFactory: OnCallHandlerWithNestApplicationFactory, makeNestContext: MakeNestContext<C>): OnCallHandlerWithNestContextFactory<C>;