@onekeyfe/react-native-cloud-kit-module 1.1.6

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 (88) hide show
  1. package/CloudKitModule.podspec +29 -0
  2. package/LICENSE +20 -0
  3. package/README.md +39 -0
  4. package/android/CMakeLists.txt +24 -0
  5. package/android/build.gradle +128 -0
  6. package/android/gradle.properties +5 -0
  7. package/android/src/main/AndroidManifest.xml +2 -0
  8. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  9. package/android/src/main/java/com/margelo/nitro/cloudkitmodule/CloudKitModule.kt +51 -0
  10. package/android/src/main/java/com/margelo/nitro/cloudkitmodule/CloudKitModulePackage.kt +22 -0
  11. package/ios/CloudKitModule.swift +186 -0
  12. package/ios/CloudKitModuleCore.swift +195 -0
  13. package/lib/module/CloudKitModule.nitro.js +4 -0
  14. package/lib/module/CloudKitModule.nitro.js.map +1 -0
  15. package/lib/module/index.js +6 -0
  16. package/lib/module/index.js.map +1 -0
  17. package/lib/module/package.json +1 -0
  18. package/lib/typescript/package.json +1 -0
  19. package/lib/typescript/src/CloudKitModule.nitro.d.ts +55 -0
  20. package/lib/typescript/src/CloudKitModule.nitro.d.ts.map +1 -0
  21. package/lib/typescript/src/index.d.ts +4 -0
  22. package/lib/typescript/src/index.d.ts.map +1 -0
  23. package/nitro.json +17 -0
  24. package/nitrogen/generated/android/c++/JAccountInfoResult.hpp +62 -0
  25. package/nitrogen/generated/android/c++/JDeleteRecordParams.hpp +57 -0
  26. package/nitrogen/generated/android/c++/JFetchRecordParams.hpp +57 -0
  27. package/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.cpp +192 -0
  28. package/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.hpp +70 -0
  29. package/nitrogen/generated/android/c++/JQueryRecordsParams.hpp +53 -0
  30. package/nitrogen/generated/android/c++/JQueryRecordsResult.hpp +73 -0
  31. package/nitrogen/generated/android/c++/JRecordExistsParams.hpp +57 -0
  32. package/nitrogen/generated/android/c++/JRecordResult.hpp +73 -0
  33. package/nitrogen/generated/android/c++/JSaveRecordParams.hpp +65 -0
  34. package/nitrogen/generated/android/c++/JSaveRecordResult.hpp +57 -0
  35. package/nitrogen/generated/android/cloudkitmodule+autolinking.cmake +81 -0
  36. package/nitrogen/generated/android/cloudkitmodule+autolinking.gradle +27 -0
  37. package/nitrogen/generated/android/cloudkitmoduleOnLoad.cpp +44 -0
  38. package/nitrogen/generated/android/cloudkitmoduleOnLoad.hpp +25 -0
  39. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/AccountInfoResult.kt +35 -0
  40. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/DeleteRecordParams.kt +32 -0
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/FetchRecordParams.kt +32 -0
  42. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/HybridCloudKitModuleSpec.kt +76 -0
  43. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsParams.kt +29 -0
  44. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsResult.kt +29 -0
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordExistsParams.kt +32 -0
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordResult.kt +44 -0
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordParams.kt +38 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordResult.kt +32 -0
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/cloudkitmoduleOnLoad.kt +35 -0
  50. package/nitrogen/generated/ios/CloudKitModule+autolinking.rb +60 -0
  51. package/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.cpp +80 -0
  52. package/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.hpp +340 -0
  53. package/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Umbrella.hpp +74 -0
  54. package/nitrogen/generated/ios/CloudKitModuleAutolinking.mm +33 -0
  55. package/nitrogen/generated/ios/CloudKitModuleAutolinking.swift +25 -0
  56. package/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.cpp +11 -0
  57. package/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.hpp +150 -0
  58. package/nitrogen/generated/ios/swift/AccountInfoResult.swift +76 -0
  59. package/nitrogen/generated/ios/swift/DeleteRecordParams.swift +46 -0
  60. package/nitrogen/generated/ios/swift/FetchRecordParams.swift +46 -0
  61. package/nitrogen/generated/ios/swift/Func_void_AccountInfoResult.swift +47 -0
  62. package/nitrogen/generated/ios/swift/Func_void_QueryRecordsResult.swift +47 -0
  63. package/nitrogen/generated/ios/swift/Func_void_SaveRecordResult.swift +47 -0
  64. package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
  65. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
  66. package/nitrogen/generated/ios/swift/Func_void_std__optional_RecordResult_.swift +47 -0
  67. package/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec.swift +55 -0
  68. package/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec_cxx.swift +250 -0
  69. package/nitrogen/generated/ios/swift/QueryRecordsParams.swift +35 -0
  70. package/nitrogen/generated/ios/swift/QueryRecordsResult.swift +43 -0
  71. package/nitrogen/generated/ios/swift/RecordExistsParams.swift +46 -0
  72. package/nitrogen/generated/ios/swift/RecordResult.swift +90 -0
  73. package/nitrogen/generated/ios/swift/SaveRecordParams.swift +68 -0
  74. package/nitrogen/generated/ios/swift/SaveRecordResult.swift +46 -0
  75. package/nitrogen/generated/shared/c++/AccountInfoResult.hpp +76 -0
  76. package/nitrogen/generated/shared/c++/DeleteRecordParams.hpp +71 -0
  77. package/nitrogen/generated/shared/c++/FetchRecordParams.hpp +71 -0
  78. package/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.cpp +27 -0
  79. package/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.hpp +95 -0
  80. package/nitrogen/generated/shared/c++/QueryRecordsParams.hpp +67 -0
  81. package/nitrogen/generated/shared/c++/QueryRecordsResult.hpp +69 -0
  82. package/nitrogen/generated/shared/c++/RecordExistsParams.hpp +71 -0
  83. package/nitrogen/generated/shared/c++/RecordResult.hpp +87 -0
  84. package/nitrogen/generated/shared/c++/SaveRecordParams.hpp +79 -0
  85. package/nitrogen/generated/shared/c++/SaveRecordResult.hpp +71 -0
  86. package/package.json +174 -0
  87. package/src/CloudKitModule.nitro.ts +64 -0
  88. package/src/index.tsx +8 -0
