@dereekb/firebase-server 13.4.1 → 13.4.2

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 (101) hide show
  1. package/index.cjs.js +455 -113
  2. package/index.esm.js +456 -114
  3. package/mailgun/package.json +9 -9
  4. package/model/index.cjs.js +645 -350
  5. package/model/index.esm.js +646 -351
  6. package/model/package.json +9 -9
  7. package/model/src/lib/mailgun/notification.send.service.mailgun.d.ts +1 -0
  8. package/model/src/lib/notification/index.d.ts +2 -2
  9. package/model/src/lib/notification/{notification.action.service.d.ts → notification.action.server.d.ts} +53 -1
  10. package/model/src/lib/notification/{notification.action.init.service.d.ts → notification.action.server.init.d.ts} +20 -0
  11. package/model/src/lib/notification/notification.config.service.d.ts +2 -0
  12. package/model/src/lib/notification/notification.create.run.d.ts +1 -0
  13. package/model/src/lib/notification/notification.error.d.ts +16 -0
  14. package/model/src/lib/notification/notification.expedite.service.d.ts +11 -3
  15. package/model/src/lib/notification/notification.module.d.ts +19 -6
  16. package/model/src/lib/notification/notification.send.service.notificationsummary.d.ts +1 -0
  17. package/model/src/lib/notification/notification.send.service.text.d.ts +2 -0
  18. package/model/src/lib/notification/notification.task.service.handler.d.ts +1 -0
  19. package/model/src/lib/notification/notification.task.service.util.d.ts +1 -0
  20. package/model/src/lib/notification/notification.task.subtask.handler.d.ts +3 -0
  21. package/model/src/lib/notification/notification.util.d.ts +4 -2
  22. package/model/src/lib/storagefile/index.d.ts +1 -1
  23. package/model/src/lib/storagefile/storagefile.action.server.d.ts +98 -1
  24. package/model/src/lib/storagefile/{storagefile.action.init.service.d.ts → storagefile.action.server.init.d.ts} +13 -2
  25. package/model/src/lib/storagefile/storagefile.error.d.ts +27 -0
  26. package/model/src/lib/storagefile/storagefile.module.d.ts +14 -4
  27. package/model/src/lib/storagefile/storagefile.task.service.handler.d.ts +29 -7
  28. package/model/src/lib/storagefile/storagefile.upload.service.initializer.d.ts +2 -0
  29. package/oidc/index.cjs.js +150 -32
  30. package/oidc/index.esm.js +150 -32
  31. package/oidc/package.json +10 -10
  32. package/oidc/src/lib/controller/oidc.interaction.controller.d.ts +12 -0
  33. package/oidc/src/lib/controller/oidc.wellknown.controller.d.ts +6 -0
  34. package/oidc/src/lib/model/jwks/jwks.d.ts +9 -0
  35. package/oidc/src/lib/model/jwks/jwks.query.d.ts +9 -0
  36. package/oidc/src/lib/model/oidc/oidcmodel.action.server.d.ts +13 -0
  37. package/oidc/src/lib/model/oidc/oidcmodel.module.d.ts +5 -1
  38. package/oidc/src/lib/oidc.config.d.ts +2 -1
  39. package/oidc/src/lib/oidc.module.d.ts +9 -2
  40. package/oidc/src/lib/service/oidc.account.service.d.ts +7 -0
  41. package/oidc/src/lib/service/oidc.adapter.service.d.ts +1 -0
  42. package/oidc/src/lib/service/oidc.config.service.d.ts +1 -0
  43. package/oidc/src/lib/service/oidc.encryption.service.d.ts +6 -0
  44. package/oidc/src/lib/service/oidc.interaction.service.d.ts +15 -0
  45. package/oidc/src/lib/service/oidc.jwks.service.d.ts +18 -2
  46. package/oidc/src/lib/service/oidc.service.d.ts +7 -3
  47. package/package.json +10 -10
  48. package/src/lib/auth/auth.context.d.ts +1 -0
  49. package/src/lib/auth/auth.service.d.ts +13 -0
  50. package/src/lib/env/env.config.d.ts +2 -0
  51. package/src/lib/env/env.service.d.ts +21 -7
  52. package/src/lib/firestore/array.d.ts +1 -0
  53. package/src/lib/firestore/driver.accessor.batch.d.ts +4 -0
  54. package/src/lib/firestore/driver.accessor.d.ts +4 -0
  55. package/src/lib/firestore/driver.accessor.default.d.ts +5 -1
  56. package/src/lib/firestore/driver.accessor.transaction.d.ts +4 -0
  57. package/src/lib/firestore/driver.d.ts +2 -0
  58. package/src/lib/firestore/driver.query.d.ts +4 -0
  59. package/src/lib/firestore/increment.d.ts +1 -0
  60. package/src/lib/function/assert.d.ts +7 -0
  61. package/src/lib/function/context.d.ts +4 -0
  62. package/src/lib/function/error.auth.d.ts +2 -0
  63. package/src/lib/function/error.d.ts +86 -11
  64. package/src/lib/index.d.ts +0 -1
  65. package/src/lib/nest/analytics/analytics.service.listener.d.ts +2 -0
  66. package/src/lib/nest/app.d.ts +6 -3
  67. package/src/lib/nest/auth/auth.module.d.ts +6 -0
  68. package/src/lib/nest/auth/auth.util.d.ts +19 -1
  69. package/src/lib/nest/development/development.app.function.d.ts +12 -4
  70. package/src/lib/nest/development/development.assert.function.d.ts +6 -2
  71. package/src/lib/nest/development/development.function.d.ts +6 -1
  72. package/src/lib/nest/development/development.schedule.function.d.ts +3 -1
  73. package/src/lib/nest/development/development.schedule.function.error.d.ts +8 -0
  74. package/src/lib/nest/env/env.service.d.ts +2 -0
  75. package/src/lib/nest/env/env.util.d.ts +6 -0
  76. package/src/lib/nest/firebase/firebase.module.d.ts +1 -0
  77. package/src/lib/nest/firestore/firestore.module.d.ts +8 -0
  78. package/src/lib/nest/function/context.d.ts +2 -0
  79. package/src/lib/nest/model/analytics.details.d.ts +21 -7
  80. package/src/lib/nest/model/analytics.emit.d.ts +3 -0
  81. package/src/lib/nest/model/analytics.handler.d.ts +30 -10
  82. package/src/lib/nest/model/api.details.d.ts +34 -1
  83. package/src/lib/nest/model/call.model.function.d.ts +20 -4
  84. package/src/lib/nest/model/create.model.function.d.ts +6 -1
  85. package/src/lib/nest/model/crud.assert.function.d.ts +12 -4
  86. package/src/lib/nest/model/delete.model.function.d.ts +6 -1
  87. package/src/lib/nest/model/permission.error.d.ts +7 -0
  88. package/src/lib/nest/model/read.model.function.d.ts +6 -1
  89. package/src/lib/nest/model/specifier.function.d.ts +3 -0
  90. package/src/lib/nest/model/update.model.function.d.ts +6 -1
  91. package/src/lib/nest/nest.provider.d.ts +10 -0
  92. package/src/lib/nest/storage/storage.module.d.ts +9 -0
  93. package/src/lib/storage/driver.accessor.d.ts +22 -0
  94. package/src/lib/storage/driver.d.ts +2 -0
  95. package/src/lib/storage/storage.d.ts +1 -0
  96. package/test/package.json +10 -10
  97. package/zoho/index.cjs.js +8 -6
  98. package/zoho/index.esm.js +8 -6
  99. package/zoho/package.json +9 -9
  100. package/zoho/src/lib/zoho.accounts.firebase.d.ts +2 -1
  101. package/zoho/src/lib/zoho.accounts.firebase.system.d.ts +2 -1
