@capacitor-community/sqlite 3.4.1-3 → 3.4.2-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.
- package/README.md +46 -1
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/CapacitorSQLitePlugin.java +1 -0
- package/electron/dist/plugin.js +40 -24
- package/electron/dist/plugin.js.map +1 -1
- package/electron/rollup.config.js +18 -2
- package/ios/Plugin/BiometricIDAuthentication.swift +3 -0
- package/ios/Plugin/CapacitorSQLite.swift +4 -0
- package/ios/Plugin/CapacitorSQLitePlugin.swift +3 -0
- package/package.json +5 -5
|
@@ -12,6 +12,22 @@ export default {
|
|
|
12
12
|
exports: 'named',
|
|
13
13
|
},
|
|
14
14
|
],
|
|
15
|
-
external: [
|
|
16
|
-
|
|
15
|
+
external: [
|
|
16
|
+
'@capacitor/core',
|
|
17
|
+
'electron',
|
|
18
|
+
'sqlite3',
|
|
19
|
+
'path',
|
|
20
|
+
'fs',
|
|
21
|
+
'os',
|
|
22
|
+
'jszip',
|
|
23
|
+
],
|
|
24
|
+
plugins: [
|
|
25
|
+
nodeResolve(),
|
|
26
|
+
commonjs({
|
|
27
|
+
ignoreDynamicRequires: true,
|
|
28
|
+
dynamicRequireTargets: [
|
|
29
|
+
'node_modules/@capacitor-community/sqlite/electron/dist/plugin.js',
|
|
30
|
+
],
|
|
31
|
+
}),
|
|
32
|
+
],
|
|
17
33
|
};
|
|
@@ -44,6 +44,7 @@ class BiometricIDAuthentication {
|
|
|
44
44
|
throw BiometricIDAuthenticationError.biometricType(message: msg)
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
+
// swiftlint:disable no_space_in_method_call
|
|
47
48
|
func authenticateUser(completion: @escaping (String?) -> Void) {
|
|
48
49
|
let context = LAContext()
|
|
49
50
|
context.touchIDAuthenticationAllowableReuseDuration = 10
|
|
@@ -76,4 +77,6 @@ class BiometricIDAuthentication {
|
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
}
|
|
80
|
+
// swiftlint:enable no_space_in_method_call
|
|
81
|
+
|
|
79
82
|
}
|
|
@@ -26,6 +26,7 @@ enum CapacitorSQLiteError: Error {
|
|
|
26
26
|
|
|
27
27
|
// swiftlint:disable function_body_length
|
|
28
28
|
// swiftlint:disable cyclomatic_complexity
|
|
29
|
+
// swiftlint:disable no_space_in_method_call
|
|
29
30
|
init(config: SqliteConfig) {
|
|
30
31
|
self.config = config
|
|
31
32
|
super.init()
|
|
@@ -97,6 +98,7 @@ enum CapacitorSQLiteError: Error {
|
|
|
97
98
|
isInit = true
|
|
98
99
|
}
|
|
99
100
|
}
|
|
101
|
+
// swiftlint:enable no_space_in_method_call
|
|
100
102
|
// swiftlint:enable cyclomatic_complexity
|
|
101
103
|
// swiftlint:enable function_body_length
|
|
102
104
|
|
|
@@ -160,6 +162,7 @@ enum CapacitorSQLiteError: Error {
|
|
|
160
162
|
// MARK: - ChangeEncryptionSecret
|
|
161
163
|
|
|
162
164
|
// swiftlint:disable function_body_length
|
|
165
|
+
// swiftlint:disable no_space_in_method_call
|
|
163
166
|
@objc public func changeEncryptionSecret(call: CAPPluginCall, passphrase: String,
|
|
164
167
|
oldPassphrase: String) throws {
|
|
165
168
|
if isInit {
|
|
@@ -225,6 +228,7 @@ enum CapacitorSQLiteError: Error {
|
|
|
225
228
|
}
|
|
226
229
|
|
|
227
230
|
}
|
|
231
|
+
// swiftlint:enable no_space_in_method_call
|
|
228
232
|
// swiftlint:enable function_body_length
|
|
229
233
|
|
|
230
234
|
// MARK: - getNCDatabasePath
|
|
@@ -109,6 +109,7 @@ public class CapacitorSQLitePlugin: CAPPlugin {
|
|
|
109
109
|
}
|
|
110
110
|
do {
|
|
111
111
|
try implementation?.changeEncryptionSecret(call: call, passphrase: passphrase, oldPassphrase: oldPassphrase)
|
|
112
|
+
retHandler.rResult(call: call)
|
|
112
113
|
return
|
|
113
114
|
} catch CapacitorSQLiteError.failed(let message) {
|
|
114
115
|
let msg = "ChangeEncryptionSecret: \(message)"
|
|
@@ -1192,6 +1193,7 @@ public class CapacitorSQLitePlugin: CAPPlugin {
|
|
|
1192
1193
|
|
|
1193
1194
|
// MARK: - Handle Notifications
|
|
1194
1195
|
|
|
1196
|
+
// swiftlint:disable no_space_in_method_call
|
|
1195
1197
|
@objc func importJsonProgress(notification: Notification) {
|
|
1196
1198
|
guard let info = notification.userInfo as? [String: Any] else { return }
|
|
1197
1199
|
DispatchQueue.main.async {
|
|
@@ -1213,6 +1215,7 @@ public class CapacitorSQLitePlugin: CAPPlugin {
|
|
|
1213
1215
|
return
|
|
1214
1216
|
}
|
|
1215
1217
|
}
|
|
1218
|
+
// swiftlint:enable no_space_in_method_call
|
|
1216
1219
|
private func sqliteConfig() -> SqliteConfig {
|
|
1217
1220
|
var config = SqliteConfig()
|
|
1218
1221
|
config.iosIsEncryption = 1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor-community/sqlite",
|
|
3
|
-
"version": "3.4.1
|
|
3
|
+
"version": "3.4.2-1",
|
|
4
4
|
"description": "Community plugin for native & electron SQLite databases",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -55,16 +55,16 @@
|
|
|
55
55
|
"prepublishOnly": "npm run build && npm run build-electron && npm run docgen"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@capacitor/android": "^3.4.
|
|
59
|
-
"@capacitor/core": "^3.4.
|
|
58
|
+
"@capacitor/android": "^3.4.2",
|
|
59
|
+
"@capacitor/core": "^3.4.2",
|
|
60
60
|
"@capacitor/docgen": "^0.0.17",
|
|
61
|
-
"@capacitor/ios": "^3.4.
|
|
61
|
+
"@capacitor/ios": "^3.4.2",
|
|
62
62
|
"@ionic/eslint-config": "^0.3.0",
|
|
63
63
|
"@ionic/prettier-config": "^1.0.1",
|
|
64
64
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
65
65
|
"@rollup/plugin-commonjs": "^20.0.0",
|
|
66
66
|
"@rollup/plugin-node-resolve": "^13.0.4",
|
|
67
|
-
"electron": "^14.
|
|
67
|
+
"electron": "^14.2.4",
|
|
68
68
|
"eslint": "^7.11.0",
|
|
69
69
|
"prettier": "~2.2.0",
|
|
70
70
|
"prettier-plugin-java": "~1.0.0",
|