@react-native-firebase/app-check 23.7.0 → 23.8.0
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/dist/commonjs/ReactNativeFirebaseAppCheckProvider.js +19 -0
- package/dist/commonjs/ReactNativeFirebaseAppCheckProvider.js.map +1 -0
- package/dist/commonjs/index.js +38 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/modular.js +124 -0
- package/dist/commonjs/modular.js.map +1 -0
- package/dist/commonjs/namespaced.js +212 -0
- package/dist/commonjs/namespaced.js.map +1 -0
- package/dist/commonjs/package.json +1 -0
- package/dist/commonjs/types/appcheck.js +93 -0
- package/dist/commonjs/types/appcheck.js.map +1 -0
- package/dist/commonjs/version.js +9 -0
- package/dist/commonjs/version.js.map +1 -0
- package/dist/commonjs/web/RNFBAppCheckModule.android.js +9 -0
- package/dist/commonjs/web/RNFBAppCheckModule.android.js.map +2 -0
- package/dist/commonjs/web/RNFBAppCheckModule.ios.js +9 -0
- package/dist/commonjs/web/RNFBAppCheckModule.ios.js.map +2 -0
- package/dist/commonjs/web/RNFBAppCheckModule.js +97 -0
- package/dist/commonjs/web/RNFBAppCheckModule.js.map +1 -0
- package/dist/module/ReactNativeFirebaseAppCheckProvider.js +14 -0
- package/dist/module/ReactNativeFirebaseAppCheckProvider.js.map +1 -0
- package/{ios/RNFBAppCheck/RNFBAppCheckModule.h → dist/module/index.js} +10 -12
- package/dist/module/index.js.map +1 -0
- package/dist/module/modular.js +110 -0
- package/dist/module/modular.js.map +1 -0
- package/{lib/index.js → dist/module/namespaced.js} +50 -80
- package/dist/module/namespaced.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/types/appcheck.js +89 -0
- package/dist/module/types/appcheck.js.map +1 -0
- package/dist/module/version.js +5 -0
- package/dist/module/version.js.map +1 -0
- package/dist/module/web/RNFBAppCheckModule.android.js +5 -0
- package/dist/module/web/RNFBAppCheckModule.android.js.map +2 -0
- package/dist/module/web/RNFBAppCheckModule.ios.js +5 -0
- package/dist/module/web/RNFBAppCheckModule.ios.js.map +2 -0
- package/dist/module/web/RNFBAppCheckModule.js +88 -0
- package/dist/module/web/RNFBAppCheckModule.js.map +1 -0
- package/dist/typescript/commonjs/lib/ReactNativeFirebaseAppCheckProvider.d.ts +8 -0
- package/dist/typescript/commonjs/lib/ReactNativeFirebaseAppCheckProvider.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/index.d.ts +5 -0
- package/dist/typescript/commonjs/lib/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/modular.d.ts +57 -0
- package/dist/typescript/commonjs/lib/modular.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/namespaced.d.ts +17 -0
- package/dist/typescript/commonjs/lib/namespaced.d.ts.map +1 -0
- package/{lib/index.d.ts → dist/typescript/commonjs/lib/types/appcheck.d.ts} +162 -221
- package/dist/typescript/commonjs/lib/types/appcheck.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/version.d.ts +2 -0
- package/dist/typescript/commonjs/lib/version.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/web/RNFBAppCheckModule.android.d.ts +3 -0
- package/dist/typescript/commonjs/lib/web/RNFBAppCheckModule.android.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/web/RNFBAppCheckModule.d.ts +18 -0
- package/dist/typescript/commonjs/lib/web/RNFBAppCheckModule.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/web/RNFBAppCheckModule.ios.d.ts +3 -0
- package/dist/typescript/commonjs/lib/web/RNFBAppCheckModule.ios.d.ts.map +1 -0
- package/dist/typescript/commonjs/package.json +1 -0
- package/dist/typescript/module/lib/ReactNativeFirebaseAppCheckProvider.d.ts +8 -0
- package/dist/typescript/module/lib/ReactNativeFirebaseAppCheckProvider.d.ts.map +1 -0
- package/dist/typescript/module/lib/index.d.ts +5 -0
- package/dist/typescript/module/lib/index.d.ts.map +1 -0
- package/dist/typescript/module/lib/modular.d.ts +57 -0
- package/dist/typescript/module/lib/modular.d.ts.map +1 -0
- package/dist/typescript/module/lib/namespaced.d.ts +17 -0
- package/dist/typescript/module/lib/namespaced.d.ts.map +1 -0
- package/dist/typescript/module/lib/types/appcheck.d.ts +299 -0
- package/dist/typescript/module/lib/types/appcheck.d.ts.map +1 -0
- package/dist/typescript/module/lib/version.d.ts +2 -0
- package/dist/typescript/module/lib/version.d.ts.map +1 -0
- package/dist/typescript/module/lib/web/RNFBAppCheckModule.android.d.ts +3 -0
- package/dist/typescript/module/lib/web/RNFBAppCheckModule.android.d.ts.map +1 -0
- package/dist/typescript/module/lib/web/RNFBAppCheckModule.d.ts +18 -0
- package/dist/typescript/module/lib/web/RNFBAppCheckModule.d.ts.map +1 -0
- package/dist/typescript/module/lib/web/RNFBAppCheckModule.ios.d.ts +3 -0
- package/dist/typescript/module/lib/web/RNFBAppCheckModule.ios.d.ts.map +1 -0
- package/dist/typescript/module/package.json +1 -0
- package/lib/ReactNativeFirebaseAppCheckProvider.ts +21 -0
- package/lib/index.ts +46 -0
- package/lib/modular.ts +157 -0
- package/lib/namespaced.ts +305 -0
- package/lib/types/appcheck.ts +386 -0
- package/lib/version.ts +2 -0
- package/lib/web/RNFBAppCheckModule.android.ts +4 -0
- package/lib/web/RNFBAppCheckModule.ios.ts +4 -0
- package/lib/web/RNFBAppCheckModule.ts +115 -0
- package/package.json +64 -8
- package/tsconfig.json +21 -0
- package/CHANGELOG.md +0 -773
- package/RNFBAppCheck.podspec +0 -50
- package/android/.editorconfig +0 -10
- package/android/build.gradle +0 -110
- package/android/lint.xml +0 -5
- package/android/settings.gradle +0 -1
- package/android/src/main/AndroidManifest.xml +0 -7
- package/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckModule.java +0 -281
- package/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckPackage.java +0 -41
- package/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckProvider.java +0 -97
- package/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckProviderFactory.java +0 -67
- package/app.plugin.js +0 -1
- package/ios/RNFBAppCheck/RNFBAppCheckModule.m +0 -171
- package/ios/RNFBAppCheck/RNFBAppCheckProvider.h +0 -33
- package/ios/RNFBAppCheck/RNFBAppCheckProvider.m +0 -90
- package/ios/RNFBAppCheck/RNFBAppCheckProviderFactory.h +0 -28
- package/ios/RNFBAppCheck/RNFBAppCheckProviderFactory.m +0 -61
- package/ios/RNFBAppCheck.xcodeproj/project.pbxproj +0 -349
- package/ios/RNFBAppCheck.xcodeproj/xcshareddata/IDETemplateMacros.plist +0 -24
- package/lib/ReactNativeFirebaseAppCheckProvider.js +0 -9
- package/lib/modular/index.d.ts +0 -149
- package/lib/modular/index.js +0 -102
- package/lib/version.js +0 -2
- package/plugin/build/index.d.ts +0 -3
- package/plugin/build/index.js +0 -15
- package/plugin/build/ios/appDelegate.d.ts +0 -6
- package/plugin/build/ios/appDelegate.js +0 -137
- package/plugin/build/ios/index.d.ts +0 -2
- package/plugin/build/ios/index.js +0 -5
- package/plugin/tsconfig.tsbuildinfo +0 -1
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.withFirebaseAppDelegate = void 0;
|
|
7
|
-
exports.modifyObjcAppDelegate = modifyObjcAppDelegate;
|
|
8
|
-
exports.modifySwiftAppDelegate = modifySwiftAppDelegate;
|
|
9
|
-
exports.modifyAppDelegateAsync = modifyAppDelegateAsync;
|
|
10
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
11
|
-
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
12
|
-
const fs_1 = __importDefault(require("fs"));
|
|
13
|
-
const methodInvocationBlock = `[RNFBAppCheckModule sharedInstance];`;
|
|
14
|
-
// https://regex101.com/r/mPgaq6/1
|
|
15
|
-
const methodInvocationLineMatcher = /(?:self\.moduleName\s*=\s*@\"([^"]*)\";)|(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[(\[RCTBridge alloc\]|self\.reactDelegate))/g;
|
|
16
|
-
// https://regex101.com/r/nHrTa9/1/
|
|
17
|
-
// if the above regex fails, we can use this one as a fallback:
|
|
18
|
-
const fallbackInvocationLineMatcher = /-\s*\(BOOL\)\s*application:\s*\(UIApplication\s*\*\s*\)\s*\w+\s+didFinishLaunchingWithOptions:/g;
|
|
19
|
-
function modifyObjcAppDelegate(contents) {
|
|
20
|
-
// Add import
|
|
21
|
-
if (!contents.includes('#import <RNFBAppCheckModule.h>')) {
|
|
22
|
-
contents = contents.replace(/#import "AppDelegate.h"/g, `#import "AppDelegate.h"
|
|
23
|
-
#import <RNFBAppCheckModule.h>`);
|
|
24
|
-
}
|
|
25
|
-
// To avoid potential issues with existing changes from older plugin versions
|
|
26
|
-
if (contents.includes(methodInvocationBlock)) {
|
|
27
|
-
return contents;
|
|
28
|
-
}
|
|
29
|
-
if (!methodInvocationLineMatcher.test(contents) &&
|
|
30
|
-
!fallbackInvocationLineMatcher.test(contents)) {
|
|
31
|
-
config_plugins_1.WarningAggregator.addWarningIOS('@react-native-firebase/app-check', 'Unable to determine correct Firebase insertion point in AppDelegate.m. Skipping Firebase addition.');
|
|
32
|
-
return contents;
|
|
33
|
-
}
|
|
34
|
-
// Add invocation
|
|
35
|
-
try {
|
|
36
|
-
return (0, generateCode_1.mergeContents)({
|
|
37
|
-
tag: '@react-native-firebase/app-check-didFinishLaunchingWithOptions',
|
|
38
|
-
src: contents,
|
|
39
|
-
newSrc: methodInvocationBlock,
|
|
40
|
-
anchor: methodInvocationLineMatcher,
|
|
41
|
-
offset: 0, // new line will be inserted right above matched anchor
|
|
42
|
-
comment: '//',
|
|
43
|
-
}).contents;
|
|
44
|
-
}
|
|
45
|
-
catch (_) {
|
|
46
|
-
// tests if the opening `{` is in the new line
|
|
47
|
-
const multilineMatcher = new RegExp(fallbackInvocationLineMatcher.source + '.+\\n*{');
|
|
48
|
-
const isHeaderMultiline = multilineMatcher.test(contents);
|
|
49
|
-
// we fallback to another regex if the first one fails
|
|
50
|
-
return (0, generateCode_1.mergeContents)({
|
|
51
|
-
tag: '@react-native-firebase/app-didFinishLaunchingWithOptions-fallback',
|
|
52
|
-
src: contents,
|
|
53
|
-
newSrc: methodInvocationBlock,
|
|
54
|
-
anchor: fallbackInvocationLineMatcher,
|
|
55
|
-
// new line will be inserted right below matched anchor
|
|
56
|
-
// or two lines, if the `{` is in the new line
|
|
57
|
-
offset: isHeaderMultiline ? 2 : 1,
|
|
58
|
-
comment: '//',
|
|
59
|
-
}).contents;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function modifySwiftAppDelegate(contents) {
|
|
63
|
-
// Add imports for Swift
|
|
64
|
-
if (!contents.includes('import RNFBAppCheck')) {
|
|
65
|
-
// Try to add after FirebaseCore if it exists
|
|
66
|
-
if (contents.includes('import FirebaseCore')) {
|
|
67
|
-
contents = contents.replace(/import FirebaseCore/g, `import FirebaseCore
|
|
68
|
-
import RNFBAppCheck`);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
// Otherwise add after Expo
|
|
72
|
-
contents = contents.replace(/import Expo/g, `import Expo
|
|
73
|
-
import RNFBAppCheck`);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// Check if App Check code is already added to avoid duplication
|
|
77
|
-
if (contents.includes('RNFBAppCheckModule.sharedInstance()')) {
|
|
78
|
-
return contents;
|
|
79
|
-
}
|
|
80
|
-
// Find the Firebase initialization end line to insert after
|
|
81
|
-
const firebaseLine = '// @generated end @react-native-firebase/app-didFinishLaunchingWithOptions';
|
|
82
|
-
if (contents.includes(firebaseLine)) {
|
|
83
|
-
// Insert right after Firebase initialization
|
|
84
|
-
return contents.replace(firebaseLine, `${firebaseLine}
|
|
85
|
-
RNFBAppCheckModule.sharedInstance()
|
|
86
|
-
FirebaseApp.configure()
|
|
87
|
-
`);
|
|
88
|
-
}
|
|
89
|
-
// If Firebase initialization block not found, add both Firebase and App Check initialization
|
|
90
|
-
// This is to make sure Firebase is initialized before App Check
|
|
91
|
-
const methodInvocationBlock = `RNFBAppCheckModule.sharedInstance()
|
|
92
|
-
FirebaseApp.configure()`;
|
|
93
|
-
const methodInvocationLineMatcher = /(?:factory\.startReactNative\()/;
|
|
94
|
-
if (!methodInvocationLineMatcher.test(contents)) {
|
|
95
|
-
config_plugins_1.WarningAggregator.addWarningIOS('@react-native-firebase/app-check', 'Unable to determine correct insertion point in AppDelegate.swift. Skipping App Check addition.');
|
|
96
|
-
return contents;
|
|
97
|
-
}
|
|
98
|
-
try {
|
|
99
|
-
return (0, generateCode_1.mergeContents)({
|
|
100
|
-
tag: '@react-native-firebase/app-check',
|
|
101
|
-
src: contents,
|
|
102
|
-
newSrc: methodInvocationBlock,
|
|
103
|
-
anchor: methodInvocationLineMatcher,
|
|
104
|
-
offset: 0,
|
|
105
|
-
comment: '//',
|
|
106
|
-
}).contents;
|
|
107
|
-
}
|
|
108
|
-
catch (_e) {
|
|
109
|
-
config_plugins_1.WarningAggregator.addWarningIOS('@react-native-firebase/app-check', 'Failed to insert App Check initialization code.');
|
|
110
|
-
return contents;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
async function modifyAppDelegateAsync(appDelegateFileInfo) {
|
|
114
|
-
const { language, path, contents } = appDelegateFileInfo;
|
|
115
|
-
let newContents;
|
|
116
|
-
if (['objc', 'objcpp'].includes(language)) {
|
|
117
|
-
newContents = modifyObjcAppDelegate(contents);
|
|
118
|
-
}
|
|
119
|
-
else if (language === 'swift') {
|
|
120
|
-
newContents = modifySwiftAppDelegate(contents);
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
throw new Error(`Cannot add Firebase code to AppDelegate of language "${language}"`);
|
|
124
|
-
}
|
|
125
|
-
await fs_1.default.promises.writeFile(path, newContents);
|
|
126
|
-
}
|
|
127
|
-
const withFirebaseAppDelegate = config => {
|
|
128
|
-
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
129
|
-
'ios',
|
|
130
|
-
async (config) => {
|
|
131
|
-
const fileInfo = config_plugins_1.IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot);
|
|
132
|
-
await modifyAppDelegateAsync(fileInfo);
|
|
133
|
-
return config;
|
|
134
|
-
},
|
|
135
|
-
]);
|
|
136
|
-
};
|
|
137
|
-
exports.withFirebaseAppDelegate = withFirebaseAppDelegate;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withFirebaseAppDelegate = void 0;
|
|
4
|
-
const appDelegate_1 = require("./appDelegate");
|
|
5
|
-
Object.defineProperty(exports, "withFirebaseAppDelegate", { enumerable: true, get: function () { return appDelegate_1.withFirebaseAppDelegate; } });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"root":["./src/index.ts","./src/ios/appDelegate.ts","./src/ios/index.ts"],"version":"5.9.3"}
|