Skip to content

Commit

Permalink
fix(functions): expose HttpsErrorCode for modular API
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley authored and mikehardy committed Feb 11, 2025
1 parent 6a7867c commit bfb9296
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/functions/__tests__/functions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import functions, {
connectFunctionsEmulator,
httpsCallable,
httpsCallableFromUrl,
HttpsErrorCode,
} from '../lib';

describe('Cloud Functions', function () {
Expand Down Expand Up @@ -79,5 +80,9 @@ describe('Cloud Functions', function () {
it('`httpsCallableFromUrl` function is properly exposed to end user', function () {
expect(httpsCallableFromUrl).toBeDefined();
});

it('`HttpsErrorCode` function is properly exposed to end user', function () {
expect(HttpsErrorCode).toBeDefined();
});
});
});
4 changes: 4 additions & 0 deletions packages/functions/lib/modular/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import FirebaseApp = ReactNativeFirebase.FirebaseApp;
import Functions = FirebaseFunctionsTypes.Module;
import HttpsCallable = FirebaseFunctionsTypes.HttpsCallable;
import HttpsCallableOptions = FirebaseFunctionsTypes.HttpsCallableOptions;
import HttpsErrorCodeType = FirebaseFunctionsTypes.HttpsErrorCode;

export const HttpsErrorCode: HttpsErrorCodeType;

/**
* Get a {@link Functions} instance for the given app.
* @param {FirebaseApp | undefined} app - The FirebaseApp to use. Optional.
Expand Down
2 changes: 2 additions & 0 deletions packages/functions/lib/modular/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ export function httpsCallable(functionsInstance, name, options) {
export function httpsCallableFromUrl(functionsInstance, url, options) {
return functionsInstance.httpsCallableFromUrl(url, options);
}

export { HttpsErrorCode } from '../index';

0 comments on commit bfb9296

Please sign in to comment.