@onekeyfe/react-native-cloud-kit-module 3.0.85 → 3.0.87

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 (23) hide show
  1. package/nitrogen/generated/android/c++/JAccountInfoResult.hpp +1 -1
  2. package/nitrogen/generated/android/c++/JDeleteRecordParams.hpp +1 -1
  3. package/nitrogen/generated/android/c++/JFetchRecordParams.hpp +1 -1
  4. package/nitrogen/generated/android/c++/JQueryRecordsParams.hpp +1 -1
  5. package/nitrogen/generated/android/c++/JQueryRecordsResult.hpp +9 -9
  6. package/nitrogen/generated/android/c++/JRecordExistsParams.hpp +1 -1
  7. package/nitrogen/generated/android/c++/JRecordResult.hpp +1 -1
  8. package/nitrogen/generated/android/c++/JSaveRecordParams.hpp +1 -1
  9. package/nitrogen/generated/android/c++/JSaveRecordResult.hpp +1 -1
  10. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/AccountInfoResult.kt +17 -0
  11. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/DeleteRecordParams.kt +15 -0
  12. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/FetchRecordParams.kt +15 -0
  13. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/HybridCloudKitModuleSpec.kt +2 -0
  14. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsParams.kt +13 -0
  15. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsResult.kt +13 -0
  16. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordExistsParams.kt +15 -0
  17. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordResult.kt +23 -0
  18. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordParams.kt +19 -0
  19. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordResult.kt +15 -0
  20. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/Variant_NullType_RecordResult.kt +16 -7
  21. package/nitrogen/generated/ios/CloudKitModule+autolinking.rb +2 -0
  22. package/nitrogen/generated/ios/swift/Variant_NullType_RecordResult.swift +12 -0
  23. package/package.json +4 -4
