From f9b48dc421ed87062cc0444745fbec65fee3c9a3 Mon Sep 17 00:00:00 2001 From: Gabber235 Date: Thu, 23 Nov 2023 15:10:23 +0100 Subject: [PATCH] Rework page Migration, finalize item capturer --- .../entries/action/DropItemActionEntry.kt | 62 +- .../entries/action/GiveItemActionEntry.kt | 28 +- .../entries/action/RemoveItemActionEntry.kt | 63 +- .../entries/event/PickupItemEventEntry.kt | 33 +- .../entries/fact/InventoryItemCountFact.kt | 47 +- app/lib/widgets/inspector/header.dart | 6 + .../inspector/headers/colored_action.dart | 39 + .../inspector/headers/info_action.dart | 41 + .../inspector/headers/multiline_action.dart | 36 + .../inspector/headers/placeholder_action.dart | 36 + app/pubspec.lock | 50 +- code_generator/Cargo.lock | 860 +++++++++--------- plugin/build.gradle.kts | 1 + .../typewriter/adapters/AdapterListeners.kt | 110 +-- .../typewriter/adapters/AdapterLoader.kt | 16 +- .../typewriter/adapters/editors/ItemEditor.kt | 19 + .../gabber235/typewriter/capture/Recorders.kt | 11 +- .../capture/capturers/ItemSnapshotCapturer.kt | 12 + .../typewriter/entry/EntryListeners.kt | 1 + .../typewriter/entry/EntryMigration.kt | 135 +++ .../typewriter/entry/PageMigrator.kt | 121 +-- .../gabber235/typewriter/utils/Extensions.kt | 7 +- .../me/gabber235/typewriter/utils/Item.kt | 16 +- version.txt | 2 +- 24 files changed, 1047 insertions(+), 705 deletions(-) create mode 100644 app/lib/widgets/inspector/headers/colored_action.dart create mode 100644 app/lib/widgets/inspector/headers/info_action.dart create mode 100644 app/lib/widgets/inspector/headers/multiline_action.dart create mode 100644 app/lib/widgets/inspector/headers/placeholder_action.dart create mode 100644 plugin/src/main/kotlin/me/gabber235/typewriter/capture/capturers/ItemSnapshotCapturer.kt create mode 100644 plugin/src/main/kotlin/me/gabber235/typewriter/entry/EntryMigration.kt diff --git a/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/action/DropItemActionEntry.kt b/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/action/DropItemActionEntry.kt index 67440899b4..4018c8b27b 100644 --- a/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/action/DropItemActionEntry.kt +++ b/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/action/DropItemActionEntry.kt @@ -1,24 +1,20 @@ package me.gabber235.typewriter.entries.action import com.github.shynixn.mccoroutine.bukkit.launch -import lirand.api.extensions.inventory.meta +import com.google.gson.JsonObject +import lirand.api.extensions.other.set import me.gabber235.typewriter.adapters.Colors import me.gabber235.typewriter.adapters.Entry -import me.gabber235.typewriter.adapters.modifiers.Colored import me.gabber235.typewriter.adapters.modifiers.Help -import me.gabber235.typewriter.adapters.modifiers.MultiLine -import me.gabber235.typewriter.adapters.modifiers.Placeholder -import me.gabber235.typewriter.entry.Criteria -import me.gabber235.typewriter.entry.Modifier +import me.gabber235.typewriter.entry.* import me.gabber235.typewriter.entry.entries.ActionEntry import me.gabber235.typewriter.plugin import me.gabber235.typewriter.utils.Icons -import me.gabber235.typewriter.utils.asMini +import me.gabber235.typewriter.utils.Item +import me.gabber235.typewriter.utils.optional import org.bukkit.Location import org.bukkit.Material import org.bukkit.entity.Player -import org.bukkit.inventory.ItemStack -import org.bukkit.inventory.meta.ItemMeta import java.util.* @Entry("drop_item", "Drop an item at location, or on player", Colors.RED, Icons.DROPBOX) @@ -39,39 +35,41 @@ class DropItemActionEntry( override val modifiers: List, override val triggers: List = emptyList(), @Help("The item to drop.") - private val material: Material = Material.AIR, - @Help("The amount of items to drop.") - private val amount: Int = 1, - @Colored - @Placeholder - @Help("The display name of the item. (Defaults to the material's display name)") - // The display name of the item to drop. If not specified, the item will have its default display name. - private val displayName: String = "", - @MultiLine - @Colored - @Placeholder - @Help("The lore of the item. (Defaults to the item's lore)") - // The lore of the item to drop. If not specified, the item will have its default lore. - private val lore: String, + val item: Item = Item.Empty, @Help("The location to drop the item. (Defaults to the player's location)") // The location to drop the item at. If this field is left blank, the item will be dropped at the location of the player triggering the action. private val location: Optional = Optional.empty(), ) : ActionEntry { override fun execute(player: Player) { super.execute(player) - val item = ItemStack(material, amount).meta { - if (this@DropItemActionEntry.displayName.isNotBlank()) displayName(this@DropItemActionEntry.displayName.asMini()) - if (this@DropItemActionEntry.lore.isNotBlank()) { - lore(this@DropItemActionEntry.lore.split("\n").map { "$it".asMini() }) - } - } // Run on main thread plugin.launch { if (location.isPresent) { - location.get().world.dropItem(location.get(), item) + location.get().world.dropItem(location.get(), item.build(player)) } else { - player.location.world.dropItem(player.location, item) + player.location.world.dropItem(player.location, item.build(player)) } } } -} \ No newline at end of file +} + +@EntryMigration(DropItemActionEntry::class, "0.4.0") +private fun migrate040(json: JsonObject, context: EntryMigratorContext): JsonObject { + val data = JsonObject() + data.copyAllBut(json, "material", "amount", "displayName", "lore") + + val material = json.getAndParse("material", context.gson).optional + val amount = json.getAndParse("amount", context.gson).optional + val displayName = json.getAndParse("displayName", context.gson).optional + val lore = json.getAndParse("lore", context.gson).optional + + val item = Item( + material = material, + amount = amount, + name = displayName, + lore = lore, + ) + data["item"] = context.gson.toJsonTree(item) + + return data +} diff --git a/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/action/GiveItemActionEntry.kt b/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/action/GiveItemActionEntry.kt index 9c39853125..59199b3b17 100644 --- a/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/action/GiveItemActionEntry.kt +++ b/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/action/GiveItemActionEntry.kt @@ -1,13 +1,16 @@ package me.gabber235.typewriter.entries.action +import com.google.gson.JsonObject +import lirand.api.extensions.other.set import me.gabber235.typewriter.adapters.Colors import me.gabber235.typewriter.adapters.Entry import me.gabber235.typewriter.adapters.modifiers.Help -import me.gabber235.typewriter.entry.Criteria -import me.gabber235.typewriter.entry.Modifier +import me.gabber235.typewriter.entry.* import me.gabber235.typewriter.entry.entries.ActionEntry import me.gabber235.typewriter.utils.Icons import me.gabber235.typewriter.utils.Item +import me.gabber235.typewriter.utils.optional +import org.bukkit.Material import org.bukkit.entity.Player @Entry("give_item", "Give an item to the player", Colors.RED, Icons.WAND_SPARKLES) @@ -32,4 +35,25 @@ class GiveItemActionEntry( player.inventory.addItem(item.build(player)) } +} + +@EntryMigration(GiveItemActionEntry::class, "0.4.0") +private fun migrate040(json: JsonObject, context: EntryMigratorContext): JsonObject { + val data = JsonObject() + data.copyAllBut(json, "material", "amount", "displayName", "lore") + + val material = json.getAndParse("material", context.gson).optional + val amount = json.getAndParse("amount", context.gson).optional + val displayName = json.getAndParse("displayName", context.gson).optional + val lore = json.getAndParse("lore", context.gson).optional + + val item = Item( + material = material, + amount = amount, + name = displayName, + lore = lore, + ) + data["item"] = context.gson.toJsonTree(item) + + return data } \ No newline at end of file diff --git a/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/action/RemoveItemActionEntry.kt b/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/action/RemoveItemActionEntry.kt index 7feef99c6d..1fc5c7f3c7 100644 --- a/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/action/RemoveItemActionEntry.kt +++ b/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/action/RemoveItemActionEntry.kt @@ -1,30 +1,33 @@ package me.gabber235.typewriter.entries.action -import lirand.api.extensions.inventory.meta +import com.google.gson.JsonObject +import lirand.api.extensions.other.set import me.gabber235.typewriter.adapters.Colors import me.gabber235.typewriter.adapters.Entry -import me.gabber235.typewriter.adapters.modifiers.Colored import me.gabber235.typewriter.adapters.modifiers.Help -import me.gabber235.typewriter.adapters.modifiers.Placeholder -import me.gabber235.typewriter.entry.Criteria -import me.gabber235.typewriter.entry.Modifier +import me.gabber235.typewriter.entry.* import me.gabber235.typewriter.entry.entries.ActionEntry import me.gabber235.typewriter.utils.Icons -import me.gabber235.typewriter.utils.asMini +import me.gabber235.typewriter.utils.Item +import me.gabber235.typewriter.utils.optional import org.bukkit.Material import org.bukkit.entity.Player -import org.bukkit.inventory.ItemStack import java.util.* @Entry("remove_item", "Remove an item from the players inventory", Colors.RED, Icons.WAND_SPARKLES) /** * The `Remove Item Action` is an action that removes an item from the player's inventory. * This action provides you with the ability to remove items from the player's inventory in response to specific events. + * + * This action will try to remove "as much as possible" but does not verify if the player has enough items in their inventory. + * If you want to guarantee that the player has enough items in their inventory, add an + * Inventory Item Count Fact to the criteria. + * * * ## How could this be used? * * This can be used when `giving` an NPC an item, and you want to remove the item from the player's inventory. - * Or when you want to remove an item from the player's inventory when they complete a quest or achievement. + * Or when you want to remove a key from the player's inventory after they use it to unlock a door. */ class RemoveItemActionEntry( override val id: String = "", @@ -33,32 +36,32 @@ class RemoveItemActionEntry( override val modifiers: List, override val triggers: List = emptyList(), @Help("The item to remove.") - private val material: Material = Material.AIR, - @Help("The amount of items to remove.") - private val amount: Int = 1, - @Help("Does the player need to have the exact amount of items?") - private val exactAmount: Boolean = false, - @Placeholder - @Colored - @Help("The name of the item.") - // If the name is given, the item must have the same name to be removed. - private val itemName: Optional = Optional.empty(), + val item: Item = Item.Empty, ) : ActionEntry { override fun execute(player: Player) { super.execute(player) - val item = ItemStack(material, amount).meta { - itemName.ifPresent { - displayName(it.asMini()) - } - } - if (exactAmount) { - if (player.inventory.containsAtLeast(item, amount)) { - player.inventory.removeItemAnySlot(item) - } - } else { - player.inventory.removeItemAnySlot(item) - } + player.inventory.removeItemAnySlot(item.build(player)) } } +@EntryMigration(RemoveItemActionEntry::class, "0.4.0") +private fun migrate040(json: JsonObject, context: EntryMigratorContext): JsonObject { + val data = JsonObject() + data.copyAllBut(json, "material", "amount", "itemName") + + val material = json.getAndParse("material", context.gson).optional + val amount = json.getAndParse("amount", context.gson).optional + val displayName = json.getAndParse>("itemName", context.gson).optional + + val item = Item( + material = material, + amount = amount, + name = displayName, + ) + data["item"] = context.gson.toJsonTree(item) + + return data +} + + diff --git a/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/event/PickupItemEventEntry.kt b/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/event/PickupItemEventEntry.kt index 697741760f..e4d1385e08 100644 --- a/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/event/PickupItemEventEntry.kt +++ b/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/event/PickupItemEventEntry.kt @@ -1,15 +1,15 @@ package me.gabber235.typewriter.entries.event +import com.google.gson.JsonObject +import lirand.api.extensions.other.set import me.gabber235.typewriter.adapters.Colors import me.gabber235.typewriter.adapters.Entry import me.gabber235.typewriter.adapters.modifiers.Help -import me.gabber235.typewriter.adapters.modifiers.MaterialProperties -import me.gabber235.typewriter.adapters.modifiers.MaterialProperty.ITEM -import me.gabber235.typewriter.entry.EntryListener -import me.gabber235.typewriter.entry.Query +import me.gabber235.typewriter.entry.* import me.gabber235.typewriter.entry.entries.EventEntry -import me.gabber235.typewriter.entry.startDialogueWithOrNextDialogue import me.gabber235.typewriter.utils.Icons +import me.gabber235.typewriter.utils.Item +import me.gabber235.typewriter.utils.optional import org.bukkit.Material import org.bukkit.entity.Player import org.bukkit.event.entity.EntityPickupItemEvent @@ -26,9 +26,8 @@ class PickupItemEventEntry( override val id: String = "", override val name: String = "", override val triggers: List = emptyList(), - @MaterialProperties(ITEM) - @Help("The item that was picked up.") - val material: Material = Material.STONE, + @Help("The item to listen for.") + val item: Item = Item.Empty, ) : EventEntry @EntryListener(PickupItemEventEntry::class) @@ -38,6 +37,20 @@ fun onPickupItem(event: EntityPickupItemEvent, query: Query - entry.material == event.item.itemStack.type + entry.item.isSameAs(player, event.item.itemStack) } startDialogueWithOrNextDialogue player -} \ No newline at end of file +} + +@EntryMigration(PickupItemEventEntry::class, "0.4.0") +private fun migrate040(json: JsonObject, context: EntryMigratorContext): JsonObject { + val data = JsonObject() + data.copyAllBut(json, "material") + + val material = json.getAndParse("material", context.gson).optional + val item = Item( + material = material, + ) + data["item"] = context.gson.toJsonTree(item) + + return data +} diff --git a/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/fact/InventoryItemCountFact.kt b/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/fact/InventoryItemCountFact.kt index 5dca81cea0..15a75c6154 100644 --- a/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/fact/InventoryItemCountFact.kt +++ b/adapters/BasicAdapter/src/main/kotlin/me/gabber235/typewriter/entries/fact/InventoryItemCountFact.kt @@ -1,15 +1,21 @@ package me.gabber235.typewriter.entries.fact +import com.google.gson.JsonObject +import lirand.api.extensions.other.set import lirand.api.extensions.server.server import me.gabber235.typewriter.adapters.Colors import me.gabber235.typewriter.adapters.Entry import me.gabber235.typewriter.adapters.modifiers.Help +import me.gabber235.typewriter.entry.EntryMigration +import me.gabber235.typewriter.entry.EntryMigratorContext +import me.gabber235.typewriter.entry.copyAllBut import me.gabber235.typewriter.entry.entries.ReadableFactEntry +import me.gabber235.typewriter.entry.getAndParse import me.gabber235.typewriter.facts.Fact import me.gabber235.typewriter.utils.Icons -import me.gabber235.typewriter.utils.asMini +import me.gabber235.typewriter.utils.Item +import me.gabber235.typewriter.utils.optional import org.bukkit.Material -import org.bukkit.inventory.ItemStack import java.util.* @Entry( @@ -32,26 +38,29 @@ class InventoryItemCountFact( override val id: String = "", override val name: String = "", override val comment: String = "", - @Help("The material the item needs to be.") - // If specified, only items with this material will be counted. - private val material: Optional = Optional.empty(), - @Help("The name of the item.") - // If specified, only items with this name will be counted. - private val itemName: Optional = Optional.empty(), + @Help("The item to check for.") + val item: Item = Item.Empty, ) : ReadableFactEntry { - private fun isValid(item: ItemStack): Boolean { - if (material.isPresent) { - if (item.type != material.get()) return false - } - if (itemName.isPresent) { - if (item.itemMeta?.displayName() != itemName.get().asMini()) return false - } - return true - } - override fun read(playerId: UUID): Fact { val player = server.getPlayer(playerId) ?: return Fact(id, 0) - val amount = player.inventory.contents.filterNotNull().filter { isValid(it) }.sumOf { it.amount } + val amount = player.inventory.contents.filterNotNull().filter { item.isSameAs(player, it) }.sumOf { it.amount } return Fact(id, amount) } } + +@EntryMigration(InventoryItemCountFact::class, "0.4.0") +private fun migrate040(json: JsonObject, context: EntryMigratorContext): JsonObject { + val data = JsonObject() + data.copyAllBut(json, "material", "itemName") + + val material = json.getAndParse>("material", context.gson).optional + val displayName = json.getAndParse>("itemName", context.gson).optional + + val item = Item( + material = material, + name = displayName, + ) + data["item"] = context.gson.toJsonTree(item) + + return data +} diff --git a/app/lib/widgets/inspector/header.dart b/app/lib/widgets/inspector/header.dart index d42d882f69..c7c6477040 100644 --- a/app/lib/widgets/inspector/header.dart +++ b/app/lib/widgets/inspector/header.dart @@ -9,9 +9,12 @@ import "package:typewriter/utils/extensions.dart"; import "package:typewriter/widgets/components/app/writers.dart"; import "package:typewriter/widgets/inspector/editors.dart"; import "package:typewriter/widgets/inspector/headers/capture_action.dart"; +import "package:typewriter/widgets/inspector/headers/colored_action.dart"; import "package:typewriter/widgets/inspector/headers/entry_selector_action.dart"; import "package:typewriter/widgets/inspector/headers/help_action.dart"; import "package:typewriter/widgets/inspector/headers/length_action.dart"; +import "package:typewriter/widgets/inspector/headers/multiline_action.dart"; +import "package:typewriter/widgets/inspector/headers/placeholder_action.dart"; import "package:typewriter/widgets/inspector/section_title.dart"; part "header.g.dart"; @@ -165,6 +168,9 @@ class Header extends InheritedWidget { @riverpod List headerActionFilters(HeaderActionFiltersRef ref) => [ HelpHeaderActionFilter(), + ColoredHeaderActionFilter(), + PlaceholderHeaderActionFilter(), + RegexHeaderActionFilter(), LengthHeaderActionFilter(), EntrySelectorHeaderActionFilter(), CaptureHeaderActionFilter(), diff --git a/app/lib/widgets/inspector/headers/colored_action.dart b/app/lib/widgets/inspector/headers/colored_action.dart new file mode 100644 index 0000000000..25a3e86192 --- /dev/null +++ b/app/lib/widgets/inspector/headers/colored_action.dart @@ -0,0 +1,39 @@ +import "package:flutter/material.dart"; +import "package:font_awesome_flutter/font_awesome_flutter.dart"; +import "package:hooks_riverpod/hooks_riverpod.dart"; +import "package:typewriter/models/adapter.dart"; +import "package:typewriter/widgets/inspector/header.dart"; +import "package:typewriter/widgets/inspector/headers/info_action.dart"; + +class ColoredHeaderActionFilter extends HeaderActionFilter { + @override + bool shouldShow(String path, FieldInfo field) => + field.getModifier("colored") != null; + + @override + HeaderActionLocation location(String path, FieldInfo field) => + HeaderActionLocation.trailing; + + @override + Widget build(String path, FieldInfo field) => + ColoredHeaderAction(field: field); +} + +class ColoredHeaderAction extends HookConsumerWidget { + const ColoredHeaderAction({ + required this.field, + super.key, + }) : super(); + + final FieldInfo field; + + @override + Widget build(BuildContext context, WidgetRef ref) { + return const InfoHeaderAction( + tooltip: "Adventure Mini Format is supported. Click for more info.", + icon: FontAwesomeIcons.paintbrush, + color: Color(0xFFff8e42), + url: "https://docs.advntr.dev/minimessage/format.html", + ); + } +} diff --git a/app/lib/widgets/inspector/headers/info_action.dart b/app/lib/widgets/inspector/headers/info_action.dart new file mode 100644 index 0000000000..daad6d332a --- /dev/null +++ b/app/lib/widgets/inspector/headers/info_action.dart @@ -0,0 +1,41 @@ +import "package:flutter/material.dart"; +import "package:font_awesome_flutter/font_awesome_flutter.dart"; +import "package:hooks_riverpod/hooks_riverpod.dart"; +import "package:url_launcher/url_launcher_string.dart"; + +class InfoHeaderAction extends HookConsumerWidget { + const InfoHeaderAction({ + required this.tooltip, + required this.icon, + required this.color, + required this.url, + super.key, + }) : super(); + + final String tooltip; + final IconData icon; + final Color color; + final String url; + + Future _launchUrl(String url) async { + if (await canLaunchUrlString(url)) { + await launchUrlString(url); + } + } + + @override + Widget build(BuildContext context, WidgetRef ref) { + return IconButton( + tooltip: tooltip, + icon: FaIcon( + icon, + size: 14, + color: color, + ), + hoverColor: color.withOpacity(0.2), + padding: const EdgeInsets.all(0), + visualDensity: VisualDensity.compact, + onPressed: () => _launchUrl(url), + ); + } +} diff --git a/app/lib/widgets/inspector/headers/multiline_action.dart b/app/lib/widgets/inspector/headers/multiline_action.dart new file mode 100644 index 0000000000..ec6f58606c --- /dev/null +++ b/app/lib/widgets/inspector/headers/multiline_action.dart @@ -0,0 +1,36 @@ +import "package:flutter/material.dart"; +import "package:font_awesome_flutter/font_awesome_flutter.dart"; +import "package:hooks_riverpod/hooks_riverpod.dart"; +import "package:typewriter/models/adapter.dart"; +import "package:typewriter/widgets/inspector/header.dart"; +import "package:typewriter/widgets/inspector/headers/info_action.dart"; + +class RegexHeaderActionFilter extends HeaderActionFilter { + @override + bool shouldShow(String path, FieldInfo field) => + field.getModifier("regex") != null; + + @override + HeaderActionLocation location(String path, FieldInfo field) => + HeaderActionLocation.trailing; + + @override + Widget build(String path, FieldInfo field) => const RegexHeaderInfo(); +} + +class RegexHeaderInfo extends HookConsumerWidget { + const RegexHeaderInfo({ + super.key, + }) : super(); + + @override + Widget build(BuildContext context, WidgetRef ref) { + return const InfoHeaderAction( + tooltip: "Regular expressions are supported. Click for more info.", + icon: FontAwesomeIcons.asterisk, + color: Color(0xFFf731d6), + url: + "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions", + ); + } +} diff --git a/app/lib/widgets/inspector/headers/placeholder_action.dart b/app/lib/widgets/inspector/headers/placeholder_action.dart new file mode 100644 index 0000000000..dd2da9d3f3 --- /dev/null +++ b/app/lib/widgets/inspector/headers/placeholder_action.dart @@ -0,0 +1,36 @@ +import "package:flutter/material.dart"; +import "package:font_awesome_flutter/font_awesome_flutter.dart"; +import "package:hooks_riverpod/hooks_riverpod.dart"; +import "package:typewriter/models/adapter.dart"; +import "package:typewriter/widgets/inspector/header.dart"; +import "package:typewriter/widgets/inspector/headers/info_action.dart"; + +class PlaceholderHeaderActionFilter extends HeaderActionFilter { + @override + bool shouldShow(String path, FieldInfo field) => + field.getModifier("placeholder") != null; + + @override + HeaderActionLocation location(String path, FieldInfo field) => + HeaderActionLocation.trailing; + + @override + Widget build(String path, FieldInfo field) => const PlaceholderHeaderAction(); +} + +class PlaceholderHeaderAction extends HookConsumerWidget { + const PlaceholderHeaderAction({ + super.key, + }) : super(); + + @override + Widget build(BuildContext context, WidgetRef ref) { + return const InfoHeaderAction( + tooltip: + "Placeholers like %player_name% are supported. Click for more info.", + icon: FontAwesomeIcons.subscript, + color: Color(0xFF00b300), + url: "https://github.com/PlaceholderAPI/PlaceholderAPI/wiki", + ); + } +} diff --git a/app/pubspec.lock b/app/pubspec.lock index 15e9d0f099..e5c0673d13 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -317,26 +317,26 @@ packages: dependency: "direct dev" description: name: custom_lint - sha256: "837821e4619c167fd5a547b03bb2fc6be7e65b800ec75528848429705c31ceba" + sha256: "198ec6b8e084d22f508a76556c9afcfb71706ad3f42b083fe0ee923351a96d90" url: "https://pub.dev" source: hosted - version: "0.5.3" + version: "0.5.7" custom_lint_builder: dependency: transitive description: name: custom_lint_builder - sha256: "3537d50202568994a6f42b1f2953aed6292fc5ecf83e45237af73f64aff2be72" + sha256: dfcfa987d2bd9d0ba751ef4bdef0f6c1aa0062f2a67fe716fd5f3f8b709d6418 url: "https://pub.dev" source: hosted - version: "0.5.3" + version: "0.5.7" custom_lint_core: dependency: transitive description: name: custom_lint_core - sha256: "3bdebdd52a42b4d6e5be9cd833ad1ecfbbc23e1020ca537060e54085497aea9c" + sha256: f84c3fe2f27ef3b8831953e477e59d4a29c2952623f9eac450d7b40d9cdd94cc url: "https://pub.dev" source: hosted - version: "0.5.3" + version: "0.5.7" dart_style: dependency: transitive description: @@ -524,10 +524,10 @@ packages: dependency: transitive description: name: hotreloader - sha256: "728c0613556c1d153f7e7f4a367cffacc3f5a677d7f6497a1c2b35add4e6dacf" + sha256: "94ee21a60ea2836500799f3af035dc3212b1562027f1e0031c14e087f0231449" url: "https://pub.dev" source: hosted - version: "3.0.6" + version: "4.1.0" http: dependency: "direct main" description: @@ -616,6 +616,22 @@ packages: url: "https://pub.dev" source: hosted version: "0.1.0-nullsafety.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "04be76c4a4bb50f14904e64749237e541e7c7bcf7ec0b196907322ab5d2fc739" + url: "https://pub.dev" + source: hosted + version: "9.0.16" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: b06739349ec2477e943055aea30172c5c7000225f79dad4702e2ec0eda79a6ff + url: "https://pub.dev" + source: hosted + version: "1.0.5" lints: dependency: transitive description: @@ -644,18 +660,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" mime: dependency: transitive description: @@ -1153,10 +1169,10 @@ packages: dependency: transitive description: name: vm_service - sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "11.10.0" + version: "13.0.0" watcher: dependency: transitive description: @@ -1169,10 +1185,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: edc8a9573dd8c5a83a183dae1af2b6fd4131377404706ca4e5420474784906fa url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.4.0" web_socket_channel: dependency: transitive description: @@ -1214,5 +1230,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.13.0" diff --git a/code_generator/Cargo.lock b/code_generator/Cargo.lock index d5a79f6d9a..89c73b8e68 100644 --- a/code_generator/Cargo.lock +++ b/code_generator/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -10,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -23,17 +32,32 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" -version = "0.13.1" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "bit_field" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" [[package]] name = "bitflags" @@ -43,39 +67,42 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytemuck" -version = "1.12.3" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa3a8d9a1ca92e282c96a32d6511b695d7d994d1d102ba85d279f9b2756947f" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.3.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" -version = "1.0.77" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -161,9 +188,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "crc32fast" @@ -174,21 +201,11 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -197,9 +214,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.13" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", "cfg-if", @@ -210,9 +227,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -225,9 +242,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "either" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encode_unicode" @@ -237,63 +254,65 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] [[package]] -name = "errno" -version = "0.3.1" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "errno" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" dependencies = [ - "cc", "libc", + "windows-sys 0.48.0", ] [[package]] name = "exr" -version = "1.5.2" +version = "1.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb5f255b5980bb0c8cf676b675d1a99be40f316881444f44e0462eaf5df5ded" +checksum = "832a761f35ab3e6664babfbdc6cef35a4860e816ec3916dcfd0882954e98a8a8" dependencies = [ "bit_field", "flume", "half", "lebe", "miniz_oxide", + "rayon-core", "smallvec", - "threadpool", + "zune-inflate", ] [[package]] name = "fastrand" -version = "1.8.0" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "fdeflate" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" dependencies = [ - "instant", + "simd-adler32", ] [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -301,14 +320,10 @@ dependencies = [ [[package]] name = "flume" -version = "0.10.14" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ - "futures-core", - "futures-sink", - "nanorand", - "pin-project", "spin", ] @@ -335,45 +350,45 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-core", "futures-task", @@ -381,34 +396,27 @@ dependencies = [ "pin-utils", ] -[[package]] -name = "getrandom" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi", - "wasm-bindgen", -] - [[package]] name = "gif" -version = "0.11.4" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3edd93c6756b4dfaf2709eafcc345ba2636565295c198a9cfbf75fa5e3e00b06" +checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" dependencies = [ "color_quant", "weezl", ] +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + [[package]] name = "h2" -version = "0.3.17" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b91535aa35fea1523ad1b86cb6b53c28e0ae566ba4a460f4457e936cad7c6f" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", @@ -425,45 +433,36 @@ dependencies = [ [[package]] name = "half" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad6a9459c9c30b177b925162351f97e7d967c7ea8bab3b8352805327daf45554" +checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" dependencies = [ "crunchy", ] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "http" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -489,15 +488,15 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -510,7 +509,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -532,9 +531,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -542,9 +541,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.5" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69b7ea949b537b0fd0af141fff8c77690f2ce96f4f41f042ccb6c69c6c965945" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" dependencies = [ "bytemuck", "byteorder", @@ -555,25 +554,25 @@ dependencies = [ "num-rational", "num-traits", "png", - "scoped_threadpool", + "qoi", "tiff", ] [[package]] name = "indexmap" -version = "1.9.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ - "autocfg", + "equivalent", "hashbrown", ] [[package]] name = "indicatif" -version = "0.17.5" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff8cc23a7393a397ed1d7f56e6365cba772aba9f9912ab968b03043c395d057" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" dependencies = [ "console", "instant", @@ -594,9 +593,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.7.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" @@ -604,7 +603,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi", "rustix", "windows-sys 0.48.0", ] @@ -620,9 +619,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jpeg-decoder" @@ -635,9 +634,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -656,21 +655,21 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -678,62 +677,50 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memoffset" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", + "simd-adler32", ] [[package]] name = "mio" -version = "0.8.5" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", - "log", "wasi", - "windows-sys 0.42.0", -] - -[[package]] -name = "nanorand" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" -dependencies = [ - "getrandom", + "windows-sys 0.48.0", ] [[package]] @@ -777,20 +764,20 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.14.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi", "libc", ] @@ -800,19 +787,28 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" -version = "1.16.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl" -version = "0.10.55" +version = "0.10.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +checksum = "79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "cfg-if", "foreign-types", "libc", @@ -823,13 +819,13 @@ dependencies = [ [[package]] name = "openssl-macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -840,9 +836,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.90" +version = "0.9.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f" dependencies = [ "cc", "libc", @@ -862,48 +858,28 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.5" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys 0.42.0", + "windows-targets 0.48.5", ] [[package]] name = "percent-encoding" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" - -[[package]] -name = "pin-project" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.12" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -913,51 +889,61 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "png" -version = "0.17.7" +version = "0.17.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" +checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" dependencies = [ "bitflags 1.3.2", "crc32fast", + "fdeflate", "flate2", "miniz_oxide", ] [[package]] name = "portable-atomic" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc55135a600d700580e406b4de0d59cb9ad25e344a3a091a97ded2622ec4ec6" +checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + [[package]] name = "quote" -version = "1.0.21" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -965,14 +951,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -986,44 +970,47 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.7.0" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", + "regex-automata", "regex-syntax", ] [[package]] -name = "regex-syntax" -version = "0.6.28" +name = "regex-automata" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.13" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ "base64", "bytes", @@ -1046,6 +1033,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-native-tls", "tower-service", @@ -1056,13 +1044,19 @@ dependencies = [ "winreg", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustix" -version = "0.38.4" +version = "0.38.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", @@ -1071,15 +1065,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "same-file" @@ -1092,31 +1086,24 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.20" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "lazy_static", - "windows-sys 0.36.1", + "windows-sys 0.48.0", ] -[[package]] -name = "scoped_threadpool" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" - [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "security-framework" -version = "2.7.0" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -1127,9 +1114,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -1137,29 +1124,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.150" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.150" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.89" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -1180,38 +1167,54 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "slab" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spin" version = "0.9.8" @@ -1243,68 +1246,90 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.109", ] [[package]] name = "syn" -version = "1.0.105" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tempfile" -version = "3.3.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand", - "libc", "redox_syscall", - "remove_dir_all", - "winapi", + "rustix", + "windows-sys 0.48.0", ] [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn", -] - -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", + "syn 2.0.39", ] [[package]] name = "tiff" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7449334f9ff2baf290d55d73983a7d6fa15e01198faef72af07e2a8db851e471" +checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" dependencies = [ "flate2", "jpeg-decoder", @@ -1322,46 +1347,45 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.24.2" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.5", "tokio-macros", - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] name = "tokio-native-tls" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", @@ -1369,9 +1393,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -1389,20 +1413,19 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -1429,21 +1452,21 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -1456,21 +1479,21 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "url" -version = "2.3.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -1485,9 +1508,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -1495,11 +1518,10 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -1511,9 +1533,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1521,24 +1543,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if", "js-sys", @@ -1548,9 +1570,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1558,28 +1580,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -1609,9 +1631,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -1622,34 +1644,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -1665,7 +1659,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -1685,17 +1679,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -1706,15 +1700,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -1724,15 +1712,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -1742,15 +1724,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -1760,15 +1736,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -1778,9 +1748,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -1790,15 +1760,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -1808,15 +1772,25 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "zune-inflate" +version = "0.2.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" +dependencies = [ + "simd-adler32", ] diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index c10b0e5412..169c048357 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -42,6 +42,7 @@ dependencies { implementation("io.ktor:ktor-server-core-jvm:2.3.4") implementation("io.ktor:ktor-server-netty-jvm:2.3.4") implementation("io.insert-koin:koin-core:3.4.0") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.6.0") compileOnly("com.github.shynixn.mccoroutine:mccoroutine-bukkit-api:2.11.0") compileOnly("com.github.shynixn.mccoroutine:mccoroutine-bukkit-core:2.11.0") diff --git a/plugin/src/main/kotlin/me/gabber235/typewriter/adapters/AdapterListeners.kt b/plugin/src/main/kotlin/me/gabber235/typewriter/adapters/AdapterListeners.kt index 507e4b0920..7b888b0452 100644 --- a/plugin/src/main/kotlin/me/gabber235/typewriter/adapters/AdapterListeners.kt +++ b/plugin/src/main/kotlin/me/gabber235/typewriter/adapters/AdapterListeners.kt @@ -9,75 +9,75 @@ import java.lang.reflect.Modifier import kotlin.reflect.KClass data class AdapterListener( - val method: Method, - val entry: KClass, - val generators: List, - val priority: EventPriority, - val ignoreCancelled: Boolean, + val method: Method, + val entry: KClass, + val generators: List, + val priority: EventPriority, + val ignoreCancelled: Boolean, ) sealed interface ParameterGenerator { - fun isApplicable(parameter: Parameter): Boolean - fun generate(event: Event, adapterListener: AdapterListener): Any + fun isApplicable(parameter: Parameter): Boolean + fun generate(event: Event, adapterListener: AdapterListener): Any - object EventParameterGenerator : ParameterGenerator { - override fun isApplicable(parameter: Parameter): Boolean { - // It and all superclasses must be Event - return Event::class.java.isAssignableFrom(parameter.type) - } + object EventParameterGenerator : ParameterGenerator { + override fun isApplicable(parameter: Parameter): Boolean { + // It and all superclasses must be Event + return Event::class.java.isAssignableFrom(parameter.type) + } - override fun generate(event: Event, adapterListener: AdapterListener): Any = event - } + override fun generate(event: Event, adapterListener: AdapterListener): Any = event + } - object QueryParameterGenerator : ParameterGenerator { - override fun isApplicable(parameter: Parameter): Boolean { - // It can only be Query - return parameter.type.isAssignableFrom(Query::class.java) - } + object QueryParameterGenerator : ParameterGenerator { + override fun isApplicable(parameter: Parameter): Boolean { + // It can only be Query + return parameter.type.isAssignableFrom(Query::class.java) + } - override fun generate(event: Event, adapterListener: AdapterListener): Any = Query(adapterListener.entry) - } + override fun generate(event: Event, adapterListener: AdapterListener): Any = Query(adapterListener.entry) + } - companion object { - private val generators = listOf(EventParameterGenerator, QueryParameterGenerator) + companion object { + private val generators = listOf(EventParameterGenerator, QueryParameterGenerator) - private fun getGenerator(parameter: Parameter): ParameterGenerator? { - return generators.firstOrNull { it.isApplicable(parameter) } - } + private fun getGenerator(parameter: Parameter): ParameterGenerator? { + return generators.firstOrNull { it.isApplicable(parameter) } + } - /** - * Creates a list of ParameterGenerators for the given method. - * @throws IllegalArgumentException if the parameter is not applicable to any generator - */ - @Throws(IllegalArgumentException::class) - fun getGenerators(parameters: Array): List { - return parameters.map { parameter -> - getGenerator(parameter) - ?: throw IllegalArgumentException("There is no way to create a parameter for ${parameter.name} (${parameter.type}) in ${parameter.declaringExecutable}") - } - } - } + /** + * Creates a list of ParameterGenerators for the given method. + * @throws IllegalArgumentException if the parameter is not applicable to any generator + */ + @Throws(IllegalArgumentException::class) + fun getGenerators(parameters: Array): List { + return parameters.map { parameter -> + getGenerator(parameter) + ?: throw IllegalArgumentException("There is no way to create a parameter for ${parameter.name} (${parameter.type}) in ${parameter.declaringExecutable}") + } + } + } } object AdapterListeners { - private fun constructAdapterListener(method: Method): AdapterListener { - val annotation = method.getAnnotation(EntryListener::class.java) - val entry = annotation.entry - val parameters = method.parameters - val generators = ParameterGenerator.getGenerators(parameters) - return AdapterListener(method, entry, generators, annotation.priority, annotation.ignoreCancelled) - } + private fun constructAdapterListener(method: Method): AdapterListener { + val annotation = method.getAnnotation(EntryListener::class.java) + val entry = annotation.entry + val parameters = method.parameters + val generators = ParameterGenerator.getGenerators(parameters) + return AdapterListener(method, entry, generators, annotation.priority, annotation.ignoreCancelled) + } - fun constructAdapterListeners(classes: List>): List { - // Go through all classes and find methods with the @EntryListener annotation - // Then construct an AdapterListener for each of them - return classes.asSequence() - .flatMap { it.methods.asSequence() } - .filter { Modifier.isStatic(it.modifiers) } - .filter { it.isAnnotationPresent(EntryListener::class.java) } - .map { constructAdapterListener(it) } - .toList() - } + fun constructAdapterListeners(classes: List>): List { + // Go through all classes and find methods with the @EntryListener annotation + // Then construct an AdapterListener for each of them + return classes.asSequence() + .flatMap { it.methods.asSequence() } + .filter { Modifier.isStatic(it.modifiers) } + .filter { it.isAnnotationPresent(EntryListener::class.java) } + .map(::constructAdapterListener) + .toList() + } } \ No newline at end of file diff --git a/plugin/src/main/kotlin/me/gabber235/typewriter/adapters/AdapterLoader.kt b/plugin/src/main/kotlin/me/gabber235/typewriter/adapters/AdapterLoader.kt index dd0b1a7b25..c67324bb3d 100644 --- a/plugin/src/main/kotlin/me/gabber235/typewriter/adapters/AdapterLoader.kt +++ b/plugin/src/main/kotlin/me/gabber235/typewriter/adapters/AdapterLoader.kt @@ -3,9 +3,12 @@ package me.gabber235.typewriter.adapters import com.google.gson.GsonBuilder import com.google.gson.JsonArray import com.google.gson.reflect.TypeToken +import me.gabber235.typewriter.adapters.editors.ItemFieldCapturer import me.gabber235.typewriter.adapters.editors.LocationFieldCapturer import me.gabber235.typewriter.capture.Capturer import me.gabber235.typewriter.capture.CapturerCreator +import me.gabber235.typewriter.entry.EntryMigrations +import me.gabber235.typewriter.entry.EntryMigrator import me.gabber235.typewriter.entry.dialogue.DialogueMessenger import me.gabber235.typewriter.entry.entries.DialogueEntry import me.gabber235.typewriter.logger @@ -39,6 +42,7 @@ private val gson = val staticCaptureClasses by lazy { listOf( LocationFieldCapturer::class, + ItemFieldCapturer::class, ) } @@ -51,6 +55,8 @@ interface AdapterLoader { fun getEntryBlueprint(type: String): EntryBlueprint? fun getCaptureClasses(): List>> + + fun getEntryMigrators(): List } class AdapterLoaderImpl : AdapterLoader, KoinComponent { @@ -132,6 +138,8 @@ class AdapterLoaderImpl : AdapterLoader, KoinComponent { val capturers = constructCapturers(captureClasses) + val entryMigrators = EntryMigrations.constructEntryMigrators(classes) + // Create the adapter data return AdapterData( adapterAnnotation?.name ?: "", @@ -141,6 +149,7 @@ class AdapterLoaderImpl : AdapterLoader, KoinComponent { messengers, adapterListeners, capturers, + entryMigrators, adapterClass, ) } @@ -222,6 +231,10 @@ class AdapterLoaderImpl : AdapterLoader, KoinComponent { override fun getCaptureClasses(): List>> { return adapters.asSequence().flatMap { it.captureClasses }.toList() } + + override fun getEntryMigrators(): List { + return adapters.asSequence().flatMap { it.entryMigrators }.toList() + } } data class AdapterData( @@ -236,10 +249,11 @@ data class AdapterData( @Transient val captureClasses: List>>, @Transient + val entryMigrators: List, + @Transient val clazz: Class<*>, ) - // Annotation for marking a class as an adapter @Target(AnnotationTarget.CLASS) annotation class Adapter( diff --git a/plugin/src/main/kotlin/me/gabber235/typewriter/adapters/editors/ItemEditor.kt b/plugin/src/main/kotlin/me/gabber235/typewriter/adapters/editors/ItemEditor.kt index 7fd351c1ec..b94104f7cb 100644 --- a/plugin/src/main/kotlin/me/gabber235/typewriter/adapters/editors/ItemEditor.kt +++ b/plugin/src/main/kotlin/me/gabber235/typewriter/adapters/editors/ItemEditor.kt @@ -3,7 +3,14 @@ package me.gabber235.typewriter.adapters.editors import com.google.gson.JsonObject import com.google.gson.reflect.TypeToken import me.gabber235.typewriter.adapters.* +import me.gabber235.typewriter.adapters.modifiers.Capture +import me.gabber235.typewriter.adapters.modifiers.CaptureModifierComputer +import me.gabber235.typewriter.capture.CapturerCreator +import me.gabber235.typewriter.capture.ImmediateFieldCapturer +import me.gabber235.typewriter.capture.RecorderRequestContext +import me.gabber235.typewriter.capture.capturers.ItemSnapshotCapturer import me.gabber235.typewriter.utils.Item +import me.gabber235.typewriter.utils.ok import java.lang.reflect.Modifier @CustomEditor(Item::class) @@ -38,4 +45,16 @@ fun ObjectEditor.item() = reference { ObjectField(fields) } + + CaptureModifierComputer with Capture(ItemFieldCapturer::class) +} + +class ItemFieldCapturer(title: String, entryId: String, fieldPath: String) : + ImmediateFieldCapturer(title, entryId, fieldPath, ItemSnapshotCapturer(title)) { + companion object : CapturerCreator { + override fun create(context: RecorderRequestContext): Result { + return ok(ItemFieldCapturer(context.title, context.entryId, context.fieldPath)) + } + + } } \ No newline at end of file diff --git a/plugin/src/main/kotlin/me/gabber235/typewriter/capture/Recorders.kt b/plugin/src/main/kotlin/me/gabber235/typewriter/capture/Recorders.kt index 225459d68c..11965053ca 100644 --- a/plugin/src/main/kotlin/me/gabber235/typewriter/capture/Recorders.kt +++ b/plugin/src/main/kotlin/me/gabber235/typewriter/capture/Recorders.kt @@ -89,7 +89,11 @@ class Recorders : KoinComponent { record(player, capturer, context.cinematicData) } - return RecorderResponse.RecordingStarting + return when (capturer) { + is ImmediateCapturer -> RecorderResponse.CapturedRecording + is RecordedCapturer -> RecorderResponse.RecordingStarting + + } } } @@ -139,6 +143,11 @@ sealed interface RecorderResponse { } } + object CapturedRecording : RecorderResponse { + override val message: String = "Captured Field!" + override val status: RecorderResponseStatus = RecorderResponseStatus.SUCCESS + } + object RecordingStarting : RecorderResponse { override val message: String = "Join the server to start recording!" override val status: RecorderResponseStatus = RecorderResponseStatus.SUCCESS diff --git a/plugin/src/main/kotlin/me/gabber235/typewriter/capture/capturers/ItemSnapshotCapturer.kt b/plugin/src/main/kotlin/me/gabber235/typewriter/capture/capturers/ItemSnapshotCapturer.kt new file mode 100644 index 0000000000..4c3dfd18d9 --- /dev/null +++ b/plugin/src/main/kotlin/me/gabber235/typewriter/capture/capturers/ItemSnapshotCapturer.kt @@ -0,0 +1,12 @@ +package me.gabber235.typewriter.capture.capturers + +import me.gabber235.typewriter.capture.ImmediateCapturer +import me.gabber235.typewriter.utils.Item +import me.gabber235.typewriter.utils.toItem +import org.bukkit.entity.Player + +class ItemSnapshotCapturer(override val title: String) : ImmediateCapturer { + override fun capture(player: Player): Item { + return player.inventory.itemInMainHand.toItem() + } +} \ No newline at end of file diff --git a/plugin/src/main/kotlin/me/gabber235/typewriter/entry/EntryListeners.kt b/plugin/src/main/kotlin/me/gabber235/typewriter/entry/EntryListeners.kt index 993d0efb9f..aaf27b121b 100644 --- a/plugin/src/main/kotlin/me/gabber235/typewriter/entry/EntryListeners.kt +++ b/plugin/src/main/kotlin/me/gabber235/typewriter/entry/EntryListeners.kt @@ -32,6 +32,7 @@ import kotlin.reflect.full.isSuperclassOf * fun onEntryCreated(event: PlayerInteractEvent, query: Query) { * // ... * } + * ``` * * IMPORTANT: The function must be static. */ diff --git a/plugin/src/main/kotlin/me/gabber235/typewriter/entry/EntryMigration.kt b/plugin/src/main/kotlin/me/gabber235/typewriter/entry/EntryMigration.kt new file mode 100644 index 0000000000..e8e3e2318b --- /dev/null +++ b/plugin/src/main/kotlin/me/gabber235/typewriter/entry/EntryMigration.kt @@ -0,0 +1,135 @@ +package me.gabber235.typewriter.entry + +import com.google.gson.Gson +import com.google.gson.JsonObject +import lirand.api.extensions.other.set +import lirand.api.utilities.allMethods +import me.gabber235.typewriter.adapters.AdapterLoader +import org.koin.core.qualifier.named +import org.koin.java.KoinJavaComponent.get +import java.lang.reflect.Method +import java.lang.reflect.Modifier +import kotlin.reflect.KClass +import kotlin.reflect.full.findAnnotations + +/** + * Annotate a function to let Typewriter know that it should be called when an entry needs to be migrated. + * + * The function must have the signature `(JsonObject, EntryMigratorContext) -> JsonObject`. + * + * Example: + * ```kotlin + * @EntryMigration(InventoryItemCountFact::class, "0.1.0") + * private fun migrate010(json: JsonObject, context: EntryMigratorContext): JsonObject { + * val data = JsonObject() + * data.keepProperties(json, "id", "name", "comment") + * + * val test = json.getAndParse>("test", context.gson).optional + * // ... + * return data + * } + * ``` + * + * IMPORTANT: The function must be static + */ +@Target(AnnotationTarget.FUNCTION) +annotation class EntryMigration(val klass: KClass, val version: String) + +class EntryMigratorContext(val gson: Gson) + +data class EntryMigrator( + val klass: KClass, + val version: SemanticVersion, + val migrator: (JsonObject, EntryMigratorContext) -> JsonObject, +) + +fun JsonObject.copyAllBut(from: JsonObject, vararg properties: String) { + from.entrySet().filter { it.key !in properties }.forEach { (key, value) -> + this[key] = value.deepCopy() + } +} + +inline fun JsonObject.getAndParse(name: String, gson: Gson): T? { + val element = this[name] ?: return null + return gson.fromJson(element, object : com.google.gson.reflect.TypeToken() {}.type) +} + +object EntryMigrations { + fun finaMaximalMigrationVersion(): SemanticVersion? { + val migrators = get(AdapterLoader::class.java).getEntryMigrators() + return migrators.maxOfOrNull { it.version } + } + + fun findMinimalNeededMigrationVersion(currentVersion: SemanticVersion): SemanticVersion? { + val migrators = get(AdapterLoader::class.java).getEntryMigrators() + return migrators.map { it.version }.filter { it > currentVersion }.minOrNull() + } + + fun findEntryMigrators(targetVersion: SemanticVersion): List> { + val migrators = get(AdapterLoader::class.java).getEntryMigrators() + return migrators.filter { it.version == targetVersion }.map { entryName(it.klass) to it } + } + + private fun entryName(klass: KClass): String { + val entry = klass.findAnnotations(me.gabber235.typewriter.adapters.Entry::class).firstOrNull() + ?: throw IllegalStateException("Entry ${klass.simpleName} does not have an @Entry annotation.") + return entry.name + } + + fun JsonObject.migrateEntriesForPage(migrators: List>) { + val gson = get(Gson::class.java, named("entryParser")) + val entries = getAsJsonArray("entries") ?: return + val newEntries = entries.map { entry -> + val entryObject = entry.asJsonObject + val type = entryObject["type"]?.asString ?: return@map entry + val entryMigrators = migrators.filter { it.first == type }.map { it.second } + if (entryMigrators.isEmpty()) { + return@map entry + } + + val context = EntryMigratorContext(gson) + + entryMigrators.fold(entryObject) { acc, migrator -> + migrator.migrator(acc, context) + } + } + + this["entries"] = newEntries.json + } + + + private fun constructEntryMigrator(method: Method): EntryMigrator { + val annotation = method.getAnnotation(EntryMigration::class.java) + + if (method.parameterCount != 2) { + throw EntryMigratorException(method, "has ${method.parameterCount} parameters.") + } + if (method.parameterTypes[0] != JsonObject::class.java) { + throw EntryMigratorException(method, "the first parameter is not JsonObject.") + } + if (method.parameterTypes[1] != EntryMigratorContext::class.java) { + throw EntryMigratorException(method, "the second parameter is not EntryMigratorContext.") + } + if (method.returnType != JsonObject::class.java) { + throw EntryMigratorException(method, "the return type is not JsonObject.") + } + + return EntryMigrator(annotation.klass, annotation.version.v) { json, context -> + method.isAccessible = true + method.invoke(null, json, context) as JsonObject + } + } + + fun constructEntryMigrators(classes: List>): List { + return classes.asSequence() + .flatMap { it.allMethods.asSequence() } + .filter { Modifier.isStatic(it.modifiers) } + .filter { it.isAnnotationPresent(EntryMigration::class.java) } + .map(::constructEntryMigrator) + .toList() + + } +} + +class EntryMigratorException(method: Method, comment: String) : + Exception("Entry migration method ${method.name} should have signature (JsonObject, EntryMigratorContext) -> JsonObject, but $comment.") diff --git a/plugin/src/main/kotlin/me/gabber235/typewriter/entry/PageMigrator.kt b/plugin/src/main/kotlin/me/gabber235/typewriter/entry/PageMigrator.kt index 21b1fed9da..ab9fe94c1f 100644 --- a/plugin/src/main/kotlin/me/gabber235/typewriter/entry/PageMigrator.kt +++ b/plugin/src/main/kotlin/me/gabber235/typewriter/entry/PageMigrator.kt @@ -1,24 +1,29 @@ package me.gabber235.typewriter.entry import com.google.gson.Gson +import com.google.gson.JsonElement import com.google.gson.JsonObject import com.google.gson.JsonPrimitive import lirand.api.extensions.other.set -import me.gabber235.typewriter.adapters.AdapterLoader +import me.gabber235.typewriter.entry.EntryMigrations.migrateEntriesForPage import me.gabber235.typewriter.logger import me.gabber235.typewriter.plugin import me.gabber235.typewriter.utils.get -import me.gabber235.typewriter.utils.logErrorIfNull -import org.koin.java.KoinJavaComponent.get import java.io.File import java.text.SimpleDateFormat import java.util.* -import kotlin.reflect.full.isSuperclassOf + + +data class PossibleMigration( + val file: File, + val version: SemanticVersion, +) + fun File.pages(): Array = listFiles { _, name -> name.endsWith(".json") } ?: emptyArray() fun File.migrateIfNecessary(run: Int = 0) { - val highestMigratorVersion = migrators.keys.maxOrNull() ?: return + val highestMigratorVersion = EntryMigrations.finaMaximalMigrationVersion() ?: return val migratable = pages().mapNotNull { file -> if (!file.exists()) { return@mapNotNull null @@ -26,14 +31,14 @@ fun File.migrateIfNecessary(run: Int = 0) { val content = file.readText() val json = Gson().fromJson(content, JsonObject::class.java) - val version = json.getAsJsonPrimitive("version")?.asString ?: "0.0.0" - val semanticVersion = SemanticVersion.fromString(version) + val pageVersion = json.getAsJsonPrimitive("version")?.asString ?: "0.0.0" + val semanticVersion = SemanticVersion.fromString(pageVersion) if (semanticVersion >= highestMigratorVersion) { return@mapNotNull null } - return@mapNotNull file to semanticVersion + return@mapNotNull PossibleMigration(file, semanticVersion) } if (migratable.isEmpty()) { @@ -55,20 +60,26 @@ fun File.migrateIfNecessary(run: Int = 0) { """.trimMargin() ) - migratable.map { it.first }.backup() + migratable.map { it.file }.backup() } - val lowestVersion = migratable.minBy { it.second }.second + val lowestPageVersion = migratable.minBy { it.version }.version + val lowestMigratorVersion = EntryMigrations.findMinimalNeededMigrationVersion(lowestPageVersion) + ?: throw IllegalStateException("Could not find a migration for version $lowestPageVersion") - val migrating = migratable.filter { it.second == lowestVersion } + val migrators = EntryMigrations.findEntryMigrators(lowestMigratorVersion) - val migrator = migrators.filter { it.key > lowestVersion }.minByOrNull { it.key }?.value - ?: throw IllegalStateException("No migrator found for version $lowestVersion") + val migrating = migratable.filter { it.version == lowestPageVersion }.map { it.file } - migrating.forEach { (file, _) -> - file.migrator() + migrating.forEach { file -> + val content = file.readText() + val json = Gson().fromJson(content, JsonObject::class.java) + json.migrateEntriesForPage(migrators) + json["version"] = lowestMigratorVersion.toString().json + file.writeText(Gson().toJson(json)) } + /// Recursively call this function until all files are migrated migrateIfNecessary(run + 1) } @@ -90,80 +101,10 @@ fun List.backup() { } } -private val migrators by lazy { - mutableMapOf Unit>( - "0.3.0".v to File::migrate0_3_0, - ) -} - -private fun File.migrate0_3_0() { - val content = readText() - val json = Gson().fromJson(content, JsonObject::class.java) - val name = json.getAsJsonPrimitive("name")?.asString ?: "unnamed_${UUID.randomUUID().toString().substring(0, 5)}" - - json["type"] = "sequence".json - json["version"] = "0.3.0".json - - val entries = json.getAsJsonArray("entries") - - val staticEntries = entries.mapNotNull { entry -> - val entryJson = entry.asJsonObject - val needsExtracting = entryJson.needsStaticExtractingForV0_3_0() - if (needsExtracting) entryJson - else null - } - - if (staticEntries.isEmpty()) { - writeText(json.toString()) - return - } - - - // Extract static entries to their own page - val newStaticPage = JsonObject().apply { - addProperty("name", "${name}_static") - addProperty("type", "static") - addProperty("version", "0.3.0") - add("entries", Gson().toJsonTree(staticEntries)) - } - - if (entries.size() == staticEntries.size) { - // All entries are static, just replace the page with the static page - writeText(newStaticPage.apply { - addProperty("name", name) - }.toString()) - return - } - - // Remove static entries from the original page - staticEntries.forEach { entries.remove(it) } - - writeText(json.toString()) - - // Write the newly created static page - val staticPageFile = parentFile["${name}_static.json"] - staticPageFile.writeText(newStaticPage.toString()) -} - -private fun JsonObject.needsStaticExtractingForV0_3_0(): Boolean { - val type = getAsJsonPrimitive("type")?.asString ?: return false - - val blueprint = get(AdapterLoader::class.java).getEntryBlueprint(type).logErrorIfNull( - """ - | ------ ERROR IN MIGRATION ------ - |Failed to get blueprint for type $type while running the migration. - | - |Make sure you install all the needed adapters to properly migrate your pages! - | --------------------------------- - """.trimMargin() - ) ?: return false - - return StaticEntry::class.isSuperclassOf(blueprint.clazz.kotlin) -} - -private val String.json get() = JsonPrimitive(this) +internal val String.json get() = JsonPrimitive(this) +internal val List.json get() = Gson().toJsonTree(this) -private val String.v get() = SemanticVersion.fromString(this) +internal val String.v get() = SemanticVersion.fromString(this) data class SemanticVersion( val major: Int, @@ -186,4 +127,8 @@ data class SemanticVersion( } return patch - other.patch } + + override fun toString(): String { + return "$major.$minor.$patch" + } } \ No newline at end of file diff --git a/plugin/src/main/kotlin/me/gabber235/typewriter/utils/Extensions.kt b/plugin/src/main/kotlin/me/gabber235/typewriter/utils/Extensions.kt index 6aa69385c3..273ba97675 100644 --- a/plugin/src/main/kotlin/me/gabber235/typewriter/utils/Extensions.kt +++ b/plugin/src/main/kotlin/me/gabber235/typewriter/utils/Extensions.kt @@ -8,6 +8,7 @@ import org.geysermc.floodgate.api.FloodgateApi import org.koin.java.KoinJavaComponent.get import java.io.File import java.time.Duration +import java.util.* import kotlin.math.round operator fun File.get(name: String): File = File(this, name) @@ -53,4 +54,8 @@ fun Float.round(decimals: Int): Float { repeat(decimals) { multiplier *= 10 } return (round(this * multiplier) / multiplier).toFloat() -} \ No newline at end of file +} + + +val Optional?.optional: Optional get() = Optional.ofNullable(this?.orElse(null)) +val T?.optional: Optional get() = Optional.ofNullable(this) \ No newline at end of file diff --git a/plugin/src/main/kotlin/me/gabber235/typewriter/utils/Item.kt b/plugin/src/main/kotlin/me/gabber235/typewriter/utils/Item.kt index 8513baf15c..e43a560f16 100644 --- a/plugin/src/main/kotlin/me/gabber235/typewriter/utils/Item.kt +++ b/plugin/src/main/kotlin/me/gabber235/typewriter/utils/Item.kt @@ -1,18 +1,18 @@ package me.gabber235.typewriter.utils -import lirand.api.extensions.inventory.ItemStack import lirand.api.extensions.inventory.meta import lirand.api.nbt.NbtData import lirand.api.nbt.tagNbtData import me.gabber235.typewriter.adapters.modifiers.* import me.gabber235.typewriter.extensions.placeholderapi.parsePlaceholders -import me.gabber235.typewriter.utils.Item.Empty.lore import org.bukkit.Material import org.bukkit.entity.Player import org.bukkit.inventory.ItemFlag import org.bukkit.inventory.ItemStack import org.bukkit.inventory.meta.ItemMeta import java.util.* +import kotlin.contracts.ExperimentalContracts +import kotlin.contracts.contract open class Item( @MaterialProperties(MaterialProperty.ITEM) @@ -79,7 +79,12 @@ open class Item( return item } - fun isSameAs(player: Player?, item: ItemStack): Boolean { + @OptIn(ExperimentalContracts::class) + fun isSameAs(player: Player?, item: ItemStack?): Boolean { + contract { + returns(true) implies (item != null) + } + if (item == null) return false if (material.isPresent && item.type != material.get()) return false if (amount.isPresent && item.amount != amount.get()) return false if (name.isPresent && item.itemMeta?.displayName() != name.get().parsePlaceholders(player) @@ -97,13 +102,14 @@ open class Item( } fun ItemStack.toItem(): Item { + val nbt = tagNbtData return Item( material = Optional.ofNullable(type), amount = Optional.ofNullable(amount), name = Optional.ofNullable(itemMeta?.displayName()?.asMini()), lore = Optional.ofNullable(itemMeta?.lore()?.joinToString("\n") { it.asMini() }), // enchantments = Optional.ofNullable(itemMeta?.enchants), - flags = Optional.ofNullable(itemMeta?.itemFlags?.toList()), - nbt = Optional.ofNullable(tagNbtData.toString()), + flags = if (itemMeta?.itemFlags?.isNotEmpty() == true) Optional.ofNullable(itemMeta?.itemFlags?.toList()) else Optional.empty(), + nbt = if (nbt.keys.isNotEmpty()) Optional.ofNullable(nbt.toString()) else Optional.empty(), ) } \ No newline at end of file diff --git a/version.txt b/version.txt index d15723fbe8..60a2d3e96c 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.3.2 +0.4.0 \ No newline at end of file