@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.
- package/CloudKitModule.podspec +29 -0
- package/LICENSE +20 -0
- package/README.md +39 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +128 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/cloudkitmodule/CloudKitModule.kt +51 -0
- package/android/src/main/java/com/margelo/nitro/cloudkitmodule/CloudKitModulePackage.kt +22 -0
- package/ios/CloudKitModule.swift +186 -0
- package/ios/CloudKitModuleCore.swift +195 -0
- package/lib/module/CloudKitModule.nitro.js +4 -0
- package/lib/module/CloudKitModule.nitro.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/CloudKitModule.nitro.d.ts +55 -0
- package/lib/typescript/src/CloudKitModule.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +17 -0
- package/nitrogen/generated/android/c++/JAccountInfoResult.hpp +62 -0
- package/nitrogen/generated/android/c++/JDeleteRecordParams.hpp +57 -0
- package/nitrogen/generated/android/c++/JFetchRecordParams.hpp +57 -0
- package/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.cpp +192 -0
- package/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.hpp +70 -0
- package/nitrogen/generated/android/c++/JQueryRecordsParams.hpp +53 -0
- package/nitrogen/generated/android/c++/JQueryRecordsResult.hpp +73 -0
- package/nitrogen/generated/android/c++/JRecordExistsParams.hpp +57 -0
- package/nitrogen/generated/android/c++/JRecordResult.hpp +73 -0
- package/nitrogen/generated/android/c++/JSaveRecordParams.hpp +65 -0
- package/nitrogen/generated/android/c++/JSaveRecordResult.hpp +57 -0
- package/nitrogen/generated/android/cloudkitmodule+autolinking.cmake +81 -0
- package/nitrogen/generated/android/cloudkitmodule+autolinking.gradle +27 -0
- package/nitrogen/generated/android/cloudkitmoduleOnLoad.cpp +44 -0
- package/nitrogen/generated/android/cloudkitmoduleOnLoad.hpp +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/AccountInfoResult.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/DeleteRecordParams.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/FetchRecordParams.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/HybridCloudKitModuleSpec.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsParams.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsResult.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordExistsParams.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordResult.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordParams.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordResult.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/cloudkitmoduleOnLoad.kt +35 -0
- package/nitrogen/generated/ios/CloudKitModule+autolinking.rb +60 -0
- package/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.cpp +80 -0
- package/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.hpp +340 -0
- package/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Umbrella.hpp +74 -0
- package/nitrogen/generated/ios/CloudKitModuleAutolinking.mm +33 -0
- package/nitrogen/generated/ios/CloudKitModuleAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.hpp +150 -0
- package/nitrogen/generated/ios/swift/AccountInfoResult.swift +76 -0
- package/nitrogen/generated/ios/swift/DeleteRecordParams.swift +46 -0
- package/nitrogen/generated/ios/swift/FetchRecordParams.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_AccountInfoResult.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_QueryRecordsResult.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_SaveRecordResult.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_RecordResult_.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec_cxx.swift +250 -0
- package/nitrogen/generated/ios/swift/QueryRecordsParams.swift +35 -0
- package/nitrogen/generated/ios/swift/QueryRecordsResult.swift +43 -0
- package/nitrogen/generated/ios/swift/RecordExistsParams.swift +46 -0
- package/nitrogen/generated/ios/swift/RecordResult.swift +90 -0
- package/nitrogen/generated/ios/swift/SaveRecordParams.swift +68 -0
- package/nitrogen/generated/ios/swift/SaveRecordResult.swift +46 -0
- package/nitrogen/generated/shared/c++/AccountInfoResult.hpp +76 -0
- package/nitrogen/generated/shared/c++/DeleteRecordParams.hpp +71 -0
- package/nitrogen/generated/shared/c++/FetchRecordParams.hpp +71 -0
- package/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.cpp +27 -0
- package/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.hpp +95 -0
- package/nitrogen/generated/shared/c++/QueryRecordsParams.hpp +67 -0
- package/nitrogen/generated/shared/c++/QueryRecordsResult.hpp +69 -0
- package/nitrogen/generated/shared/c++/RecordExistsParams.hpp +71 -0
- package/nitrogen/generated/shared/c++/RecordResult.hpp +87 -0
- package/nitrogen/generated/shared/c++/SaveRecordParams.hpp +79 -0
- package/nitrogen/generated/shared/c++/SaveRecordResult.hpp +71 -0
- package/package.json +174 -0
- package/src/CloudKitModule.nitro.ts +64 -0
- package/src/index.tsx +8 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCloudKitModuleSpec_cxx.swift
|
|
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
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A class implementation that bridges HybridCloudKitModuleSpec over to C++.
|
|
13
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
14
|
+
*
|
|
15
|
+
* Also, some Swift types need to be bridged with special handling:
|
|
16
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
17
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
18
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
19
|
+
*/
|
|
20
|
+
open class HybridCloudKitModuleSpec_cxx {
|
|
21
|
+
/**
|
|
22
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::cloudkitmodule::bridge::swift`)
|
|
23
|
+
* from `CloudKitModule-Swift-Cxx-Bridge.hpp`.
|
|
24
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
25
|
+
*/
|
|
26
|
+
public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Holds an instance of the `HybridCloudKitModuleSpec` Swift protocol.
|
|
30
|
+
*/
|
|
31
|
+
private var __implementation: any HybridCloudKitModuleSpec
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
35
|
+
*/
|
|
36
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridCloudKitModuleSpec_
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Create a new `HybridCloudKitModuleSpec_cxx` that wraps the given `HybridCloudKitModuleSpec`.
|
|
40
|
+
* All properties and methods bridge to C++ types.
|
|
41
|
+
*/
|
|
42
|
+
public init(_ implementation: any HybridCloudKitModuleSpec) {
|
|
43
|
+
self.__implementation = implementation
|
|
44
|
+
self.__cxxPart = .init()
|
|
45
|
+
/* no base class */
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get the actual `HybridCloudKitModuleSpec` instance this class wraps.
|
|
50
|
+
*/
|
|
51
|
+
@inline(__always)
|
|
52
|
+
public func getHybridCloudKitModuleSpec() -> any HybridCloudKitModuleSpec {
|
|
53
|
+
return __implementation
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
58
|
+
* This acquires one additional strong reference on the object!
|
|
59
|
+
*/
|
|
60
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
61
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Casts an unsafe pointer to a `HybridCloudKitModuleSpec_cxx`.
|
|
66
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridCloudKitModuleSpec_cxx>`.
|
|
67
|
+
* This removes one strong reference from the object!
|
|
68
|
+
*/
|
|
69
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridCloudKitModuleSpec_cxx {
|
|
70
|
+
return Unmanaged<HybridCloudKitModuleSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
75
|
+
* The C++ part is a `std::shared_ptr<HybridCloudKitModuleSpec>`.
|
|
76
|
+
*/
|
|
77
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridCloudKitModuleSpec_ {
|
|
78
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
79
|
+
if cachedCxxPart.__convertToBool() {
|
|
80
|
+
return cachedCxxPart
|
|
81
|
+
} else {
|
|
82
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridCloudKitModuleSpec_(self.toUnsafe())
|
|
83
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridCloudKitModuleSpec_(newCxxPart)
|
|
84
|
+
return newCxxPart
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
92
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
93
|
+
*/
|
|
94
|
+
@inline(__always)
|
|
95
|
+
public var memorySize: Int {
|
|
96
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Call dispose() on the Swift class.
|
|
101
|
+
* This _may_ be called manually from JS.
|
|
102
|
+
*/
|
|
103
|
+
@inline(__always)
|
|
104
|
+
public func dispose() {
|
|
105
|
+
self.__implementation.dispose()
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Properties
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
// Methods
|
|
112
|
+
@inline(__always)
|
|
113
|
+
public final func isAvailable() -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
114
|
+
do {
|
|
115
|
+
let __result = try self.__implementation.isAvailable()
|
|
116
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
117
|
+
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
118
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
119
|
+
__result
|
|
120
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
121
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
122
|
+
return __promise
|
|
123
|
+
}()
|
|
124
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
125
|
+
} catch (let __error) {
|
|
126
|
+
let __exceptionPtr = __error.toCpp()
|
|
127
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@inline(__always)
|
|
132
|
+
public final func getAccountInfo() -> bridge.Result_std__shared_ptr_Promise_AccountInfoResult___ {
|
|
133
|
+
do {
|
|
134
|
+
let __result = try self.__implementation.getAccountInfo()
|
|
135
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_AccountInfoResult__ in
|
|
136
|
+
let __promise = bridge.create_std__shared_ptr_Promise_AccountInfoResult__()
|
|
137
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_AccountInfoResult__(__promise)
|
|
138
|
+
__result
|
|
139
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
140
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
141
|
+
return __promise
|
|
142
|
+
}()
|
|
143
|
+
return bridge.create_Result_std__shared_ptr_Promise_AccountInfoResult___(__resultCpp)
|
|
144
|
+
} catch (let __error) {
|
|
145
|
+
let __exceptionPtr = __error.toCpp()
|
|
146
|
+
return bridge.create_Result_std__shared_ptr_Promise_AccountInfoResult___(__exceptionPtr)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@inline(__always)
|
|
151
|
+
public final func saveRecord(params: SaveRecordParams) -> bridge.Result_std__shared_ptr_Promise_SaveRecordResult___ {
|
|
152
|
+
do {
|
|
153
|
+
let __result = try self.__implementation.saveRecord(params: params)
|
|
154
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_SaveRecordResult__ in
|
|
155
|
+
let __promise = bridge.create_std__shared_ptr_Promise_SaveRecordResult__()
|
|
156
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_SaveRecordResult__(__promise)
|
|
157
|
+
__result
|
|
158
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
159
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
160
|
+
return __promise
|
|
161
|
+
}()
|
|
162
|
+
return bridge.create_Result_std__shared_ptr_Promise_SaveRecordResult___(__resultCpp)
|
|
163
|
+
} catch (let __error) {
|
|
164
|
+
let __exceptionPtr = __error.toCpp()
|
|
165
|
+
return bridge.create_Result_std__shared_ptr_Promise_SaveRecordResult___(__exceptionPtr)
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@inline(__always)
|
|
170
|
+
public final func fetchRecord(params: FetchRecordParams) -> bridge.Result_std__shared_ptr_Promise_std__optional_RecordResult____ {
|
|
171
|
+
do {
|
|
172
|
+
let __result = try self.__implementation.fetchRecord(params: params)
|
|
173
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__optional_RecordResult___ in
|
|
174
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__optional_RecordResult___()
|
|
175
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__optional_RecordResult___(__promise)
|
|
176
|
+
__result
|
|
177
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__optional_RecordResult_ in
|
|
178
|
+
if let __unwrappedValue = __result {
|
|
179
|
+
return bridge.create_std__optional_RecordResult_(__unwrappedValue)
|
|
180
|
+
} else {
|
|
181
|
+
return .init()
|
|
182
|
+
}
|
|
183
|
+
}()) })
|
|
184
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
185
|
+
return __promise
|
|
186
|
+
}()
|
|
187
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__optional_RecordResult____(__resultCpp)
|
|
188
|
+
} catch (let __error) {
|
|
189
|
+
let __exceptionPtr = __error.toCpp()
|
|
190
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__optional_RecordResult____(__exceptionPtr)
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@inline(__always)
|
|
195
|
+
public final func deleteRecord(params: DeleteRecordParams) -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
196
|
+
do {
|
|
197
|
+
let __result = try self.__implementation.deleteRecord(params: params)
|
|
198
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
199
|
+
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
200
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
201
|
+
__result
|
|
202
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
203
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
204
|
+
return __promise
|
|
205
|
+
}()
|
|
206
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
207
|
+
} catch (let __error) {
|
|
208
|
+
let __exceptionPtr = __error.toCpp()
|
|
209
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
@inline(__always)
|
|
214
|
+
public final func recordExists(params: RecordExistsParams) -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
215
|
+
do {
|
|
216
|
+
let __result = try self.__implementation.recordExists(params: params)
|
|
217
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
218
|
+
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
219
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
220
|
+
__result
|
|
221
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
222
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
223
|
+
return __promise
|
|
224
|
+
}()
|
|
225
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
226
|
+
} catch (let __error) {
|
|
227
|
+
let __exceptionPtr = __error.toCpp()
|
|
228
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@inline(__always)
|
|
233
|
+
public final func queryRecords(params: QueryRecordsParams) -> bridge.Result_std__shared_ptr_Promise_QueryRecordsResult___ {
|
|
234
|
+
do {
|
|
235
|
+
let __result = try self.__implementation.queryRecords(params: params)
|
|
236
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_QueryRecordsResult__ in
|
|
237
|
+
let __promise = bridge.create_std__shared_ptr_Promise_QueryRecordsResult__()
|
|
238
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_QueryRecordsResult__(__promise)
|
|
239
|
+
__result
|
|
240
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
241
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
242
|
+
return __promise
|
|
243
|
+
}()
|
|
244
|
+
return bridge.create_Result_std__shared_ptr_Promise_QueryRecordsResult___(__resultCpp)
|
|
245
|
+
} catch (let __error) {
|
|
246
|
+
let __exceptionPtr = __error.toCpp()
|
|
247
|
+
return bridge.create_Result_std__shared_ptr_Promise_QueryRecordsResult___(__exceptionPtr)
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QueryRecordsParams.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `QueryRecordsParams`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias QueryRecordsParams = margelo.nitro.cloudkitmodule.QueryRecordsParams
|
|
14
|
+
|
|
15
|
+
public extension QueryRecordsParams {
|
|
16
|
+
private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `QueryRecordsParams`.
|
|
20
|
+
*/
|
|
21
|
+
init(recordType: String) {
|
|
22
|
+
self.init(std.string(recordType))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var recordType: String {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return String(self.__recordType)
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__recordType = std.string(newValue)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QueryRecordsResult.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `QueryRecordsResult`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias QueryRecordsResult = margelo.nitro.cloudkitmodule.QueryRecordsResult
|
|
14
|
+
|
|
15
|
+
public extension QueryRecordsResult {
|
|
16
|
+
private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `QueryRecordsResult`.
|
|
20
|
+
*/
|
|
21
|
+
init(records: [RecordResult]) {
|
|
22
|
+
self.init(records.withUnsafeBufferPointer { __pointer -> bridge.std__vector_RecordResult_ in
|
|
23
|
+
return bridge.copy_std__vector_RecordResult_(__pointer.baseAddress!, records.count)
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var records: [RecordResult] {
|
|
28
|
+
@inline(__always)
|
|
29
|
+
get {
|
|
30
|
+
return { () -> [RecordResult] in
|
|
31
|
+
let __data = bridge.get_data_std__vector_RecordResult_(self.__records)
|
|
32
|
+
let __size = self.__records.size()
|
|
33
|
+
return Array(UnsafeBufferPointer(start: __data, count: __size))
|
|
34
|
+
}()
|
|
35
|
+
}
|
|
36
|
+
@inline(__always)
|
|
37
|
+
set {
|
|
38
|
+
self.__records = newValue.withUnsafeBufferPointer { __pointer -> bridge.std__vector_RecordResult_ in
|
|
39
|
+
return bridge.copy_std__vector_RecordResult_(__pointer.baseAddress!, newValue.count)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RecordExistsParams.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `RecordExistsParams`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RecordExistsParams = margelo.nitro.cloudkitmodule.RecordExistsParams
|
|
14
|
+
|
|
15
|
+
public extension RecordExistsParams {
|
|
16
|
+
private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RecordExistsParams`.
|
|
20
|
+
*/
|
|
21
|
+
init(recordType: String, recordID: String) {
|
|
22
|
+
self.init(std.string(recordType), std.string(recordID))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var recordType: String {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return String(self.__recordType)
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__recordType = std.string(newValue)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var recordID: String {
|
|
37
|
+
@inline(__always)
|
|
38
|
+
get {
|
|
39
|
+
return String(self.__recordID)
|
|
40
|
+
}
|
|
41
|
+
@inline(__always)
|
|
42
|
+
set {
|
|
43
|
+
self.__recordID = std.string(newValue)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RecordResult.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `RecordResult`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RecordResult = margelo.nitro.cloudkitmodule.RecordResult
|
|
14
|
+
|
|
15
|
+
public extension RecordResult {
|
|
16
|
+
private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RecordResult`.
|
|
20
|
+
*/
|
|
21
|
+
init(recordID: String, recordType: String, data: String, meta: String, createdAt: Double, modifiedAt: Double) {
|
|
22
|
+
self.init(std.string(recordID), std.string(recordType), std.string(data), std.string(meta), createdAt, modifiedAt)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var recordID: String {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return String(self.__recordID)
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__recordID = std.string(newValue)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var recordType: String {
|
|
37
|
+
@inline(__always)
|
|
38
|
+
get {
|
|
39
|
+
return String(self.__recordType)
|
|
40
|
+
}
|
|
41
|
+
@inline(__always)
|
|
42
|
+
set {
|
|
43
|
+
self.__recordType = std.string(newValue)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var data: String {
|
|
48
|
+
@inline(__always)
|
|
49
|
+
get {
|
|
50
|
+
return String(self.__data)
|
|
51
|
+
}
|
|
52
|
+
@inline(__always)
|
|
53
|
+
set {
|
|
54
|
+
self.__data = std.string(newValue)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var meta: String {
|
|
59
|
+
@inline(__always)
|
|
60
|
+
get {
|
|
61
|
+
return String(self.__meta)
|
|
62
|
+
}
|
|
63
|
+
@inline(__always)
|
|
64
|
+
set {
|
|
65
|
+
self.__meta = std.string(newValue)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var createdAt: Double {
|
|
70
|
+
@inline(__always)
|
|
71
|
+
get {
|
|
72
|
+
return self.__createdAt
|
|
73
|
+
}
|
|
74
|
+
@inline(__always)
|
|
75
|
+
set {
|
|
76
|
+
self.__createdAt = newValue
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
var modifiedAt: Double {
|
|
81
|
+
@inline(__always)
|
|
82
|
+
get {
|
|
83
|
+
return self.__modifiedAt
|
|
84
|
+
}
|
|
85
|
+
@inline(__always)
|
|
86
|
+
set {
|
|
87
|
+
self.__modifiedAt = newValue
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SaveRecordParams.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `SaveRecordParams`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias SaveRecordParams = margelo.nitro.cloudkitmodule.SaveRecordParams
|
|
14
|
+
|
|
15
|
+
public extension SaveRecordParams {
|
|
16
|
+
private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `SaveRecordParams`.
|
|
20
|
+
*/
|
|
21
|
+
init(recordType: String, recordID: String, data: String, meta: String) {
|
|
22
|
+
self.init(std.string(recordType), std.string(recordID), std.string(data), std.string(meta))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var recordType: String {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return String(self.__recordType)
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__recordType = std.string(newValue)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var recordID: String {
|
|
37
|
+
@inline(__always)
|
|
38
|
+
get {
|
|
39
|
+
return String(self.__recordID)
|
|
40
|
+
}
|
|
41
|
+
@inline(__always)
|
|
42
|
+
set {
|
|
43
|
+
self.__recordID = std.string(newValue)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var data: String {
|
|
48
|
+
@inline(__always)
|
|
49
|
+
get {
|
|
50
|
+
return String(self.__data)
|
|
51
|
+
}
|
|
52
|
+
@inline(__always)
|
|
53
|
+
set {
|
|
54
|
+
self.__data = std.string(newValue)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var meta: String {
|
|
59
|
+
@inline(__always)
|
|
60
|
+
get {
|
|
61
|
+
return String(self.__meta)
|
|
62
|
+
}
|
|
63
|
+
@inline(__always)
|
|
64
|
+
set {
|
|
65
|
+
self.__meta = std.string(newValue)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SaveRecordResult.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `SaveRecordResult`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias SaveRecordResult = margelo.nitro.cloudkitmodule.SaveRecordResult
|
|
14
|
+
|
|
15
|
+
public extension SaveRecordResult {
|
|
16
|
+
private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `SaveRecordResult`.
|
|
20
|
+
*/
|
|
21
|
+
init(recordID: String, createdAt: Double) {
|
|
22
|
+
self.init(std.string(recordID), createdAt)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var recordID: String {
|
|
26
|
+
@inline(__always)
|
|
27
|
+
get {
|
|
28
|
+
return String(self.__recordID)
|
|
29
|
+
}
|
|
30
|
+
@inline(__always)
|
|
31
|
+
set {
|
|
32
|
+
self.__recordID = std.string(newValue)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var createdAt: Double {
|
|
37
|
+
@inline(__always)
|
|
38
|
+
get {
|
|
39
|
+
return self.__createdAt
|
|
40
|
+
}
|
|
41
|
+
@inline(__always)
|
|
42
|
+
set {
|
|
43
|
+
self.__createdAt = newValue
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AccountInfoResult.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
|
+
#include <optional>
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::cloudkitmodule {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A struct which can be represented as a JavaScript object (AccountInfoResult).
|
|
30
|
+
*/
|
|
31
|
+
struct AccountInfoResult {
|
|
32
|
+
public:
|
|
33
|
+
double status SWIFT_PRIVATE;
|
|
34
|
+
std::string statusName SWIFT_PRIVATE;
|
|
35
|
+
std::optional<std::string> containerUserId SWIFT_PRIVATE;
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
AccountInfoResult() = default;
|
|
39
|
+
explicit AccountInfoResult(double status, std::string statusName, std::optional<std::string> containerUserId): status(status), statusName(statusName), containerUserId(containerUserId) {}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
} // namespace margelo::nitro::cloudkitmodule
|
|
43
|
+
|
|
44
|
+
namespace margelo::nitro {
|
|
45
|
+
|
|
46
|
+
// C++ AccountInfoResult <> JS AccountInfoResult (object)
|
|
47
|
+
template <>
|
|
48
|
+
struct JSIConverter<margelo::nitro::cloudkitmodule::AccountInfoResult> final {
|
|
49
|
+
static inline margelo::nitro::cloudkitmodule::AccountInfoResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
50
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
51
|
+
return margelo::nitro::cloudkitmodule::AccountInfoResult(
|
|
52
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "status")),
|
|
53
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "statusName")),
|
|
54
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "containerUserId"))
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::AccountInfoResult& arg) {
|
|
58
|
+
jsi::Object obj(runtime);
|
|
59
|
+
obj.setProperty(runtime, "status", JSIConverter<double>::toJSI(runtime, arg.status));
|
|
60
|
+
obj.setProperty(runtime, "statusName", JSIConverter<std::string>::toJSI(runtime, arg.statusName));
|
|
61
|
+
obj.setProperty(runtime, "containerUserId", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.containerUserId));
|
|
62
|
+
return obj;
|
|
63
|
+
}
|
|
64
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
65
|
+
if (!value.isObject()) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
jsi::Object obj = value.getObject(runtime);
|
|
69
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "status"))) return false;
|
|
70
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "statusName"))) return false;
|
|
71
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "containerUserId"))) return false;
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro
|