|
|
|
|
@@ -778,6 +778,8 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -804,6 +806,8 @@ fun uniffi_affine_mobile_native_checksum_method_docstoragepool_clear_clocks(
|
|
|
|
|
): Short
|
|
|
|
|
fun uniffi_affine_mobile_native_checksum_method_docstoragepool_connect(
|
|
|
|
|
): Short
|
|
|
|
|
fun uniffi_affine_mobile_native_checksum_method_docstoragepool_crawl_doc_data(
|
|
|
|
|
): Short
|
|
|
|
|
fun uniffi_affine_mobile_native_checksum_method_docstoragepool_delete_blob(
|
|
|
|
|
): Short
|
|
|
|
|
fun uniffi_affine_mobile_native_checksum_method_docstoragepool_delete_doc(
|
|
|
|
|
@@ -913,6 +917,8 @@ fun uniffi_affine_mobile_native_fn_method_docstoragepool_clear_clocks(`ptr`: Poi
|
|
|
|
|
): Long
|
|
|
|
|
fun uniffi_affine_mobile_native_fn_method_docstoragepool_connect(`ptr`: Pointer,`universalId`: RustBuffer.ByValue,`path`: RustBuffer.ByValue,
|
|
|
|
|
): Long
|
|
|
|
|
fun uniffi_affine_mobile_native_fn_method_docstoragepool_crawl_doc_data(`ptr`: Pointer,`universalId`: RustBuffer.ByValue,`docId`: RustBuffer.ByValue,
|
|
|
|
|
): Long
|
|
|
|
|
fun uniffi_affine_mobile_native_fn_method_docstoragepool_delete_blob(`ptr`: Pointer,`universalId`: RustBuffer.ByValue,`key`: RustBuffer.ByValue,`permanently`: Byte,
|
|
|
|
|
): Long
|
|
|
|
|
fun uniffi_affine_mobile_native_fn_method_docstoragepool_delete_doc(`ptr`: Pointer,`universalId`: RustBuffer.ByValue,`docId`: RustBuffer.ByValue,
|
|
|
|
|
@@ -1107,6 +1113,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
|
|
|
|
|
if (lib.uniffi_affine_mobile_native_checksum_method_docstoragepool_connect() != 19047.toShort()) {
|
|
|
|
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
|
|
|
}
|
|
|
|
|
if (lib.uniffi_affine_mobile_native_checksum_method_docstoragepool_crawl_doc_data() != 36347.toShort()) {
|
|
|
|
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
|
|
|
}
|
|
|
|
|
if (lib.uniffi_affine_mobile_native_checksum_method_docstoragepool_delete_blob() != 53695.toShort()) {
|
|
|
|
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
|
|
|
}
|
|
|
|
|
@@ -1602,6 +1611,8 @@ public interface DocStoragePoolInterface {
|
|
|
|
|
*/
|
|
|
|
|
suspend fun `connect`(`universalId`: kotlin.String, `path`: kotlin.String)
|
|
|
|
|
|
|
|
|
|
suspend fun `crawlDocData`(`universalId`: kotlin.String, `docId`: kotlin.String): CrawlResult
|
|
|
|
|
|
|
|
|
|
suspend fun `deleteBlob`(`universalId`: kotlin.String, `key`: kotlin.String, `permanently`: kotlin.Boolean)
|
|
|
|
|
|
|
|
|
|
suspend fun `deleteDoc`(`universalId`: kotlin.String, `docId`: kotlin.String)
|
|
|
|
|
@@ -1787,6 +1798,27 @@ open class DocStoragePool: Disposable, AutoCloseable, DocStoragePoolInterface
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Throws(UniffiException::class)
|
|
|
|
|
@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
|
|
|
|
|
override suspend fun `crawlDocData`(`universalId`: kotlin.String, `docId`: kotlin.String) : CrawlResult {
|
|
|
|
|
return uniffiRustCallAsync(
|
|
|
|
|
callWithPointer { thisPtr ->
|
|
|
|
|
UniffiLib.INSTANCE.uniffi_affine_mobile_native_fn_method_docstoragepool_crawl_doc_data(
|
|
|
|
|
thisPtr,
|
|
|
|
|
FfiConverterString.lower(`universalId`),FfiConverterString.lower(`docId`),
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
{ future, callback, continuation -> UniffiLib.INSTANCE.ffi_affine_mobile_native_rust_future_poll_rust_buffer(future, callback, continuation) },
|
|
|
|
|
{ future, continuation -> UniffiLib.INSTANCE.ffi_affine_mobile_native_rust_future_complete_rust_buffer(future, continuation) },
|
|
|
|
|
{ future -> UniffiLib.INSTANCE.ffi_affine_mobile_native_rust_future_free_rust_buffer(future) },
|
|
|
|
|
// lift function
|
|
|
|
|
{ FfiConverterTypeCrawlResult.lift(it) },
|
|
|
|
|
// Error FFI converter
|
|
|
|
|
UniffiException.ErrorHandler,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Throws(UniffiException::class)
|
|
|
|
|
@Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
|
|
|
|
|
override suspend fun `deleteBlob`(`universalId`: kotlin.String, `key`: kotlin.String, `permanently`: kotlin.Boolean) {
|
|
|
|
|
@@ -2424,6 +2456,102 @@ public object FfiConverterTypeBlob: FfiConverterRustBuffer<Blob> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data class BlockInfo (
|
|
|
|
|
var `blockId`: kotlin.String,
|
|
|
|
|
var `flavour`: kotlin.String,
|
|
|
|
|
var `content`: List<kotlin.String>?,
|
|
|
|
|
var `blob`: List<kotlin.String>?,
|
|
|
|
|
var `refDocId`: List<kotlin.String>?,
|
|
|
|
|
var `refInfo`: List<kotlin.String>?,
|
|
|
|
|
var `parentFlavour`: kotlin.String?,
|
|
|
|
|
var `parentBlockId`: kotlin.String?,
|
|
|
|
|
var `additional`: kotlin.String?
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
companion object
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @suppress
|
|
|
|
|
*/
|
|
|
|
|
public object FfiConverterTypeBlockInfo: FfiConverterRustBuffer<BlockInfo> {
|
|
|
|
|
override fun read(buf: ByteBuffer): BlockInfo {
|
|
|
|
|
return BlockInfo(
|
|
|
|
|
FfiConverterString.read(buf),
|
|
|
|
|
FfiConverterString.read(buf),
|
|
|
|
|
FfiConverterOptionalSequenceString.read(buf),
|
|
|
|
|
FfiConverterOptionalSequenceString.read(buf),
|
|
|
|
|
FfiConverterOptionalSequenceString.read(buf),
|
|
|
|
|
FfiConverterOptionalSequenceString.read(buf),
|
|
|
|
|
FfiConverterOptionalString.read(buf),
|
|
|
|
|
FfiConverterOptionalString.read(buf),
|
|
|
|
|
FfiConverterOptionalString.read(buf),
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun allocationSize(value: BlockInfo) = (
|
|
|
|
|
FfiConverterString.allocationSize(value.`blockId`) +
|
|
|
|
|
FfiConverterString.allocationSize(value.`flavour`) +
|
|
|
|
|
FfiConverterOptionalSequenceString.allocationSize(value.`content`) +
|
|
|
|
|
FfiConverterOptionalSequenceString.allocationSize(value.`blob`) +
|
|
|
|
|
FfiConverterOptionalSequenceString.allocationSize(value.`refDocId`) +
|
|
|
|
|
FfiConverterOptionalSequenceString.allocationSize(value.`refInfo`) +
|
|
|
|
|
FfiConverterOptionalString.allocationSize(value.`parentFlavour`) +
|
|
|
|
|
FfiConverterOptionalString.allocationSize(value.`parentBlockId`) +
|
|
|
|
|
FfiConverterOptionalString.allocationSize(value.`additional`)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
override fun write(value: BlockInfo, buf: ByteBuffer) {
|
|
|
|
|
FfiConverterString.write(value.`blockId`, buf)
|
|
|
|
|
FfiConverterString.write(value.`flavour`, buf)
|
|
|
|
|
FfiConverterOptionalSequenceString.write(value.`content`, buf)
|
|
|
|
|
FfiConverterOptionalSequenceString.write(value.`blob`, buf)
|
|
|
|
|
FfiConverterOptionalSequenceString.write(value.`refDocId`, buf)
|
|
|
|
|
FfiConverterOptionalSequenceString.write(value.`refInfo`, buf)
|
|
|
|
|
FfiConverterOptionalString.write(value.`parentFlavour`, buf)
|
|
|
|
|
FfiConverterOptionalString.write(value.`parentBlockId`, buf)
|
|
|
|
|
FfiConverterOptionalString.write(value.`additional`, buf)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data class CrawlResult (
|
|
|
|
|
var `blocks`: List<BlockInfo>,
|
|
|
|
|
var `title`: kotlin.String,
|
|
|
|
|
var `summary`: kotlin.String
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
companion object
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @suppress
|
|
|
|
|
*/
|
|
|
|
|
public object FfiConverterTypeCrawlResult: FfiConverterRustBuffer<CrawlResult> {
|
|
|
|
|
override fun read(buf: ByteBuffer): CrawlResult {
|
|
|
|
|
return CrawlResult(
|
|
|
|
|
FfiConverterSequenceTypeBlockInfo.read(buf),
|
|
|
|
|
FfiConverterString.read(buf),
|
|
|
|
|
FfiConverterString.read(buf),
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun allocationSize(value: CrawlResult) = (
|
|
|
|
|
FfiConverterSequenceTypeBlockInfo.allocationSize(value.`blocks`) +
|
|
|
|
|
FfiConverterString.allocationSize(value.`title`) +
|
|
|
|
|
FfiConverterString.allocationSize(value.`summary`)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
override fun write(value: CrawlResult, buf: ByteBuffer) {
|
|
|
|
|
FfiConverterSequenceTypeBlockInfo.write(value.`blocks`, buf)
|
|
|
|
|
FfiConverterString.write(value.`title`, buf)
|
|
|
|
|
FfiConverterString.write(value.`summary`, buf)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data class DocClock (
|
|
|
|
|
var `docId`: kotlin.String,
|
|
|
|
|
var `timestamp`: kotlin.Long
|
|
|
|
|
@@ -2732,6 +2860,38 @@ public object FfiConverterOptionalLong: FfiConverterRustBuffer<kotlin.Long?> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @suppress
|
|
|
|
|
*/
|
|
|
|
|
public object FfiConverterOptionalString: FfiConverterRustBuffer<kotlin.String?> {
|
|
|
|
|
override fun read(buf: ByteBuffer): kotlin.String? {
|
|
|
|
|
if (buf.get().toInt() == 0) {
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
return FfiConverterString.read(buf)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun allocationSize(value: kotlin.String?): ULong {
|
|
|
|
|
if (value == null) {
|
|
|
|
|
return 1UL
|
|
|
|
|
} else {
|
|
|
|
|
return 1UL + FfiConverterString.allocationSize(value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun write(value: kotlin.String?, buf: ByteBuffer) {
|
|
|
|
|
if (value == null) {
|
|
|
|
|
buf.put(0)
|
|
|
|
|
} else {
|
|
|
|
|
buf.put(1)
|
|
|
|
|
FfiConverterString.write(value, buf)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @suppress
|
|
|
|
|
*/
|
|
|
|
|
@@ -2828,6 +2988,38 @@ public object FfiConverterOptionalTypeDocRecord: FfiConverterRustBuffer<DocRecor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @suppress
|
|
|
|
|
*/
|
|
|
|
|
public object FfiConverterOptionalSequenceString: FfiConverterRustBuffer<List<kotlin.String>?> {
|
|
|
|
|
override fun read(buf: ByteBuffer): List<kotlin.String>? {
|
|
|
|
|
if (buf.get().toInt() == 0) {
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
return FfiConverterSequenceString.read(buf)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun allocationSize(value: List<kotlin.String>?): ULong {
|
|
|
|
|
if (value == null) {
|
|
|
|
|
return 1UL
|
|
|
|
|
} else {
|
|
|
|
|
return 1UL + FfiConverterSequenceString.allocationSize(value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun write(value: List<kotlin.String>?, buf: ByteBuffer) {
|
|
|
|
|
if (value == null) {
|
|
|
|
|
buf.put(0)
|
|
|
|
|
} else {
|
|
|
|
|
buf.put(1)
|
|
|
|
|
FfiConverterSequenceString.write(value, buf)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @suppress
|
|
|
|
|
*/
|
|
|
|
|
@@ -2856,6 +3048,62 @@ public object FfiConverterSequenceLong: FfiConverterRustBuffer<List<kotlin.Long>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @suppress
|
|
|
|
|
*/
|
|
|
|
|
public object FfiConverterSequenceString: FfiConverterRustBuffer<List<kotlin.String>> {
|
|
|
|
|
override fun read(buf: ByteBuffer): List<kotlin.String> {
|
|
|
|
|
val len = buf.getInt()
|
|
|
|
|
return List<kotlin.String>(len) {
|
|
|
|
|
FfiConverterString.read(buf)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun allocationSize(value: List<kotlin.String>): ULong {
|
|
|
|
|
val sizeForLength = 4UL
|
|
|
|
|
val sizeForItems = value.map { FfiConverterString.allocationSize(it) }.sum()
|
|
|
|
|
return sizeForLength + sizeForItems
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun write(value: List<kotlin.String>, buf: ByteBuffer) {
|
|
|
|
|
buf.putInt(value.size)
|
|
|
|
|
value.iterator().forEach {
|
|
|
|
|
FfiConverterString.write(it, buf)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @suppress
|
|
|
|
|
*/
|
|
|
|
|
public object FfiConverterSequenceTypeBlockInfo: FfiConverterRustBuffer<List<BlockInfo>> {
|
|
|
|
|
override fun read(buf: ByteBuffer): List<BlockInfo> {
|
|
|
|
|
val len = buf.getInt()
|
|
|
|
|
return List<BlockInfo>(len) {
|
|
|
|
|
FfiConverterTypeBlockInfo.read(buf)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun allocationSize(value: List<BlockInfo>): ULong {
|
|
|
|
|
val sizeForLength = 4UL
|
|
|
|
|
val sizeForItems = value.map { FfiConverterTypeBlockInfo.allocationSize(it) }.sum()
|
|
|
|
|
return sizeForLength + sizeForItems
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun write(value: List<BlockInfo>, buf: ByteBuffer) {
|
|
|
|
|
buf.putInt(value.size)
|
|
|
|
|
value.iterator().forEach {
|
|
|
|
|
FfiConverterTypeBlockInfo.write(it, buf)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @suppress
|
|
|
|
|
*/
|
|
|
|
|
|