diff options
95 files changed, 4041 insertions, 91 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9eee2c..fd9ec1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,10 @@ jobs: with: distribution: temurin java-version: 17 - + - name: Setup PNPM + uses: pnpm/action-setup@v4 + with: + package_json_file: 'server/frontend/package.json' - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 diff --git a/basetypes/src/main/kotlin/moe/nea/ledger/TransactionType.kt b/basetypes/src/main/kotlin/moe/nea/ledger/TransactionType.kt index 8424893..d4c15e5 100644 --- a/basetypes/src/main/kotlin/moe/nea/ledger/TransactionType.kt +++ b/basetypes/src/main/kotlin/moe/nea/ledger/TransactionType.kt @@ -8,13 +8,16 @@ enum class TransactionType { AUCTION_SOLD, AUTOMERCHANT_PROFIT_COLLECT, BANK_DEPOSIT, + BANK_INTEREST, BANK_WITHDRAW, + BASIC_REFORGE, BAZAAR_BUY_INSTANT, BAZAAR_BUY_ORDER, BAZAAR_SELL_INSTANT, BAZAAR_SELL_ORDER, BITS_PURSE_STATUS, BOOSTER_COOKIE_ATE, + CADUCOUS_FEEDER_USED, CAPSAICIN_EYEDROPS_USED, COMMUNITY_SHOP_BUY, CORPSE_DESECRATED, @@ -22,6 +25,7 @@ enum class TransactionType { DRACONIC_SACRIFICE, DUNGEON_CHEST_OPEN, FORGED, + GHOST_COIN_DROP, GOD_POTION_DRANK, GOD_POTION_MIXIN_DRANK, GUMMY_POLAR_BEAR_ATE, @@ -31,6 +35,8 @@ enum class TransactionType { KUUDRA_CHEST_OPEN, NPC_BUY, NPC_SELL, + PEST_REPELLENT_USED, + STONKS_AUCTION, VISITOR_BARGAIN, WYRM_EVOKED, }
\ No newline at end of file diff --git a/basetypes/src/main/kotlin/moe/nea/ledger/utils/ULIDWrapper.kt b/basetypes/src/main/kotlin/moe/nea/ledger/utils/ULIDWrapper.kt index b8c5d3b..29d5e31 100644 --- a/basetypes/src/main/kotlin/moe/nea/ledger/utils/ULIDWrapper.kt +++ b/basetypes/src/main/kotlin/moe/nea/ledger/utils/ULIDWrapper.kt @@ -9,6 +9,14 @@ value class ULIDWrapper( val wrapped: String ) { companion object { + fun lowerBound(timestamp: Instant): ULIDWrapper { + return ULIDWrapper(ULID.generate(timestamp.toEpochMilli(), ByteArray(10))) + } + + fun upperBound(timestamp: Instant): ULIDWrapper { + return ULIDWrapper(ULID.generate(timestamp.toEpochMilli(), ByteArray(10) { -1 })) + } + fun createULIDAt(timestamp: Instant): ULIDWrapper { return ULIDWrapper(ULID.generate( timestamp.toEpochMilli(), diff --git a/build-src/src/main/kotlin/helpers.kt b/build-src/src/main/kotlin/helpers.kt index 5afef4f..48c230e 100644 --- a/build-src/src/main/kotlin/helpers.kt +++ b/build-src/src/main/kotlin/helpers.kt @@ -1,4 +1,5 @@ import org.gradle.api.plugins.ExtensionAware +import org.gradle.kotlin.dsl.DependencyHandlerScope import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.findByType @@ -8,3 +9,9 @@ inline fun <reified T : Any> ExtensionAware.configureIf(crossinline block: T.() extensions.configure<T> { block() } } } + +val ktor_version = "3.0.3" + +fun DependencyHandlerScope.declareKtorVersion() { + "implementation"(platform("io.ktor:ktor-bom:$ktor_version")) +} diff --git a/build-src/src/main/kotlin/ledger-globals.gradle.kts b/build-src/src/main/kotlin/ledger-globals.gradle.kts index 8d49379..4238322 100644 --- a/build-src/src/main/kotlin/ledger-globals.gradle.kts +++ b/build-src/src/main/kotlin/ledger-globals.gradle.kts @@ -1,3 +1,5 @@ +apply(plugin = "org.gradle.base") + repositories { mavenCentral() maven("https://repo.nea.moe/releases/") diff --git a/build.gradle.kts b/build.gradle.kts index 8377205..4c6ee45 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,11 +2,12 @@ import com.github.gmazzo.buildconfig.BuildConfigExtension import java.io.ByteArrayOutputStream plugins { - val kotlinVersion = "2.0.20" + val kotlinVersion = "2.0.21" kotlin("jvm") version kotlinVersion apply false kotlin("plugin.serialization") version kotlinVersion apply false id("com.github.gmazzo.buildconfig") version "5.5.0" apply false id("ledger-globals") + id("com.google.devtools.ksp") version "2.0.21-1.0.26" apply false id("com.github.johnrengelman.shadow") version "8.1.1" apply false } diff --git a/database/core/src/main/kotlin/moe/nea/ledger/database/Column.kt b/database/core/src/main/kotlin/moe/nea/ledger/database/Column.kt index 33727de..c21a159 100644 --- a/database/core/src/main/kotlin/moe/nea/ledger/database/Column.kt +++ b/database/core/src/main/kotlin/moe/nea/ledger/database/Column.kt @@ -4,20 +4,20 @@ import moe.nea.ledger.database.sql.IntoSelectable import moe.nea.ledger.database.sql.Selectable import java.sql.PreparedStatement -class Column<T> @Deprecated("Use Table.column instead") constructor( +class Column<T, Raw> @Deprecated("Use Table.column instead") constructor( val table: Table, val name: String, - val type: DBType<T> + val type: DBType<T, Raw> ) : IntoSelectable<T> { - override fun asSelectable() = object : Selectable<T> { + override fun asSelectable() = object : Selectable<T, Raw> { override fun asSql(): String { return qualifiedSqlName } - override val dbType: DBType<T> + override val dbType: DBType<T, Raw> get() = this@Column.type - override fun guessColumn(): Column<T>? { + override fun guessColumn(): Column<T, Raw> { return this@Column } diff --git a/database/core/src/main/kotlin/moe/nea/ledger/database/Constraint.kt b/database/core/src/main/kotlin/moe/nea/ledger/database/Constraint.kt index 9f7c9ef..729c6b8 100644 --- a/database/core/src/main/kotlin/moe/nea/ledger/database/Constraint.kt +++ b/database/core/src/main/kotlin/moe/nea/ledger/database/Constraint.kt @@ -1,6 +1,6 @@ package moe.nea.ledger.database interface Constraint { - val affectedColumns: Collection<Column<*>> + val affectedColumns: Collection<Column<*, *>> fun asSQL(): String }
\ No newline at end of file diff --git a/database/core/src/main/kotlin/moe/nea/ledger/database/DBType.kt b/database/core/src/main/kotlin/moe/nea/ledger/database/DBType.kt index 86ff544..622aff3 100644 --- a/databas |
