@react-native-firebase/app-check 23.7.0 → 23.8.1

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 (94) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/commonjs/ReactNativeFirebaseAppCheckProvider.js +19 -0
  3. package/dist/commonjs/ReactNativeFirebaseAppCheckProvider.js.map +1 -0
  4. package/dist/commonjs/index.js +38 -0
  5. package/dist/commonjs/index.js.map +1 -0
  6. package/dist/commonjs/modular.js +124 -0
  7. package/dist/commonjs/modular.js.map +1 -0
  8. package/dist/commonjs/namespaced.js +212 -0
  9. package/dist/commonjs/namespaced.js.map +1 -0
  10. package/dist/commonjs/package.json +1 -0
  11. package/dist/commonjs/types/appcheck.js +93 -0
  12. package/dist/commonjs/types/appcheck.js.map +1 -0
  13. package/dist/commonjs/version.js +9 -0
  14. package/dist/commonjs/version.js.map +1 -0
  15. package/dist/commonjs/web/RNFBAppCheckModule.android.js +10 -0
  16. package/dist/commonjs/web/RNFBAppCheckModule.android.js.map +1 -0
  17. package/dist/commonjs/web/RNFBAppCheckModule.ios.js +10 -0
  18. package/dist/commonjs/web/RNFBAppCheckModule.ios.js.map +1 -0
  19. package/dist/commonjs/web/RNFBAppCheckModule.js +91 -0
  20. package/dist/commonjs/web/RNFBAppCheckModule.js.map +1 -0
  21. package/dist/module/ReactNativeFirebaseAppCheckProvider.js +14 -0
  22. package/dist/module/ReactNativeFirebaseAppCheckProvider.js.map +1 -0
  23. package/dist/module/index.js +28 -0
  24. package/dist/module/index.js.map +1 -0
  25. package/dist/module/modular.js +110 -0
  26. package/dist/module/modular.js.map +1 -0
  27. package/{lib/index.js → dist/module/namespaced.js} +50 -80
  28. package/dist/module/namespaced.js.map +1 -0
  29. package/dist/module/package.json +1 -0
  30. package/dist/module/types/appcheck.js +89 -0
  31. package/dist/module/types/appcheck.js.map +1 -0
  32. package/dist/module/version.js +5 -0
  33. package/dist/module/version.js.map +1 -0
  34. package/dist/module/web/RNFBAppCheckModule.android.js +6 -0
  35. package/dist/module/web/RNFBAppCheckModule.android.js.map +1 -0
  36. package/dist/module/web/RNFBAppCheckModule.ios.js +6 -0
  37. package/dist/module/web/RNFBAppCheckModule.ios.js.map +1 -0
  38. package/{lib → dist/module}/web/RNFBAppCheckModule.js +19 -27
  39. package/dist/module/web/RNFBAppCheckModule.js.map +1 -0
  40. package/dist/typescript/commonjs/lib/ReactNativeFirebaseAppCheckProvider.d.ts +8 -0
  41. package/dist/typescript/commonjs/lib/ReactNativeFirebaseAppCheckProvider.d.ts.map +1 -0
  42. package/dist/typescript/commonjs/lib/index.d.ts +5 -0
  43. package/dist/typescript/commonjs/lib/index.d.ts.map +1 -0
  44. package/dist/typescript/commonjs/lib/modular.d.ts +57 -0
  45. package/dist/typescript/commonjs/lib/modular.d.ts.map +1 -0
  46. package/dist/typescript/commonjs/lib/namespaced.d.ts +17 -0
  47. package/dist/typescript/commonjs/lib/namespaced.d.ts.map +1 -0
  48. package/{lib/index.d.ts → dist/typescript/commonjs/lib/types/appcheck.d.ts} +162 -221
  49. package/dist/typescript/commonjs/lib/types/appcheck.d.ts.map +1 -0
  50. package/dist/typescript/commonjs/lib/version.d.ts +2 -0
  51. package/dist/typescript/commonjs/lib/version.d.ts.map +1 -0
  52. package/dist/typescript/commonjs/lib/web/RNFBAppCheckModule.android.d.ts +3 -0
  53. package/dist/typescript/commonjs/lib/web/RNFBAppCheckModule.android.d.ts.map +1 -0
  54. package/dist/typescript/commonjs/lib/web/RNFBAppCheckModule.d.ts +18 -0
  55. package/dist/typescript/commonjs/lib/web/RNFBAppCheckModule.d.ts.map +1 -0
  56. package/dist/typescript/commonjs/lib/web/RNFBAppCheckModule.ios.d.ts +3 -0
  57. package/dist/typescript/commonjs/lib/web/RNFBAppCheckModule.ios.d.ts.map +1 -0
  58. package/dist/typescript/commonjs/package.json +1 -0
  59. package/dist/typescript/module/lib/ReactNativeFirebaseAppCheckProvider.d.ts +8 -0
  60. package/dist/typescript/module/lib/ReactNativeFirebaseAppCheckProvider.d.ts.map +1 -0
  61. package/dist/typescript/module/lib/index.d.ts +5 -0
  62. package/dist/typescript/module/lib/index.d.ts.map +1 -0
  63. package/dist/typescript/module/lib/modular.d.ts +57 -0
  64. package/dist/typescript/module/lib/modular.d.ts.map +1 -0
  65. package/dist/typescript/module/lib/namespaced.d.ts +17 -0
  66. package/dist/typescript/module/lib/namespaced.d.ts.map +1 -0
  67. package/dist/typescript/module/lib/types/appcheck.d.ts +299 -0
  68. package/dist/typescript/module/lib/types/appcheck.d.ts.map +1 -0
  69. package/dist/typescript/module/lib/version.d.ts +2 -0
  70. package/dist/typescript/module/lib/version.d.ts.map +1 -0
  71. package/dist/typescript/module/lib/web/RNFBAppCheckModule.android.d.ts +3 -0
  72. package/dist/typescript/module/lib/web/RNFBAppCheckModule.android.d.ts.map +1 -0
  73. package/dist/typescript/module/lib/web/RNFBAppCheckModule.d.ts +18 -0
  74. package/dist/typescript/module/lib/web/RNFBAppCheckModule.d.ts.map +1 -0
  75. package/dist/typescript/module/lib/web/RNFBAppCheckModule.ios.d.ts +3 -0
  76. package/dist/typescript/module/lib/web/RNFBAppCheckModule.ios.d.ts.map +1 -0
  77. package/dist/typescript/module/package.json +1 -0
  78. package/lib/ReactNativeFirebaseAppCheckProvider.ts +21 -0
  79. package/lib/index.ts +46 -0
  80. package/lib/modular.ts +157 -0
  81. package/lib/namespaced.ts +305 -0
  82. package/lib/types/appcheck.ts +386 -0
  83. package/lib/version.ts +2 -0
  84. package/lib/web/RNFBAppCheckModule.android.ts +4 -0
  85. package/lib/web/RNFBAppCheckModule.ios.ts +4 -0
  86. package/lib/web/RNFBAppCheckModule.ts +115 -0
  87. package/package.json +54 -8
  88. package/tsconfig.json +21 -0
  89. package/lib/ReactNativeFirebaseAppCheckProvider.js +0 -9
  90. package/lib/modular/index.d.ts +0 -149
  91. package/lib/modular/index.js +0 -102
  92. package/lib/version.js +0 -2
  93. package/lib/web/RNFBAppCheckModule.android.js +0 -2
  94. package/lib/web/RNFBAppCheckModule.ios.js +0 -2
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _firebaseAppCheck = require("@react-native-firebase/app/lib/internal/web/firebaseAppCheck");
8
+ var _utils = require("@react-native-firebase/app/lib/internal/web/utils");
9
+ let appCheckInstances = {};
10
+ let listenersForApp = {};
11
+ function getAppCheckInstanceForApp(appName) {
12
+ if (!appCheckInstances[appName]) {
13
+ throw new Error(`firebase AppCheck instance for app ${appName} has not been initialized, ensure you have called initializeAppCheck() first.`);
14
+ }
15
+ return appCheckInstances[appName];
16
+ }
17
+ /**
18
+ * This is a 'NativeModule' for the web platform.
19
+ * Methods here are identical to the ones found in
20
+ * the native android/ios modules e.g. `@ReactMethod` annotated
21
+ * java methods on Android.
22
+ */
23
+ const _module = {
24
+ initializeAppCheck(appName, options) {
25
+ (0, _firebaseAppCheck.makeIDBAvailable)();
26
+ return (0, _utils.guard)(async () => {
27
+ if (appCheckInstances[appName]) {
28
+ return;
29
+ }
30
+ const {
31
+ provider,
32
+ isTokenAutoRefreshEnabled
33
+ } = options;
34
+ const _provider = new _firebaseAppCheck.CustomProvider({
35
+ getToken() {
36
+ if ('getToken' in provider && typeof provider.getToken === 'function') {
37
+ return provider.getToken();
38
+ }
39
+ throw new Error('Provider does not have a getToken method');
40
+ }
41
+ });
42
+ appCheckInstances[appName] = (0, _firebaseAppCheck.initializeAppCheck)((0, _firebaseAppCheck.getApp)(appName), {
43
+ provider: _provider,
44
+ isTokenAutoRefreshEnabled
45
+ });
46
+ });
47
+ },
48
+ setTokenAutoRefreshEnabled(appName, isTokenAutoRefreshEnabled) {
49
+ return (0, _utils.guard)(async () => {
50
+ const instance = getAppCheckInstanceForApp(appName);
51
+ (0, _firebaseAppCheck.setTokenAutoRefreshEnabled)(instance, isTokenAutoRefreshEnabled);
52
+ });
53
+ },
54
+ getLimitedUseToken(appName) {
55
+ return (0, _utils.guard)(async () => {
56
+ const instance = getAppCheckInstanceForApp(appName);
57
+ return (0, _firebaseAppCheck.getLimitedUseToken)(instance);
58
+ });
59
+ },
60
+ getToken(appName, forceRefresh) {
61
+ return (0, _utils.guard)(async () => {
62
+ const instance = getAppCheckInstanceForApp(appName);
63
+ return (0, _firebaseAppCheck.getToken)(instance, forceRefresh);
64
+ });
65
+ },
66
+ addAppCheckListener(appName) {
67
+ return (0, _utils.guard)(async () => {
68
+ if (listenersForApp[appName]) {
69
+ return;
70
+ }
71
+ const instance = getAppCheckInstanceForApp(appName);
72
+ listenersForApp[appName] = (0, _firebaseAppCheck.onTokenChanged)(instance, tokenResult => {
73
+ (0, _utils.emitEvent)('appCheck_token_changed', {
74
+ appName,
75
+ ...tokenResult
76
+ });
77
+ });
78
+ });
79
+ },
80
+ removeAppCheckListener(appName) {
81
+ return (0, _utils.guard)(async () => {
82
+ if (!listenersForApp[appName]) {
83
+ return;
84
+ }
85
+ listenersForApp[appName]();
86
+ delete listenersForApp[appName];
87
+ });
88
+ }
89
+ };
90
+ var _default = exports.default = _module;
91
+ //# sourceMappingURL=RNFBAppCheckModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_firebaseAppCheck","require","_utils","appCheckInstances","listenersForApp","getAppCheckInstanceForApp","appName","Error","module","initializeAppCheck","options","makeIDBAvailable","guard","provider","isTokenAutoRefreshEnabled","_provider","CustomProvider","getToken","getApp","setTokenAutoRefreshEnabled","instance","getLimitedUseToken","forceRefresh","addAppCheckListener","onTokenChanged","tokenResult","emitEvent","removeAppCheckListener","_default","exports","default"],"sourceRoot":"../../../lib","sources":["web/RNFBAppCheckModule.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAUA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAIE,iBAAsC,GAAG,CAAC,CAAC;AAC/C,IAAIC,eAA2C,GAAG,CAAC,CAAC;AAEpD,SAASC,yBAAyBA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C,YAAY;MACvB,MAAMQ,QAAQ,GAAGf,yBAAyB,CAACC,OAAO,CAAC;MACnD,OAAO,IAAAe,oCAAkB,EAACD,QAAQ,CAAC;IACrC,CAAC,CAAC;EACJ,CAAC;EACDH,QAAQA,CAACX,OAAe,EAAEgB,YAAqB,EAAE;IAC/C,OAAO,IAAAV,YAAK,EAAC,YAAY;MACvB,MAAMQ,QAAQ,GAAGf,yBAAyB,CAACC,OAAO,CAAC;MACnD,OAAO,IAAAW,0BAAQ,EAACG,QAAQ,EAAEE,YAAY,CAAC;IACzC,CAAC,CAAC;EACJ,CAAC;EACDC,mBAAmBA,CAACjB,OAAe,EAAE;IACnC,OAAO,IAAAM,YAAK,EAAC,YAAY;MACvB,IAAIR,eAAe,CAACE,OAAO,CAAC,EAAE;QAC5B;MACF;MACA,MAAMc,QAAQ,GAAGf,yBAAyB,CAACC,OAAO,CAAC;MACnDF,eAAe,CAACE,OAAO,CAAC,GAAG,IAAAkB,gCAAc,EACvCJ,QAAQ,EACPK,WAAsD,IAAK;QAC1D,IAAAC,gBAAS,EAAC,wBAAwB,EAAE;UAClCpB,OAAO;UACP,GAAGmB;QACL,CAAC,CAAC;MACJ,CACF,CAAC;IACH,CAAC,CAAC;EACJ,CAAC;EACDE,sBAAsBA,CAACrB,OAAe,EAAE;IACtC,OAAO,IAAAM,YAAK,EAAC,YAAY;MACvB,IAAI,CAACR,eAAe,CAACE,OAAO,CAAC,EAAE;QAC7B;MACF;MACAF,eAAe,CAACE,OAAO,CAAC,CAAC,CAAC;MAC1B,OAAOF,eAAe,CAACE,OAAO,CAAC;IACjC,CAAC,CAAC;EACJ;AACF,CAAC;AAAC,IAAAsB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEatB,OAAM","ignoreList":[]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ export default class ReactNativeFirebaseAppCheckProvider {
4
+ constructor() {}
5
+ configure(options) {
6
+ this.providerOptions = options;
7
+ }
8
+ async getToken() {
9
+ // This is a placeholder - the actual implementation is handled by the native modules
10
+ // This method exists to satisfy the AppCheckProvider interface
11
+ throw new Error('getToken() must be called after configure() and is handled by native modules');
12
+ }
13
+ }
14
+ //# sourceMappingURL=ReactNativeFirebaseAppCheckProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ReactNativeFirebaseAppCheckProvider","constructor","configure","options","providerOptions","getToken","Error"],"sourceRoot":"../../lib","sources":["ReactNativeFirebaseAppCheckProvider.ts"],"mappings":";;AAMA,eAAe,MAAMA,mCAAmC,CAA6B;EAGnFC,WAAWA,CAAA,EAAG,CAAC;EAEfC,SAASA,CAACC,OAAwB,EAAQ;IACxC,IAAI,CAACC,eAAe,GAAGD,OAAO;EAChC;EAEA,MAAME,QAAQA,CAAA,EAA2B;IACvC;IACA;IACA,MAAM,IAAIC,KAAK,CAAC,8EAA8E,CAAC;EACjG;AACF","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+
20
+ // Export types from types/appcheck
21
+
22
+ // Export modular API functions
23
+ export * from "./modular.js";
24
+
25
+ // Export namespaced API
26
+ export * from "./namespaced.js";
27
+ export { default } from "./namespaced.js";
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["default"],"sourceRoot":"../../lib","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAuBA;AACA,cAAc,cAAW;;AAEzB;AACA,cAAc,iBAAc;AAC5B,SAASA,OAAO,QAAQ,iBAAc","ignoreList":[]}
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+
20
+ import { getApp } from '@react-native-firebase/app';
21
+ import { MODULAR_DEPRECATION_ARG } from '@react-native-firebase/app/lib/common';
22
+ import ReactNativeFirebaseAppCheckProvider from "./ReactNativeFirebaseAppCheckProvider.js";
23
+ /**
24
+ * Activate App Check for the given app. Can be called only once per app.
25
+ * @param app - The app to initialize App Check for. Optional.
26
+ * @param options - App Check options.
27
+ * @returns Promise<AppCheck>
28
+ */
29
+ export async function initializeAppCheck(app, options) {
30
+ if (app) {
31
+ const appInstance = getApp(app.name);
32
+ const appCheck = appInstance.appCheck();
33
+ // @ts-ignore - Extra arg used by deprecation proxy to detect modular calls
34
+ await appCheck.initializeAppCheck.call(appCheck, options, MODULAR_DEPRECATION_ARG);
35
+ return appCheck;
36
+ }
37
+ const appInstance = getApp();
38
+ const appCheck = appInstance.appCheck();
39
+ // @ts-ignore - Extra arg used by deprecation proxy to detect modular calls
40
+ await appCheck.initializeAppCheck.call(appCheck, options, MODULAR_DEPRECATION_ARG);
41
+ return appCheck;
42
+ }
43
+
44
+ /**
45
+ * Get the current App Check token. Attaches to the most recent in-flight request if one is present.
46
+ * Returns null if no token is present and no token requests are in-flight.
47
+ * @param appCheckInstance - The App Check instance.
48
+ * @param forceRefresh - Whether to force refresh the token. Optional
49
+ * @returns Promise<AppCheckTokenResult>
50
+ */
51
+ export function getToken(appCheckInstance, forceRefresh) {
52
+ return appCheckInstance.getToken.call(appCheckInstance, forceRefresh,
53
+ // @ts-ignore - Extra arg used by deprecation proxy to detect modular calls
54
+ MODULAR_DEPRECATION_ARG);
55
+ }
56
+
57
+ /**
58
+ * Get a limited-use (consumable) App Check token.
59
+ * For use with server calls to firebase functions or custom backends using the firebase admin SDK.
60
+ * @param appCheckInstance - The App Check instance.
61
+ * @returns Promise<AppCheckTokenResult>
62
+ */
63
+ export function getLimitedUseToken(appCheckInstance) {
64
+ return appCheckInstance.getLimitedUseToken.call(appCheckInstance,
65
+ // @ts-ignore - Extra arg used by deprecation proxy to detect modular calls
66
+ MODULAR_DEPRECATION_ARG);
67
+ }
68
+
69
+ /**
70
+ * Set whether App Check will automatically refresh tokens as needed.
71
+ * @param appCheckInstance - The App Check instance.
72
+ * @param isAutoRefreshEnabled - Whether to enable auto-refresh.
73
+ */
74
+ export function setTokenAutoRefreshEnabled(appCheckInstance, isAutoRefreshEnabled) {
75
+ appCheckInstance.setTokenAutoRefreshEnabled.call(appCheckInstance, isAutoRefreshEnabled,
76
+ // @ts-ignore - Extra arg used by deprecation proxy to detect modular calls
77
+ MODULAR_DEPRECATION_ARG);
78
+ }
79
+
80
+ /**
81
+ * Registers a listener to changes in the token state. There can be more
82
+ * than one listener registered at the same time for one or more
83
+ * App Check instances. The listeners call back on the UI thread whenever
84
+ * the current token associated with this App Check instance changes.
85
+ *
86
+ * @param appCheckInstance - The App Check instance.
87
+ * @param listener - The listener to register.
88
+ * @returns Unsubscribe
89
+ */
90
+
91
+ /**
92
+ * Registers a listener to changes in the token state. There can be more
93
+ * than one listener registered at the same time for one or more
94
+ * App Check instances. The listeners call back on the UI thread whenever
95
+ * the current token associated with this App Check instance changes.
96
+ *
97
+ * @param appCheckInstance - The App Check instance.
98
+ * @param onNext - The callback function for token changes.
99
+ * @param onError - Optional error callback.
100
+ * @param onCompletion - Optional completion callback.
101
+ * @returns Unsubscribe
102
+ */
103
+
104
+ export function onTokenChanged(appCheckInstance, onNextOrObserver, onError, onCompletion) {
105
+ return appCheckInstance.onTokenChanged.call(appCheckInstance, onNextOrObserver, onError, onCompletion,
106
+ // @ts-ignore - Extra arg used by deprecation proxy to detect modular calls
107
+ MODULAR_DEPRECATION_ARG);
108
+ }
109
+ export { ReactNativeFirebaseAppCheckProvider };
110
+ //# sourceMappingURL=modular.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getApp","MODULAR_DEPRECATION_ARG","ReactNativeFirebaseAppCheckProvider","initializeAppCheck","app","options","appInstance","name","appCheck","call","getToken","appCheckInstance","forceRefresh","getLimitedUseToken","setTokenAutoRefreshEnabled","isAutoRefreshEnabled","onTokenChanged","onNextOrObserver","onError","onCompletion"],"sourceRoot":"../../lib","sources":["modular.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAkC,4BAA4B;AAC7E,SAASC,uBAAuB,QAAQ,uCAAuC;AAC/E,OAAOC,mCAAmC,MAAM,0CAAuC;AAWvF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,kBAAkBA,CACtCC,GAAqC,EACrCC,OAAyB,EACN;EACnB,IAAID,GAAG,EAAE;IACP,MAAME,WAAW,GAAGN,MAAM,CAACI,GAAG,CAACG,IAAI,CAAoC;IACvE,MAAMC,QAAQ,GAAGF,WAAW,CAACE,QAAQ,CAAC,CAAC;IACvC;IACA,MAAMA,QAAQ,CAACL,kBAAkB,CAACM,IAAI,CAACD,QAAQ,EAAEH,OAAO,EAAEJ,uBAAuB,CAAC;IAClF,OAAOO,QAAQ;EACjB;EACA,MAAMF,WAAW,GAAGN,MAAM,CAAC,CAAoC;EAC/D,MAAMQ,QAAQ,GAAGF,WAAW,CAACE,QAAQ,CAAC,CAAC;EACvC;EACA,MAAMA,QAAQ,CAACL,kBAAkB,CAACM,IAAI,CAACD,QAAQ,EAAEH,OAAO,EAAEJ,uBAAuB,CAAC;EAClF,OAAOO,QAAQ;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,QAAQA,CACtBC,gBAA0B,EAC1BC,YAAsB,EACQ;EAC9B,OAAOD,gBAAgB,CAACD,QAAQ,CAACD,IAAI,CACnCE,gBAAgB,EAChBC,YAAY;EACZ;EACAX,uBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASY,kBAAkBA,CAACF,gBAA0B,EAAgC;EAC3F,OAAOA,gBAAgB,CAACE,kBAAkB,CAACJ,IAAI,CAC7CE,gBAAgB;EAChB;EACAV,uBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASa,0BAA0BA,CACxCH,gBAA0B,EAC1BI,oBAA6B,EACvB;EACNJ,gBAAgB,CAACG,0BAA0B,CAACL,IAAI,CAC9CE,gBAAgB,EAChBI,oBAAoB;EACpB;EACAd,uBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAO,SAASe,cAAcA,CAC5BL,gBAA0B,EAC1BM,gBAEmD,EACnDC,OAAgC,EAChCC,YAAyB,EACZ;EACb,OAAOR,gBAAgB,CAACK,cAAc,CAACP,IAAI,CACzCE,gBAAgB,EAChBM,gBAAgB,EAChBC,OAAO,EACPC,YAAY;EACZ;EACAlB,uBACF,CAAC;AACH;AAEA,SAASC,mCAAmC","ignoreList":[]}
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+
1
3
  /*
2
4
  * Copyright (c) 2016-present Invertase Limited & Contributors
3
5
  *
@@ -15,32 +17,15 @@
15
17
  *
16
18
  */
