mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-23 21:06:22 +08:00
feat: integrate native indexer for mobile (#14174)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **New Features**
* Added full-text search functionality to mobile apps (Android and iOS),
enabling document indexing and search capabilities.
* Enhanced blob upload support with new GraphQL mutations for creating,
completing, and managing file uploads.
* **Improvements**
* iOS and Android now use SQLite storage backend for improved indexing
performance, aligning with desktop experience.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
+48
@@ -0,0 +1,48 @@
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
@_exported import ApolloAPI
|
||||
|
||||
public class AbortBlobUploadMutation: GraphQLMutation {
|
||||
public static let operationName: String = "abortBlobUpload"
|
||||
public static let operationDocument: ApolloAPI.OperationDocument = .init(
|
||||
definition: .init(
|
||||
#"mutation abortBlobUpload($workspaceId: String!, $key: String!, $uploadId: String!) { abortBlobUpload(workspaceId: $workspaceId, key: $key, uploadId: $uploadId) }"#
|
||||
))
|
||||
|
||||
public var workspaceId: String
|
||||
public var key: String
|
||||
public var uploadId: String
|
||||
|
||||
public init(
|
||||
workspaceId: String,
|
||||
key: String,
|
||||
uploadId: String
|
||||
) {
|
||||
self.workspaceId = workspaceId
|
||||
self.key = key
|
||||
self.uploadId = uploadId
|
||||
}
|
||||
|
||||
public var __variables: Variables? { [
|
||||
"workspaceId": workspaceId,
|
||||
"key": key,
|
||||
"uploadId": uploadId
|
||||
] }
|
||||
|
||||
public struct Data: AffineGraphQL.SelectionSet {
|
||||
public let __data: DataDict
|
||||
public init(_dataDict: DataDict) { __data = _dataDict }
|
||||
|
||||
public static var __parentType: any ApolloAPI.ParentType { AffineGraphQL.Objects.Mutation }
|
||||
public static var __selections: [ApolloAPI.Selection] { [
|
||||
.field("abortBlobUpload", Bool.self, arguments: [
|
||||
"workspaceId": .variable("workspaceId"),
|
||||
"key": .variable("key"),
|
||||
"uploadId": .variable("uploadId")
|
||||
]),
|
||||
] }
|
||||
|
||||
public var abortBlobUpload: Bool { __data["abortBlobUpload"] }
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
@_exported import ApolloAPI
|
||||
|
||||
public class CompleteBlobUploadMutation: GraphQLMutation {
|
||||
public static let operationName: String = "completeBlobUpload"
|
||||
public static let operationDocument: ApolloAPI.OperationDocument = .init(
|
||||
definition: .init(
|
||||
#"mutation completeBlobUpload($workspaceId: String!, $key: String!, $uploadId: String, $parts: [BlobUploadPartInput!]) { completeBlobUpload( workspaceId: $workspaceId key: $key uploadId: $uploadId parts: $parts ) }"#
|
||||
))
|
||||
|
||||
public var workspaceId: String
|
||||
public var key: String
|
||||
public var uploadId: GraphQLNullable<String>
|
||||
public var parts: GraphQLNullable<[BlobUploadPartInput]>
|
||||
|
||||
public init(
|
||||
workspaceId: String,
|
||||
key: String,
|
||||
uploadId: GraphQLNullable<String>,
|
||||
parts: GraphQLNullable<[BlobUploadPartInput]>
|
||||
) {
|
||||
self.workspaceId = workspaceId
|
||||
self.key = key
|
||||
self.uploadId = uploadId
|
||||
self.parts = parts
|
||||
}
|
||||
|
||||
public var __variables: Variables? { [
|
||||
"workspaceId": workspaceId,
|
||||
"key": key,
|
||||
"uploadId": uploadId,
|
||||
"parts": parts
|
||||
] }
|
||||
|
||||
public struct Data: AffineGraphQL.SelectionSet {
|
||||
public let __data: DataDict
|
||||
public init(_dataDict: DataDict) { __data = _dataDict }
|
||||
|
||||
public static var __parentType: any ApolloAPI.ParentType { AffineGraphQL.Objects.Mutation }
|
||||
public static var __selections: [ApolloAPI.Selection] { [
|
||||
.field("completeBlobUpload", String.self, arguments: [
|
||||
"workspaceId": .variable("workspaceId"),
|
||||
"key": .variable("key"),
|
||||
"uploadId": .variable("uploadId"),
|
||||
"parts": .variable("parts")
|
||||
]),
|
||||
] }
|
||||
|
||||
public var completeBlobUpload: String { __data["completeBlobUpload"] }
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
@_exported import ApolloAPI
|
||||
|
||||
public class CreateBlobUploadMutation: GraphQLMutation {
|
||||
public static let operationName: String = "createBlobUpload"
|
||||
public static let operationDocument: ApolloAPI.OperationDocument = .init(
|
||||
definition: .init(
|
||||
#"mutation createBlobUpload($workspaceId: String!, $key: String!, $size: Int!, $mime: String!) { createBlobUpload(workspaceId: $workspaceId, key: $key, size: $size, mime: $mime) { __typename method blobKey alreadyUploaded uploadUrl headers expiresAt uploadId partSize uploadedParts { __typename partNumber etag } } }"#
|
||||
))
|
||||
|
||||
public var workspaceId: String
|
||||
public var key: String
|
||||
public var size: Int
|
||||
public var mime: String
|
||||
|
||||
public init(
|
||||
workspaceId: String,
|
||||
key: String,
|
||||
size: Int,
|
||||
mime: String
|
||||
) {
|
||||
self.workspaceId = workspaceId
|
||||
self.key = key
|
||||
self.size = size
|
||||
self.mime = mime
|
||||
}
|
||||
|
||||
public var __variables: Variables? { [
|
||||
"workspaceId": workspaceId,
|
||||
"key": key,
|
||||
"size": size,
|
||||
"mime": mime
|
||||
] }
|
||||
|
||||
public struct Data: AffineGraphQL.SelectionSet {
|
||||
public let __data: DataDict
|
||||
public init(_dataDict: DataDict) { __data = _dataDict }
|
||||
|
||||
public static var __parentType: any ApolloAPI.ParentType { AffineGraphQL.Objects.Mutation }
|
||||
public static var __selections: [ApolloAPI.Selection] { [
|
||||
.field("createBlobUpload", CreateBlobUpload.self, arguments: [
|
||||
"workspaceId": .variable("workspaceId"),
|
||||
"key": .variable("key"),
|
||||
"size": .variable("size"),
|
||||
"mime": .variable("mime")
|
||||
]),
|
||||
] }
|
||||
|
||||
public var createBlobUpload: CreateBlobUpload { __data["createBlobUpload"] }
|
||||
|
||||
/// CreateBlobUpload
|
||||
///
|
||||
/// Parent Type: `BlobUploadInit`
|
||||
public struct CreateBlobUpload: AffineGraphQL.SelectionSet {
|
||||
public let __data: DataDict
|
||||
public init(_dataDict: DataDict) { __data = _dataDict }
|
||||
|
||||
public static var __parentType: any ApolloAPI.ParentType { AffineGraphQL.Objects.BlobUploadInit }
|
||||
public static var __selections: [ApolloAPI.Selection] { [
|
||||
.field("__typename", String.self),
|
||||
.field("method", GraphQLEnum<AffineGraphQL.BlobUploadMethod>.self),
|
||||
.field("blobKey", String.self),
|
||||
.field("alreadyUploaded", Bool?.self),
|
||||
.field("uploadUrl", String?.self),
|
||||
.field("headers", AffineGraphQL.JSONObject?.self),
|
||||
.field("expiresAt", AffineGraphQL.DateTime?.self),
|
||||
.field("uploadId", String?.self),
|
||||
.field("partSize", Int?.self),
|
||||
.field("uploadedParts", [UploadedPart]?.self),
|
||||
] }
|
||||
|
||||
public var method: GraphQLEnum<AffineGraphQL.BlobUploadMethod> { __data["method"] }
|
||||
public var blobKey: String { __data["blobKey"] }
|
||||
public var alreadyUploaded: Bool? { __data["alreadyUploaded"] }
|
||||
public var uploadUrl: String? { __data["uploadUrl"] }
|
||||
public var headers: AffineGraphQL.JSONObject? { __data["headers"] }
|
||||
public var expiresAt: AffineGraphQL.DateTime? { __data["expiresAt"] }
|
||||
public var uploadId: String? { __data["uploadId"] }
|
||||
public var partSize: Int? { __data["partSize"] }
|
||||
public var uploadedParts: [UploadedPart]? { __data["uploadedParts"] }
|
||||
|
||||
/// CreateBlobUpload.UploadedPart
|
||||
///
|
||||
/// Parent Type: `BlobUploadedPart`
|
||||
public struct UploadedPart: AffineGraphQL.SelectionSet {
|
||||
public let __data: DataDict
|
||||
public init(_dataDict: DataDict) { __data = _dataDict }
|
||||
|
||||
public static var __parentType: any ApolloAPI.ParentType { AffineGraphQL.Objects.BlobUploadedPart }
|
||||
public static var __selections: [ApolloAPI.Selection] { [
|
||||
.field("__typename", String.self),
|
||||
.field("partNumber", Int.self),
|
||||
.field("etag", String.self),
|
||||
] }
|
||||
|
||||
public var partNumber: Int { __data["partNumber"] }
|
||||
public var etag: String { __data["etag"] }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
@_exported import ApolloAPI
|
||||
|
||||
public class GetBlobUploadPartUrlMutation: GraphQLMutation {
|
||||
public static let operationName: String = "getBlobUploadPartUrl"
|
||||
public static let operationDocument: ApolloAPI.OperationDocument = .init(
|
||||
definition: .init(
|
||||
#"mutation getBlobUploadPartUrl($workspaceId: String!, $key: String!, $uploadId: String!, $partNumber: Int!) { getBlobUploadPartUrl( workspaceId: $workspaceId key: $key uploadId: $uploadId partNumber: $partNumber ) { __typename uploadUrl headers expiresAt } }"#
|
||||
))
|
||||
|
||||
public var workspaceId: String
|
||||
public var key: String
|
||||
public var uploadId: String
|
||||
public var partNumber: Int
|
||||
|
||||
public init(
|
||||
workspaceId: String,
|
||||
key: String,
|
||||
uploadId: String,
|
||||
partNumber: Int
|
||||
) {
|
||||
self.workspaceId = workspaceId
|
||||
self.key = key
|
||||
self.uploadId = uploadId
|
||||
self.partNumber = partNumber
|
||||
}
|
||||
|
||||
public var __variables: Variables? { [
|
||||
"workspaceId": workspaceId,
|
||||
"key": key,
|
||||
"uploadId": uploadId,
|
||||
"partNumber": partNumber
|
||||
] }
|
||||
|
||||
public struct Data: AffineGraphQL.SelectionSet {
|
||||
public let __data: DataDict
|
||||
public init(_dataDict: DataDict) { __data = _dataDict }
|
||||
|
||||
public static var __parentType: any ApolloAPI.ParentType { AffineGraphQL.Objects.Mutation }
|
||||
public static var __selections: [ApolloAPI.Selection] { [
|
||||
.field("getBlobUploadPartUrl", GetBlobUploadPartUrl.self, arguments: [
|
||||
"workspaceId": .variable("workspaceId"),
|
||||
"key": .variable("key"),
|
||||
"uploadId": .variable("uploadId"),
|
||||
"partNumber": .variable("partNumber")
|
||||
]),
|
||||
] }
|
||||
|
||||
public var getBlobUploadPartUrl: GetBlobUploadPartUrl { __data["getBlobUploadPartUrl"] }
|
||||
|
||||
/// GetBlobUploadPartUrl
|
||||
///
|
||||
/// Parent Type: `BlobUploadPart`
|
||||
public struct GetBlobUploadPartUrl: AffineGraphQL.SelectionSet {
|
||||
public let __data: DataDict
|
||||
public init(_dataDict: DataDict) { __data = _dataDict }
|
||||
|
||||
public static var __parentType: any ApolloAPI.ParentType { AffineGraphQL.Objects.BlobUploadPart }
|
||||
public static var __selections: [ApolloAPI.Selection] { [
|
||||
.field("__typename", String.self),
|
||||
.field("uploadUrl", String.self),
|
||||
.field("headers", AffineGraphQL.JSONObject?.self),
|
||||
.field("expiresAt", AffineGraphQL.DateTime?.self),
|
||||
] }
|
||||
|
||||
public var uploadUrl: String { __data["uploadUrl"] }
|
||||
public var headers: AffineGraphQL.JSONObject? { __data["headers"] }
|
||||
public var expiresAt: AffineGraphQL.DateTime? { __data["expiresAt"] }
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import ApolloAPI
|
||||
|
||||
/// Blob upload method
|
||||
public enum BlobUploadMethod: String, EnumType {
|
||||
case graphql = "GRAPHQL"
|
||||
case multipart = "MULTIPART"
|
||||
case presigned = "PRESIGNED"
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import ApolloAPI
|
||||
|
||||
public struct BlobUploadPartInput: InputObject {
|
||||
public private(set) var __data: InputDict
|
||||
|
||||
public init(_ data: InputDict) {
|
||||
__data = data
|
||||
}
|
||||
|
||||
public init(
|
||||
etag: String,
|
||||
partNumber: Int
|
||||
) {
|
||||
__data = InputDict([
|
||||
"etag": etag,
|
||||
"partNumber": partNumber
|
||||
])
|
||||
}
|
||||
|
||||
public var etag: String {
|
||||
get { __data["etag"] }
|
||||
set { __data["etag"] = newValue }
|
||||
}
|
||||
|
||||
public var partNumber: Int {
|
||||
get { __data["partNumber"] }
|
||||
set { __data["partNumber"] = newValue }
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import ApolloAPI
|
||||
|
||||
public extension Objects {
|
||||
static let BlobUploadInit = ApolloAPI.Object(
|
||||
typename: "BlobUploadInit",
|
||||
implementedInterfaces: [],
|
||||
keyFields: nil
|
||||
)
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import ApolloAPI
|
||||
|
||||
public extension Objects {
|
||||
static let BlobUploadPart = ApolloAPI.Object(
|
||||
typename: "BlobUploadPart",
|
||||
implementedInterfaces: [],
|
||||
keyFields: nil
|
||||
)
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import ApolloAPI
|
||||
|
||||
public extension Objects {
|
||||
static let BlobUploadedPart = ApolloAPI.Object(
|
||||
typename: "BlobUploadedPart",
|
||||
implementedInterfaces: [],
|
||||
keyFields: nil
|
||||
)
|
||||
}
|
||||
+3
@@ -24,6 +24,9 @@ public enum SchemaMetadata: ApolloAPI.SchemaMetadata {
|
||||
case "AggregateBucketObjectType": return AffineGraphQL.Objects.AggregateBucketObjectType
|
||||
case "AggregateResultObjectType": return AffineGraphQL.Objects.AggregateResultObjectType
|
||||
case "AppConfigValidateResult": return AffineGraphQL.Objects.AppConfigValidateResult
|
||||
case "BlobUploadInit": return AffineGraphQL.Objects.BlobUploadInit
|
||||
case "BlobUploadPart": return AffineGraphQL.Objects.BlobUploadPart
|
||||
case "BlobUploadedPart": return AffineGraphQL.Objects.BlobUploadedPart
|
||||
case "ChatMessage": return AffineGraphQL.Objects.ChatMessage
|
||||
case "CommentChangeObjectType": return AffineGraphQL.Objects.CommentChangeObjectType
|
||||
case "CommentChangeObjectTypeEdge": return AffineGraphQL.Objects.CommentChangeObjectTypeEdge
|
||||
|
||||
Reference in New Issue
Block a user