Add tag builders
This commit is contained in:
1 parent
9b2022e79f
commit
3bc12ca344
21 files changed
+296
-14
No files matched your search
+7
-1
@@ -3,8 +3,10 @@ package press.mantra.compose.database.model
|
|||||||
import androidx.room3.Entity
|
import androidx.room3.Entity
|
||||||
import androidx.room3.PrimaryKey
|
import androidx.room3.PrimaryKey
|
||||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder
|
||||||
import press.mantra.compose.database.model.traits.TimestampedEntity
|
import press.mantra.compose.database.model.traits.TimestampedEntity
|
||||||
import press.mantra.compose.nostr.nip30303.ArtifactEvent
|
import press.mantra.compose.nostr.nip30303.ArtifactEvent
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.DialectIdTag
|
||||||
import kotlin.time.Clock
|
import kotlin.time.Clock
|
||||||
import kotlin.time.Instant
|
import kotlin.time.Instant
|
||||||
|
|
||||||
@@ -33,7 +35,11 @@ data class MantraArtifact(
|
|||||||
id = id,
|
id = id,
|
||||||
pubKey = publicKey,
|
pubKey = publicKey,
|
||||||
createdAt = createdAt.epochSeconds,
|
createdAt = createdAt.epochSeconds,
|
||||||
tags = emptyArray(),
|
tags = TagArrayBuilder<ArtifactEvent>()
|
||||||
|
.addUnique(
|
||||||
|
DialectIdTag.assemble(dialectId)
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
content = "",
|
content = "",
|
||||||
sig = signature
|
sig = signature
|
||||||
)
|
)
|
||||||
|
|||||||
+5
-1
@@ -3,8 +3,10 @@ package press.mantra.compose.database.model
|
|||||||
import androidx.room3.Entity
|
import androidx.room3.Entity
|
||||||
import androidx.room3.PrimaryKey
|
import androidx.room3.PrimaryKey
|
||||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder
|
||||||
import press.mantra.compose.database.model.traits.TimestampedEntity
|
import press.mantra.compose.database.model.traits.TimestampedEntity
|
||||||
import press.mantra.compose.nostr.nip30303.ArtifactVersionEvent
|
import press.mantra.compose.nostr.nip30303.ArtifactVersionEvent
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.ArtifactIdTag
|
||||||
import kotlin.time.Clock
|
import kotlin.time.Clock
|
||||||
import kotlin.time.Instant
|
import kotlin.time.Instant
|
||||||
|
|
||||||
@@ -33,7 +35,9 @@ data class MantraArtifactVersion(
|
|||||||
id = id,
|
id = id,
|
||||||
pubKey = publicKey,
|
pubKey = publicKey,
|
||||||
createdAt = createdAt.epochSeconds,
|
createdAt = createdAt.epochSeconds,
|
||||||
tags = emptyArray(),
|
tags = TagArrayBuilder<ArtifactVersionEvent>().addUnique(
|
||||||
|
ArtifactIdTag.assemble(artifactId)
|
||||||
|
).build(),
|
||||||
content = "",
|
content = "",
|
||||||
sig = signature
|
sig = signature
|
||||||
)
|
)
|
||||||
|
|||||||
+6
-1
@@ -3,8 +3,11 @@ package press.mantra.compose.database.model
|
|||||||
import androidx.room3.Entity
|
import androidx.room3.Entity
|
||||||
import androidx.room3.PrimaryKey
|
import androidx.room3.PrimaryKey
|
||||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder
|
||||||
import press.mantra.compose.database.model.traits.TimestampedEntity
|
import press.mantra.compose.database.model.traits.TimestampedEntity
|
||||||
|
import press.mantra.compose.nostr.nip30303.ArtifactVersionEvent
|
||||||
import press.mantra.compose.nostr.nip30303.ChapterEvent
|
import press.mantra.compose.nostr.nip30303.ChapterEvent
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.ArtifactVersionIdTag
|
||||||
import kotlin.time.Clock
|
import kotlin.time.Clock
|
||||||
import kotlin.time.Instant
|
import kotlin.time.Instant
|
||||||
|
|
||||||
@@ -34,7 +37,9 @@ data class MantraChapter(
|
|||||||
id = id,
|
id = id,
|
||||||
pubKey = publicKey,
|
pubKey = publicKey,
|
||||||
createdAt = createdAt.epochSeconds,
|
createdAt = createdAt.epochSeconds,
|
||||||
tags = emptyArray(),
|
tags = TagArrayBuilder<ArtifactVersionEvent>().addUnique(
|
||||||
|
ArtifactVersionIdTag.assemble(artifactVersionId)
|
||||||
|
).build(),
|
||||||
content = "",
|
content = "",
|
||||||
sig = signature
|
sig = signature
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ package press.mantra.compose.database.model
|
|||||||
import androidx.room3.Entity
|
import androidx.room3.Entity
|
||||||
import androidx.room3.PrimaryKey
|
import androidx.room3.PrimaryKey
|
||||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder
|
||||||
import press.mantra.compose.database.model.traits.TimestampedEntity
|
import press.mantra.compose.database.model.traits.TimestampedEntity
|
||||||
import press.mantra.compose.nostr.nip30303.ChunkEvent
|
import press.mantra.compose.nostr.nip30303.ChunkEvent
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.ChapterIdTag
|
||||||
import kotlin.time.Clock
|
import kotlin.time.Clock
|
||||||
import kotlin.time.Instant
|
import kotlin.time.Instant
|
||||||
|
|
||||||
@@ -33,7 +35,9 @@ data class MantraChunk(
|
|||||||
id = id,
|
id = id,
|
||||||
pubKey = publicKey,
|
pubKey = publicKey,
|
||||||
createdAt = createdAt.epochSeconds,
|
createdAt = createdAt.epochSeconds,
|
||||||
tags = emptyArray(),
|
tags = TagArrayBuilder<ChunkEvent>().addUnique(
|
||||||
|
ChapterIdTag.assemble(chapterId)
|
||||||
|
).build(),
|
||||||
content = "",
|
content = "",
|
||||||
sig = signature
|
sig = signature
|
||||||
)
|
)
|
||||||
|
|||||||
+11
-1
@@ -3,8 +3,11 @@ package press.mantra.compose.database.model
|
|||||||
import androidx.room3.Entity
|
import androidx.room3.Entity
|
||||||
import androidx.room3.PrimaryKey
|
import androidx.room3.PrimaryKey
|
||||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder
|
||||||
import press.mantra.compose.database.model.traits.TimestampedEntity
|
import press.mantra.compose.database.model.traits.TimestampedEntity
|
||||||
import press.mantra.compose.nostr.nip30303.TranslationEvent
|
import press.mantra.compose.nostr.nip30303.TranslationEvent
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.TranslationArtifactVersionIdTag
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.TranslationChunkIdTag
|
||||||
import kotlin.time.Clock
|
import kotlin.time.Clock
|
||||||
import kotlin.time.Instant
|
import kotlin.time.Instant
|
||||||
|
|
||||||
@@ -31,7 +34,14 @@ data class MantraTranslation(
|
|||||||
id = id,
|
id = id,
|
||||||
pubKey = publicKey,
|
pubKey = publicKey,
|
||||||
createdAt = createdAt.epochSeconds,
|
createdAt = createdAt.epochSeconds,
|
||||||
tags = emptyArray(),
|
tags = TagArrayBuilder<TranslationEvent>()
|
||||||
|
.addUnique(
|
||||||
|
TranslationArtifactVersionIdTag.assemble(translationArtifactVersionId)
|
||||||
|
)
|
||||||
|
.addUnique(
|
||||||
|
TranslationChunkIdTag.assemble(translationChunkId)
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
content = "",
|
content = "",
|
||||||
sig = signature
|
sig = signature
|
||||||
)
|
)
|
||||||
|
|||||||
+12
-1
@@ -3,8 +3,12 @@ package press.mantra.compose.database.model
|
|||||||
import androidx.room3.Entity
|
import androidx.room3.Entity
|
||||||
import androidx.room3.PrimaryKey
|
import androidx.room3.PrimaryKey
|
||||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder
|
||||||
import press.mantra.compose.database.model.traits.TimestampedEntity
|
import press.mantra.compose.database.model.traits.TimestampedEntity
|
||||||
|
import press.mantra.compose.nostr.nip30303.ArtifactVersionEvent
|
||||||
import press.mantra.compose.nostr.nip30303.TranslationArtifactVersionEvent
|
import press.mantra.compose.nostr.nip30303.TranslationArtifactVersionEvent
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.ArtifactVersionIdTag
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.DialectIdTag
|
||||||
import kotlin.time.Clock
|
import kotlin.time.Clock
|
||||||
import kotlin.time.Instant
|
import kotlin.time.Instant
|
||||||
|
|
||||||
@@ -32,7 +36,14 @@ data class MantraTranslationArtifactVersion(
|
|||||||
id = id,
|
id = id,
|
||||||
pubKey = publicKey,
|
pubKey = publicKey,
|
||||||
createdAt = createdAt.epochSeconds,
|
createdAt = createdAt.epochSeconds,
|
||||||
tags = emptyArray(),
|
tags = TagArrayBuilder<ArtifactVersionEvent>()
|
||||||
|
.addUnique(
|
||||||
|
ArtifactVersionIdTag.assemble(artifactVersionId)
|
||||||
|
)
|
||||||
|
.addUnique(
|
||||||
|
DialectIdTag.assemble(dialectId)
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
content = "",
|
content = "",
|
||||||
sig = signature
|
sig = signature
|
||||||
)
|
)
|
||||||
|
|||||||
+13
-1
@@ -3,9 +3,13 @@ package press.mantra.compose.database.model
|
|||||||
import androidx.room3.Entity
|
import androidx.room3.Entity
|
||||||
import androidx.room3.PrimaryKey
|
import androidx.room3.PrimaryKey
|
||||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder
|
||||||
|
import com.vitorpamplona.quartz.nipF4Podcasts.metadata.tags.AuthorTag
|
||||||
import com.vitorpamplona.quartz.utils.TimeUtils
|
import com.vitorpamplona.quartz.utils.TimeUtils
|
||||||
import press.mantra.compose.database.model.traits.TimestampedEntity
|
import press.mantra.compose.database.model.traits.TimestampedEntity
|
||||||
import press.mantra.compose.nostr.nip30303.TranslationArtifactVersionEditorListEvent
|
import press.mantra.compose.nostr.nip30303.TranslationArtifactVersionEditorListEvent
|
||||||
|
import press.mantra.compose.nostr.nip30303.TranslationChapterProofReaderListEvent
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.TranslationArtifactVersionIdTag
|
||||||
import kotlin.time.Clock
|
import kotlin.time.Clock
|
||||||
import kotlin.time.Instant
|
import kotlin.time.Instant
|
||||||
|
|
||||||
@@ -33,7 +37,15 @@ data class MantraTranslationArtifactVersionEditor(
|
|||||||
id = "",
|
id = "",
|
||||||
pubKey = "",
|
pubKey = "",
|
||||||
createdAt = TimeUtils.now(),
|
createdAt = TimeUtils.now(),
|
||||||
tags = emptyArray(),
|
tags = TagArrayBuilder<TranslationChapterProofReaderListEvent>()
|
||||||
|
.addUnique(
|
||||||
|
TranslationArtifactVersionIdTag.assemble("") // TODO: use actual value..
|
||||||
|
)
|
||||||
|
// TODO: Add tag for editorPublicKey
|
||||||
|
.addUnique(
|
||||||
|
AuthorTag.assemble("") // TODO: Get piblicKeyList...
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
content = "",
|
content = "",
|
||||||
sig = ""
|
sig = ""
|
||||||
)
|
)
|
||||||
|
|||||||
+11
-1
@@ -2,8 +2,11 @@ package press.mantra.compose.database.model
|
|||||||
|
|
||||||
import androidx.room3.Entity
|
import androidx.room3.Entity
|
||||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder
|
||||||
import press.mantra.compose.database.model.traits.TimestampedEntity
|
import press.mantra.compose.database.model.traits.TimestampedEntity
|
||||||
import press.mantra.compose.nostr.nip30303.TranslationChapterEvent
|
import press.mantra.compose.nostr.nip30303.TranslationChapterEvent
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.ChapterIdTag
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.TranslationArtifactVersionIdTag
|
||||||
import kotlin.time.Clock
|
import kotlin.time.Clock
|
||||||
import kotlin.time.Instant
|
import kotlin.time.Instant
|
||||||
|
|
||||||
@@ -28,7 +31,14 @@ data class MantraTranslationChapter(
|
|||||||
id = id,
|
id = id,
|
||||||
pubKey = publicKey,
|
pubKey = publicKey,
|
||||||
createdAt = createdAt.epochSeconds,
|
createdAt = createdAt.epochSeconds,
|
||||||
tags = emptyArray(),
|
tags = TagArrayBuilder<TranslationChapterEvent>()
|
||||||
|
.addUnique(
|
||||||
|
TranslationArtifactVersionIdTag.assemble(translationArtifactVersionId)
|
||||||
|
)
|
||||||
|
.addUnique(
|
||||||
|
ChapterIdTag.assemble(chapterId)
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
content = "",
|
content = "",
|
||||||
sig = signature
|
sig = signature
|
||||||
)
|
)
|
||||||
|
|||||||
+11
-1
@@ -3,9 +3,12 @@ package press.mantra.compose.database.model
|
|||||||
import androidx.room3.Entity
|
import androidx.room3.Entity
|
||||||
import androidx.room3.PrimaryKey
|
import androidx.room3.PrimaryKey
|
||||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder
|
||||||
|
import com.vitorpamplona.quartz.nipF4Podcasts.metadata.tags.AuthorTag
|
||||||
import com.vitorpamplona.quartz.utils.TimeUtils
|
import com.vitorpamplona.quartz.utils.TimeUtils
|
||||||
import press.mantra.compose.database.model.traits.TimestampedEntity
|
import press.mantra.compose.database.model.traits.TimestampedEntity
|
||||||
import press.mantra.compose.nostr.nip30303.TranslationChapterProofReaderListEvent
|
import press.mantra.compose.nostr.nip30303.TranslationChapterProofReaderListEvent
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.TranslationChapterIdTag
|
||||||
import kotlin.time.Clock
|
import kotlin.time.Clock
|
||||||
import kotlin.time.Instant
|
import kotlin.time.Instant
|
||||||
|
|
||||||
@@ -33,7 +36,14 @@ data class MantraTranslationChapterProofReader(
|
|||||||
id = "",
|
id = "",
|
||||||
pubKey = "",
|
pubKey = "",
|
||||||
createdAt = TimeUtils.now(),
|
createdAt = TimeUtils.now(),
|
||||||
tags = emptyArray(),
|
tags = TagArrayBuilder<TranslationChapterProofReaderListEvent>()
|
||||||
|
.addUnique(
|
||||||
|
TranslationChapterIdTag.assemble("")
|
||||||
|
)
|
||||||
|
.addUnique(
|
||||||
|
AuthorTag.assemble("") // TODO: PublicKeyListTag
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
content = "",
|
content = "",
|
||||||
sig = ""
|
sig = ""
|
||||||
)
|
)
|
||||||
|
|||||||
+11
-1
@@ -3,9 +3,12 @@ package press.mantra.compose.database.model
|
|||||||
import androidx.room3.Entity
|
import androidx.room3.Entity
|
||||||
import androidx.room3.PrimaryKey
|
import androidx.room3.PrimaryKey
|
||||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder
|
||||||
|
import com.vitorpamplona.quartz.nipF4Podcasts.metadata.tags.AuthorTag
|
||||||
import com.vitorpamplona.quartz.utils.TimeUtils
|
import com.vitorpamplona.quartz.utils.TimeUtils
|
||||||
import press.mantra.compose.database.model.traits.TimestampedEntity
|
import press.mantra.compose.database.model.traits.TimestampedEntity
|
||||||
import press.mantra.compose.nostr.nip30303.TranslationChapterTranslatorListEvent
|
import press.mantra.compose.nostr.nip30303.TranslationChapterTranslatorListEvent
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.TranslationChapterIdTag
|
||||||
import kotlin.time.Clock
|
import kotlin.time.Clock
|
||||||
import kotlin.time.Instant
|
import kotlin.time.Instant
|
||||||
|
|
||||||
@@ -33,7 +36,14 @@ data class MantraTranslationChapterTranslator(
|
|||||||
id = "",
|
id = "",
|
||||||
pubKey = "",
|
pubKey = "",
|
||||||
createdAt = TimeUtils.now(),
|
createdAt = TimeUtils.now(),
|
||||||
tags = emptyArray(),
|
tags = TagArrayBuilder<TranslationChapterTranslatorListEvent>()
|
||||||
|
.addUnique(
|
||||||
|
TranslationChapterIdTag.assemble("")
|
||||||
|
)
|
||||||
|
.addUnique(
|
||||||
|
AuthorTag.assemble("") // TODO: PublicKeyListTag
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
content = "",
|
content = "",
|
||||||
sig = ""
|
sig = ""
|
||||||
)
|
)
|
||||||
|
|||||||
+13
-3
@@ -3,8 +3,11 @@ package press.mantra.compose.database.model
|
|||||||
import androidx.room3.Entity
|
import androidx.room3.Entity
|
||||||
import androidx.room3.PrimaryKey
|
import androidx.room3.PrimaryKey
|
||||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder
|
||||||
import press.mantra.compose.database.model.traits.TimestampedEntity
|
import press.mantra.compose.database.model.traits.TimestampedEntity
|
||||||
import press.mantra.compose.nostr.nip30303.TranslationChunkEvent
|
import press.mantra.compose.nostr.nip30303.TranslationChunkEvent
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.ChunkIdTag
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.TranslationChapterIdTag
|
||||||
import kotlin.time.Clock
|
import kotlin.time.Clock
|
||||||
import kotlin.time.Instant
|
import kotlin.time.Instant
|
||||||
|
|
||||||
@@ -16,10 +19,10 @@ data class MantraTranslationChunk(
|
|||||||
@PrimaryKey
|
@PrimaryKey
|
||||||
val id: HexKey,
|
val id: HexKey,
|
||||||
val publicKey: HexKey,
|
val publicKey: HexKey,
|
||||||
val text: String,
|
|
||||||
val index: Int,
|
|
||||||
val chunkId: HexKey,
|
val chunkId: HexKey,
|
||||||
val translationChapterId: HexKey,
|
val translationChapterId: HexKey,
|
||||||
|
val text: String,
|
||||||
|
val index: Int,
|
||||||
|
|
||||||
val signature: String,
|
val signature: String,
|
||||||
|
|
||||||
@@ -32,7 +35,14 @@ data class MantraTranslationChunk(
|
|||||||
id = id,
|
id = id,
|
||||||
pubKey = publicKey,
|
pubKey = publicKey,
|
||||||
createdAt = createdAt.epochSeconds,
|
createdAt = createdAt.epochSeconds,
|
||||||
tags = emptyArray(),
|
tags = TagArrayBuilder<TranslationChunkEvent>()
|
||||||
|
.addUnique(
|
||||||
|
TranslationChapterIdTag.assemble(translationChapterId)
|
||||||
|
)
|
||||||
|
.addUnique(
|
||||||
|
ChunkIdTag.assemble(chunkId) // TODO: PublicKeyListTag
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
content = "",
|
content = "",
|
||||||
sig = signature
|
sig = signature
|
||||||
)
|
)
|
||||||
|
|||||||
+11
-1
@@ -3,9 +3,12 @@ package press.mantra.compose.database.model
|
|||||||
import androidx.room3.Entity
|
import androidx.room3.Entity
|
||||||
import androidx.room3.PrimaryKey
|
import androidx.room3.PrimaryKey
|
||||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder
|
||||||
|
import com.vitorpamplona.quartz.nipF4Podcasts.metadata.tags.AuthorTag
|
||||||
import com.vitorpamplona.quartz.utils.TimeUtils
|
import com.vitorpamplona.quartz.utils.TimeUtils
|
||||||
import press.mantra.compose.database.model.traits.TimestampedEntity
|
import press.mantra.compose.database.model.traits.TimestampedEntity
|
||||||
import press.mantra.compose.nostr.nip30303.TranslationTranslatorListEvent
|
import press.mantra.compose.nostr.nip30303.TranslationTranslatorListEvent
|
||||||
|
import press.mantra.compose.nostr.nip30303.tags.TranslationIdTag
|
||||||
import kotlin.time.Clock
|
import kotlin.time.Clock
|
||||||
import kotlin.time.Instant
|
import kotlin.time.Instant
|
||||||
|
|
||||||
@@ -33,7 +36,14 @@ data class MantraTranslationTranslator(
|
|||||||
id = "",
|
id = "",
|
||||||
pubKey = "",
|
pubKey = "",
|
||||||
createdAt = TimeUtils.now(),
|
createdAt = TimeUtils.now(),
|
||||||
tags = emptyArray(),
|
tags = TagArrayBuilder<TranslationTranslatorListEvent>()
|
||||||
|
.addUnique(
|
||||||
|
TranslationIdTag.assemble("") // TODO: Use actual translationId
|
||||||
|
)
|
||||||
|
.addUnique(
|
||||||
|
AuthorTag.assemble("") // TODO: PublicKeyListTag
|
||||||
|
)
|
||||||
|
.build(),
|
||||||
content = "",
|
content = "",
|
||||||
sig = ""
|
sig = ""
|
||||||
)
|
)
|
||||||
|
|||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package press.mantra.compose.nostr.nip30303.tags
|
||||||
|
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.has
|
||||||
|
import com.vitorpamplona.quartz.utils.ensure
|
||||||
|
|
||||||
|
class ArtifactIdTag {
|
||||||
|
companion object {
|
||||||
|
const val TAG_NAME = "artifactId"
|
||||||
|
|
||||||
|
fun parse(tag: Array<String>): HexKey? {
|
||||||
|
ensure(tag.has(1)) { return null }
|
||||||
|
ensure(tag[0] == TAG_NAME) { return null }
|
||||||
|
ensure(tag[1].isNotBlank()) { return null }
|
||||||
|
return tag[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
fun assemble(artifactId: HexKey) = arrayOf(TAG_NAME, artifactId)
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package press.mantra.compose.nostr.nip30303.tags
|
||||||
|
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.has
|
||||||
|
import com.vitorpamplona.quartz.utils.ensure
|
||||||
|
|
||||||
|
class ArtifactVersionIdTag {
|
||||||
|
companion object {
|
||||||
|
const val TAG_NAME = "artifactVersionId"
|
||||||
|
|
||||||
|
fun parse(tag: Array<String>): HexKey? {
|
||||||
|
ensure(tag.has(1)) { return null }
|
||||||
|
ensure(tag[0] == TAG_NAME) { return null }
|
||||||
|
ensure(tag[1].isNotBlank()) { return null }
|
||||||
|
return tag[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
fun assemble(artifactVersionId: HexKey) = arrayOf(TAG_NAME, artifactVersionId)
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package press.mantra.compose.nostr.nip30303.tags
|
||||||
|
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.has
|
||||||
|
import com.vitorpamplona.quartz.utils.ensure
|
||||||
|
|
||||||
|
class ChapterIdTag {
|
||||||
|
companion object {
|
||||||
|
const val TAG_NAME = "chapterIdTag"
|
||||||
|
|
||||||
|
fun parse(tag: Array<String>): HexKey? {
|
||||||
|
ensure(tag.has(1)) { return null }
|
||||||
|
ensure(tag[0] == TAG_NAME) { return null }
|
||||||
|
ensure(tag[1].isNotBlank()) { return null }
|
||||||
|
return tag[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
fun assemble(chapterIdTag: HexKey) = arrayOf(TAG_NAME, chapterIdTag)
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package press.mantra.compose.nostr.nip30303.tags
|
||||||
|
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.has
|
||||||
|
import com.vitorpamplona.quartz.utils.ensure
|
||||||
|
|
||||||
|
class ChunkIdTag {
|
||||||
|
companion object {
|
||||||
|
const val TAG_NAME = "chunkIdTag"
|
||||||
|
|
||||||
|
fun parse(tag: Array<String>): HexKey? {
|
||||||
|
ensure(tag.has(1)) { return null }
|
||||||
|
ensure(tag[0] == TAG_NAME) { return null }
|
||||||
|
ensure(tag[1].isNotBlank()) { return null }
|
||||||
|
return tag[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
fun assemble(chunkIdTag: HexKey) = arrayOf(TAG_NAME, chunkIdTag)
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package press.mantra.compose.nostr.nip30303.tags
|
||||||
|
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.has
|
||||||
|
import com.vitorpamplona.quartz.utils.ensure
|
||||||
|
|
||||||
|
class DialectIdTag {
|
||||||
|
companion object {
|
||||||
|
const val TAG_NAME = "dialectIdTag"
|
||||||
|
|
||||||
|
fun parse(tag: Array<String>): HexKey? {
|
||||||
|
ensure(tag.has(1)) { return null }
|
||||||
|
ensure(tag[0] == TAG_NAME) { return null }
|
||||||
|
ensure(tag[1].isNotBlank()) { return null }
|
||||||
|
return tag[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
fun assemble(dialectIdTag: HexKey) = arrayOf(TAG_NAME, dialectIdTag)
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package press.mantra.compose.nostr.nip30303.tags
|
||||||
|
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.has
|
||||||
|
import com.vitorpamplona.quartz.utils.ensure
|
||||||
|
|
||||||
|
class TranslationArtifactVersionIdTag {
|
||||||
|
companion object {
|
||||||
|
const val TAG_NAME = "translationArtifactVersionId"
|
||||||
|
|
||||||
|
fun parse(tag: Array<String>): HexKey? {
|
||||||
|
ensure(tag.has(1)) { return null }
|
||||||
|
ensure(tag[0] == TAG_NAME) { return null }
|
||||||
|
ensure(tag[1].isNotBlank()) { return null }
|
||||||
|
return tag[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
fun assemble(translationArtifactVersionId: HexKey) = arrayOf(TAG_NAME, translationArtifactVersionId)
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package press.mantra.compose.nostr.nip30303.tags
|
||||||
|
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.has
|
||||||
|
import com.vitorpamplona.quartz.utils.ensure
|
||||||
|
|
||||||
|
class TranslationChapterIdTag {
|
||||||
|
companion object {
|
||||||
|
const val TAG_NAME = "translationChapterIdTag"
|
||||||
|
|
||||||
|
fun parse(tag: Array<String>): HexKey? {
|
||||||
|
ensure(tag.has(1)) { return null }
|
||||||
|
ensure(tag[0] == TAG_NAME) { return null }
|
||||||
|
ensure(tag[1].isNotBlank()) { return null }
|
||||||
|
return tag[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
fun assemble(translationChapterIdTag: HexKey) = arrayOf(TAG_NAME, translationChapterIdTag)
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package press.mantra.compose.nostr.nip30303.tags
|
||||||
|
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.has
|
||||||
|
import com.vitorpamplona.quartz.utils.ensure
|
||||||
|
|
||||||
|
class TranslationChunkIdTag {
|
||||||
|
companion object {
|
||||||
|
const val TAG_NAME = "translationChunkIdTag"
|
||||||
|
|
||||||
|
fun parse(tag: Array<String>): HexKey? {
|
||||||
|
ensure(tag.has(1)) { return null }
|
||||||
|
ensure(tag[0] == TAG_NAME) { return null }
|
||||||
|
ensure(tag[1].isNotBlank()) { return null }
|
||||||
|
return tag[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
fun assemble(translationChunkIdTag: HexKey) = arrayOf(TAG_NAME, translationChunkIdTag)
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package press.mantra.compose.nostr.nip30303.tags
|
||||||
|
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
|
import com.vitorpamplona.quartz.nip01Core.core.has
|
||||||
|
import com.vitorpamplona.quartz.utils.ensure
|
||||||
|
|
||||||
|
class TranslationIdTag {
|
||||||
|
companion object {
|
||||||
|
const val TAG_NAME = "translationIdTag"
|
||||||
|
|
||||||
|
fun parse(tag: Array<String>): HexKey? {
|
||||||
|
ensure(tag.has(1)) { return null }
|
||||||
|
ensure(tag[0] == TAG_NAME) { return null }
|
||||||
|
ensure(tag[1].isNotBlank()) { return null }
|
||||||
|
return tag[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
fun assemble(translationIdTag: HexKey) = arrayOf(TAG_NAME, translationIdTag)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user