@@ -0,0 +1,71 @@
1
+ ///
2
+ /// DeleteRecordParams.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::cloudkitmodule {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (DeleteRecordParams).
29
+ */
30
+ struct DeleteRecordParams {
31
+ public:
32
+ std::string recordType SWIFT_PRIVATE;
33
+ std::string recordID SWIFT_PRIVATE;
34
+
35
+ public:
36
+ DeleteRecordParams() = default;
37
+ explicit DeleteRecordParams(std::string recordType, std::string recordID): recordType(recordType), recordID(recordID) {}
38
+ };
39
+
40
+ } // namespace margelo::nitro::cloudkitmodule
41
+
42
+ namespace margelo::nitro {
43
+
44
+ // C++ DeleteRecordParams <> JS DeleteRecordParams (object)
45
+ template <>
46
+ struct JSIConverter<margelo::nitro::cloudkitmodule::DeleteRecordParams> final {
47
+ static inline margelo::nitro::cloudkitmodule::DeleteRecordParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
48
+ jsi::Object obj = arg.asObject(runtime);
49
+ return margelo::nitro::cloudkitmodule::DeleteRecordParams(
50
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "recordType")),
51
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "recordID"))
52
+ );
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::DeleteRecordParams& arg) {
55
+ jsi::Object obj(runtime);
56
+ obj.setProperty(runtime, "recordType", JSIConverter<std::string>::toJSI(runtime, arg.recordType));
57
+ obj.setProperty(runtime, "recordID", JSIConverter<std::string>::toJSI(runtime, arg.recordID));
58
+ return obj;
59
+ }
60
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
61
+ if (!value.isObject()) {
62
+ return false;
63
+ }
64
+ jsi::Object obj = value.getObject(runtime);
65
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "recordType"))) return false;
66
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "recordID"))) return false;
67
+ return true;
68
+ }
69
+ };
70
+
71
+ } // namespace margelo::nitro
@@ -0,0 +1,71 @@
1
+ ///
2
+ /// FetchRecordParams.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::cloudkitmodule {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (FetchRecordParams).
29
+ */
30
+ struct FetchRecordParams {
31
+ public:
32
+ std::string recordType SWIFT_PRIVATE;
33
+ std::string recordID SWIFT_PRIVATE;
34
+
35
+ public:
36
+ FetchRecordParams() = default;
37
+ explicit FetchRecordParams(std::string recordType, std::string recordID): recordType(recordType), recordID(recordID) {}
38
+ };
39
+
40
+ } // namespace margelo::nitro::cloudkitmodule
41
+
42
+ namespace margelo::nitro {
43
+
44
+ // C++ FetchRecordParams <> JS FetchRecordParams (object)
45
+ template <>
46
+ struct JSIConverter<margelo::nitro::cloudkitmodule::FetchRecordParams> final {
47
+ static inline margelo::nitro::cloudkitmodule::FetchRecordParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
48
+ jsi::Object obj = arg.asObject(runtime);
49
+ return margelo::nitro::cloudkitmodule::FetchRecordParams(
50
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "recordType")),
51
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "recordID"))
52
+ );
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::FetchRecordParams& arg) {
55
+ jsi::Object obj(runtime);
56
+ obj.setProperty(runtime, "recordType", JSIConverter<std::string>::toJSI(runtime, arg.recordType));
57
+ obj.setProperty(runtime, "recordID", JSIConverter<std::string>::toJSI(runtime, arg.recordID));
58
+ return obj;
59
+ }
60
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
61
+ if (!value.isObject()) {
62
+ return false;
63
+ }
64
+ jsi::Object obj = value.getObject(runtime);
65
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "recordType"))) return false;
66
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "recordID"))) return false;
67
+ return true;
68
+ }
69
+ };
70
+
71
+ } // namespace margelo::nitro
@@ -0,0 +1,27 @@
1
+ ///
2
+ /// HybridCloudKitModuleSpec.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "HybridCloudKitModuleSpec.hpp"
9
+
10
+ namespace margelo::nitro::cloudkitmodule {
11
+
12
+ void HybridCloudKitModuleSpec::loadHybridMethods() {
13
+ // load base methods/properties
14
+ HybridObject::loadHybridMethods();
15
+ // load custom methods/properties
16
+ registerHybrids(this, [](Prototype& prototype) {
17
+ prototype.registerHybridMethod("isAvailable", &HybridCloudKitModuleSpec::isAvailable);
18
+ prototype.registerHybridMethod("getAccountInfo", &HybridCloudKitModuleSpec::getAccountInfo);
19
+ prototype.registerHybridMethod("saveRecord", &HybridCloudKitModuleSpec::saveRecord);
20
+ prototype.registerHybridMethod("fetchRecord", &HybridCloudKitModuleSpec::fetchRecord);
21
+ prototype.registerHybridMethod("deleteRecord", &HybridCloudKitModuleSpec::deleteRecord);
22
+ prototype.registerHybridMethod("recordExists", &HybridCloudKitModuleSpec::recordExists);
23
+ prototype.registerHybridMethod("queryRecords", &HybridCloudKitModuleSpec::queryRecords);
24
+ });
25
+ }
26
+
27
+ } // namespace margelo::nitro::cloudkitmodule
@@ -0,0 +1,95 @@
1
+ ///
2
+ /// HybridCloudKitModuleSpec.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/HybridObject.hpp>)
11
+ #include <NitroModules/HybridObject.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+
16
+ // Forward declaration of `AccountInfoResult` to properly resolve imports.
17
+ namespace margelo::nitro::cloudkitmodule { struct AccountInfoResult; }
18
+ // Forward declaration of `SaveRecordResult` to properly resolve imports.
19
+ namespace margelo::nitro::cloudkitmodule { struct SaveRecordResult; }
20
+ // Forward declaration of `SaveRecordParams` to properly resolve imports.
21
+ namespace margelo::nitro::cloudkitmodule { struct SaveRecordParams; }
22
+ // Forward declaration of `RecordResult` to properly resolve imports.
23
+ namespace margelo::nitro::cloudkitmodule { struct RecordResult; }
24
+ // Forward declaration of `FetchRecordParams` to properly resolve imports.
25
+ namespace margelo::nitro::cloudkitmodule { struct FetchRecordParams; }
26
+ // Forward declaration of `DeleteRecordParams` to properly resolve imports.
27
+ namespace margelo::nitro::cloudkitmodule { struct DeleteRecordParams; }
28
+ // Forward declaration of `RecordExistsParams` to properly resolve imports.
29
+ namespace margelo::nitro::cloudkitmodule { struct RecordExistsParams; }
30
+ // Forward declaration of `QueryRecordsResult` to properly resolve imports.
31
+ namespace margelo::nitro::cloudkitmodule { struct QueryRecordsResult; }
32
+ // Forward declaration of `QueryRecordsParams` to properly resolve imports.
33
+ namespace margelo::nitro::cloudkitmodule { struct QueryRecordsParams; }
34
+
35
+ #include <NitroModules/Promise.hpp>
36
+ #include "AccountInfoResult.hpp"
37
+ #include "SaveRecordResult.hpp"
38
+ #include "SaveRecordParams.hpp"
39
+ #include "RecordResult.hpp"
40
+ #include <optional>
41
+ #include "FetchRecordParams.hpp"
42
+ #include "DeleteRecordParams.hpp"
43
+ #include "RecordExistsParams.hpp"
44
+ #include "QueryRecordsResult.hpp"
45
+ #include "QueryRecordsParams.hpp"
46
+
47
+ namespace margelo::nitro::cloudkitmodule {
48
+
49
+ using namespace margelo::nitro;
50
+
51
+ /**
52
+ * An abstract base class for `CloudKitModule`
53
+ * Inherit this class to create instances of `HybridCloudKitModuleSpec` in C++.
54
+ * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
55
+ * @example
56
+ * ```cpp
57
+ * class HybridCloudKitModule: public HybridCloudKitModuleSpec {
58
+ * public:
59
+ * HybridCloudKitModule(...): HybridObject(TAG) { ... }
60
+ * // ...
61
+ * };
62
+ * ```
63
+ */
64
+ class HybridCloudKitModuleSpec: public virtual HybridObject {
65
+ public:
66
+ // Constructor
67
+ explicit HybridCloudKitModuleSpec(): HybridObject(TAG) { }
68
+
69
+ // Destructor
70
+ ~HybridCloudKitModuleSpec() override = default;
71
+
72
+ public:
73
+ // Properties
74
+
75
+
76
+ public:
77
+ // Methods
78
+ virtual std::shared_ptr<Promise<bool>> isAvailable() = 0;
79
+ virtual std::shared_ptr<Promise<AccountInfoResult>> getAccountInfo() = 0;
80
+ virtual std::shared_ptr<Promise<SaveRecordResult>> saveRecord(const SaveRecordParams& params) = 0;
81
+ virtual std::shared_ptr<Promise<std::optional<RecordResult>>> fetchRecord(const FetchRecordParams& params) = 0;
82
+ virtual std::shared_ptr<Promise<bool>> deleteRecord(const DeleteRecordParams& params) = 0;
83
+ virtual std::shared_ptr<Promise<bool>> recordExists(const RecordExistsParams& params) = 0;
84
+ virtual std::shared_ptr<Promise<QueryRecordsResult>> queryRecords(const QueryRecordsParams& params) = 0;
85
+
86
+ protected:
87
+ // Hybrid Setup
88
+ void loadHybridMethods() override;
89
+
90
+ protected:
91
+ // Tag for logging
92
+ static constexpr auto TAG = "CloudKitModule";
93
+ };
94
+
95
+ } // namespace margelo::nitro::cloudkitmodule
@@ -0,0 +1,67 @@
1
+ ///
2
+ /// QueryRecordsParams.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::cloudkitmodule {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (QueryRecordsParams).
29
+ */
30
+ struct QueryRecordsParams {
31
+ public:
32
+ std::string recordType SWIFT_PRIVATE;
33
+
34
+ public:
35
+ QueryRecordsParams() = default;
36
+ explicit QueryRecordsParams(std::string recordType): recordType(recordType) {}
37
+ };
38
+
39
+ } // namespace margelo::nitro::cloudkitmodule
40
+
41
+ namespace margelo::nitro {
42
+
43
+ // C++ QueryRecordsParams <> JS QueryRecordsParams (object)
44
+ template <>
45
+ struct JSIConverter<margelo::nitro::cloudkitmodule::QueryRecordsParams> final {
46
+ static inline margelo::nitro::cloudkitmodule::QueryRecordsParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
47
+ jsi::Object obj = arg.asObject(runtime);
48
+ return margelo::nitro::cloudkitmodule::QueryRecordsParams(
49
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "recordType"))
50
+ );
51
+ }
52
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::QueryRecordsParams& arg) {
53
+ jsi::Object obj(runtime);
54
+ obj.setProperty(runtime, "recordType", JSIConverter<std::string>::toJSI(runtime, arg.recordType));
55
+ return obj;
56
+ }
57
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
58
+ if (!value.isObject()) {
59
+ return false;
60
+ }
61
+ jsi::Object obj = value.getObject(runtime);
62
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "recordType"))) return false;
63
+ return true;
64
+ }
65
+ };
66
+
67
+ } // namespace margelo::nitro
@@ -0,0 +1,69 @@
1
+ ///
2
+ /// QueryRecordsResult.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+ // Forward declaration of `RecordResult` to properly resolve imports.
22
+ namespace margelo::nitro::cloudkitmodule { struct RecordResult; }
23
+
24
+ #include "RecordResult.hpp"
25
+ #include <vector>
26
+
27
+ namespace margelo::nitro::cloudkitmodule {
28
+
29
+ /**
30
+ * A struct which can be represented as a JavaScript object (QueryRecordsResult).
31
+ */
32
+ struct QueryRecordsResult {
33
+ public:
34
+ std::vector<RecordResult> records SWIFT_PRIVATE;
35
+
36
+ public:
37
+ QueryRecordsResult() = default;
38
+ explicit QueryRecordsResult(std::vector<RecordResult> records): records(records) {}
39
+ };
40
+
41
+ } // namespace margelo::nitro::cloudkitmodule
42
+
43
+ namespace margelo::nitro {
44
+
45
+ // C++ QueryRecordsResult <> JS QueryRecordsResult (object)
46
+ template <>
47
+ struct JSIConverter<margelo::nitro::cloudkitmodule::QueryRecordsResult> final {
48
+ static inline margelo::nitro::cloudkitmodule::QueryRecordsResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ jsi::Object obj = arg.asObject(runtime);
50
+ return margelo::nitro::cloudkitmodule::QueryRecordsResult(
51
+ JSIConverter<std::vector<margelo::nitro::cloudkitmodule::RecordResult>>::fromJSI(runtime, obj.getProperty(runtime, "records"))
52
+ );
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::QueryRecordsResult& arg) {
55
+ jsi::Object obj(runtime);
56
+ obj.setProperty(runtime, "records", JSIConverter<std::vector<margelo::nitro::cloudkitmodule::RecordResult>>::toJSI(runtime, arg.records));
57
+ return obj;
58
+ }
59
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
60
+ if (!value.isObject()) {
61
+ return false;
62
+ }
63
+ jsi::Object obj = value.getObject(runtime);
64
+ if (!JSIConverter<std::vector<margelo::nitro::cloudkitmodule::RecordResult>>::canConvert(runtime, obj.getProperty(runtime, "records"))) return false;
65
+ return true;
66
+ }
67
+ };
68
+
69
+ } // namespace margelo::nitro
@@ -0,0 +1,71 @@
1
+ ///
2
+ /// RecordExistsParams.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::cloudkitmodule {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (RecordExistsParams).
29
+ */
30
+ struct RecordExistsParams {
31
+ public:
32
+ std::string recordType SWIFT_PRIVATE;
33
+ std::string recordID SWIFT_PRIVATE;
34
+
35
+ public:
36
+ RecordExistsParams() = default;
37
+ explicit RecordExistsParams(std::string recordType, std::string recordID): recordType(recordType), recordID(recordID) {}
38
+ };
39
+
40
+ } // namespace margelo::nitro::cloudkitmodule
41
+
42
+ namespace margelo::nitro {
43
+
44
+ // C++ RecordExistsParams <> JS RecordExistsParams (object)
45
+ template <>
46
+ struct JSIConverter<margelo::nitro::cloudkitmodule::RecordExistsParams> final {
47
+ static inline margelo::nitro::cloudkitmodule::RecordExistsParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
48
+ jsi::Object obj = arg.asObject(runtime);
49
+ return margelo::nitro::cloudkitmodule::RecordExistsParams(
50
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "recordType")),
51
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "recordID"))
52
+ );
53
+ }
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::RecordExistsParams& arg) {
55
+ jsi::Object obj(runtime);
56
+ obj.setProperty(runtime, "recordType", JSIConverter<std::string>::toJSI(runtime, arg.recordType));
57
+ obj.setProperty(runtime, "recordID", JSIConverter<std::string>::toJSI(runtime, arg.recordID));
58
+ return obj;
59
+ }
60
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
61
+ if (!value.isObject()) {
62
+ return false;
63
+ }
64
+ jsi::Object obj = value.getObject(runtime);
65
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "recordType"))) return false;
66
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "recordID"))) return false;
67
+ return true;
68
+ }
69
+ };
70
+
71
+ } // namespace margelo::nitro
@@ -0,0 +1,87 @@
1
+ ///
2
+ /// RecordResult.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::cloudkitmodule {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (RecordResult).
29
+ */
30
+ struct RecordResult {
31
+ public:
32
+ std::string recordID SWIFT_PRIVATE;
33
+ std::string recordType SWIFT_PRIVATE;
34
+ std::string data SWIFT_PRIVATE;
35
+ std::string meta SWIFT_PRIVATE;
36
+ double createdAt SWIFT_PRIVATE;
37
+ double modifiedAt SWIFT_PRIVATE;
38
+
39
+ public:
40
+ RecordResult() = default;
41
+ explicit RecordResult(std::string recordID, std::string recordType, std::string data, std::string meta, double createdAt, double modifiedAt): recordID(recordID), recordType(recordType), data(data), meta(meta), createdAt(createdAt), modifiedAt(modifiedAt) {}
42
+ };
43
+
44
+ } // namespace margelo::nitro::cloudkitmodule
45
+
46
+ namespace margelo::nitro {
47
+
48
+ // C++ RecordResult <> JS RecordResult (object)
49
+ template <>
50
+ struct JSIConverter<margelo::nitro::cloudkitmodule::RecordResult> final {
51
+ static inline margelo::nitro::cloudkitmodule::RecordResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
52
+ jsi::Object obj = arg.asObject(runtime);
53
+ return margelo::nitro::cloudkitmodule::RecordResult(
54
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "recordID")),
55
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "recordType")),
56
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "data")),
57
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "meta")),
58
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "createdAt")),
59
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "modifiedAt"))
60
+ );
61
+ }
62
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::RecordResult& arg) {
63
+ jsi::Object obj(runtime);
64
+ obj.setProperty(runtime, "recordID", JSIConverter<std::string>::toJSI(runtime, arg.recordID));
65
+ obj.setProperty(runtime, "recordType", JSIConverter<std::string>::toJSI(runtime, arg.recordType));
66
+ obj.setProperty(runtime, "data", JSIConverter<std::string>::toJSI(runtime, arg.data));
67
+ obj.setProperty(runtime, "meta", JSIConverter<std::string>::toJSI(runtime, arg.meta));
68
+ obj.setProperty(runtime, "createdAt", JSIConverter<double>::toJSI(runtime, arg.createdAt));
69
+ obj.setProperty(runtime, "modifiedAt", JSIConverter<double>::toJSI(runtime, arg.modifiedAt));
70
+ return obj;
71
+ }
72
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
73
+ if (!value.isObject()) {
74
+ return false;
75
+ }
76
+ jsi::Object obj = value.getObject(runtime);
77
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "recordID"))) return false;
78
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "recordType"))) return false;
79
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "data"))) return false;
80
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "meta"))) return false;
81
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "createdAt"))) return false;
82
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "modifiedAt"))) return false;
83
+ return true;
84
+ }
85
+ };
86
+
87
+ } // namespace margelo::nitro
@@ -0,0 +1,79 @@
1
+ ///
2
+ /// SaveRecordParams.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::cloudkitmodule {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (SaveRecordParams).
29
+ */
30
+ struct SaveRecordParams {
31
+ public:
32
+ std::string recordType SWIFT_PRIVATE;
33
+ std::string recordID SWIFT_PRIVATE;
34
+ std::string data SWIFT_PRIVATE;
35
+ std::string meta SWIFT_PRIVATE;
36
+
37
+ public:
38
+ SaveRecordParams() = default;
39
+ explicit SaveRecordParams(std::string recordType, std::string recordID, std::string data, std::string meta): recordType(recordType), recordID(recordID), data(data), meta(meta) {}
40
+ };
41
+
42
+ } // namespace margelo::nitro::cloudkitmodule
43
+
44
+ namespace margelo::nitro {
45
+
46
+ // C++ SaveRecordParams <> JS SaveRecordParams (object)
47
+ template <>
48
+ struct JSIConverter<margelo::nitro::cloudkitmodule::SaveRecordParams> final {
49
+ static inline margelo::nitro::cloudkitmodule::SaveRecordParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
50
+ jsi::Object obj = arg.asObject(runtime);
51
+ return margelo::nitro::cloudkitmodule::SaveRecordParams(
52
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "recordType")),
53
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "recordID")),
54
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "data")),
55
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "meta"))
56
+ );
57
+ }
58
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::SaveRecordParams& arg) {
59
+ jsi::Object obj(runtime);
60
+ obj.setProperty(runtime, "recordType", JSIConverter<std::string>::toJSI(runtime, arg.recordType));
61
+ obj.setProperty(runtime, "recordID", JSIConverter<std::string>::toJSI(runtime, arg.recordID));
62
+ obj.setProperty(runtime, "data", JSIConverter<std::string>::toJSI(runtime, arg.data));
63
+ obj.setProperty(runtime, "meta", JSIConverter<std::string>::toJSI(runtime, arg.meta));
64
+ return obj;
65
+ }
66
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
67
+ if (!value.isObject()) {
68
+ return false;
69
+ }
70
+ jsi::Object obj = value.getObject(runtime);
71
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "recordType"))) return false;
72
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "recordID"))) return false;
73
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "data"))) return false;
74
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "meta"))) return false;
75
+ return true;
76
+ }
77
+ };
78
+
79
+ } // namespace margelo::nitro