@@ -16,7 +16,7 @@ export declare class DefaultFirestoreDocumentDataAccessor<T> implements Firestor
16
16
  exists(): Promise<boolean>;
17
17
  get(): Promise<DocumentSnapshot<T>>;
18
18
  getWithConverter<U = DocumentData>(converter: null | FirestoreDataConverter<U>): Promise<DocumentSnapshot<U>>;
19
- delete(params: FirestoreDocumentDeleteParams): Promise<GoogleCloudWriteResult>;
19
+ delete(params?: FirestoreDocumentDeleteParams): Promise<GoogleCloudWriteResult>;
20
20
  set(data: WithFieldValue<T>, options?: SetOptions): Promise<GoogleCloudWriteResult>;
21
21
  increment(data: FirestoreAccessorIncrementUpdate<T>, params?: FirestoreDocumentUpdateParams): Promise<GoogleCloudWriteResult>;
22
22
  arrayUpdate(data: FirestoreAccessorArrayUpdate<T>, params?: FirestoreDocumentUpdateParams): Promise<GoogleCloudWriteResult>;
@@ -25,6 +25,8 @@ export declare class DefaultFirestoreDocumentDataAccessor<T> implements Firestor
25
25
  /**
26
26
  * Creates a {@link FirestoreDocumentDataAccessorFactory} that produces default (non-batched, non-transactional) accessors.
27
27
  *
28
+ * @returns A factory that creates default (non-batched, non-transactional) accessors.
29
+ *
28
30
  * @example
29
31
  * ```typescript
30
32
  * const factory = defaultFirestoreAccessorFactory<User>();
@@ -36,5 +38,7 @@ export declare function defaultFirestoreAccessorFactory<T>(): FirestoreDocumentD
36
38
  * Creates a {@link FirestoreDocumentContext} with no special execution context (no batch, no transaction).
37
39
  *
38
40
  * Operations performed through this context execute immediately against Firestore.
41
+ *
42
+ * @returns A {@link FirestoreDocumentContext} for direct Firestore operations.
39
43
  */
40
44
  export declare function defaultFirestoreDocumentContext<T>(): FirestoreDocumentContext<T>;
@@ -32,6 +32,7 @@ export declare class TransactionFirestoreDocumentDataAccessor<T> implements Fire
32
32
  * atomic operation.
33
33
  *
34
34
  * @param transaction - The Google Cloud Transaction to execute operations within.
35
+ * @returns A factory that creates transaction-backed accessors sharing the given transaction.
35
36
  *
36
37
  * @example
37
38
  * ```typescript
@@ -58,5 +59,8 @@ export declare class TransactionFirestoreDocumentContext<T> implements Firestore
58
59
  }
59
60
  /**
60
61
  * Creates a {@link TransactionFirestoreDocumentContext} wrapping the given transaction.
62
+ *
63
+ * @param transaction - The Google Cloud Transaction to use.
64
+ * @returns A new {@link TransactionFirestoreDocumentContext} for the given transaction.
61
65
  */
62
66
  export declare function transactionDocumentContext<T>(transaction: GoogleCloudTransaction): TransactionFirestoreDocumentContext<T>;
@@ -8,6 +8,8 @@ export type GoogleCloudFirestoreDrivers = FirestoreDrivers;
8
8
  *
9
9
  * Bundles the server-side accessor driver and query driver, identified as `@google-cloud/firestore`.
10
10
  *
11
+ * @returns A complete set of {@link FirestoreDrivers} for the Google Cloud Admin SDK.
12
+ *
11
13
  * @example
12
14
  * ```typescript
13
15
  * const drivers = googleCloudFirestoreDrivers();
