Skip to content

Commit e16ccc4

Browse files
refactor(app-check): migrate to TypeScript (#8813)
1 parent 98b4d79 commit e16ccc4

20 files changed

+929
-687
lines changed

packages/ai/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@react-native-firebase/app/lib/internal": ["../app/dist/typescript/commonjs/lib/internal"],
3434
"@react-native-firebase/app": ["../app/dist/typescript/commonjs/lib"],
3535
"@react-native-firebase/auth": ["../auth/lib"],
36-
"@react-native-firebase/app-check": ["../app-check/lib"]
36+
"@react-native-firebase/app-check": ["../app-check/dist/typescript/commonjs/lib"]
3737
}
3838
},
3939
"include": ["lib/**/*"],

packages/app-check/__tests__/appcheck.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
ReactNativeFirebaseAppCheckProviderAndroidOptions,
2525
ReactNativeFirebaseAppCheckProviderAppleOptions,
2626
ReactNativeFirebaseAppCheckProviderWebOptions,
27-
ReactNativeFirebaseAppCheckProvider,
2827
} from '../lib';
2928

3029
describe('appCheck()', function () {
@@ -84,8 +83,8 @@ describe('appCheck()', function () {
8483
});
8584

8685
it('`ReactNativeAppCheckProvider objects are properly exposed to end user', function () {
87-
expect(ReactNativeFirebaseAppCheckProvider).toBeDefined();
88-
const provider = new ReactNativeFirebaseAppCheckProvider();
86+
expect(firebase.appCheck().newReactNativeFirebaseAppCheckProvider).toBeDefined();
87+
const provider = firebase.appCheck().newReactNativeFirebaseAppCheckProvider();
8988
expect(provider.configure).toBeDefined();
9089
const options = { debugToken: 'foo' } as ReactNativeFirebaseAppCheckProviderOptions;
9190
const appleOptions = {

packages/app-check/lib/ReactNativeFirebaseAppCheckProvider.js

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import type {
2+
AppCheckProvider,
3+
AppCheckToken,
4+
ReactNativeFirebaseAppCheckProviderOptionsMap as ProviderOptions,
5+
} from './types/appcheck';
6+
7+
export default class ReactNativeFirebaseAppCheckProvider implements AppCheckProvider {
8+
providerOptions?: ProviderOptions;
9+
10+
constructor() {}
11+
12+
configure(options: ProviderOptions): void {
13+
this.providerOptions = options;
14+
}
15+
16+
async getToken(): Promise<AppCheckToken> {
17+
// This is a placeholder - the actual implementation is handled by the native modules
18+
// This method exists to satisfy the AppCheckProvider interface
19+
throw new Error('getToken() must be called after configure() and is handled by native modules');
20+
}
21+
}

0 commit comments

Comments
 (0)