@capgo/capacitor-data-storage-sqlite 6.0.59 → 7.1.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/CapgoCapacitorDataStorageSqlite.podspec +2 -2
- package/Package.swift +30 -0
- package/README.md +724 -0
- package/android/build.gradle +11 -11
- package/android/src/main/java/com/jeep/plugin/capacitor/capgocapacitordatastoragesqlite/CapgoCapacitorDataStorageSqlite.java +290 -320
- package/android/src/main/java/com/jeep/plugin/capacitor/capgocapacitordatastoragesqlite/CapgoCapacitorDataStorageSqlitePlugin.java +373 -388
- package/android/src/main/java/com/jeep/plugin/capacitor/capgocapacitordatastoragesqlite/RetHandler.java +97 -97
- package/android/src/main/java/com/jeep/plugin/capacitor/capgocapacitordatastoragesqlite/cdssUtils/Data.java +3 -3
- package/android/src/main/java/com/jeep/plugin/capacitor/capgocapacitordatastoragesqlite/cdssUtils/Global.java +2 -2
- package/android/src/main/java/com/jeep/plugin/capacitor/capgocapacitordatastoragesqlite/cdssUtils/ImportExportJson/JsonStore.java +108 -110
- package/android/src/main/java/com/jeep/plugin/capacitor/capgocapacitordatastoragesqlite/cdssUtils/ImportExportJson/JsonTable.java +78 -80
- package/android/src/main/java/com/jeep/plugin/capacitor/capgocapacitordatastoragesqlite/cdssUtils/ImportExportJson/JsonValue.java +62 -64
- package/android/src/main/java/com/jeep/plugin/capacitor/capgocapacitordatastoragesqlite/cdssUtils/StorageDatabaseHelper.java +557 -624
- package/android/src/main/java/com/jeep/plugin/capacitor/capgocapacitordatastoragesqlite/cdssUtils/UtilsSQLCipher.java +103 -144
- package/dist/docs.json +0 -64
- package/dist/esm/definitions.d.ts +0 -19
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +5 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web-utils/StorageDatabaseHelper.d.ts +2 -2
- package/dist/esm/web-utils/StorageDatabaseHelper.js +8 -8
- package/dist/esm/web-utils/StorageDatabaseHelper.js.map +1 -1
- package/dist/esm/web-utils/json-utils.js +15 -18
- package/dist/esm/web-utils/json-utils.js.map +1 -1
- package/dist/esm/web.d.ts +2 -3
- package/dist/esm/web.js +37 -44
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +56 -67
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +56 -67
- package/dist/plugin.js.map +1 -1
- package/ios/{Plugin → Sources/CapgoCapacitorDataStorageSqlitePlugin}/CapgoCapacitorDataStorageSqlitePlugin.swift +27 -10
- package/ios/{Plugin → Sources/CapgoCapacitorDataStorageSqlitePlugin}/StorageDatabaseHelper.swift +1 -1
- package/ios/{Plugin → Sources/CapgoCapacitorDataStorageSqlitePlugin}/Utils/UtilsFile.swift +1 -1
- package/ios/{Plugin → Sources/CapgoCapacitorDataStorageSqlitePlugin}/Utils/UtilsSQLCipher.swift +3 -3
- package/ios/Tests/CapgoCapacitorDataStorageSqlitePluginTests/CapacitorDataStorageSqlitePluginTests.swift +13 -0
- package/package.json +34 -38
- package/electron/dist/plugin.js +0 -1044
- package/electron/dist/plugin.js.map +0 -1
- package/ios/Plugin/CapgoCapacitorDataStorageSqlitePlugin.h +0 -10
- package/ios/Plugin/CapgoCapacitorDataStorageSqlitePlugin.m +0 -29
- package/ios/Plugin/Info.plist +0 -24
- package/readme.md +0 -210
- /package/ios/{Plugin → Sources/CapgoCapacitorDataStorageSqlitePlugin}/CapgoCapacitorDataStorageSqlite.swift +0 -0
- /package/ios/{Plugin → Sources/CapgoCapacitorDataStorageSqlitePlugin}/Data.swift +0 -0
- /package/ios/{Plugin → Sources/CapgoCapacitorDataStorageSqlitePlugin}/Global.swift +0 -0
- /package/ios/{Plugin → Sources/CapgoCapacitorDataStorageSqlitePlugin}/ImportExportJson/JsonStore.swift +0 -0
- /package/ios/{Plugin → Sources/CapgoCapacitorDataStorageSqlitePlugin}/ReturnHandler.swift +0 -0
- /package/ios/{Plugin → Sources/CapgoCapacitorDataStorageSqlitePlugin}/Utils/Blob.swift +0 -0
- /package/ios/{Plugin → Sources/CapgoCapacitorDataStorageSqlitePlugin}/Utils/UtilsBinding.swift +0 -0
- /package/ios/{Plugin → Sources/CapgoCapacitorDataStorageSqlitePlugin}/Utils/UtilsEncryption.swift +0 -0
|
@@ -11,79 +11,77 @@ import org.json.JSONObject;
|
|
|
11
11
|
|
|
12
12
|
public class JsonValue {
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private String key = null;
|
|
19
|
-
private String value = null;
|
|
14
|
+
private static final String TAG = "JsonValue";
|
|
15
|
+
private static final List<String> keySchemaLevel = new ArrayList<String>(Arrays.asList("key", "value"));
|
|
16
|
+
private String key = null;
|
|
17
|
+
private String value = null;
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
// Getter
|
|
20
|
+
public String getKey() {
|
|
21
|
+
return key;
|
|
22
|
+
}
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
public String getValue() {
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
// Setter
|
|
29
|
+
public void setKey(String newKey) {
|
|
30
|
+
this.key = newKey;
|
|
31
|
+
}
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
public void setValue(String newValue) {
|
|
34
|
+
this.value = newValue;
|
|
35
|
+
}
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
public ArrayList<String> getKeys() {
|
|
38
|
+
ArrayList<String> retArray = new ArrayList<String>();
|
|
39
|
+
if (getKey() != null && getKey().length() > 0) retArray.add("key");
|
|
40
|
+
if (getValue() != null && getValue().length() > 0) retArray.add("value");
|
|
41
|
+
return retArray;
|
|
42
|
+
}
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
public boolean isValue(JSONObject jsObj) {
|
|
45
|
+
if (jsObj == null || jsObj.length() == 0) return false;
|
|
46
|
+
Iterator<String> keys = jsObj.keys();
|
|
47
|
+
while (keys.hasNext()) {
|
|
48
|
+
String key = keys.next();
|
|
49
|
+
if (!keySchemaLevel.contains(key)) return false;
|
|
50
|
+
try {
|
|
51
|
+
Object val = jsObj.get(key);
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
if (key.equals("key")) {
|
|
54
|
+
if (!(val instanceof String)) {
|
|
55
|
+
return false;
|
|
56
|
+
} else {
|
|
57
|
+
key = (String) val;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (key.equals("value")) {
|
|
61
|
+
if (!(val instanceof String)) {
|
|
62
|
+
return false;
|
|
63
|
+
} else {
|
|
64
|
+
value = (String) val;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
} catch (JSONException e) {
|
|
68
|
+
e.printStackTrace();
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
68
71
|
}
|
|
69
|
-
|
|
70
|
-
e.printStackTrace();
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
72
|
+
return true;
|
|
73
73
|
}
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
74
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
public void print() {
|
|
76
|
+
String row = "";
|
|
77
|
+
if (this.getKey() != null) row = "key: " + this.getKey();
|
|
78
|
+
Log.d(TAG, row + " value: " + this.getValue());
|
|
79
|
+
}
|
|
82
80
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
public JSObject getValueAsJSObject() {
|
|
82
|
+
JSObject retObj = new JSObject();
|
|
83
|
+
if (this.key != null) retObj.put("key", this.key);
|
|
84
|
+
retObj.put("value", this.value);
|
|
85
|
+
return retObj;
|
|
86
|
+
}
|
|
89
87
|
}
|