@@ -14,6 +14,8 @@ export declare const FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING: FullFire
14
14
  * Creates a {@link FirestoreQueryConstraintFunctionsDriver} for the Google Cloud Firestore server SDK.
15
15
  *
16
16
  * Translates abstract query constraints into Google Cloud Firestore query builder calls.
17
+ *
18
+ * @returns A {@link FirestoreQueryConstraintFunctionsDriver} for the server SDK.
17
19
  */
18
20
  export declare function firestoreClientQueryConstraintFunctionsDriver(): FirestoreQueryConstraintFunctionsDriver;
19
21
  /**
@@ -23,6 +25,8 @@ export declare function firestoreClientQueryConstraintFunctionsDriver(): Firesto
23
25
  * streaming (streamDocs) via `onSnapshot`. Transaction-aware reads are supported
24
26
  * through the optional transaction parameter in `getDocs`.
25
27
  *
28
+ * @returns A complete {@link FirestoreQueryDriver} for the Google Cloud Admin SDK.
29
+ *
26
30
  * @example
27
31
  * ```typescript
28
32
  * const queryDriver = googleCloudFirestoreQueryDriver();
@@ -6,6 +6,7 @@ import { type UpdateData, type FirestoreAccessorIncrementUpdate } from '@dereekb
6
6
  * Each field in the input maps to an atomic increment operation. Null/undefined values default to 0.
7
7
  *
8
8
  * @param input - The increment specification mapping field names to numeric deltas.
9
+ * @returns Firestore {@link UpdateData} with atomic increment operations.
9
10
  *
10
11
  * @example
11
12
  * ```typescript
@@ -3,6 +3,7 @@ import { type CallableContext } from '../type';
3
3
  /**
4
4
  * Asserts that the callable context contains auth data with a valid UID.
5
5
  *
6
+ * @param context - The callable context to check for auth data.
6
7
  * @throws {HttpsError} Throws unauthenticated error if no auth data is present.
7
8
  *
8
9
  * @example
@@ -17,6 +18,7 @@ export declare function assertContextHasAuth(context: CallableContext): void;
17
18
  *
18
19
  * @param document - The Firestore document to load data from.
19
20
  * @param message - Optional custom error message.
21
+ * @returns The document's snapshot data.
20
22
  * @throws {HttpsError} Throws a {@link modelNotAvailableError} (404) if the document has no data.
21
23
  *
22
24
  * @example
@@ -32,6 +34,7 @@ export declare function assertSnapshotData<D extends FirestoreDocument<any>>(doc
32
34
  *
33
35
  * @param document - The Firestore document to load data from.
34
36
  * @param message - Optional custom error message.
37
+ * @returns The document's snapshot data with `id` and `key` attached.
35
38
  * @throws {HttpsError} Throws a {@link modelNotAvailableError} (404) if the document has no data.
36
39
  */
37
40
  export declare function assertSnapshotDataWithKey<D extends FirestoreDocument<any>>(document: D, message?: string): Promise<DocumentDataWithIdAndKey<FirestoreDocumentData<D>>>;
