@dereekb/firebase-server 13.12.3 → 13.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +164 -22
- package/index.esm.js +164 -24
- package/mailgun/index.cjs.js +6 -3
- package/mailgun/index.esm.js +6 -3
- package/mailgun/package.json +9 -9
- package/mcp/index.cjs.js +10 -8
- package/mcp/index.esm.js +11 -9
- package/mcp/package.json +11 -11
- package/mcp/src/lib/service/analytics/mcp.analytics.config.d.ts +5 -3
- package/mcp/src/lib/service/analytics/mcp.analytics.service.d.ts +3 -2
- package/model/package.json +9 -9
- package/oidc/index.cjs.js +116 -8
- package/oidc/index.esm.js +115 -10
- package/oidc/package.json +10 -10
- package/oidc/src/lib/oidc.config.d.ts +40 -2
- package/oidc/src/lib/oidc.module.d.ts +39 -2
- package/oidc/src/lib/service/oidc.client.service.d.ts +12 -4
- package/package.json +10 -10
- package/src/lib/auth/auth.service.d.ts +91 -17
- package/src/lib/function/error.d.ts +42 -0
- package/test/index.cjs.js +29 -0
- package/test/index.esm.js +29 -0
- package/test/package.json +11 -11
- package/test/src/lib/firebase/firebase.admin.auth.d.ts +22 -0
- package/twilio/package.json +8 -8
- package/zoho/package.json +9 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server",
|
|
3
|
-
"version": "13.12.
|
|
3
|
+
"version": "13.12.5",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"exports": {
|
|
6
6
|
"./test": {
|
|
@@ -57,15 +57,15 @@
|
|
|
57
57
|
"types": "./src/index.d.ts",
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@cantoo/pdf-lib": "^2.6.5",
|
|
60
|
-
"@dereekb/analytics": "13.12.
|
|
61
|
-
"@dereekb/date": "13.12.
|
|
62
|
-
"@dereekb/dbx-core": "13.12.
|
|
63
|
-
"@dereekb/firebase": "13.12.
|
|
64
|
-
"@dereekb/model": "13.12.
|
|
65
|
-
"@dereekb/nestjs": "13.12.
|
|
66
|
-
"@dereekb/rxjs": "13.12.
|
|
67
|
-
"@dereekb/util": "13.12.
|
|
68
|
-
"@dereekb/zoho": "13.12.
|
|
60
|
+
"@dereekb/analytics": "13.12.5",
|
|
61
|
+
"@dereekb/date": "13.12.5",
|
|
62
|
+
"@dereekb/dbx-core": "13.12.5",
|
|
63
|
+
"@dereekb/firebase": "13.12.5",
|
|
64
|
+
"@dereekb/model": "13.12.5",
|
|
65
|
+
"@dereekb/nestjs": "13.12.5",
|
|
66
|
+
"@dereekb/rxjs": "13.12.5",
|
|
67
|
+
"@dereekb/util": "13.12.5",
|
|
68
|
+
"@dereekb/zoho": "13.12.5",
|
|
69
69
|
"@google-cloud/firestore": "^7.11.6",
|
|
70
70
|
"@google-cloud/storage": "^7.19.0",
|
|
71
71
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
@@ -90,7 +90,14 @@ export interface FirebaseServerAuthUserContext extends FirebaseServerAuthUserIde
|
|
|
90
90
|
/**
|
|
91
91
|
* Applies an arbitrary update to the user's Firebase Auth record.
|
|
92
92
|
*
|
|
93
|
+
* When Firebase rejects the update because the new email or phone number is already
|
|
94
|
+
* associated with another account, throws a typed {@link FirebaseServerAuthUserExistsError}
|
|
95
|
+
* (with `identifierType` set to `'email'` or `'phone'`). When the phone number is malformed,
|
|
96
|
+
* throws a {@link FirebaseServerAuthUserBadInputError}. All other errors propagate unchanged.
|
|
97
|
+
*
|
|
93
98
|
* @param template - The update fields to apply.
|
|
99
|
+
* @throws {FirebaseServerAuthUserExistsError} When the email/phone is already in use.
|
|
100
|
+
* @throws {FirebaseServerAuthUserBadInputError} When the phone number is invalid.
|
|
94
101
|
*/
|
|
95
102
|
updateUser(template: admin.auth.UpdateRequest): Promise<admin.auth.UserRecord>;
|
|
96
103
|
/**
|
|
@@ -669,23 +676,82 @@ export interface FirebaseServerAuthPasswordResetSendContentConfig<D = unknown> {
|
|
|
669
676
|
*/
|
|
670
677
|
readonly data?: Maybe<D>;
|
|
671
678
|
}
|
|
679
|
+
/**
|
|
680
|
+
* Opaque composite token returned to the user during a password reset. Encodes both
|
|
681
|
+
* the raw reset code and the target uid in a single value so the completion call does
|
|
682
|
+
* not need a separate uid argument (which a logged-out forgot-password flow cannot provide).
|
|
683
|
+
*
|
|
684
|
+
* The on-the-wire shape is `<code>-<uid>`. The raw code is the numeric string produced by
|
|
685
|
+
* {@link DEFAULT_FIREBASE_PASSWORD_NUMBER_GENERATOR}, so the first `-` cleanly splits the token.
|
|
686
|
+
* Do not split or mutate the token outside of {@link decodeFirebaseServerUserPasswordResetOobCode}.
|
|
687
|
+
*/
|
|
688
|
+
export type FirebaseServerUserPasswordResetOobCode = string & {
|
|
689
|
+
__firebaseServerUserPasswordResetOobCode: true;
|
|
690
|
+
};
|
|
691
|
+
/**
|
|
692
|
+
* Builds the composite oob code from a raw reset code (the numeric value stored in
|
|
693
|
+
* {@link FirebaseServerAuthResetUserPasswordClaims.resetPassword}) and the target user's uid.
|
|
694
|
+
*
|
|
695
|
+
* @param uid - The target user's UID.
|
|
696
|
+
* @param code - The raw reset code from the user's claims.
|
|
697
|
+
*
|
|
698
|
+
* @example
|
|
699
|
+
* ```typescript
|
|
700
|
+
* const oobCode = encodeFirebaseServerUserPasswordResetOobCode(user.uid, claims.resetPassword);
|
|
701
|
+
* // e.g. '482910-abcDEF123'
|
|
702
|
+
* ```
|
|
703
|
+
*/
|
|
704
|
+
export declare function encodeFirebaseServerUserPasswordResetOobCode(uid: FirebaseAuthUserId, code: string): FirebaseServerUserPasswordResetOobCode;
|
|
705
|
+
/**
|
|
706
|
+
* Decodes a composite oob code back into its `{ uid, code }` parts. Returns `undefined`
|
|
707
|
+
* when the token is malformed (missing separator, non-numeric code, empty uid).
|
|
708
|
+
*
|
|
709
|
+
* @param token - The composite oob token, typically received from the password-reset email.
|
|
710
|
+
*
|
|
711
|
+
* @example
|
|
712
|
+
* ```typescript
|
|
713
|
+
* const decoded = decodeFirebaseServerUserPasswordResetOobCode('482910-abcDEF123');
|
|
714
|
+
* // decoded = { uid: 'abcDEF123', code: '482910' }
|
|
715
|
+
* ```
|
|
716
|
+
*/
|
|
717
|
+
export declare function decodeFirebaseServerUserPasswordResetOobCode(token: string): {
|
|
718
|
+
uid: FirebaseAuthUserId;
|
|
719
|
+
code: string;
|
|
720
|
+
} | undefined;
|
|
672
721
|
/**
|
|
673
722
|
* Details about a user that is in the password reset phase, including their user context,
|
|
674
|
-
* reset claims data, and the send configuration that was used.
|
|
723
|
+
* reset claims data, the encoded oob code intended for the user, and the send configuration that was used.
|
|
675
724
|
*/
|
|
676
725
|
export interface FirebaseServerAuthPasswordResetDetails<U extends FirebaseServerAuthUserContext = FirebaseServerAuthUserContext, D = unknown> extends FirebaseServerAuthPasswordResetSendContentConfig<D> {
|
|
677
726
|
readonly userContext: U;
|
|
678
727
|
readonly claims: FirebaseAuthResetUserPasswordClaimsData;
|
|
728
|
+
/**
|
|
729
|
+
* The encoded oob code intended for the user (carries the raw reset code AND the target uid).
|
|
730
|
+
* Subclasses that send password-reset emails should embed this value, not `claims.resetPassword`.
|
|
731
|
+
*/
|
|
732
|
+
readonly oobCode: FirebaseServerUserPasswordResetOobCode;
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Result of {@link FirebaseServerUserPasswordResetService.beginPasswordReset}, exposing both the
|
|
736
|
+
* stored reset claims and the encoded composite oob code intended for the user.
|
|
737
|
+
*/
|
|
738
|
+
export interface FirebaseServerAuthBeginPasswordResetResult {
|
|
739
|
+
readonly claims: FirebaseServerAuthResetUserPasswordClaims;
|
|
740
|
+
/**
|
|
741
|
+
* The encoded oob code that should be delivered to the user (e.g. embedded in the reset email).
|
|
742
|
+
*/
|
|
743
|
+
readonly oobCode: FirebaseServerUserPasswordResetOobCode;
|
|
679
744
|
}
|
|
680
745
|
/**
|
|
681
|
-
* Input for completing a password reset, containing the
|
|
682
|
-
* and the desired new password.
|
|
746
|
+
* Input for completing a password reset, containing the composite oob code from the recovery email
|
|
747
|
+
* (which encodes both the temporary reset code AND the target uid) and the desired new password.
|
|
683
748
|
*/
|
|
684
749
|
export interface FirebaseServerAuthCompletePasswordResetInput {
|
|
685
750
|
/**
|
|
686
|
-
* The
|
|
751
|
+
* The full oob token from the recovery email — encodes both the raw reset code AND the target uid.
|
|
752
|
+
* The service decodes this internally to resolve the user and verify the embedded code.
|
|
687
753
|
*/
|
|
688
|
-
readonly
|
|
754
|
+
readonly oobCode: FirebaseServerUserPasswordResetOobCode;
|
|
689
755
|
/**
|
|
690
756
|
* The new password to set after verification succeeds.
|
|
691
757
|
*/
|
|
@@ -700,9 +766,9 @@ export interface FirebaseServerAuthCompletePasswordResetInput {
|
|
|
700
766
|
* @example
|
|
701
767
|
* ```typescript
|
|
702
768
|
* const resetSvc = authService.passwordReset();
|
|
703
|
-
* const
|
|
704
|
-
* // Later, after user
|
|
705
|
-
* await resetSvc.completePasswordReset(
|
|
769
|
+
* const { oobCode } = await resetSvc.beginPasswordReset({ uid: 'some-uid', sendResetContent: true });
|
|
770
|
+
* // Later, after the user clicks the link in their reset email:
|
|
771
|
+
* await resetSvc.completePasswordReset({ oobCode, newPassword: 'newSecure' });
|
|
706
772
|
* ```
|
|
707
773
|
*/
|
|
708
774
|
export interface FirebaseServerUserPasswordResetService<D = unknown, U extends FirebaseServerAuthUserContext = FirebaseServerAuthUserContext> {
|
|
@@ -713,13 +779,16 @@ export interface FirebaseServerUserPasswordResetService<D = unknown, U extends F
|
|
|
713
779
|
* When `sendResetContent` is true, this method delegates to {@link sendResetContent} and
|
|
714
780
|
* may throw the same errors (throttle, send-once, no-config) depending on the configuration.
|
|
715
781
|
*
|
|
782
|
+
* Returns both the stored reset claims and the encoded composite oob code that should be
|
|
783
|
+
* delivered to the user (the value the user will later submit to {@link completePasswordReset}).
|
|
784
|
+
*
|
|
716
785
|
* @param input - Configuration for the reset, including user identification and send options.
|
|
717
786
|
* @throws {Error} Throws if neither uid nor email is provided.
|
|
718
787
|
* @throws {FirebaseServerAuthPasswordResetThrottleError} When send is throttled and `sendResetThrowErrors` is true.
|
|
719
788
|
* @throws {FirebaseServerAuthPasswordResetSendOnceError} When already sent and `sendResetDetailsOnce` + `sendResetThrowErrors` are true.
|
|
720
789
|
* @throws {FirebaseServerAuthPasswordResetNoResetConfigError} When no reset claims exist and `sendResetThrowErrors` is true.
|
|
721
790
|
*/
|
|
722
|
-
beginPasswordReset(input: FirebaseServerAuthInitiatePasswordReset<D>): Promise<
|
|
791
|
+
beginPasswordReset(input: FirebaseServerAuthInitiatePasswordReset<D>): Promise<FirebaseServerAuthBeginPasswordResetResult>;
|
|
723
792
|
/**
|
|
724
793
|
* Sends reset content (e.g., a reset email) to the user.
|
|
725
794
|
*
|
|
@@ -750,14 +819,19 @@ export interface FirebaseServerUserPasswordResetService<D = unknown, U extends F
|
|
|
750
819
|
*/
|
|
751
820
|
loadResetDetailsForUserContext(userContext: U, config?: FirebaseServerAuthPasswordResetSendContentConfig<D>): Promise<Maybe<FirebaseServerAuthPasswordResetDetails<U, D>>>;
|
|
752
821
|
/**
|
|
753
|
-
* Completes the password reset by
|
|
754
|
-
* claims and setting the new password.
|
|
822
|
+
* Completes the password reset by decoding the composite oob token, resolving the target user,
|
|
823
|
+
* verifying the embedded reset code against the user's claims, and setting the new password.
|
|
824
|
+
* Clears reset claims on success.
|
|
755
825
|
*
|
|
756
|
-
*
|
|
757
|
-
*
|
|
758
|
-
*
|
|
826
|
+
* The target uid is read from the encoded token — callers do not need to know it separately,
|
|
827
|
+
* which is what enables the logged-out "forgot password" flow.
|
|
828
|
+
*
|
|
829
|
+
* @param input - The encoded oob token and new password.
|
|
830
|
+
* @throws {FirebaseServerAuthPasswordResetInvalidCodeError} When the token is malformed, the
|
|
831
|
+
* embedded uid does not own an active reset, the code is expired, or the code does not match.
|
|
832
|
+
* The same opaque error is thrown for every failure mode.
|
|
759
833
|
*/
|
|
760
|
-
completePasswordReset(
|
|
834
|
+
completePasswordReset(input: FirebaseServerAuthCompletePasswordResetInput): Promise<admin.auth.UserRecord>;
|
|
761
835
|
}
|
|
762
836
|
/**
|
|
763
837
|
* Default throttle duration (60 seconds) between reset content re-sends to prevent spam while
|
|
@@ -798,7 +872,7 @@ export declare abstract class AbstractFirebaseServerUserPasswordResetService<U e
|
|
|
798
872
|
protected resetThrottleTime: Milliseconds;
|
|
799
873
|
constructor(authService: FirebaseServerAuthService<U, C>);
|
|
800
874
|
get authService(): FirebaseServerAuthService<U, C>;
|
|
801
|
-
beginPasswordReset(input: FirebaseServerAuthInitiatePasswordReset<D>): Promise<
|
|
875
|
+
beginPasswordReset(input: FirebaseServerAuthInitiatePasswordReset<D>): Promise<FirebaseServerAuthBeginPasswordResetResult>;
|
|
802
876
|
sendResetContent(uid: FirebaseAuthUserId, config?: FirebaseServerAuthPasswordResetSendContentConfig<D>): Promise<boolean>;
|
|
803
877
|
loadResetDetails(uid: FirebaseAuthUserId, config?: FirebaseServerAuthPasswordResetSendContentConfig<D>): Promise<Maybe<FirebaseServerAuthPasswordResetDetails<U, D>>>;
|
|
804
878
|
loadResetDetailsForUserContext(userContext: U, config?: FirebaseServerAuthPasswordResetSendContentConfig<D>): Promise<Maybe<FirebaseServerAuthPasswordResetDetails<U, D>>>;
|
|
@@ -808,7 +882,7 @@ export declare abstract class AbstractFirebaseServerUserPasswordResetService<U e
|
|
|
808
882
|
* @param details - The user's reset details containing the user context.
|
|
809
883
|
*/
|
|
810
884
|
protected updateResetContentSentTime(details: FirebaseServerAuthPasswordResetDetails<U, D>): Promise<void>;
|
|
811
|
-
completePasswordReset(
|
|
885
|
+
completePasswordReset(input: FirebaseServerAuthCompletePasswordResetInput): Promise<admin.auth.UserRecord>;
|
|
812
886
|
/**
|
|
813
887
|
* Delivers reset content (e.g., reset email, SMS) to the user.
|
|
814
888
|
*
|
|
@@ -136,6 +136,12 @@ export interface FirebaseServerErrorInfo {
|
|
|
136
136
|
*
|
|
137
137
|
* @param input - The value to check.
|
|
138
138
|
* @returns `true` if the input is a Firebase {@link HttpsError}.
|
|
139
|
+
*
|
|
140
|
+
* @dbxUtil
|
|
141
|
+
* @dbxUtilCategory firebase-error
|
|
142
|
+
* @dbxUtilKind function
|
|
143
|
+
* @dbxUtilTags firebase, https, error, type-guard, server, callable
|
|
144
|
+
* @dbxUtilRelated is-firebase-error, firebase-server-error-info
|
|
139
145
|
*/
|
|
140
146
|
export declare function isFirebaseHttpsError(input: unknown | HttpsError): input is HttpsError;
|
|
141
147
|
/**
|
|
@@ -143,6 +149,12 @@ export declare function isFirebaseHttpsError(input: unknown | HttpsError): input
|
|
|
143
149
|
*
|
|
144
150
|
* @param input - The value to check.
|
|
145
151
|
* @returns `true` if the input is a Firebase Admin {@link admin.FirebaseError}.
|
|
152
|
+
*
|
|
153
|
+
* @dbxUtil
|
|
154
|
+
* @dbxUtilCategory firebase-error
|
|
155
|
+
* @dbxUtilKind function
|
|
156
|
+
* @dbxUtilTags firebase, admin, error, type-guard, server
|
|
157
|
+
* @dbxUtilRelated is-firebase-https-error, firebase-server-error-info
|
|
146
158
|
*/
|
|
147
159
|
export declare function isFirebaseError(input: unknown | admin.FirebaseError): input is admin.FirebaseError;
|
|
148
160
|
/**
|
|
@@ -154,6 +166,12 @@ export declare function isFirebaseError(input: unknown | admin.FirebaseError): i
|
|
|
154
166
|
* @param e - The caught error to analyze.
|
|
155
167
|
* @returns Structured {@link FirebaseServerErrorInfo} with classified error details.
|
|
156
168
|
*
|
|
169
|
+
* @dbxUtil
|
|
170
|
+
* @dbxUtilCategory firebase-error
|
|
171
|
+
* @dbxUtilKind function
|
|
172
|
+
* @dbxUtilTags firebase, error, decode, analyze, https, admin, server, classify, server-error
|
|
173
|
+
* @dbxUtilRelated firebase-server-error-info-code-pair, firebase-server-error-info-server-error-pair, firebase-server-error-info-server-error-code-pair, is-firebase-https-error, is-firebase-error
|
|
174
|
+
*
|
|
157
175
|
* @example
|
|
158
176
|
* ```typescript
|
|
159
177
|
* try {
|
|
@@ -170,6 +188,12 @@ export declare function firebaseServerErrorInfo(e: unknown): FirebaseServerError
|
|
|
170
188
|
*
|
|
171
189
|
* @param e - The caught error to analyze.
|
|
172
190
|
* @returns A tuple of the Firebase error code (if present) and the full error info.
|
|
191
|
+
*
|
|
192
|
+
* @dbxUtil
|
|
193
|
+
* @dbxUtilCategory firebase-error
|
|
194
|
+
* @dbxUtilKind function
|
|
195
|
+
* @dbxUtilTags firebase, error, code, pair, tuple, pattern-match, decode
|
|
196
|
+
* @dbxUtilRelated firebase-server-error-info, firebase-server-error-info-server-error-pair, firebase-server-error-info-server-error-code-pair
|
|
173
197
|
*/
|
|
174
198
|
export declare function firebaseServerErrorInfoCodePair(e: unknown): [Maybe<FirebaseErrorCode>, FirebaseServerErrorInfo];
|
|
175
199
|
/**
|
|
@@ -177,6 +201,12 @@ export declare function firebaseServerErrorInfoCodePair(e: unknown): [Maybe<Fire
|
|
|
177
201
|
*
|
|
178
202
|
* @param e - The caught error to analyze.
|
|
179
203
|
* @returns A tuple of the server error (if present) and the full error info.
|
|
204
|
+
*
|
|
205
|
+
* @dbxUtil
|
|
206
|
+
* @dbxUtilCategory firebase-error
|
|
207
|
+
* @dbxUtilKind function
|
|
208
|
+
* @dbxUtilTags firebase, error, server-error, pair, tuple, pattern-match, decode, details
|
|
209
|
+
* @dbxUtilRelated firebase-server-error-info, firebase-server-error-info-code-pair, firebase-server-error-info-server-error-code-pair
|
|
180
210
|
*/
|
|
181
211
|
export declare function firebaseServerErrorInfoServerErrorPair(e: unknown): [Maybe<ServerError>, FirebaseServerErrorInfo];
|
|
182
212
|
/**
|
|
@@ -184,6 +214,12 @@ export declare function firebaseServerErrorInfoServerErrorPair(e: unknown): [May
|
|
|
184
214
|
*
|
|
185
215
|
* @param e - The caught error to analyze.
|
|
186
216
|
* @returns A tuple of the server error code (if present) and the full error info.
|
|
217
|
+
*
|
|
218
|
+
* @dbxUtil
|
|
219
|
+
* @dbxUtilCategory firebase-error
|
|
220
|
+
* @dbxUtilKind function
|
|
221
|
+
* @dbxUtilTags firebase, error, server-error, code, string-code, pair, tuple, pattern-match, decode
|
|
222
|
+
* @dbxUtilRelated firebase-server-error-info, firebase-server-error-info-code-pair, firebase-server-error-info-server-error-pair
|
|
187
223
|
*/
|
|
188
224
|
export declare function firebaseServerErrorInfoServerErrorCodePair(e: unknown): [Maybe<StringErrorCode>, FirebaseServerErrorInfo];
|
|
189
225
|
/**
|
|
@@ -193,5 +229,11 @@ export declare function firebaseServerErrorInfoServerErrorCodePair(e: unknown):
|
|
|
193
229
|
*
|
|
194
230
|
* @param e - The caught error.
|
|
195
231
|
* @param handleFirebaseErrorFn - Handler that receives the typed {@link admin.FirebaseError}.
|
|
232
|
+
*
|
|
233
|
+
* @dbxUtil
|
|
234
|
+
* @dbxUtilCategory firebase-error
|
|
235
|
+
* @dbxUtilKind function
|
|
236
|
+
* @dbxUtilTags firebase, admin, error, handler, catch, conditional, rethrow
|
|
237
|
+
* @dbxUtilRelated is-firebase-error, firebase-server-error-info
|
|
196
238
|
*/
|
|
197
239
|
export declare function handleFirebaseError(e: unknown, handleFirebaseErrorFn: ThrowErrorFunction<admin.FirebaseError>): never | void;
|
package/test/index.cjs.js
CHANGED
|
@@ -320,6 +320,20 @@ function _ts_generator$a(thisArg, body) {
|
|
|
320
320
|
return this.instance.callWrappedFunction(fn, params, skipJsonConversion);
|
|
321
321
|
}
|
|
322
322
|
},
|
|
323
|
+
{
|
|
324
|
+
/**
|
|
325
|
+
* Convenience function for calling the function without an authenticated user context.
|
|
326
|
+
*
|
|
327
|
+
* Equivalent to `fn(params, options ?? {})`.
|
|
328
|
+
*
|
|
329
|
+
* @param fn
|
|
330
|
+
* @param params
|
|
331
|
+
* @returns
|
|
332
|
+
*/ key: "callWrappedFunctionWithoutUserContext",
|
|
333
|
+
value: function callWrappedFunctionWithoutUserContext(fn, params, options) {
|
|
334
|
+
return this.instance.callWrappedFunctionWithoutUserContext(fn, params, options);
|
|
335
|
+
}
|
|
336
|
+
},
|
|
323
337
|
{
|
|
324
338
|
key: "callCloudFunction",
|
|
325
339
|
value: function callCloudFunction(fn, params) {
|
|
@@ -436,6 +450,21 @@ function _ts_generator$a(thisArg, body) {
|
|
|
436
450
|
});
|
|
437
451
|
}
|
|
438
452
|
},
|
|
453
|
+
{
|
|
454
|
+
/**
|
|
455
|
+
* Convenience function for calling the function without an authenticated user context.
|
|
456
|
+
*
|
|
457
|
+
* Equivalent to `fn(params, options ?? {})`.
|
|
458
|
+
*
|
|
459
|
+
* @param fn - Wrapped gen 2 callable request to invoke.
|
|
460
|
+
* @param params - Request payload to pass to the callable, simulating the JSON body of an HTTP call.
|
|
461
|
+
* @param options - Optional callable options.
|
|
462
|
+
* @returns Promise resolving to the callable's return value.
|
|
463
|
+
*/ key: "callWrappedFunctionWithoutUserContext",
|
|
464
|
+
value: function callWrappedFunctionWithoutUserContext(fn, params, options) {
|
|
465
|
+
return fn(params, options !== null && options !== void 0 ? options : {});
|
|
466
|
+
}
|
|
467
|
+
},
|
|
439
468
|
{
|
|
440
469
|
key: "callCloudFunction",
|
|
441
470
|
value: function callCloudFunction(fn, params) {
|
package/test/index.esm.js
CHANGED
|
@@ -319,6 +319,20 @@ function _ts_generator$a(thisArg, body) {
|
|
|
319
319
|
return this.instance.callWrappedFunction(fn, params, skipJsonConversion);
|
|
320
320
|
}
|
|
321
321
|
},
|
|
322
|
+
{
|
|
323
|
+
/**
|
|
324
|
+
* Convenience function for calling the function without an authenticated user context.
|
|
325
|
+
*
|
|
326
|
+
* Equivalent to `fn(params, options ?? {})`.
|
|
327
|
+
*
|
|
328
|
+
* @param fn
|
|
329
|
+
* @param params
|
|
330
|
+
* @returns
|
|
331
|
+
*/ key: "callWrappedFunctionWithoutUserContext",
|
|
332
|
+
value: function callWrappedFunctionWithoutUserContext(fn, params, options) {
|
|
333
|
+
return this.instance.callWrappedFunctionWithoutUserContext(fn, params, options);
|
|
334
|
+
}
|
|
335
|
+
},
|
|
322
336
|
{
|
|
323
337
|
key: "callCloudFunction",
|
|
324
338
|
value: function callCloudFunction(fn, params) {
|
|
@@ -435,6 +449,21 @@ function _ts_generator$a(thisArg, body) {
|
|
|
435
449
|
});
|
|
436
450
|
}
|
|
437
451
|
},
|
|
452
|
+
{
|
|
453
|
+
/**
|
|
454
|
+
* Convenience function for calling the function without an authenticated user context.
|
|
455
|
+
*
|
|
456
|
+
* Equivalent to `fn(params, options ?? {})`.
|
|
457
|
+
*
|
|
458
|
+
* @param fn - Wrapped gen 2 callable request to invoke.
|
|
459
|
+
* @param params - Request payload to pass to the callable, simulating the JSON body of an HTTP call.
|
|
460
|
+
* @param options - Optional callable options.
|
|
461
|
+
* @returns Promise resolving to the callable's return value.
|
|
462
|
+
*/ key: "callWrappedFunctionWithoutUserContext",
|
|
463
|
+
value: function callWrappedFunctionWithoutUserContext(fn, params, options) {
|
|
464
|
+
return fn(params, options !== null && options !== void 0 ? options : {});
|
|
465
|
+
}
|
|
466
|
+
},
|
|
438
467
|
{
|
|
439
468
|
key: "callCloudFunction",
|
|
440
469
|
value: function callCloudFunction(fn, params) {
|
package/test/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server/test",
|
|
3
|
-
"version": "13.12.
|
|
3
|
+
"version": "13.12.5",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/analytics": "13.12.
|
|
6
|
-
"@dereekb/date": "13.12.
|
|
7
|
-
"@dereekb/firebase": "13.12.
|
|
8
|
-
"@dereekb/firebase-server": "13.12.
|
|
9
|
-
"@dereekb/firebase-server/oidc": "13.12.
|
|
10
|
-
"@dereekb/model": "13.12.
|
|
11
|
-
"@dereekb/nestjs": "13.12.
|
|
12
|
-
"@dereekb/rxjs": "13.12.
|
|
13
|
-
"@dereekb/util": "13.12.
|
|
5
|
+
"@dereekb/analytics": "13.12.5",
|
|
6
|
+
"@dereekb/date": "13.12.5",
|
|
7
|
+
"@dereekb/firebase": "13.12.5",
|
|
8
|
+
"@dereekb/firebase-server": "13.12.5",
|
|
9
|
+
"@dereekb/firebase-server/oidc": "13.12.5",
|
|
10
|
+
"@dereekb/model": "13.12.5",
|
|
11
|
+
"@dereekb/nestjs": "13.12.5",
|
|
12
|
+
"@dereekb/rxjs": "13.12.5",
|
|
13
|
+
"@dereekb/util": "13.12.5",
|
|
14
14
|
"@google-cloud/firestore": "^7.11.6",
|
|
15
15
|
"@google-cloud/storage": "^7.19.0",
|
|
16
16
|
"@nestjs/common": "^11.1.19",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"supertest": "^7.2.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@dereekb/nestjs": "13.12.
|
|
26
|
+
"@dereekb/nestjs": "13.12.5"
|
|
27
27
|
},
|
|
28
28
|
"exports": {
|
|
29
29
|
"./package.json": "./package.json",
|
|
@@ -42,6 +42,7 @@ export interface AuthorizedUserTestContext {
|
|
|
42
42
|
loadDecodedIdToken(): Promise<DecodedIdToken>;
|
|
43
43
|
makeContextOptions(): Promise<ContextOptions>;
|
|
44
44
|
callWrappedFunction<F extends WrappedCallableRequest<any, any>>(fn: F, params: WrappedCallableRequestParams<F>, skipJsonConversion?: boolean): Promise<WrappedCallableRequestOutput<F>>;
|
|
45
|
+
callWrappedFunctionWithoutUserContext<F extends WrappedCallableRequest<any, any>>(fn: F, params: WrappedCallableRequestParams<F>, options?: CallableContextOptions): Promise<WrappedCallableRequestOutput<F>>;
|
|
45
46
|
/**
|
|
46
47
|
* Used for calling any non-callable gen 2 function (e.g. scheduled functions, cloud functions, blocking functions) or any gen 1 function.
|
|
47
48
|
*
|
|
@@ -75,6 +76,16 @@ export declare class AuthorizedUserTestContextFixture<PI extends FirebaseAdminTe
|
|
|
75
76
|
loadDecodedIdToken(): Promise<DecodedIdToken>;
|
|
76
77
|
makeContextOptions(): Promise<ContextOptions>;
|
|
77
78
|
callWrappedFunction<F extends WrappedCallableRequest<any, any>>(fn: F, params: WrappedCallableRequestParams<F>, skipJsonConversion?: boolean): Promise<WrappedCallableRequestOutput<F>>;
|
|
79
|
+
/**
|
|
80
|
+
* Convenience function for calling the function without an authenticated user context.
|
|
81
|
+
*
|
|
82
|
+
* Equivalent to `fn(params, options ?? {})`.
|
|
83
|
+
*
|
|
84
|
+
* @param fn
|
|
85
|
+
* @param params
|
|
86
|
+
* @returns
|
|
87
|
+
*/
|
|
88
|
+
callWrappedFunctionWithoutUserContext<F extends WrappedCallableRequest<any, any>>(fn: F, params: WrappedCallableRequestParams<F>, options?: CallableContextOptions): Promise<WrappedCallableRequestOutput<F>>;
|
|
78
89
|
callCloudFunction<F extends WrappedCloudFunction<I, O>, I extends object, O = unknown>(fn: F, params: I, skipJsonConversion?: boolean): Promise<O>;
|
|
79
90
|
callCloudFunction<F extends WrappedScheduledFunction, O = unknown>(fn: F): Promise<O>;
|
|
80
91
|
callCloudFunction<F extends WrappedBlockingFunctionWithHandler<E, O>, E extends object, O>(fn: F, params: E): Promise<O>;
|
|
@@ -115,6 +126,17 @@ export declare class AuthorizedUserTestContextInstance<PI extends FirebaseAdminT
|
|
|
115
126
|
* @returns Promise resolving to the callable's return value.
|
|
116
127
|
*/
|
|
117
128
|
callWrappedFunction<F extends WrappedCallableRequest<any, any>>(fn: F, params: WrappedCallableRequestParams<F>, skipJsonConversion?: boolean): Promise<WrappedCallableRequestOutput<F>>;
|
|
129
|
+
/**
|
|
130
|
+
* Convenience function for calling the function without an authenticated user context.
|
|
131
|
+
*
|
|
132
|
+
* Equivalent to `fn(params, options ?? {})`.
|
|
133
|
+
*
|
|
134
|
+
* @param fn - Wrapped gen 2 callable request to invoke.
|
|
135
|
+
* @param params - Request payload to pass to the callable, simulating the JSON body of an HTTP call.
|
|
136
|
+
* @param options - Optional callable options.
|
|
137
|
+
* @returns Promise resolving to the callable's return value.
|
|
138
|
+
*/
|
|
139
|
+
callWrappedFunctionWithoutUserContext<F extends WrappedCallableRequest<any, any>>(fn: F, params: WrappedCallableRequestParams<F>, options?: CallableContextOptions): Promise<WrappedCallableRequestOutput<F>>;
|
|
118
140
|
/**
|
|
119
141
|
* Calls a wrapped gen 2 scheduled/blocking/event function with the input params and context options from makeContextOptions().
|
|
120
142
|
*
|
package/twilio/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server/twilio",
|
|
3
|
-
"version": "13.12.
|
|
3
|
+
"version": "13.12.5",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/date": "13.12.
|
|
6
|
-
"@dereekb/firebase": "13.12.
|
|
7
|
-
"@dereekb/firebase-server": "13.12.
|
|
8
|
-
"@dereekb/model": "13.12.
|
|
9
|
-
"@dereekb/nestjs": "13.12.
|
|
10
|
-
"@dereekb/rxjs": "13.12.
|
|
11
|
-
"@dereekb/util": "13.12.
|
|
5
|
+
"@dereekb/date": "13.12.5",
|
|
6
|
+
"@dereekb/firebase": "13.12.5",
|
|
7
|
+
"@dereekb/firebase-server": "13.12.5",
|
|
8
|
+
"@dereekb/model": "13.12.5",
|
|
9
|
+
"@dereekb/nestjs": "13.12.5",
|
|
10
|
+
"@dereekb/rxjs": "13.12.5",
|
|
11
|
+
"@dereekb/util": "13.12.5"
|
|
12
12
|
},
|
|
13
13
|
"exports": {
|
|
14
14
|
"./package.json": "./package.json",
|
package/zoho/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server/zoho",
|
|
3
|
-
"version": "13.12.
|
|
3
|
+
"version": "13.12.5",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/analytics": "13.12.
|
|
6
|
-
"@dereekb/date": "13.12.
|
|
7
|
-
"@dereekb/model": "13.12.
|
|
8
|
-
"@dereekb/nestjs": "13.12.
|
|
9
|
-
"@dereekb/rxjs": "13.12.
|
|
10
|
-
"@dereekb/firebase": "13.12.
|
|
11
|
-
"@dereekb/util": "13.12.
|
|
12
|
-
"@dereekb/zoho": "13.12.
|
|
5
|
+
"@dereekb/analytics": "13.12.5",
|
|
6
|
+
"@dereekb/date": "13.12.5",
|
|
7
|
+
"@dereekb/model": "13.12.5",
|
|
8
|
+
"@dereekb/nestjs": "13.12.5",
|
|
9
|
+
"@dereekb/rxjs": "13.12.5",
|
|
10
|
+
"@dereekb/firebase": "13.12.5",
|
|
11
|
+
"@dereekb/util": "13.12.5",
|
|
12
|
+
"@dereekb/zoho": "13.12.5"
|
|
13
13
|
},
|
|
14
14
|
"exports": {
|
|
15
15
|
"./package.json": "./package.json",
|