@@ -18,7 +18,7 @@ namespace margelo::nitro::cloudkitmodule {
18
18
  using namespace facebook;
19
19
 
20
20
  /**
21
- * The C++ JNI bridge between the C++ struct "AccountInfoResult" and the the Kotlin data class "AccountInfoResult".
21
+ * The C++ JNI bridge between the C++ struct "AccountInfoResult" and the Kotlin data class "AccountInfoResult".
22
22
  */
23
23
  struct JAccountInfoResult final: public jni::JavaClass<JAccountInfoResult> {
24
24
  public:
@@ -17,7 +17,7 @@ namespace margelo::nitro::cloudkitmodule {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "DeleteRecordParams" and the the Kotlin data class "DeleteRecordParams".
20
+ * The C++ JNI bridge between the C++ struct "DeleteRecordParams" and the Kotlin data class "DeleteRecordParams".
21
21
  */
22
22
  struct JDeleteRecordParams final: public jni::JavaClass<JDeleteRecordParams> {
23
23
  public:
@@ -17,7 +17,7 @@ namespace margelo::nitro::cloudkitmodule {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "FetchRecordParams" and the the Kotlin data class "FetchRecordParams".
20
+ * The C++ JNI bridge between the C++ struct "FetchRecordParams" and the Kotlin data class "FetchRecordParams".
21
21
  */
22
22
  struct JFetchRecordParams final: public jni::JavaClass<JFetchRecordParams> {
23
23
  public:
@@ -17,7 +17,7 @@ namespace margelo::nitro::cloudkitmodule {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "QueryRecordsParams" and the the Kotlin data class "QueryRecordsParams".
20
+ * The C++ JNI bridge between the C++ struct "QueryRecordsParams" and the Kotlin data class "QueryRecordsParams".
21
21
  */
22
22
  struct JQueryRecordsParams final: public jni::JavaClass<JQueryRecordsParams> {
23
23
  public:
@@ -20,7 +20,7 @@ namespace margelo::nitro::cloudkitmodule {
20
20
  using namespace facebook;
21
21
 
22
22
  /**
23
- * The C++ JNI bridge between the C++ struct "QueryRecordsResult" and the the Kotlin data class "QueryRecordsResult".
23
+ * The C++ JNI bridge between the C++ struct "QueryRecordsResult" and the Kotlin data class "QueryRecordsResult".
24
24
  */
25
25
  struct JQueryRecordsResult final: public jni::JavaClass<JQueryRecordsResult> {
26
26
  public:
@@ -37,16 +37,16 @@ namespace margelo::nitro::cloudkitmodule {
37
37
  static const auto fieldRecords = clazz->getField<jni::JArrayClass<JRecordResult>>("records");
38
38
  jni::local_ref<jni::JArrayClass<JRecordResult>> records = this->getFieldValue(fieldRecords);
39
39
  return QueryRecordsResult(
40
- [&]() {
41
- size_t __size = records->size();
40
+ [&](auto&& __input) {
41
+ size_t __size = __input->size();
42
42
  std::vector<RecordResult> __vector;
43
43
  __vector.reserve(__size);
44
44
  for (size_t __i = 0; __i < __size; __i++) {
45
- auto __element = records->getElement(__i);
45
+ auto __element = __input->getElement(__i);
46
46
  __vector.push_back(__element->toCpp());
47
47
  }
48
48
  return __vector;
49
- }()
49
+ }(records)
50
50
  );
51
51
  }
52
52
 
@@ -61,16 +61,16 @@ namespace margelo::nitro::cloudkitmodule {
61
61
  static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
62
62
  return create(
63
63
  clazz,
64
- [&]() {
65
- size_t __size = value.records.size();
64
+ [&](auto&& __input) {
65
+ size_t __size = __input.size();
66
66
  jni::local_ref<jni::JArrayClass<JRecordResult>> __array = jni::JArrayClass<JRecordResult>::newArray(__size);
67
67
  for (size_t __i = 0; __i < __size; __i++) {
68
- const auto& __element = value.records[__i];
68
+ const auto& __element = __input[__i];
69
69
  auto __elementJni = JRecordResult::fromCpp(__element);
70
70
  __array->setElement(__i, *__elementJni);
71
71
  }
72
72
  return __array;
73
- }()
73
+ }(value.records)
74
74
  );
75
75
  }
76
76
  };
@@ -17,7 +17,7 @@ namespace margelo::nitro::cloudkitmodule {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "RecordExistsParams" and the the Kotlin data class "RecordExistsParams".
20
+ * The C++ JNI bridge between the C++ struct "RecordExistsParams" and the Kotlin data class "RecordExistsParams".
21
21
  */
22
22
  struct JRecordExistsParams final: public jni::JavaClass<JRecordExistsParams> {
23
23
  public:
@@ -17,7 +17,7 @@ namespace margelo::nitro::cloudkitmodule {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "RecordResult" and the the Kotlin data class "RecordResult".
20
+ * The C++ JNI bridge between the C++ struct "RecordResult" and the Kotlin data class "RecordResult".
21
21
  */
22
22
  struct JRecordResult final: public jni::JavaClass<JRecordResult> {
23
23
  public:
@@ -17,7 +17,7 @@ namespace margelo::nitro::cloudkitmodule {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "SaveRecordParams" and the the Kotlin data class "SaveRecordParams".
20
+ * The C++ JNI bridge between the C++ struct "SaveRecordParams" and the Kotlin data class "SaveRecordParams".
21
21
  */
22
22
  struct JSaveRecordParams final: public jni::JavaClass<JSaveRecordParams> {
23
23
  public:
@@ -17,7 +17,7 @@ namespace margelo::nitro::cloudkitmodule {
17
17
  using namespace facebook;
18
18
 
19
19
  /**
20
- * The C++ JNI bridge between the C++ struct "SaveRecordResult" and the the Kotlin data class "SaveRecordResult".
20
+ * The C++ JNI bridge between the C++ struct "SaveRecordResult" and the Kotlin data class "SaveRecordResult".
21
21
  */
22
22
  struct JSaveRecordResult final: public jni::JavaClass<JSaveRecordResult> {
23
23
  public:
@@ -9,6 +9,7 @@ package com.margelo.nitro.cloudkitmodule
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -29,6 +30,22 @@ data class AccountInfoResult(
29
30
  ) {
30
31
  /* primary constructor */
31
32
 
33
+ override fun equals(other: Any?): Boolean {
34
+ if (this === other) return true
35
+ if (other !is AccountInfoResult) return false
36
+ return Objects.deepEquals(this.status, other.status)
37
+ && Objects.deepEquals(this.statusName, other.statusName)
38
+ && Objects.deepEquals(this.containerUserId, other.containerUserId)
39
+ }
40
+
41
+ override fun hashCode(): Int {
42
+ return arrayOf<Any?>(
43
+ status,
44
+ statusName,
45
+ containerUserId
46
+ ).contentDeepHashCode()
47
+ }
48
+
32
49
  companion object {
33
50
  /**
34
51
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.cloudkitmodule
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -26,6 +27,20 @@ data class DeleteRecordParams(
26
27
  ) {
27
28
  /* primary constructor */
28
29
 
30
+ override fun equals(other: Any?): Boolean {
31
+ if (this === other) return true
32
+ if (other !is DeleteRecordParams) return false
33
+ return Objects.deepEquals(this.recordType, other.recordType)
34
+ && Objects.deepEquals(this.recordID, other.recordID)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf<Any?>(
39
+ recordType,
40
+ recordID
41
+ ).contentDeepHashCode()
42
+ }
43
+
29
44
  companion object {
30
45
  /**
31
46
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.cloudkitmodule
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -26,6 +27,20 @@ data class FetchRecordParams(
26
27
  ) {
27
28
  /* primary constructor */
28
29
 
30
+ override fun equals(other: Any?): Boolean {
31
+ if (this === other) return true
32
+ if (other !is FetchRecordParams) return false
33
+ return Objects.deepEquals(this.recordType, other.recordType)
34
+ && Objects.deepEquals(this.recordID, other.recordID)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf<Any?>(
39
+ recordType,
40
+ recordID
41
+ ).contentDeepHashCode()
42
+ }
43
+
29
44
  companion object {
30
45
  /**
31
46
  * Constructor called from C++
@@ -10,6 +10,7 @@ package com.margelo.nitro.cloudkitmodule
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.jni.HybridData
12
12
  import com.facebook.proguard.annotations.DoNotStrip
13
+ import dalvik.annotation.optimization.FastNative
13
14
  import com.margelo.nitro.core.Promise
14
15
  import com.margelo.nitro.core.NullType
15
16
  import com.margelo.nitro.core.HybridObject
@@ -68,6 +69,7 @@ abstract class HybridCloudKitModuleSpec: HybridObject() {
68
69
  @Keep
69
70
  protected open class CxxPart(javaPart: HybridCloudKitModuleSpec): HybridObject.CxxPart(javaPart) {
70
71
  // C++ JHybridCloudKitModuleSpec::CxxPart::initHybrid(...)
72
+ @FastNative
71
73
  external override fun initHybrid(): HybridData
72
74
  }
73
75
  override fun createCxxPart(): CxxPart {
@@ -9,6 +9,7 @@ package com.margelo.nitro.cloudkitmodule
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -23,6 +24,18 @@ data class QueryRecordsParams(
23
24
  ) {
24
25
  /* primary constructor */
25
26
 
27
+ override fun equals(other: Any?): Boolean {
28
+ if (this === other) return true
29
+ if (other !is QueryRecordsParams) return false
30
+ return Objects.deepEquals(this.recordType, other.recordType)
31
+ }
32
+
33
+ override fun hashCode(): Int {
34
+ return arrayOf<Any?>(
35
+ recordType
36
+ ).contentDeepHashCode()
37
+ }
38
+
26
39
  companion object {
27
40
  /**
28
41
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.cloudkitmodule
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -23,6 +24,18 @@ data class QueryRecordsResult(
23
24
  ) {
24
25
  /* primary constructor */
25
26
 
27
+ override fun equals(other: Any?): Boolean {
28
+ if (this === other) return true
29
+ if (other !is QueryRecordsResult) return false
30
+ return Objects.deepEquals(this.records, other.records)
31
+ }
32
+
33
+ override fun hashCode(): Int {
34
+ return arrayOf<Any?>(
35
+ records
36
+ ).contentDeepHashCode()
37
+ }
38
+
26
39
  companion object {
27
40
  /**
28
41
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.cloudkitmodule
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -26,6 +27,20 @@ data class RecordExistsParams(
26
27
  ) {
27
28
  /* primary constructor */
28
29
 
30
+ override fun equals(other: Any?): Boolean {
31
+ if (this === other) return true
32
+ if (other !is RecordExistsParams) return false
33
+ return Objects.deepEquals(this.recordType, other.recordType)
34
+ && Objects.deepEquals(this.recordID, other.recordID)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf<Any?>(
39
+ recordType,
40
+ recordID
41
+ ).contentDeepHashCode()
42
+ }
43
+
29
44
  companion object {
30
45
  /**
31
46
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.cloudkitmodule
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -38,6 +39,28 @@ data class RecordResult(
38
39
  ) {
39
40
  /* primary constructor */
40
41
 
42
+ override fun equals(other: Any?): Boolean {
43
+ if (this === other) return true
44
+ if (other !is RecordResult) return false
45
+ return Objects.deepEquals(this.recordID, other.recordID)
46
+ && Objects.deepEquals(this.recordType, other.recordType)
47
+ && Objects.deepEquals(this.data, other.data)
48
+ && Objects.deepEquals(this.meta, other.meta)
49
+ && Objects.deepEquals(this.createdAt, other.createdAt)
50
+ && Objects.deepEquals(this.modifiedAt, other.modifiedAt)
51
+ }
52
+
53
+ override fun hashCode(): Int {
54
+ return arrayOf<Any?>(
55
+ recordID,
56
+ recordType,
57
+ data,
58
+ meta,
59
+ createdAt,
60
+ modifiedAt
61
+ ).contentDeepHashCode()
62
+ }
63
+
41
64
  companion object {
42
65
  /**
43
66
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.cloudkitmodule
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -32,6 +33,24 @@ data class SaveRecordParams(
32
33
  ) {
33
34
  /* primary constructor */
34
35
 
36
+ override fun equals(other: Any?): Boolean {
37
+ if (this === other) return true
38
+ if (other !is SaveRecordParams) return false
39
+ return Objects.deepEquals(this.recordType, other.recordType)
40
+ && Objects.deepEquals(this.recordID, other.recordID)
41
+ && Objects.deepEquals(this.data, other.data)
42
+ && Objects.deepEquals(this.meta, other.meta)
43
+ }
44
+
45
+ override fun hashCode(): Int {
46
+ return arrayOf<Any?>(
47
+ recordType,
48
+ recordID,
49
+ data,
50
+ meta
51
+ ).contentDeepHashCode()
52
+ }
53
+
35
54
  companion object {
36
55
  /**
37
56
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.cloudkitmodule
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -26,6 +27,20 @@ data class SaveRecordResult(
26
27
  ) {
27
28
  /* primary constructor */
28
29
 
30
+ override fun equals(other: Any?): Boolean {
31
+ if (this === other) return true
32
+ if (other !is SaveRecordResult) return false
33
+ return Objects.deepEquals(this.recordID, other.recordID)
34
+ && Objects.deepEquals(this.createdAt, other.createdAt)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf<Any?>(
39
+ recordID,
40
+ createdAt
41
+ ).contentDeepHashCode()
42
+ }
43
+
29
44
  companion object {
30
45
  /**
31
46
  * Constructor called from C++
@@ -21,6 +21,22 @@ sealed class Variant_NullType_RecordResult {
21
21
  @DoNotStrip
22
22
  data class Second(@DoNotStrip val value: RecordResult): Variant_NullType_RecordResult()
23
23
 
24
+ inline fun <reified T> asType(): T? {
25
+ return when (this) {
26
+ is First -> (value) as? T
27
+ is Second -> (value) as? T
28
+ }
29
+ }
30
+ inline fun <reified T> isType(): Boolean {
31
+ return asType<T>() != null
32
+ }
33
+ inline fun <R> match(first: (NullType) -> R, second: (RecordResult) -> R): R {
34
+ return when (this) {
35
+ is First -> first(value)
36
+ is Second -> second(value)
37
+ }
38
+ }
39
+
24
40
  val isFirst: Boolean
25
41
  get() = this is First
26
42
  val isSecond: Boolean
@@ -35,13 +51,6 @@ sealed class Variant_NullType_RecordResult {
35
51
  return value
36
52
  }
37
53
 
38
- inline fun <R> match(first: (NullType) -> R, second: (RecordResult) -> R): R {
39
- return when (this) {
40
- is First -> first(value)
41
- is Second -> second(value)
42
- }
43
- }
44
-
45
54
  companion object {
46
55
  @JvmStatic
47
56
  @DoNotStrip
@@ -56,5 +56,7 @@ def add_nitrogen_files(spec)
56
56
  "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
57
57
  # Enables stricter modular headers
58
58
  "DEFINES_MODULE" => "YES",
59
+ # Disable auto-generated ObjC header for Swift (Static linkage on Xcode 26.4 breaks here)
60
+ "SWIFT_INSTALL_OBJC_HEADER" => "NO",
59
61
  })
60
62
  end
@@ -16,3 +16,15 @@ public indirect enum Variant_NullType_RecordResult {
16
16
  case first(NullType)
17
17
  case second(RecordResult)
18
18
  }
19
+
20
+ public extension Variant_NullType_RecordResult {
21
+ func asType<T>(_ type: T.Type = T.self) -> T? {
22
+ switch self {
23
+ case .first(let value): return value as? T
24
+ case .second(let value): return value as? T
25
+ }
26
+ }
27
+ func isType<T>(_ type: T.Type = T.self) -> Bool {
28
+ return self.asType(type) != nil
29
+ }
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-cloud-kit-module",
3
- "version": "3.0.85",
3
+ "version": "3.0.87",
4
4
  "description": "react-native-cloud-kit-module",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -78,12 +78,12 @@
78
78
  "eslint-plugin-prettier": "^5.5.4",
79
79
  "jest": "^29.7.0",
80
80
  "lefthook": "^2.0.3",
81
- "nitrogen": "0.35.2",
81
+ "nitrogen": "0.36.5",
82
82
  "prettier": "^2.8.8",
83
83
  "react": "19.2.0",
84
84
  "react-native": "patch:react-native@npm%3A0.83.0#~/.yarn/patches/react-native-npm-0.83.0-577d0f2d83.patch",
85
85
  "react-native-builder-bob": "^0.40.13",
86
- "react-native-nitro-modules": "0.35.2",
86
+ "react-native-nitro-modules": "0.36.5",
87
87
  "release-it": "^19.0.4",
88
88
  "turbo": "^2.5.6",
89
89
  "typescript": "^5.9.2"
@@ -91,7 +91,7 @@
91
91
  "peerDependencies": {
92
92
  "react": "*",
93
93
  "react-native": "*",
94
- "react-native-nitro-modules": "0.35.2"
94
+ "react-native-nitro-modules": "0.36.5"
95
95
  },
96
96
  "react-native-builder-bob": {
97
97
  "source": "src",