@@ -47,5 +50,9 @@ export declare function assertDocumentExists<D extends FirestoreDocument<any>>(d
47
50
  * Creates a {@link modelNotAvailableError} for the given document's model type.
48
51
  *
49
52
  * Used by {@link assertDocumentExists} and other assertion functions.
53
+ *
54
+ * @param document - The document (or object with `modelType`) to generate the error for.
55
+ * @param message - Optional custom error message.
56
+ * @returns A {@link modelNotAvailableError} with the document's model type in the message.
50
57
  */
51
58
  export declare function documentModelNotAvailableError(document: Pick<FirestoreDocument<any>, 'modelType'>, message?: string): import("firebase-functions/https").HttpsError;
@@ -8,6 +8,9 @@ export type CallableContextWithAuthData<R extends CallableContext = CallableCont
8
8
  /**
9
9
  * Type guard that checks whether the given callable context contains authenticated user data (non-null auth with a uid).
10
10
  *
11
+ * @param context - The callable context to check.
12
+ * @returns `true` if the context has authenticated user data with a valid UID.
13
+ *
11
14
  * @example
12
15
  * ```typescript
13
16
  * if (isContextWithAuthData(context)) {
@@ -19,6 +22,7 @@ export declare function isContextWithAuthData<R extends CallableContext>(context
19
22
  /**
20
23
  * Asserts that the callable context contains authenticated user data.
21
24
  *
25
+ * @param context - The callable context to assert on.
22
26
  * @throws {HttpsError} Throws an unauthenticated error if auth data is missing.
23
27
  *
24
28
  * @example
@@ -6,6 +6,8 @@ import type * as admin from 'firebase-admin';
6
6
  export declare const PHONE_NUMBER_ALREADY_EXISTS_ERROR_CODE = "PHONE_NUMBER_ALREADY_EXISTS";
7
7
  /**
8
8
  * Creates a precondition conflict (409) error indicating the phone number already exists.
9
+ *
10
+ * @returns A new precondition-conflict (409) {@link HttpsError} with the phone-number-exists code.
9
11
  */
10
12
  export declare function phoneNumberAlreadyExistsError(): import("firebase-functions/https").HttpsError;
11
13
  /**
@@ -4,10 +4,14 @@ import { type FirebaseErrorCode } from '@dereekb/firebase';
4
4
  import { HttpsError } from 'firebase-functions/https';
5
5
  /**
6
6
  * Creates an unauthenticated {@link HttpsError} indicating the request context has no auth data.
7
+ *
8
+ * @returns A new unauthenticated {@link HttpsError} with the no-auth error code.
7
9
  */
8
10
  export declare function unauthenticatedContextHasNoAuthData(): HttpsError;
9
11
  /**
10
12
  * Creates an unauthenticated {@link HttpsError} indicating the request context has no user UID.
13
+ *
14
+ * @returns A new unauthenticated {@link HttpsError} with the no-auth error code.
11
15
  */
12
16
  export declare function unauthenticatedContextHasNoUidError(): HttpsError;
13
17
  /**
@@ -17,37 +21,92 @@ export declare function unauthenticatedContextHasNoUidError(): HttpsError;
17
21
  * a string error code, and an optional {@link ServerError} detail object.
18
22
  */
19
23
  export declare const UNAUTHENTICATED_ERROR_CODE = "UNAUTHENTICATED";
20
- /** Creates an unauthenticated (401) {@link HttpsError}. */
24
+ /**
25
+ * Creates an unauthenticated (401) {@link HttpsError}.
26
+ *
27
+ * @param messageOrError - Optional error message string or partial server error object.
28
+ * @returns A new unauthenticated (401) {@link HttpsError}.
29
+ */
21
30
  export declare function unauthenticatedError(messageOrError?: ErrorMessageOrPartialServerError): HttpsError;
22
31
  export declare const FORBIDDEN_ERROR_CODE = "FORBIDDEN";
23
- /** Creates a forbidden (403) {@link HttpsError}. */
32
+ /**
33
+ * Creates a forbidden (403) {@link HttpsError}.
34
+ *
35
+ * @param messageOrError - Optional error message string or partial server error object.
36
+ * @returns A new forbidden (403) {@link HttpsError}.
37
+ */
24
38
  export declare function forbiddenError(messageOrError?: ErrorMessageOrPartialServerError): HttpsError;
25
39
  export declare const PERMISSION_DENIED_ERROR_CODE = "PERMISSION_DENIED";
26
- /** Creates a permission-denied (403) {@link HttpsError}. */
40
+ /**
41
+ * Creates a permission-denied (403) {@link HttpsError}.
42
+ *
43
+ * @param messageOrError - Optional error message string or partial server error object.
44
+ * @returns A new permission-denied (403) {@link HttpsError}.
45
+ */
27
46
  export declare function permissionDeniedError(messageOrError?: ErrorMessageOrPartialServerError): HttpsError;
28
47
  export declare const NOT_FOUND_ERROR_CODE = "NOT_FOUND";
29
- /** Creates a not-found (404) {@link HttpsError}. */
48
+ /**
49
+ * Creates a not-found (404) {@link HttpsError}.
50
+ *
51
+ * @param messageOrError - Optional error message string or partial server error object.
52
+ * @returns A new not-found (404) {@link HttpsError}.
53
+ */
30
54
  export declare function notFoundError(messageOrError?: ErrorMessageOrPartialServerError): HttpsError;
31
55
  export declare const MODEL_NOT_AVAILABLE_ERROR_CODE = "MODEL_NOT_AVAILABLE";
32
- /** Creates a model-not-available (404) {@link HttpsError}, used when a Firestore document does not exist. */
56
+ /**
57
+ * Creates a model-not-available (404) {@link HttpsError}, used when a Firestore document does not exist.
58
+ *
59
+ * @param messageOrError - Optional error message string or partial server error object.
60
+ * @returns A new model-not-available (404) {@link HttpsError}.
61
+ */
33
62
  export declare function modelNotAvailableError(messageOrError?: ErrorMessageOrPartialServerError): HttpsError;
34
63
  export declare const BAD_REQUEST_ERROR_CODE = "BAD_REQUEST";
35
- /** Creates a bad-request (400) {@link HttpsError}. */
64
+ /**
65
+ * Creates a bad-request (400) {@link HttpsError}.
66
+ *
67
+ * @param messageOrError - Optional error message string or partial server error object.
68
+ * @returns A new bad-request (400) {@link HttpsError}.
69
+ */
36
70
  export declare function badRequestError(messageOrError?: ErrorMessageOrPartialServerError): HttpsError;
37
71
  export declare const CONFLICT_ERROR_CODE = "CONFLICT";
38
- /** Creates a precondition-conflict (409) {@link HttpsError}. */
72
+ /**
73
+ * Creates a precondition-conflict (409) {@link HttpsError}.
74
+ *
75
+ * @param messageOrError - Optional error message string or partial server error object.
76
+ * @returns A new precondition-conflict (409) {@link HttpsError}.
77
+ */
39
78
  export declare function preconditionConflictError(messageOrError?: ErrorMessageOrPartialServerError): HttpsError;
40
79
  export declare const ALREADY_EXISTS_ERROR_CODE = "ALREADY_EXISTS";
41
- /** Creates an already-exists (409) {@link HttpsError}. */
80
+ /**
81
+ * Creates an already-exists (409) {@link HttpsError}.
82
+ *
83
+ * @param messageOrError - Optional error message string or partial server error object.
84
+ * @returns A new already-exists (409) {@link HttpsError}.
85
+ */
42
86
  export declare function alreadyExistsError(messageOrError?: ErrorMessageOrPartialServerError): HttpsError;
43
87
  export declare const UNAVAILABLE_ERROR_CODE = "UNAVAILABLE";
44
- /** Creates an unavailable (503) {@link HttpsError}. */
88
+ /**
89
+ * Creates an unavailable (503) {@link HttpsError}.
90
+ *
91
+ * @param messageOrError - Optional error message string or partial server error object.
92
+ * @returns A new unavailable (503) {@link HttpsError}.
93
+ */
45
94
  export declare function unavailableError(messageOrError?: ErrorMessageOrPartialServerError): HttpsError;
46
95
  export declare const UNAVAILABLE_OR_DEACTIVATED_FUNCTION_ERROR_CODE = "UNAVAILABLE_OR_DEACTIVATED_FUNCTION";
47
- /** Creates an unimplemented (501) {@link HttpsError} for deactivated or unavailable functions. */
96
+ /**
97
+ * Creates an unimplemented (501) {@link HttpsError} for deactivated or unavailable functions.
98
+ *
99
+ * @param messageOrError - Optional error message string or partial server error object.
100
+ * @returns A new unimplemented (501) {@link HttpsError}.
101
+ */
48
102
  export declare function unavailableOrDeactivatedFunctionError(messageOrError?: ErrorMessageOrPartialServerError): HttpsError;
49
103
  export declare const INTERNAL_SERVER_ERROR_CODE = "INTERNAL_ERROR";
50
- /** Creates an internal-error (500) {@link HttpsError}. */
104
+ /**
105
+ * Creates an internal-error (500) {@link HttpsError}.
106
+ *
107
+ * @param messageOrError - Optional error message string or partial server error object.
108
+ * @returns A new internal-error (500) {@link HttpsError}.
109
+ */
51
110
  export declare function internalServerError(messageOrError?: ErrorMessageOrPartialServerError): HttpsError;
52
111
  /**
53
112
  * Discriminator for the type of Firebase server error encountered.
@@ -91,10 +150,16 @@ export interface FirebaseServerErrorInfo {
91
150
  }
92
151
  /**
93
152
  * Type guard for Firebase {@link HttpsError} instances.
153
+ *
154
+ * @param input - The value to check.
155
+ * @returns `true` if the input is a Firebase {@link HttpsError}.
94
156
  */
95
157
  export declare function isFirebaseHttpsError(input: unknown | HttpsError): input is HttpsError;
96
158
  /**
97
159
  * Type guard for Firebase Admin {@link admin.FirebaseError} instances.
160
+ *
161
+ * @param input - The value to check.
162
+ * @returns `true` if the input is a Firebase Admin {@link admin.FirebaseError}.
98
163
  */
99
164
  export declare function isFirebaseError(input: unknown | admin.FirebaseError): input is admin.FirebaseError;
100
165
  /**
@@ -104,6 +169,7 @@ export declare function isFirebaseError(input: unknown | admin.FirebaseError): i
104
169
  * and extracts any embedded error codes and {@link ServerError} details.
105
170
  *
106
171
  * @param e - The caught error to analyze.
172
+ * @returns Structured {@link FirebaseServerErrorInfo} with classified error details.
107
173
  *
108
174
  * @example
109
175
  * ```typescript
@@ -118,14 +184,23 @@ export declare function isFirebaseError(input: unknown | admin.FirebaseError): i
118
184
  export declare function firebaseServerErrorInfo(e: unknown): FirebaseServerErrorInfo;
119
185
  /**
120
186
  * Returns a tuple of [firebaseErrorCode, errorInfo] for pattern-matching on Firebase error codes.
187
+ *
188
+ * @param e - The caught error to analyze.
189
+ * @returns A tuple of the Firebase error code (if present) and the full error info.
121
190
  */
122
191
  export declare function firebaseServerErrorInfoCodePair(e: unknown): [Maybe<FirebaseErrorCode>, FirebaseServerErrorInfo];
123
192
  /**
124
193
  * Returns a tuple of [serverError, errorInfo] for pattern-matching on embedded server error details.
194
+ *
195
+ * @param e - The caught error to analyze.
196
+ * @returns A tuple of the server error (if present) and the full error info.
125
197
  */
126
198
  export declare function firebaseServerErrorInfoServerErrorPair(e: unknown): [Maybe<ServerError>, FirebaseServerErrorInfo];
127
199
  /**
128
200
  * Returns a tuple of [serverErrorCode, errorInfo] for pattern-matching on server error string codes.
201
+ *
202
+ * @param e - The caught error to analyze.
203
+ * @returns A tuple of the server error code (if present) and the full error info.
129
204
  */
130
205
  export declare function firebaseServerErrorInfoServerErrorCodePair(e: unknown): [Maybe<StringErrorCode>, FirebaseServerErrorInfo];
131
206
  /**
@@ -1,5 +1,4 @@
1
1
  export * from './auth';
2
- export * from './auth';
3
2
  export * from './env';
4
3
  export * from './firestore';
5
4
  export * from './function';
@@ -46,5 +46,7 @@ export declare abstract class FirebaseServerAnalyticsServiceListener {
46
46
  * Creates a default no-op {@link FirebaseServerAnalyticsServiceListener}.
47
47
  *
48
48
  * Used when no analytics provider is configured. All methods are no-ops.
49
+ *
50
+ * @returns A no-op listener that silently discards all analytics events.
49
51
  */
50
52
  export declare function noopFirebaseServerAnalyticsServiceListener(): FirebaseServerAnalyticsServiceListener;
@@ -39,8 +39,6 @@ export interface NestServerInstance<T> {
39
39
  */
40
40
  removeNestServer(firebaseApp: admin.app.App): Promise<boolean>;
41
41
  }
42
- /** @deprecated Use `FirebaseNestServerRootModule` from `./app.module` instead. */
43
- export { FirebaseNestServerRootModule } from './app.module';
44
42
  /**
45
43
  * Optional hook to customize the NestJS application after creation but before initialization.
46
44
  */
@@ -108,7 +106,9 @@ export interface NestServerInstanceConfig<T> {
108
106
  export interface NestFirebaseServerEnvironmentConfig {
109
107
  readonly environment: FirebaseServerEnvironmentConfig;
110
108
  }
111
- /** @deprecated Use NestFirebaseServerEnvironmentConfig instead. */
109
+ /**
110
+ * @deprecated Use NestFirebaseServerEnvironmentConfig instead.
111
+ */
112
112
  export type NestServerEnvironmentConfig = NestFirebaseServerEnvironmentConfig;
113
113
  /**
114
114
  * Creates a {@link NestServerInstance} that manages NestJS server lifecycle within Firebase Cloud Functions.
@@ -117,6 +117,9 @@ export type NestServerEnvironmentConfig = NestFirebaseServerEnvironmentConfig;
117
117
  * times with the same app reuses the existing server. The factory wires up Firebase Admin,
118
118
  * environment config, storage, AppCheck middleware, and webhook routes based on the config.
119
119
  *
120
+ * @param config - Configuration for the NestJS server instance including the root module, providers, and middleware options.
121
+ * @returns A NestServerInstance that manages server lifecycle for the given module class.
122
+ *
120
123
  * @example
121
124
  * ```typescript
122
125
  * const instance = nestServerInstance({ moduleClass: AppModule, appCheckEnabled: true });
@@ -28,6 +28,9 @@ export type ProvideFirebaseServerAuthService<T extends FirebaseServerAuthService
28
28
  * Returns two providers: the concrete service and an alias that maps
29
29
  * `FirebaseServerAuthService` to the concrete token, enabling injection by the abstract type.
30
30
  *
31
+ * @param provider - The factory provider configuration for the auth service.
32
+ * @returns A tuple containing the configured provider and an alias provider.
33
+ *
31
34
  * @example
32
35
  * ```typescript
33
36
  * const providers = provideFirebaseServerAuthService({
@@ -44,6 +47,9 @@ export interface FirebaseServerAuthModuleMetadataConfig<T extends FirebaseServer
44
47
  * Generates NestJS {@link ModuleMetadata} for an app's auth module, including the {@link FirebaseServerAuthModule}
45
48
  * import and the custom {@link FirebaseServerAuthService} provider.
46
49
  *
50
+ * @param config - The module metadata configuration including the service provider.
51
+ * @returns The merged NestJS module metadata.
52
+ *
47
53
  * @example
48
54
  * ```typescript
49
55
  * @Module(firebaseServerAuthModuleMetadata({
@@ -5,11 +5,15 @@ import { type AbstractFirebaseNestContext } from '../nest.provider';
5
5
  /**
6
6
  * Asserts that the caller has admin privileges in the request.
7
7
  *
8
+ * @param request - The callable request to check for admin privileges.
8
9
  * @throws {HttpsError} Throws forbidden (403) if the caller is not an admin.
9
10
  */
10
11
  export declare function assertIsAdminInRequest<N extends AbstractFirebaseNestContext<any, any> = AbstractFirebaseNestContext<any, any>, I = unknown>(request: NestContextCallableRequestWithOptionalAuth<N, I>): void;
11
12
  /**
12
13
  * Checks whether the caller has admin privileges in the request.
14
+ *
15
+ * @param request - The callable request to check for admin privileges.
16
+ * @returns True if the caller has admin privileges.
13
17
  */
14
18
  export declare function isAdminInRequest<N extends AbstractFirebaseNestContext<any, any> = AbstractFirebaseNestContext<any, any>, I = unknown>(request: NestContextCallableRequestWithOptionalAuth<N, I>): boolean;
15
19
  /**
@@ -17,6 +21,8 @@ export declare function isAdminInRequest<N extends AbstractFirebaseNestContext<a
17
21
  *
18
22
  * If the request data contains a `uid` that differs from the caller's auth UID, admin status is required.
19
23
  *
24
+ * @param request - The callable request containing the target UID.
25
+ * @param requireUid - If true, a UID must be present in the request data.
20
26
  * @returns The resolved target UID (from request data or auth).
21
27
  * @throws {HttpsError} Throws forbidden (403) if the caller is not authorized.
22
28
  */
@@ -24,28 +30,39 @@ export declare function assertIsAdminOrTargetUserInRequestData<N extends Abstrac
24
30
  /**
25
31
  * Checks whether the caller is an admin or is targeting their own user record in the request data.
26
32
  *
33
+ * @param request - The callable request containing the target UID.
27
34
  * @param requireUid - If true, a UID must be present in the request data.
35
+ * @returns True if the caller is an admin or is targeting their own user record.
28
36
  */
29
37
  export declare function isAdminOrTargetUserInRequestData<N extends AbstractFirebaseNestContext<any, any> = AbstractFirebaseNestContext<any, any>, I extends Partial<UserRelated> = Partial<UserRelated>>(request: NestContextCallableRequestWithOptionalAuth<N, I>, requireUid?: boolean): boolean;
30
38
  /**
31
39
  * Asserts that the caller has signed the Terms of Service.
32
40
  *
41
+ * @param request - The callable request to check for ToS status.
33
42
  * @throws {HttpsError} Throws forbidden (403) if ToS has not been signed.
34
43
  */
35
44
  export declare function assertHasSignedTosInRequest<N extends AbstractFirebaseNestContext<any, any> = AbstractFirebaseNestContext<any, any>, I = unknown>(request: NestContextCallableRequestWithOptionalAuth<N, I>): void;
36
45
  /**
37
46
  * Checks whether the caller has signed the Terms of Service.
47
+ *
48
+ * @param request - The callable request to check for ToS status.
49
+ * @returns True if the caller has signed the Terms of Service.
38
50
  */
39
51
  export declare function hasSignedTosInRequest<N extends AbstractFirebaseNestContext<any, any> = AbstractFirebaseNestContext<any, any>, I = unknown>(request: NestContextCallableRequestWithOptionalAuth<N, I>): boolean;
40
52
  /**
41
53
  * Asserts that the caller has all of the specified auth roles.
42
54
  *
55
+ * @param request - The callable request to check for auth roles.
43
56
  * @param authRoles - One or more roles that must all be present.
44
57
  * @throws {HttpsError} Throws forbidden (403) if any required role is missing.
45
58
  */
46
59
  export declare function assertHasRolesInRequest<N extends AbstractFirebaseNestContext<any, any> = AbstractFirebaseNestContext<any, any>, I = unknown>(request: NestContextCallableRequestWithOptionalAuth<N, I>, authRoles: ArrayOrValue<AuthRole>): void;
47
60
  /**
48
61
  * Checks whether the caller has all of the specified auth roles.
62
+ *
63
+ * @param request - The callable request to check for auth roles.
64
+ * @param authRoles - One or more roles that must all be present.
65
+ * @returns True if the caller has all of the specified auth roles.
49
66
  */
50
67
  export declare function hasAuthRolesInRequest<N extends AbstractFirebaseNestContext<any, any> = AbstractFirebaseNestContext<any, any>, I = unknown>(request: NestContextCallableRequestWithOptionalAuth<N, I>, authRoles: ArrayOrValue<AuthRole>): boolean;
51
68
  /**
@@ -53,6 +70,7 @@ export declare function hasAuthRolesInRequest<N extends AbstractFirebaseNestCont
53
70
  *
54
71
  * This may be used to filter out new users that were not invited from finishing their onboarding.
55
72
  *
56
- * @param request
73
+ * @param request - The callable request to check for setup password claims.
74
+ * @returns True if the claims contain a setup password key.
57
75
  */
58
76
  export declare function hasNewUserSetupPasswordInRequest<N extends AbstractFirebaseNestContext<any, any> = AbstractFirebaseNestContext<any, any>, I = unknown>(request: NestContextCallableRequestWithOptionalAuth<N, I>): boolean;
@@ -16,7 +16,9 @@ import { type OnCallDevelopmentFunctionMap } from './development.function';
16
16
  * @typeParam S - The schedule function map type.
17
17
  */
18
18
  export interface FirebaseServerDevFunctionsConfig<N extends AbstractFirebaseNestContext<any, any>, S extends NestApplicationScheduleConfiguredFunctionMap> {
19
- /** When false, dev endpoints return an "unavailable" error instead of executing. */
19
+ /**
20
+ * When false, dev endpoints return an "unavailable" error instead of executing.
21
+ */
20
22
  readonly enabled: boolean;
21
23
  /**
22
24
  * Whether or not to require an auth context when calling dev functions. True by default.
@@ -24,11 +26,17 @@ export interface FirebaseServerDevFunctionsConfig<N extends AbstractFirebaseNest
24
26
  * Set to false only in local development where authentication is unavailable.
25
27
  */
26
28
  readonly secure?: boolean;
27
- /** Getter for the NestJS application promise, used to bootstrap the context. */
29
+ /**
30
+ * Getter for the NestJS application promise, used to bootstrap the context.
31
+ */
28
32
  readonly nest: NestAppPromiseGetter;
29
- /** Map of specifier keys to developer utility functions. */
33
+ /**
34
+ * Map of specifier keys to developer utility functions.
35
+ */
30
36
  readonly developerFunctionsMap: OnCallDevelopmentFunctionMap<N>;
31
- /** Factory that wraps a handler function with NestJS context resolution. */
37
+ /**
38
+ * Factory that wraps a handler function with NestJS context resolution.
39
+ */
32
40
  readonly onCallFactory: OnCallHandlerWithNestContextFactory<N>;
33
41
  /**
34
42
  * Whether or not to disable adding the dev schedule function. False by default.
@@ -10,9 +10,13 @@ import { type NestContextCallableRequest } from '../function/nest';
10
10
  * @typeParam I - The input data type of the request.
11
11
  */
12
12
  export interface AssertDevelopmentRequestFunctionContext<N, I = unknown> {
13
- /** The original callable request including the NestJS context and caller data. */
13
+ /**
14
+ * The original callable request including the NestJS context and caller data.
15
+ */
14
16
  readonly request: NestContextCallableRequest<N, I>;
15
- /** The development function specifier string identifying which dev operation was requested. */
17
+ /**
18
+ * The development function specifier string identifying which dev operation was requested.
19
+ */
16
20
  readonly specifier: string;
17
21
  }
18
22
  /**
@@ -31,7 +31,9 @@ export type OnCallDevelopmentFunctionMap<N> = {
31
31
  * @typeParam N - The NestJS context type.
32
32
  */
33
33
  export interface OnCallDevelopmentConfig<N> {
34
- /** Optional assertion run before the dev handler; throw to reject the request. */
34
+ /**
35
+ * Optional assertion run before the dev handler; throw to reject the request.
36
+ */
35
37
  readonly preAssert?: AssertDevelopmentRequestFunction<N, OnCallDevelopmentParams>;
36
38
  }
37
39
  /**
@@ -55,5 +57,8 @@ export interface OnCallDevelopmentConfig<N> {
55
57
  export declare function onCallDevelopmentFunction<N>(map: OnCallDevelopmentFunctionMap<N>, config?: OnCallDevelopmentConfig<N>): OnCallWithNestContext<N, OnCallDevelopmentParams>;
56
58
  /**
57
59
  * Creates a bad-request error indicating the provided development function specifier is not recognized.
60
+ *
61
+ * @param specifier - the unrecognized specifier string from the client request.
62
+ * @returns A bad-request error with the unknown specifier details.
58
63
  */
59
64
  export declare function developmentUnknownSpecifierError(specifier: DevelopmentFirebaseFunctionSpecifier): import("firebase-functions/https").HttpsError;
@@ -5,7 +5,9 @@ import { type OnCallDevelopmentFunction } from './development.function';
5
5
  * Configuration for {@link makeScheduledFunctionDevelopmentFunction}.
6
6
  */
7
7
  export interface MakeScheduledFunctionDevelopmentFunctionConfig {
8
- /** The complete map of registered scheduled functions that can be triggered manually. */
8
+ /**
9
+ * The complete map of registered scheduled functions that can be triggered manually.
10
+ */
9
11
  readonly allScheduledFunctions: NestApplicationScheduleConfiguredFunctionMap;
10
12
  }
11
13
  /**
@@ -5,6 +5,8 @@ export declare const NO_RUN_NAME_SPECIFIED_FOR_SCHEDULED_FUNCTION_DEVELOPMENT_FU
5
5
  /**
6
6
  * Creates a bad-request error for when the caller sends a 'run' command
7
7
  * without specifying which scheduled function to execute.
8
+ *
9
+ * @returns A bad-request error indicating the missing run name.
8
10
  */
9
11
  export declare function noRunNameSpecifiedForScheduledFunctionDevelopmentFunction(): import("firebase-functions/https").HttpsError;
10
12
  /**
@@ -14,6 +16,9 @@ export declare const UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_NAME_CODE =
14
16
  /**
15
17
  * Creates a bad-request error for when the requested scheduled function name
16
18
  * is not found in the registered function map.
19
+ *
20
+ * @param name - the unrecognized function name from the client request.
21
+ * @returns A bad-request error with the unknown function name details.
17
22
  */
18
23
  export declare function unknownScheduledFunctionDevelopmentFunctionName(name: unknown): import("firebase-functions/https").HttpsError;
19
24
  /**
@@ -23,5 +28,8 @@ export declare const UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_TYPE_CODE =
23
28
  /**
24
29
  * Creates a bad-request error for when the request `type` field does not match
25
30
  * any supported operation ('run' or 'list').
31
+ *
32
+ * @param type - the unrecognized type value from the client request.
33
+ * @returns A bad-request error with the unknown type details.
26
34
  */
27
35
  export declare function unknownScheduledFunctionDevelopmentFunctionType(type: unknown): import("firebase-functions/https").HttpsError;
@@ -11,6 +11,8 @@ export declare class DefaultFirebaseServerEnvService extends ServerEnvironmentSe
11
11
  private readonly _appUrlDetails;
12
12
  /**
13
13
  * Enabled when not in production and not in a testing environment.
14
+ *
15
+ * @returns True if the development scheduler should be enabled.
14
16
  */
15
17
  get developmentSchedulerEnabled(): boolean;
16
18
  get appUrlDetails(): Maybe<WebsiteUrlDetails>;
@@ -5,6 +5,9 @@ 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.
9
+ * @returns An async decision function that resolves to `true` in production.
10
+ *
8
11
  * @example
9
12
  * ```typescript
10
13
  * const isProduction = nestAppIsProductionEnvironment(nestAppGetter);
@@ -16,5 +19,8 @@ export declare function nestAppIsProductionEnvironment(nest: NestAppPromiseGette
16
19
  * Creates an async decision function that resolves to `true` if the development scheduler is enabled.
17
20
  *
18
21
  * The development scheduler is enabled in non-production, non-testing environments.
22
+ *
23
+ * @param nest - getter for the NestJS application context promise.
24
+ * @returns An async decision function that resolves to `true` when the development scheduler is enabled.
19
25
  */
20
26
  export declare function nestAppHasDevelopmentSchedulerEnabled(nest: NestAppPromiseGetter): AsyncDecisionFunction<void>;
@@ -10,6 +10,7 @@ export declare const FIREBASE_APP_TOKEN: InjectionToken;
10
10
  * Creates a NestJS {@link FactoryProvider} that binds a Firebase Admin app getter to {@link FIREBASE_APP_TOKEN}.
11
11
  *
12
12
  * @param useFactory - Factory function returning the Firebase Admin app instance.
13
+ * @returns A NestJS factory provider for the Firebase Admin app.
13
14
  *
14
15
  * @example
15
16
  * ```typescript
@@ -33,6 +33,11 @@ export interface ProvideAppFirestoreCollectionsConfig<T> {
33
33
  /**
34
34
  * Creates a NestJS provider that initializes a Firestore collections instance from the app's {@link FirestoreContext}.
35
35
  *
36
+ * @param config - The provide token and factory function configuration.
37
+ * @param config.provide - The class token to provide.
38
+ * @param config.useFactory - Factory that creates the collections from a FirestoreContext.
39
+ * @returns A tuple containing the configured NestJS provider.
40
+ *
36
41
  * @example
37
42
  * ```typescript
38
43
  * const [provider] = provideAppFirestoreCollections({
@@ -48,6 +53,9 @@ export interface ProvideAppFirestoreModuleMetadataConfig<T> extends ProvideAppFi
48
53
  * Generates NestJS {@link ModuleMetadata} for an app's Firestore module, including the
49
54
  * {@link FirebaseServerFirestoreContextModule} import and the app's collections provider.
50
55
  *
56
+ * @param config - The Firestore collections config plus optional additional module metadata.
57
+ * @returns NestJS module metadata ready to be passed to the `@Module()` decorator.
58
+ *
51
59
  * @example
52
60
  * ```typescript
53
61
  * @Module(appFirestoreModuleMetadata({
@@ -43,6 +43,8 @@ export type FirebaseServerActionsTransformFactoryLogErrorFunctionInput = Firebas
43
43
  /**
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
+ *
47
+ * @param details - the validation error details to log.
46
48
  */
47
49
  export declare const defaultFirebaseServerActionsTransformFactoryLogErrorFunction: FirebaseServerActionsTransformFactoryLogErrorFunction;
48
50
  /**