17
19
 
18
- import {
19
- isBoolean,
20
- isIOS,
21
- isString,
22
- isObject,
23
- isFunction,
24
- isUndefined,
25
- isOther,
26
- parseListenerOrObserver,
27
- } from '@react-native-firebase/app/lib/common';
28
- import {
29
- createModuleNamespace,
30
- FirebaseModule,
31
- getFirebaseRoot,
32
- } from '@react-native-firebase/app/lib/internal';
20
+ import { isBoolean, isIOS, isString, isObject, isFunction, isUndefined, isOther, parseListenerOrObserver } from '@react-native-firebase/app/lib/common';
21
+ import { createModuleNamespace, FirebaseModule, getFirebaseRoot } from '@react-native-firebase/app/lib/internal';
33
22
  import { Platform } from 'react-native';
34
- import ReactNativeFirebaseAppCheckProvider from './ReactNativeFirebaseAppCheckProvider';
23
+ import ReactNativeFirebaseAppCheckProvider from "./ReactNativeFirebaseAppCheckProvider.js";
35
24
  import { setReactNativeModule } from '@react-native-firebase/app/lib/internal/nativeModule';
36
25
  import fallBackModule from './web/RNFBAppCheckModule';
37
-
38
- import version from './version';
39
-
26
+ import { version } from "./version.js";
40
27
  const namespace = 'appCheck';
41
-
42
28
  const nativeModuleName = 'RNFBAppCheckModule';
43
-
44
29
  export class CustomProvider {
45
30
  constructor(_customProviderOptions) {
46
31
  if (!isObject(_customProviderOptions)) {
@@ -51,38 +36,37 @@ export class CustomProvider {
51
36
  }
52
37
  this._customProviderOptions = _customProviderOptions;
53
38
  }
54
-
55
39
  async getToken() {
56
40
  return this._customProviderOptions.getToken();
57
41
  }
58
42
  }
59
-
60
43
  const statics = {
61
- CustomProvider,
44
+ CustomProvider
62
45
  };
63
46
 
47
+ /**
48
+ * Type guard to check if a provider has providerOptions.
49
+ * This provides proper type narrowing for providers that support platform-specific configuration.
50
+ */
51
+ function hasProviderOptions(provider) {
52
+ return provider !== undefined && 'providerOptions' in provider && provider.providerOptions !== undefined;
53
+ }
64
54
  class FirebaseAppCheckModule extends FirebaseModule {
65
- constructor(...args) {
66
- super(...args);
67
-
55
+ constructor(app, config, customUrlOrRegion) {
56
+ super(app, config, customUrlOrRegion);
68
57
  this.emitter.addListener(this.eventNameForApp('appCheck_token_changed'), event => {
69
58
  this.emitter.emit(this.eventNameForApp('onAppCheckTokenChanged'), event);
70
59
  });
71
-
72
60
  this._listenerCount = 0;
73
61
  }
74
-
75
62
  getIsTokenRefreshEnabledDefault() {
76
63
  // no default to start
77
- isTokenAutoRefreshEnabled = undefined;
78
-
64
+ let isTokenAutoRefreshEnabled = undefined;
79
65
  return isTokenAutoRefreshEnabled;
80
66
  }
81
-
82
67
  newReactNativeFirebaseAppCheckProvider() {
83
68
  return new ReactNativeFirebaseAppCheckProvider();
84
69
  }
85
-
86
70
  initializeAppCheck(options) {
87
71
  if (isOther) {
88
72
  if (!isObject(options)) {
@@ -95,12 +79,18 @@ class FirebaseAppCheckModule extends FirebaseModule {
95
79
  }
96
80
  // determine token refresh setting, if not specified
97
81
  if (!isBoolean(options.isTokenAutoRefreshEnabled)) {
98
- options.isTokenAutoRefreshEnabled = this.firebaseJson.app_check_token_auto_refresh;
82
+ const tokenRefresh = this.firebaseJson.app_check_token_auto_refresh;
83
+ if (isBoolean(tokenRefresh)) {
84
+ options.isTokenAutoRefreshEnabled = tokenRefresh;
85
+ }
99
86
  }
100
87
 
101
88
  // If that was not defined, attempt to use app-wide data collection setting per docs:
102
89
  if (!isBoolean(options.isTokenAutoRefreshEnabled)) {
103
- options.isTokenAutoRefreshEnabled = this.firebaseJson.app_data_collection_default_enabled;
90
+ const dataCollection = this.firebaseJson.app_data_collection_default_enabled;
91
+ if (isBoolean(dataCollection)) {
92
+ options.isTokenAutoRefreshEnabled = dataCollection;
93
+ }
104
94
  }
105
95
 
106
96
  // If that also was not defined, the default is documented as true.
@@ -108,35 +98,24 @@ class FirebaseAppCheckModule extends FirebaseModule {
108
98
  options.isTokenAutoRefreshEnabled = true;
109
99
  }
110
100
  this.native.setTokenAutoRefreshEnabled(options.isTokenAutoRefreshEnabled);
111
-
112
- if (options.provider === undefined || options.provider.providerOptions === undefined) {
101
+ if (!hasProviderOptions(options.provider)) {
113
102
  throw new Error('Invalid configuration: no provider or no provider options defined.');
114
103
  }
104
+ const provider = options.provider;
115
105
  if (Platform.OS === 'android') {
116
- if (!isString(options.provider.providerOptions.android.provider)) {
117
- throw new Error(
118
- 'Invalid configuration: no android provider configured while on android platform.',
119
- );
106
+ if (!isString(provider.providerOptions?.android?.provider)) {
107
+ throw new Error('Invalid configuration: no android provider configured while on android platform.');
120
108
  }
121
- return this.native.configureProvider(
122
- options.provider.providerOptions.android.provider,
123
- options.provider.providerOptions.android.debugToken,
124
- );
109
+ return this.native.configureProvider(provider.providerOptions.android.provider, provider.providerOptions.android.debugToken);
125
110
  }
126
111
  if (Platform.OS === 'ios' || Platform.OS === 'macos') {
127
- if (!isString(options.provider.providerOptions.apple.provider)) {
128
- throw new Error(
129
- 'Invalid configuration: no apple provider configured while on apple platform.',
130
- );
112
+ if (!isString(provider.providerOptions?.apple?.provider)) {
113
+ throw new Error('Invalid configuration: no apple provider configured while on apple platform.');
131
114
  }
132
- return this.native.configureProvider(
133
- options.provider.providerOptions.apple.provider,
134
- options.provider.providerOptions.apple.debugToken,
135
- );
115
+ return this.native.configureProvider(provider.providerOptions.apple.provider, provider.providerOptions.apple.debugToken);
136
116
  }
137
117
  throw new Error('Unsupported platform: ' + Platform.OS);
138
118
  }
139
-
140
119
  activate(siteKeyOrProvider, isTokenAutoRefreshEnabled) {
141
120
  if (isOther) {
142
121
  throw new Error('firebase.appCheck().activate(*) is not supported on other platforms');
@@ -146,28 +125,29 @@ class FirebaseAppCheckModule extends FirebaseModule {
146
125
  }
147
126
 
148
127
  // We wrap our new flexible interface, with compatible defaults
149
- rnfbProvider = new ReactNativeFirebaseAppCheckProvider();
128
+ const rnfbProvider = new ReactNativeFirebaseAppCheckProvider();
150
129
  rnfbProvider.configure({
151
130
  android: {
152
- provider: 'playIntegrity',
131
+ provider: 'playIntegrity'
153
132
  },
154
133
  apple: {
155
- provider: 'deviceCheck',
134
+ provider: 'deviceCheck'
156
135
  },
157
136
  web: {
158
137
  provider: 'reCaptchaV3',
159
- siteKey: 'none',
160
- },
138
+ siteKey: 'none'
139
+ }
140
+ });
141
+ return this.initializeAppCheck({
142
+ provider: rnfbProvider,
143
+ isTokenAutoRefreshEnabled
161
144
  });
162
-
163
- return this.initializeAppCheck({ provider: rnfbProvider, isTokenAutoRefreshEnabled });
164
145
  }
165
146
 
166
147
  // TODO this is an async call
167
148
  setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled) {
168
149
  this.native.setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled);
169
150
  }
170
-
171
151
  getToken(forceRefresh) {
172
152
  if (!forceRefresh) {
173
153
  return this.native.getToken(false);
@@ -175,13 +155,10 @@ class FirebaseAppCheckModule extends FirebaseModule {
175
155
  return this.native.getToken(true);
176
156
  }
177
157
  }
178
-
179
158
  getLimitedUseToken() {
180
159
  return this.native.getLimitedUseToken();
181
160
  }
182
-
183
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
184
- onTokenChanged(onNextOrObserver, onError, onCompletion) {
161
+ onTokenChanged(onNextOrObserver, _onError, _onCompletion) {
185
162
  // iOS does not provide any native listening feature
186
163
  if (isIOS) {
187
164
  // eslint-disable-next-line no-console
@@ -196,12 +173,8 @@ class FirebaseAppCheckModule extends FirebaseModule {
196
173
  // else if (onError) {
197
174
  // errorFn = onError;
198
175
  // }
199
- const subscription = this.emitter.addListener(
200
- this.eventNameForApp('onAppCheckTokenChanged'),
201
- nextFn,
202
- );
176
+ const subscription = this.emitter.addListener(this.eventNameForApp('onAppCheckTokenChanged'), nextFn);
203
177
  if (this._listenerCount === 0) this.native.addAppCheckListener();
204
-
205
178
  this._listenerCount++;
206
179
  return () => {
207
180
  subscription.remove();
@@ -210,13 +183,8 @@ class FirebaseAppCheckModule extends FirebaseModule {
210
183
  };
211
184
  }
212
185
  }
213
-
214
- // import { SDK_VERSION } from '@react-native-firebase/app-check';
215
186
  export const SDK_VERSION = version;
216
-
217
- // import appCheck from '@react-native-firebase/app-check';
218
- // appCheck().X(...);
219
- export default createModuleNamespace({
187
+ const appCheckNamespace = createModuleNamespace({
220
188
  statics,
221
189
  version,
222
190
  namespace,
@@ -224,10 +192,11 @@ export default createModuleNamespace({
224
192
  nativeEvents: ['appCheck_token_changed'],
225
193
  hasMultiAppSupport: true,
226
194
  hasCustomUrlOrRegionSupport: false,
227
- ModuleClass: FirebaseAppCheckModule,
195
+ ModuleClass: FirebaseAppCheckModule
228
196
  });
229
-
230
- export * from './modular';
197
+ // import appCheck from '@react-native-firebase/app-check';
198
+ // appCheck().X(...);
199
+ export default appCheckNamespace;
231
200
 
232
201
  // import appCheck, { firebase } from '@react-native-firebase/app-check';
233
202
  // appCheck().X(...);
@@ -236,3 +205,4 @@ export const firebase = getFirebaseRoot();
236
205
 
237
206
  // Register the interop module for non-native platforms.
238
207
  setReactNativeModule(nativeModuleName, fallBackModule);
208
+ //# sourceMappingURL=namespaced.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isBoolean","isIOS","isString","isObject","isFunction","isUndefined","isOther","parseListenerOrObserver","createModuleNamespace","FirebaseModule","getFirebaseRoot","Platform","ReactNativeFirebaseAppCheckProvider","setReactNativeModule","fallBackModule","version","namespace","nativeModuleName","CustomProvider","constructor","_customProviderOptions","Error","getToken","statics","hasProviderOptions","provider","undefined","providerOptions","FirebaseAppCheckModule","app","config","customUrlOrRegion","emitter","addListener","eventNameForApp","event","emit","_listenerCount","getIsTokenRefreshEnabledDefault","isTokenAutoRefreshEnabled","newReactNativeFirebaseAppCheckProvider","initializeAppCheck","options","native","tokenRefresh","firebaseJson","app_check_token_auto_refresh","dataCollection","app_data_collection_default_enabled","setTokenAutoRefreshEnabled","OS","android","configureProvider","debugToken","apple","activate","siteKeyOrProvider","rnfbProvider","configure","web","siteKey","forceRefresh","getLimitedUseToken","onTokenChanged","onNextOrObserver","_onError","_onCompletion","console","warn","nextFn","subscription","addAppCheckListener","remove","removeAppCheckListener","SDK_VERSION","appCheckNamespace","nativeEvents","hasMultiAppSupport","hasCustomUrlOrRegionSupport","ModuleClass","firebase"],"sourceRoot":"../../lib","sources":["namespaced.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,SAAS,EACTC,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACVC,WAAW,EACXC,OAAO,EACPC,uBAAuB,QAClB,uCAAuC;AAC9C,SACEC,qBAAqB,EACrBC,cAAc,EACdC,eAAe,QACV,yCAAyC;AAEhD,SAASC,QAAQ,QAAQ,cAAc;AACvC,OAAOC,mCAAmC,MAAM,0CAAuC;AACvF,SAASC,oBAAoB,QAAQ,sDAAsD;AAC3F,OAAOC,cAAc,MAAM,0BAA0B;AACrD,SAASC,OAAO,QAAQ,cAAW;AAcnC,MAAMC,SAAS,GAAG,UAAU;AAE5B,MAAMC,gBAAgB,GAAG,oBAAoB;AAE7C,OAAO,MAAMC,cAAc,CAA6B;EAGtDC,WAAWA,CAACC,sBAA6C,EAAE;IACzD,IAAI,CAACjB,QAAQ,CAACiB,sBAAsB,CAAC,EAAE;MACrC,MAAM,IAAIC,KAAK,CAAC,qDAAqD,CAAC;IACxE;IACA,IAAI,CAACjB,UAAU,CAACgB,sBAAsB,CAACE,QAAQ,CAAC,EAAE;MAChD,MAAM,IAAID,KAAK,CAAC,sDAAsD,CAAC;IACzE;IACA,IAAI,CAACD,sBAAsB,GAAGA,sBAAsB;EACtD;EAEA,MAAME,QAAQA,CAAA,EAAG;IACf,OAAO,IAAI,CAACF,sBAAsB,CAACE,QAAQ,CAAC,CAAC;EAC/C;AACF;AAEA,MAAMC,OAAO,GAAG;EACdL;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA,SAASM,kBAAkBA,CACzBC,QAAqC,EACJ;EACjC,OACEA,QAAQ,KAAKC,SAAS,IACtB,iBAAiB,IAAID,QAAQ,IAC7BA,QAAQ,CAACE,eAAe,KAAKD,SAAS;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yright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+ // ============ Provider Types ============
20
+ /**
21
+ * An App Check provider. This can be either the built-in reCAPTCHA provider
22
+ * or a custom provider. For more on custom providers, see
23
+ * https://firebase.google.com/docs/app-check/web-custom-provider
24
+ */
25
+ /**
26
+ * Function to get an App Check token through a custom provider service.
27
+ */
28
+ // ============ Options & Result Types ============
29
+ /**
30
+ * Custom provider class.
31
+ * @public
32
+ */
33
+ /**
34
+ * Options for App Check initialization.
35
+ */
36
+ /**
37
+ * The token returned from an `AppCheckProvider`.
38
+ */
39
+ /**
40
+ * Result returned by `getToken()`.
41
+ */
42
+ /**
43
+ * The result return from `onTokenChanged`
44
+ */
45
+ // ============ Observer Types ============
46
+ /**
47
+ * A function that unsubscribes from token changes.
48
+ */
49
+ // ============ ReactNativeFirebaseAppCheckProvider Types ============
50
+ /**
51
+ * Platform-specific provider options configuration.
52
+ */
53
+ /**
54
+ * Configuration object for ReactNativeFirebaseAppCheckProvider
55
+ * that can be passed directly with providerOptions (for convenience in initialization).
56
+ * The runtime accepts objects with providerOptions even if they don't have
57
+ * getToken() and configure() methods.
58
+ */
59
+ /**
60
+ * Type representing providers that have providerOptions.
61
+ * Used for type narrowing in runtime code.
62
+ */
63
+ // ============ Module Interface ============
64
+ /**
65
+ * App Check module instance - returned from firebase.appCheck() or firebase.app().appCheck()
66
+ */
67
+ // ============ Statics Interface ============
68
+ /**
69
+ * Static properties available on firebase.appCheck
70
+ */
71
+ /**
72
+ * FirebaseApp type with appCheck() method.
73
+ * @deprecated Import FirebaseApp from '@react-native-firebase/app' instead.
74
+ * The appCheck() method is added via module augmentation.
75
+ */
76
+ // ============ Module Augmentation ============
77
+ /* eslint-disable @typescript-eslint/no-namespace */
78
+ /* eslint-enable @typescript-eslint/no-namespace */
79
+ // ============ Backwards Compatibility Namespace ============
80
+ // Helper types to reference outer scope types within the namespace
81
+ // These are needed because TypeScript can't directly alias types with the same name
82
+ /**
83
+ * @deprecated Use the exported types directly instead.
84
+ * FirebaseAppCheckTypes namespace is kept for backwards compatibility.
85
+ */
86
+ /* eslint-disable @typescript-eslint/no-namespace */
87
+ export let FirebaseAppCheckTypes;
88
+ /* eslint-enable @typescript-eslint/no-namespace */
89
+ //# sourceMappingURL=appcheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FirebaseAppCheckTypes"],"sourceRoot":"../../../lib","sources":["types/appcheck.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AAEA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AAKA;AAEA;AACA;AACA;AACA;AAMA;AACA;AACA;AAqBA;AACA;AACA;AAYA;AACA;AACA;AAQA;AACA;AACA;AAGA;AAcA;AACA;AACA;AAGA;AAqCA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAuBA;AACA;AACA;AACA;AAKA;AAEA;AACA;AACA;AAwGA;AAEA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AAGA;AAEA;AAWA;AAEA;AAEA;AACA;AAUA;AACA;AACA;AACA;AACA;AAAA,WACiBA,qBAAqB;AAsBtC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ // Generated by genversion.
4
+ export const version = '23.8.1';
5
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["version"],"sourceRoot":"../../lib","sources":["version.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,QAAQ","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ // No-op for android.
4
+ const module = {};
5
+ export default module;
6
+ //# sourceMappingURL=RNFBAppCheckModule.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["module"],"sourceRoot":"../../../lib","sources":["web/RNFBAppCheckModule.android.ts"],"mappings":";;AAAA;AACA,MAAMA,MAA6B,GAAG,CAAC,CAAC;AAExC,eAAeA,MAAM","ignoreList":[]}