diff --git a/CMakeLists.txt b/CMakeLists.txt index eb8fc66..8617eba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,34 +2,24 @@ cmake_minimum_required(VERSION 3.15) cmake_policy(SET CMP0091 NEW) cmake_policy(SET CMP0042 NEW) project(image) - +include_directories(${CMAKE_JS_INC}) file(GLOB SOURCE_FILES "natives/*.cc" "natives/*.h") - -if (CMAKE_JS_VERSION) - include_directories(${CMAKE_JS_INC}) - add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC} natives/node/image.cc) - set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node") - target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB}) -else() - add_executable(${PROJECT_NAME} ${SOURCE_FILES} natives/cli/image.cc) -endif() - +add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC}) +set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node") +target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB}) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) - if(MSVC) # todo: change flags for more parity with GCC/clang, I don't know much about MSVC so pull requests are open - set(CMAKE_CXX_FLAGS "/Wall /EHsc /GS") - set(CMAKE_CXX_FLAGS_DEBUG "/Zi") - set(CMAKE_CXX_FLAGS_RELEASE "/Ox") - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - set(BUILD_SHARED_LIBS TRUE) +set(CMAKE_CXX_FLAGS "/Wall /EHsc /GS") +set(CMAKE_CXX_FLAGS_DEBUG "/Zi") +set(CMAKE_CXX_FLAGS_RELEASE "/Ox") +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +set(BUILD_SHARED_LIBS TRUE) else() - set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror=format-security -Wno-cast-function-type -fexceptions -D_GLIBCXX_ASSERTIONS -fstack-clash-protection -pedantic -D_GLIBCXX_USE_CXX11_ABI=1") - set(CMAKE_CXX_FLAGS_DEBUG "-g") - set(CMAKE_CXX_FLAGS_RELEASE "-O2") +set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror=format-security -Wno-cast-function-type -fexceptions -D_GLIBCXX_ASSERTIONS -fstack-clash-protection -pedantic -D_GLIBCXX_USE_CXX11_ABI=1") +set(CMAKE_CXX_FLAGS_DEBUG "-g") +set(CMAKE_CXX_FLAGS_RELEASE "-O3") endif() -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - find_package(ImageMagick REQUIRED COMPONENTS Magick++ MagickCore) add_definitions(-DMAGICKCORE_QUANTUM_DEPTH=16) add_definitions(-DMAGICKCORE_HDRI_ENABLE=0) @@ -41,7 +31,7 @@ include_directories(${VIPS_INCLUDE_DIRS}) link_directories(${VIPS_LIBRARY_DIRS}) target_link_libraries(${PROJECT_NAME} ${VIPS_LDFLAGS}) -if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET AND CMAKE_JS_VERSION) +if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET) # Generate node.lib execute_process(COMMAND ${CMAKE_AR} /def:${CMAKE_JS_NODELIB_DEF} /out:${CMAKE_JS_NODELIB_TARGET} ${CMAKE_STATIC_LINKER_FLAGS}) endif() diff --git a/application.yml b/application.yml index 96c4464..744b708 100644 --- a/application.yml +++ b/application.yml @@ -28,7 +28,7 @@ lavalink: plugins: - dependency: "com.github.esmBot:lava-xm-plugin:v0.2.1" repository: "https://jitpack.io" - - dependency: "com.github.TopiSenpai.LavaSrc:lavasrc-plugin:3.2.0" + - dependency: "com.github.TopiSenpai.LavaSrc:lavasrc-plugin:3.1.7" repository: "https://jitpack.io" plugins: diff --git a/assets/images/scottmap.png b/assets/images/scottmap.png deleted file mode 100644 index f57e04e..0000000 Binary files a/assets/images/scottmap.png and /dev/null differ diff --git a/classes/imageCommand.js b/classes/imageCommand.js index 554a17b..a9ba426 100644 --- a/classes/imageCommand.js +++ b/classes/imageCommand.js @@ -25,9 +25,7 @@ class ImageCommand extends Command { const imageParams = { cmd: this.constructor.command, - params: { - togif: !!this.options.togif - }, + params: {}, id: (this.interaction ?? this.message).id }; @@ -131,11 +129,6 @@ class ImageCommand extends Command { description: "An image/GIF URL" }); } - this.flags.push({ - name: "togif", - type: 5, - description: "Force GIF output" - }); return this; } diff --git a/commands/general/eval.js b/commands/general/eval.js index 62b0e1f..64e3bea 100644 --- a/commands/general/eval.js +++ b/commands/general/eval.js @@ -17,11 +17,9 @@ class EvalCommand extends Command { const sendString = `\`\`\`js\n${cleaned}\n\`\`\``; if (sendString.length >= 2000) { return { - content: "The result was too large, so here it is as a file:", - files: [{ - contents: cleaned, - name: "result.txt" - }] + text: "The result was too large, so here it is as a file:", + file: cleaned, + name: "result.txt" }; } else { return sendString; diff --git a/commands/general/restart.js b/commands/general/restart.js index a39cf2a..5f4c496 100644 --- a/commands/general/restart.js +++ b/commands/general/restart.js @@ -7,7 +7,7 @@ class RestartCommand extends Command { this.success = false; return "Only the bot owner can restart me!"; } - await this.channel.createMessage(Object.assign({ + await this.message.channel.createMessage(Object.assign({ content: "esmBot is restarting." }, this.reference)); process.exit(1); diff --git a/commands/image-editing/explode.js b/commands/image-editing/explode.js index 63168f4..a03bda2 100644 --- a/commands/image-editing/explode.js +++ b/commands/image-editing/explode.js @@ -1,6 +1,10 @@ import ImageCommand from "../../classes/imageCommand.js"; class ExplodeCommand extends ImageCommand { + params = { + amount: -1 + }; + static description = "Explodes an image"; static aliases = ["exp"]; diff --git a/commands/image-editing/implode.js b/commands/image-editing/implode.js index 1f05b2e..60f9909 100644 --- a/commands/image-editing/implode.js +++ b/commands/image-editing/implode.js @@ -2,7 +2,7 @@ import ImageCommand from "../../classes/imageCommand.js"; class ImplodeCommand extends ImageCommand { params = { - implode: true + amount: 1 }; static description = "Implodes an image"; diff --git a/config/messages.json b/config/messages.json index 4c6f16f..d6d5d25 100644 --- a/config/messages.json +++ b/config/messages.json @@ -128,6 +128,7 @@ "$19 Fortnite Card", "Wild Woody", "RDI Halcyon", + "cry about it", "KFC", "Cave Story", "YouTube ads", @@ -158,6 +159,7 @@ "Item Asylum", "TIC-80", "Ghetto Smosh", + "brought to you by the DFS project", "Splatoon 3", "changed", "Chutes and Ladders", @@ -194,9 +196,6 @@ "ANTONBLAST", "[object Object]", "Xonotic", - "Lario", - "Hi-Fi Rush", - "Calckey", "The clock is ticking." ] } diff --git a/docs/custom-commands.md b/docs/custom-commands.md index 2cce3e9..1b8b1e7 100644 --- a/docs/custom-commands.md +++ b/docs/custom-commands.md @@ -22,7 +22,7 @@ As you can see, each command is grouped into categories, which are represented b !!! tip The `message` category is special; commands in here act as right-click context menu message commands instead of "classic" or slash commands. -## Command Structure +## Commnand Structure It's recommended to use the `Command` class located in `classes/command.js` to create a new command in most cases. This class provides various parameters and fields that will likely be useful when creating a command. Here is a simple example of a working command file: ```js import Command from "../../classes/command.js"; diff --git a/events/guildCreate.js b/events/guildCreate.js deleted file mode 100644 index f63ca10..0000000 --- a/events/guildCreate.js +++ /dev/null @@ -1,6 +0,0 @@ -import { log } from "../utils/logger.js"; - -// run when the bot is added to a guild -export default async (client, guild) => { - log(`[GUILD JOIN] ${guild.name} (${guild.id}) added the bot.`); -}; diff --git a/events/voiceChannelLeave.js b/events/voiceChannelLeave.js index 00e8fdf..137b21b 100644 --- a/events/voiceChannelLeave.js +++ b/events/voiceChannelLeave.js @@ -1,7 +1,6 @@ import { players, queues, skipVotes } from "../utils/soundplayer.js"; import AwaitRejoin from "../utils/awaitrejoin.js"; import { random } from "../utils/misc.js"; -import { logger } from "../utils/logger.js"; const isWaiting = new Map(); @@ -17,10 +16,9 @@ export default async (client, member, oldChannel) => { content: "🔊 Waiting 10 seconds for someone to return..." }); const awaitRejoin = new AwaitRejoin(oldChannel, true, member.id); - awaitRejoin.once("end", async (rejoined, newMember, cancel) => { + awaitRejoin.on("end", async (rejoined, newMember) => { isWaiting.delete(oldChannel.id); if (rejoined) { - if (cancel) return; connection.player.setPaused(false); if (member.id !== newMember.id) { players.set(connection.voiceChannel.guildID, { player: connection.player, type: connection.type, host: newMember.id, voiceChannel: connection.voiceChannel, originalChannel: connection.originalChannel, loop: connection.loop, shuffle: connection.shuffle, playMessage: connection.playMessage }); @@ -31,20 +29,19 @@ export default async (client, member, oldChannel) => { try { await waitMessage.delete(); } catch { - logger.warn(`Failed to delete wait message ${waitMessage.id}`); + // no-op } } } else { try { if (waitMessage.channel.messages.has(waitMessage.id)) await waitMessage.delete(); } catch { - logger.warn(`Failed to delete wait message ${waitMessage.id}`); + // no-op } - if (cancel) return; try { connection.player.node.leaveChannel(connection.originalChannel.guildID); } catch { - logger.warn(`Failed to leave voice channel ${connection.originalChannel.guildID}`); + // no-op } players.delete(connection.originalChannel.guildID); queues.delete(connection.originalChannel.guildID); @@ -61,13 +58,13 @@ export default async (client, member, oldChannel) => { content: "🔊 Waiting 10 seconds for the host to return..." }); const awaitRejoin = new AwaitRejoin(oldChannel, false, member.id); - awaitRejoin.once("end", async (rejoined) => { + awaitRejoin.on("end", async (rejoined) => { isWaiting.delete(oldChannel.id); if (rejoined) { try { if (waitMessage.channel.messages.has(waitMessage.id)) await waitMessage.delete(); } catch { - logger.warn(`Failed to delete wait message ${waitMessage.id}`); + // no-op } } else { const members = oldChannel.voiceMembers.filter((i) => i.id !== client.user.id && !i.bot); @@ -75,12 +72,12 @@ export default async (client, member, oldChannel) => { try { if (waitMessage.channel.messages.has(waitMessage.id)) await waitMessage.delete(); } catch { - logger.warn(`Failed to delete wait message ${waitMessage.id}`); + // no-op } try { connection.player.node.leaveChannel(connection.originalChannel.guildID); } catch { - logger.warn(`Failed to leave voice channel ${connection.originalChannel.guildID}`); + // no-op } players.delete(connection.originalChannel.guildID); queues.delete(connection.originalChannel.guildID); @@ -102,7 +99,7 @@ export default async (client, member, oldChannel) => { try { connection.player.node.leaveChannel(connection.originalChannel.guildID); } catch { - logger.warn(`Failed to leave voice channel ${connection.originalChannel.guildID}`); + // no-op } players.delete(connection.originalChannel.guildID); queues.delete(connection.originalChannel.guildID); diff --git a/mkdocs.yml b/mkdocs.yml index 7f68add..b283150 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -2,7 +2,7 @@ site_name: esmBot docs_dir: docs/ repo_name: 'esmBot/esmBot' repo_url: 'https://github.com/esmBot/esmBot' -copyright: Copyright © 2018 - 2023 Essem +copyright: Copyright © 2018 - 2022 Essem nav: - Home: index.md - setup.md diff --git a/natives/blur.cc b/natives/blur.cc index 5347f8e..8cdebd4 100644 --- a/natives/blur.cc +++ b/natives/blur.cc @@ -7,14 +7,14 @@ using namespace std; using namespace vips; -char *Blur(string type, string *outType, char *BufferData, size_t BufferLength, +char *Blur(string *type, char *BufferData, size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { bool sharp = GetArgument(Arguments, "sharp"); VOption *options = VImage::option()->set("access", "sequential"); VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -25,7 +25,7 @@ char *Blur(string type, string *outType, char *BufferData, size_t BufferLength, sharp ? in.sharpen(VImage::option()->set("sigma", 3)) : in.gaussblur(15); void *buf; - out.write_to_buffer(("." + *outType).c_str(), &buf, DataSize); + out.write_to_buffer(("." + *type).c_str(), &buf, DataSize); return (char *)buf; } diff --git a/natives/blur.h b/natives/blur.h index 4f4b96d..8b017e2 100644 --- a/natives/blur.h +++ b/natives/blur.h @@ -4,5 +4,5 @@ using std::string; -char* Blur(string type, string* outType, char* BufferData, size_t BufferLength, +char* Blur(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/bounce.cc b/natives/bounce.cc index e0d27a7..7faad55 100644 --- a/natives/bounce.cc +++ b/natives/bounce.cc @@ -7,29 +7,28 @@ using namespace std; using namespace vips; -char *Bounce(string type, string *outType, char *BufferData, - size_t BufferLength, [[maybe_unused]] ArgumentMap Arguments, - size_t *DataSize) { +char *Bounce(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { VOption *options = VImage::option(); VImage in = VImage::new_from_buffer( BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1)->set("access", "sequential") - : options) + *type == "gif" ? options->set("n", -1)->set("access", "sequential") + : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); int width = in.width(); int pageHeight = vips_image_get_page_height(in.get_image()); - int nPages = type == "gif" ? vips_image_get_n_pages(in.get_image()) : 15; + int nPages = *type == "gif" ? vips_image_get_n_pages(in.get_image()) : 15; double mult = M_PI / nPages; int halfHeight = pageHeight / 2; vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; double height = halfHeight * ((abs(sin(i * mult)) * -1) + 1); VImage embedded = img_frame.embed(0, height, width, pageHeight + halfHeight); @@ -37,7 +36,7 @@ char *Bounce(string type, string *outType, char *BufferData, } VImage final = VImage::arrayjoin(img, VImage::option()->set("across", 1)); final.set(VIPS_META_PAGE_HEIGHT, pageHeight + halfHeight); - if (type != "gif") { + if (*type != "gif") { vector delay(30, 50); final.set("delay", delay); } @@ -45,7 +44,7 @@ char *Bounce(string type, string *outType, char *BufferData, void *buf; final.write_to_buffer(".gif", &buf, DataSize); - *outType = "gif"; + *type = "gif"; return (char *)buf; } \ No newline at end of file diff --git a/natives/bounce.h b/natives/bounce.h index 0ea273a..44a329f 100644 --- a/natives/bounce.h +++ b/natives/bounce.h @@ -4,5 +4,5 @@ using std::string; -char* Bounce(string type, string* outType, char* BufferData, size_t BufferLength, +char* Bounce(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/caption.cc b/natives/caption.cc index 1979c4f..d1824af 100644 --- a/natives/caption.cc +++ b/natives/caption.cc @@ -6,8 +6,8 @@ using namespace std; using namespace vips; -char *Caption(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Caption(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { string caption = GetArgument(Arguments, "caption"); string font = GetArgument(Arguments, "font"); string basePath = GetArgument(Arguments, "basePath"); @@ -16,7 +16,7 @@ char *Caption(string type, string *outType, char *BufferData, VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -57,7 +57,7 @@ char *Caption(string type, string *outType, char *BufferData, vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; VImage frame = captionImage.join( img_frame, VIPS_DIRECTION_VERTICAL, VImage::option()->set("background", 0xffffff)->set("expand", true)); @@ -68,10 +68,9 @@ char *Caption(string type, string *outType, char *BufferData, void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" - ? VImage::option()->set("dither", 0)->set("reoptimise", 1) - : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) + : 0); return (char *)buf; } diff --git a/natives/caption.h b/natives/caption.h index 6ff73c1..a84ccb1 100644 --- a/natives/caption.h +++ b/natives/caption.h @@ -4,5 +4,5 @@ using std::string; -char* Caption(string type, string* outType, char* BufferData, size_t BufferLength, +char* Caption(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/caption2.cc b/natives/caption2.cc index 0b9026e..a7bf181 100644 --- a/natives/caption2.cc +++ b/natives/caption2.cc @@ -7,8 +7,8 @@ using namespace std; using namespace vips; -char *CaptionTwo(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *CaptionTwo(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { bool top = GetArgument(Arguments, "top"); string caption = GetArgument(Arguments, "caption"); string font = GetArgument(Arguments, "font"); @@ -18,7 +18,7 @@ char *CaptionTwo(string type, string *outType, char *BufferData, VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -58,7 +58,7 @@ char *CaptionTwo(string type, string *outType, char *BufferData, vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; VImage frame = (top ? captionImage : img_frame) .join(top ? img_frame : captionImage, VIPS_DIRECTION_VERTICAL, @@ -72,10 +72,9 @@ char *CaptionTwo(string type, string *outType, char *BufferData, void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" - ? VImage::option()->set("dither", 0)->set("reoptimise", 1) - : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) + : 0); return (char *)buf; } diff --git a/natives/caption2.h b/natives/caption2.h index 6ee4790..d45e2d2 100644 --- a/natives/caption2.h +++ b/natives/caption2.h @@ -4,5 +4,5 @@ using std::string; -char* CaptionTwo(string type, string* outType, char* BufferData, size_t BufferLength, +char* CaptionTwo(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/circle.cc b/natives/circle.cc index 96a1768..3834be3 100644 --- a/natives/circle.cc +++ b/natives/circle.cc @@ -11,9 +11,8 @@ using namespace std; using namespace Magick; -char *Circle(string type, string *outType, char *BufferData, - size_t BufferLength, [[maybe_unused]] ArgumentMap Arguments, - size_t *DataSize) { +char *Circle(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { Blob blob; list frames; @@ -30,13 +29,13 @@ char *Circle(string type, string *outType, char *BufferData, for (Image &image : coalesced) { image.rotationalBlur(10); - image.magick(*outType); + image.magick(*type); blurred.push_back(image); } optimizeTransparency(blurred.begin(), blurred.end()); - if (*outType == "gif") { + if (*type == "gif") { for (Image &image : blurred) { image.quantizeDitherMethod(FloydSteinbergDitherMethod); image.quantize(); diff --git a/natives/circle.h b/natives/circle.h index 4ee7f96..283ca79 100644 --- a/natives/circle.h +++ b/natives/circle.h @@ -4,5 +4,5 @@ using std::string; -char* Circle(string type, string* outType, char* BufferData, size_t BufferLength, +char* Circle(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/cli/image.cc b/natives/cli/image.cc deleted file mode 100644 index 344d0bb..0000000 --- a/natives/cli/image.cc +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -#include "../common.h" - -void showUsage(char *path) { - std::cout << "Usage: " << path << " operation [--arg=\"param\"] [...]" << std::endl; -} - -int main(int argc, char *argv[]) { - if (argc < 1 || - (argc == 1 && !strcmp(argv[1], "-h"))) { - showUsage(argv[0]); -#ifdef _WIN32 - system("PAUSE"); -#endif - return 1; - } - - char *op = argv[1]; - - //handleArguments(argc, argv); - - std::cout << "This does nothing yet, but it might in the future!" << std::endl; - return 0; -} \ No newline at end of file diff --git a/natives/colors.cc b/natives/colors.cc index b488600..6c8fa62 100644 --- a/natives/colors.cc +++ b/natives/colors.cc @@ -10,15 +10,15 @@ using namespace vips; VImage sepia = VImage::new_matrixv(3, 3, 0.3588, 0.7044, 0.1368, 0.2990, 0.5870, 0.1140, 0.2392, 0.4696, 0.0912); -char *Colors(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Colors(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { string color = GetArgument(Arguments, "color"); VOption *options = VImage::option()->set("access", "sequential"); VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); VImage out; @@ -30,7 +30,7 @@ char *Colors(string type, string *outType, char *BufferData, } void *buf; - out.write_to_buffer(("." + *outType).c_str(), &buf, DataSize); + out.write_to_buffer(("." + *type).c_str(), &buf, DataSize); return (char *)buf; } diff --git a/natives/colors.h b/natives/colors.h index 4d00d0b..d0bddf5 100644 --- a/natives/colors.h +++ b/natives/colors.h @@ -4,5 +4,5 @@ using std::string; -char* Colors(string type, string* outType, char* BufferData, size_t BufferLength, +char* Colors(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/common.h b/natives/common.h index 1d71efb..2099433 100644 --- a/natives/common.h +++ b/natives/common.h @@ -12,46 +12,6 @@ using std::variant; typedef variant ArgumentVariant; typedef map ArgumentMap; -#include "blur.h" -#include "bounce.h" -#include "caption.h" -#include "caption2.h" -#include "circle.h" -#include "colors.h" -#include "crop.h" -#include "deepfry.h" -#include "explode.h" -#include "flag.h" -#include "flip.h" -#include "freeze.h" -#include "gamexplain.h" -#include "globe.h" -#include "homebrew.h" -#include "invert.h" -#include "jpeg.h" -#include "magik.h" -#include "meme.h" -#include "mirror.h" -#include "motivate.h" -#include "reddit.h" -#include "resize.h" -#include "reverse.h" -#include "scott.h" -#include "snapchat.h" -#include "sonic.h" -#include "speed.h" -#include "spin.h" -#include "squish.h" -#include "swirl.h" -#include "tile.h" -#include "togif.h" -#include "uncanny.h" -#include "uncaption.h" -#include "wall.h" -#include "watermark.h" -#include "whisper.h" -#include "zamn.h" - template T GetArgument(ArgumentMap map, string key) { try { @@ -82,49 +42,4 @@ T GetArgumentWithFallback(ArgumentMap map, string key, T fallback) { const std::unordered_map fontPaths{ {"futura", "assets/fonts/caption.otf"}, {"helvetica", "assets/fonts/caption2.ttf"}, - {"roboto", "assets/fonts/reddit.ttf"}}; - -const std::map - FunctionMap = {{"blur", &Blur}, - {"bounce", &Bounce}, - {"caption", &Caption}, - {"captionTwo", &CaptionTwo}, - {"circle", &Circle}, - {"colors", &Colors}, - {"crop", &Crop}, - {"deepfry", &Deepfry}, - {"explode", &Explode}, - {"flag", &Flag}, - {"flip", &Flip}, - {"freeze", &Freeze}, - {"gamexplain", Gamexplain}, - {"globe", Globe}, - {"invert", Invert}, - {"jpeg", Jpeg}, - {"magik", Magik}, - {"meme", Meme}, - {"mirror", Mirror}, - {"motivate", Motivate}, - {"reddit", Reddit}, - {"resize", Resize}, - {"reverse", Reverse}, - {"scott", Scott}, - {"snapchat", Snapchat}, - {"speed", &Speed}, - {"spin", Spin}, - {"squish", Squish}, - {"swirl", Swirl}, - {"tile", Tile}, - {"togif", ToGif}, - {"uncanny", Uncanny}, - {"uncaption", &Uncaption}, - {"wall", Wall}, - {"watermark", &Watermark}, - {"whisper", Whisper}, - {"zamn", Zamn}}; - -const std::map - NoInputFunctionMap = {{"homebrew", Homebrew}, {"sonic", Sonic}}; \ No newline at end of file + {"roboto", "assets/fonts/reddit.ttf"}}; \ No newline at end of file diff --git a/natives/crop.cc b/natives/crop.cc index 9faba5b..07cbad5 100644 --- a/natives/crop.cc +++ b/natives/crop.cc @@ -7,13 +7,13 @@ using namespace std; using namespace vips; -char *Crop(string type, string *outType, char *BufferData, size_t BufferLength, - [[maybe_unused]] ArgumentMap Arguments, size_t *DataSize) { +char *Crop(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { VOption *options = VImage::option()->set("access", "sequential"); VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); int width = in.width(); @@ -24,7 +24,7 @@ char *Crop(string type, string *outType, char *BufferData, size_t BufferLength, int finalHeight = 0; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; int frameWidth = img_frame.width(); int frameHeight = img_frame.height(); bool widthOrHeight = frameWidth / frameHeight >= 1; @@ -42,10 +42,9 @@ char *Crop(string type, string *outType, char *BufferData, size_t BufferLength, void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" - ? VImage::option()->set("dither", 0)->set("reoptimise", 1) - : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) + : 0); return (char *)buf; } \ No newline at end of file diff --git a/natives/crop.h b/natives/crop.h index c7cad96..439b4d1 100644 --- a/natives/crop.h +++ b/natives/crop.h @@ -4,5 +4,5 @@ using std::string; -char* Crop(string type, string* outType, char* BufferData, size_t BufferLength, +char* Crop(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/deepfry.cc b/natives/deepfry.cc index 9fe72a0..dce5b97 100644 --- a/natives/deepfry.cc +++ b/natives/deepfry.cc @@ -6,14 +6,13 @@ using namespace std; using namespace vips; -char *Deepfry(string type, string *outType, char *BufferData, - size_t BufferLength, [[maybe_unused]] ArgumentMap Arguments, - size_t *DataSize) { +char *Deepfry(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { VOption *options = VImage::option()->set("access", "sequential"); VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -26,7 +25,7 @@ char *Deepfry(string type, string *outType, char *BufferData, VImage fried = (in * 1.3 - (255.0 * 1.3 - 255.0)) * 1.5; VImage final; - if (totalHeight > 65500 && type == "gif") { + if (totalHeight > 65500 && *type == "gif") { vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = in.crop(0, i * pageHeight, width, pageHeight); @@ -49,13 +48,13 @@ char *Deepfry(string type, string *outType, char *BufferData, VImage::option()->set("Q", 1)->set("strip", true)); final = VImage::new_from_buffer(jpgBuf, jpgLength, ""); final.set(VIPS_META_PAGE_HEIGHT, pageHeight); - if (type == "gif") final.set("delay", fried.get_array_int("delay")); + if (*type == "gif") final.set("delay", fried.get_array_int("delay")); } void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" ? VImage::option()->set("dither", 0) : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0) : 0); return (char *)buf; } \ No newline at end of file diff --git a/natives/deepfry.h b/natives/deepfry.h index 9196438..00cc403 100644 --- a/natives/deepfry.h +++ b/natives/deepfry.h @@ -4,5 +4,5 @@ using std::string; -char* Deepfry(string type, string* outType, char* BufferData, size_t BufferLength, +char* Deepfry(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/explode.cc b/natives/explode.cc index bc167e0..4d6d42c 100644 --- a/natives/explode.cc +++ b/natives/explode.cc @@ -1,52 +1,58 @@ -#include - #include "common.h" +#include + +#include +#include +#include +#include +#include + using namespace std; -using namespace vips; +using namespace Magick; -char *Explode(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { - bool implode = GetArgument(Arguments, "implode"); - string basePath = GetArgument(Arguments, "basePath"); +char *Explode(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { - VOption *options = VImage::option(); + int amount = GetArgument(Arguments, "amount"); + int delay = GetArgumentWithFallback(Arguments, "delay", 0); - VImage in = - VImage::new_from_buffer( - BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1)->set("access", "sequential") - : options) - .colourspace(VIPS_INTERPRETATION_sRGB); - if (!in.has_alpha()) in = in.bandjoin(255); + Blob blob; - int width = in.width(); - int pageHeight = vips_image_get_page_height(in.get_image()); - int nPages = vips_image_get_n_pages(in.get_image()); - - string distortPath = basePath + "assets/images/" + - (implode ? "linearimplode.png" : "linearexplode.png"); - VImage distort = - (VImage::new_from_file(distortPath.c_str()) - .resize(width / 500.0, VImage::option() - ->set("vscale", pageHeight / 500.0) - ->set("kernel", VIPS_KERNEL_CUBIC)) / - 65535); - - VImage distortImage = (distort[0] * width).bandjoin(distort[1] * pageHeight); - - vector img; - for (int i = 0; i < nPages; i++) { - VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; - VImage mapped = img_frame.mapim(distortImage); - img.push_back(mapped); + list frames; + list coalesced; + list blurred; + try { + readImages(&frames, Blob(BufferData, BufferLength)); + } catch (Magick::WarningCoder &warning) { + cerr << "Coder Warning: " << warning.what() << endl; + } catch (Magick::Warning &warning) { + cerr << "Warning: " << warning.what() << endl; } - VImage final = VImage::arrayjoin(img, VImage::option()->set("across", 1)); - final.set(VIPS_META_PAGE_HEIGHT, pageHeight); + coalesceImages(&coalesced, frames.begin(), frames.end()); - void *buf; - final.write_to_buffer(("." + *outType).c_str(), &buf, DataSize); + for (Image &image : coalesced) { + image.implode(amount); + image.magick(*type); + blurred.push_back(image); + } - return (char *)buf; + optimizeTransparency(blurred.begin(), blurred.end()); + + if (*type == "gif") { + for (Image &image : blurred) { + image.quantizeDither(false); + image.quantize(); + if (delay != 0) image.animationDelay(delay); + } + } + + writeImages(blurred.begin(), blurred.end(), &blob); + + *DataSize = blob.length(); + + // workaround because the data is tied to the blob + char *data = (char *)malloc(*DataSize); + memcpy(data, blob.data(), *DataSize); + return data; } \ No newline at end of file diff --git a/natives/explode.h b/natives/explode.h index 3c07169..255224f 100644 --- a/natives/explode.h +++ b/natives/explode.h @@ -4,5 +4,5 @@ using std::string; -char* Explode(string type, string* outType, char* BufferData, size_t BufferLength, +char* Explode(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/flag.cc b/natives/flag.cc index adfaeb2..2c4a9a5 100644 --- a/natives/flag.cc +++ b/natives/flag.cc @@ -5,7 +5,7 @@ using namespace std; using namespace vips; -char *Flag(string type, string *outType, char *BufferData, size_t BufferLength, +char *Flag(string *type, char *BufferData, size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { string overlay = GetArgument(Arguments, "overlay"); string basePath = GetArgument(Arguments, "basePath"); @@ -14,7 +14,7 @@ char *Flag(string type, string *outType, char *BufferData, size_t BufferLength, VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -40,10 +40,9 @@ char *Flag(string type, string *outType, char *BufferData, size_t BufferLength, void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" - ? VImage::option()->set("dither", 0)->set("reoptimise", 1) - : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) + : 0); return (char *)buf; } \ No newline at end of file diff --git a/natives/flag.h b/natives/flag.h index 123aa73..976266b 100644 --- a/natives/flag.h +++ b/natives/flag.h @@ -4,5 +4,5 @@ using std::string; -char* Flag(string type, string* outType, char* BufferData, size_t BufferLength, +char* Flag(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/flip.cc b/natives/flip.cc index 1344404..a9eb71e 100644 --- a/natives/flip.cc +++ b/natives/flip.cc @@ -6,12 +6,12 @@ using namespace std; using namespace vips; -char *Flip(string type, string *outType, char *BufferData, size_t BufferLength, +char *Flip(string *type, char *BufferData, size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { bool flop = GetArgument(Arguments, "flop"); VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" + *type == "gif" ? VImage::option()->set("n", -1)->set( "access", "sequential") : 0) @@ -21,7 +21,7 @@ char *Flip(string type, string *outType, char *BufferData, size_t BufferLength, VImage out; if (flop) { out = in.flip(VIPS_DIRECTION_HORIZONTAL); - } else if (type == "gif") { + } else if (*type == "gif") { // libvips gif handling is both a blessing and a curse vector img; int pageHeight = vips_image_get_page_height(in.get_image()); @@ -39,10 +39,9 @@ char *Flip(string type, string *outType, char *BufferData, size_t BufferLength, void *buf; out.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" - ? VImage::option()->set("dither", 0)->set("reoptimise", 1) - : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) + : 0); return (char *)buf; } \ No newline at end of file diff --git a/natives/flip.h b/natives/flip.h index d9ff128..9029498 100644 --- a/natives/flip.h +++ b/natives/flip.h @@ -4,5 +4,5 @@ using std::string; -char* Flip(string type, string* outType, char* BufferData, size_t BufferLength, +char* Flip(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/freeze.cc b/natives/freeze.cc index 2eb15c4..6174dba 100644 --- a/natives/freeze.cc +++ b/natives/freeze.cc @@ -7,8 +7,8 @@ using namespace std; using namespace vips; -char *Freeze(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Freeze(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { bool loop = GetArgumentWithFallback(Arguments, "loop", false); int frame = GetArgumentWithFallback(Arguments, "frame", -1); @@ -46,10 +46,10 @@ char *Freeze(string type, string *outType, char *BufferData, } else if (frame >= 0 && !loop) { VOption *options = VImage::option()->set("access", "sequential"); - VImage in = - VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) - .colourspace(VIPS_INTERPRETATION_sRGB); + VImage in = VImage::new_from_buffer( + BufferData, BufferLength, "", + *type == "gif" ? options->set("n", -1) : options) + .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); int pageHeight = vips_image_get_page_height(in.get_image()); @@ -60,7 +60,7 @@ char *Freeze(string type, string *outType, char *BufferData, out.set("loop", 1); void *buf; - out.write_to_buffer(("." + *outType).c_str(), &buf, DataSize); + out.write_to_buffer(("." + *type).c_str(), &buf, DataSize); return (char *)buf; } else { diff --git a/natives/freeze.h b/natives/freeze.h index 4c0e931..dde7da9 100644 --- a/natives/freeze.h +++ b/natives/freeze.h @@ -4,5 +4,5 @@ using std::string; -char* Freeze(string type, string* outType, char* BufferData, size_t BufferLength, +char* Freeze(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/gamexplain.cc b/natives/gamexplain.cc index a05b371..21c33f1 100644 --- a/natives/gamexplain.cc +++ b/natives/gamexplain.cc @@ -5,15 +5,15 @@ using namespace std; using namespace vips; -char *Gamexplain(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Gamexplain(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { string basePath = GetArgument(Arguments, "basePath"); VOption *options = VImage::option()->set("access", "sequential"); VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -27,7 +27,7 @@ char *Gamexplain(string type, string *outType, char *BufferData, vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; VImage resized = img_frame .resize(1181.0 / (double)width, @@ -41,10 +41,9 @@ char *Gamexplain(string type, string *outType, char *BufferData, void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" - ? VImage::option()->set("dither", 0)->set("reoptimise", 1) - : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) + : 0); return (char *)buf; } \ No newline at end of file diff --git a/natives/gamexplain.h b/natives/gamexplain.h index 7c07c6d..42c6881 100644 --- a/natives/gamexplain.h +++ b/natives/gamexplain.h @@ -4,5 +4,5 @@ using std::string; -char* Gamexplain(string type, string* outType, char* BufferData, size_t BufferLength, +char* Gamexplain(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/globe.cc b/natives/globe.cc index 595329e..cd2874d 100644 --- a/natives/globe.cc +++ b/natives/globe.cc @@ -5,7 +5,7 @@ using namespace std; using namespace vips; -char *Globe(string type, string *outType, char *BufferData, size_t BufferLength, +char *Globe(string *type, char *BufferData, size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { string basePath = GetArgument(Arguments, "basePath"); @@ -14,14 +14,14 @@ char *Globe(string type, string *outType, char *BufferData, size_t BufferLength, VImage in = VImage::new_from_buffer( BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1)->set("access", "sequential") + *type == "gif" ? options->set("n", -1)->set("access", "sequential") : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); int width = in.width(); int pageHeight = vips_image_get_page_height(in.get_image()); - int nPages = type == "gif" ? vips_image_get_n_pages(in.get_image()) : 30; + int nPages = *type == "gif" ? vips_image_get_n_pages(in.get_image()) : 30; double size = min(width, pageHeight); @@ -47,7 +47,7 @@ char *Globe(string type, string *outType, char *BufferData, size_t BufferLength, vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; VImage resized = img_frame.resize( size / (double)width, VImage::option()->set("vscale", size / (double)pageHeight)); @@ -61,7 +61,7 @@ char *Globe(string type, string *outType, char *BufferData, size_t BufferLength, } VImage final = VImage::arrayjoin(img, VImage::option()->set("across", 1)); final.set(VIPS_META_PAGE_HEIGHT, size); - if (type != "gif") { + if (*type != "gif") { vector delay(30, 50); final.set("delay", delay); } diff --git a/natives/globe.h b/natives/globe.h index ca21889..66a97fb 100644 --- a/natives/globe.h +++ b/natives/globe.h @@ -4,5 +4,5 @@ using std::string; -char* Globe(string type, string* outType, char* BufferData, size_t BufferLength, +char* Globe(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/homebrew.cc b/natives/homebrew.cc index 28f2afd..209630b 100644 --- a/natives/homebrew.cc +++ b/natives/homebrew.cc @@ -5,8 +5,7 @@ using namespace std; using namespace vips; -char *Homebrew(string type, string *outType, ArgumentMap Arguments, - size_t *DataSize) { +char *Homebrew(string *type, ArgumentMap Arguments, size_t *DataSize) { string caption = GetArgument(Arguments, "caption"); string basePath = GetArgument(Arguments, "basePath"); @@ -31,7 +30,9 @@ char *Homebrew(string type, string *outType, ArgumentMap Arguments, ->set("y", 300 - (text.height() / 2) - 8)); void *buf; - out.write_to_buffer(("." + *outType).c_str(), &buf, DataSize); + out.write_to_buffer(".png", &buf, DataSize); + + *type = "png"; return (char *)buf; } \ No newline at end of file diff --git a/natives/homebrew.h b/natives/homebrew.h index 3304c4e..d6db633 100644 --- a/natives/homebrew.h +++ b/natives/homebrew.h @@ -4,4 +4,4 @@ using std::string; -char *Homebrew(string type, string *outType, ArgumentMap Arguments, size_t *DataSize); \ No newline at end of file +char *Homebrew(string *type, ArgumentMap Arguments, size_t *DataSize); \ No newline at end of file diff --git a/natives/node/image.cc b/natives/image.cc similarity index 50% rename from natives/node/image.cc rename to natives/image.cc index c3ecb9f..b85efb6 100644 --- a/natives/node/image.cc +++ b/natives/image.cc @@ -4,7 +4,46 @@ #include #include -#include "../common.h" +#include "blur.h" +#include "bounce.h" +#include "caption.h" +#include "caption2.h" +#include "circle.h" +#include "colors.h" +#include "common.h" +#include "crop.h" +#include "deepfry.h" +#include "explode.h" +#include "flag.h" +#include "flip.h" +#include "freeze.h" +#include "gamexplain.h" +#include "globe.h" +#include "homebrew.h" +#include "invert.h" +#include "jpeg.h" +#include "magik.h" +#include "meme.h" +#include "mirror.h" +#include "motivate.h" +#include "reddit.h" +#include "resize.h" +#include "reverse.h" +#include "scott.h" +#include "snapchat.h" +#include "sonic.h" +#include "speed.h" +#include "spin.h" +#include "squish.h" +#include "swirl.h" +#include "tile.h" +#include "togif.h" +#include "uncanny.h" +#include "uncaption.h" +#include "wall.h" +#include "watermark.h" +#include "whisper.h" +#include "zamn.h" #ifdef _WIN32 #include @@ -13,6 +52,51 @@ using namespace std; +std::map + FunctionMap = {{"blur", &Blur}, + {"bounce", &Bounce}, + {"caption", &Caption}, + {"captionTwo", &CaptionTwo}, + {"circle", &Circle}, + {"colors", &Colors}, + {"crop", &Crop}, + {"deepfry", &Deepfry}, + {"explode", &Explode}, + {"flag", &Flag}, + {"flip", &Flip}, + {"freeze", &Freeze}, + {"gamexplain", Gamexplain}, + {"globe", Globe}, + {"invert", Invert}, + {"jpeg", Jpeg}, + {"magik", Magik}, + {"meme", Meme}, + {"mirror", Mirror}, + {"motivate", Motivate}, + {"reddit", Reddit}, + {"resize", Resize}, + {"reverse", Reverse}, + {"scott", Scott}, + {"snapchat", Snapchat}, + {"speed", &Speed}, + {"spin", Spin}, + {"squish", Squish}, + {"swirl", Swirl}, + {"tile", Tile}, + {"togif", ToGif}, + {"uncanny", Uncanny}, + {"uncaption", &Uncaption}, + {"wall", Wall}, + {"watermark", &Watermark}, + {"whisper", Whisper}, + {"zamn", Zamn}}; + +std::map + NoInputFunctionMap = {{"homebrew", Homebrew}, {"sonic", Sonic}}; + bool isNapiValueInt(Napi::Env& env, Napi::Value& num) { return env.Global() .Get("Number") @@ -32,7 +116,7 @@ Napi::Value ProcessImage(const Napi::CallbackInfo& info) { string command = info[0].As().Utf8Value(); Napi::Object obj = info[1].As(); string type = - obj.Has("type") ? obj.Get("type").As().Utf8Value() : "png"; + obj.Has("type") ? obj.Get("type").As().Utf8Value() : NULL; Napi::Array properties = obj.GetPropertyNames(); @@ -64,28 +148,25 @@ Napi::Value ProcessImage(const Napi::CallbackInfo& info) { } } - string outType = GetArgument(Arguments, "togif") ? "gif" : type; - size_t length = 0; char* buf; if (obj.Has("data")) { Napi::Buffer data = obj.Has("data") ? obj.Get("data").As>() : Napi::Buffer::New(env, 0); - buf = FunctionMap.at(command)(type, &outType, data.Data(), data.Length(), + buf = FunctionMap.at(command)(&type, data.Data(), data.Length(), Arguments, &length); } else { - buf = NoInputFunctionMap.at(command)(type, &outType, Arguments, &length); + buf = NoInputFunctionMap.at(command)(&type, Arguments, &length); } vips_error_clear(); vips_thread_shutdown(); - result.Set("data", - Napi::Buffer::New(env, buf, length, - []([[maybe_unused]] Napi::Env env, - void* data) { free(data); })); - result.Set("type", outType); + result.Set("data", Napi::Buffer::New( + env, buf, length, + [](Napi::Env env, void* data) { free(data); })); + result.Set("type", type); } catch (std::exception const& err) { Napi::Error::New(env, err.what()).ThrowAsJavaScriptException(); } catch (...) { diff --git a/natives/invert.cc b/natives/invert.cc index a46fc10..376c066 100644 --- a/natives/invert.cc +++ b/natives/invert.cc @@ -5,14 +5,13 @@ using namespace std; using namespace vips; -char *Invert(string type, string *outType, char *BufferData, - size_t BufferLength, [[maybe_unused]] ArgumentMap Arguments, - size_t *DataSize) { +char *Invert(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { VOption *options = VImage::option()->set("access", "sequential"); VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -22,7 +21,7 @@ char *Invert(string type, string *outType, char *BufferData, VImage out = inverted.bandjoin(in.extract_band(3)); void *buf; - out.write_to_buffer(("." + *outType).c_str(), &buf, DataSize); + out.write_to_buffer(("." + *type).c_str(), &buf, DataSize); return (char *)buf; } \ No newline at end of file diff --git a/natives/invert.h b/natives/invert.h index 7db64e3..42f7ea8 100644 --- a/natives/invert.h +++ b/natives/invert.h @@ -4,5 +4,5 @@ using std::string; -char* Invert(string type, string* outType, char* BufferData, size_t BufferLength, +char* Invert(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/jpeg.cc b/natives/jpeg.cc index d1eff63..9dcb47d 100644 --- a/natives/jpeg.cc +++ b/natives/jpeg.cc @@ -5,13 +5,13 @@ using namespace std; using namespace vips; -char *Jpeg(string type, string *outType, char *BufferData, size_t BufferLength, +char *Jpeg(string *type, char *BufferData, size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { int quality = GetArgumentWithFallback(Arguments, "quality", 0); void *buf; - if (type == "gif") { + if (*type == "gif") { VImage in = VImage::new_from_buffer( BufferData, BufferLength, "", VImage::option()->set("access", "sequential")->set("n", -1)) @@ -53,22 +53,13 @@ char *Jpeg(string type, string *outType, char *BufferData, size_t BufferLength, } final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" ? VImage::option()->set("dither", 0) : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0) : 0); } else { VImage in = VImage::new_from_buffer(BufferData, BufferLength, ""); - void *jpgBuf; - in.write_to_buffer(".jpg", &jpgBuf, DataSize, + in.write_to_buffer(".jpg", &buf, DataSize, VImage::option()->set("Q", quality)->set("strip", true)); - if (*outType == "gif") { - VImage gifIn = VImage::new_from_buffer((char *)jpgBuf, *DataSize, ""); - gifIn.write_to_buffer( - ".gif", &buf, DataSize, - VImage::option()->set("Q", quality)->set("strip", true)); - } else { - *outType = "jpg"; - buf = jpgBuf; - } + *type = "jpg"; } return (char *)buf; diff --git a/natives/jpeg.h b/natives/jpeg.h index 2e6912c..ed67612 100644 --- a/natives/jpeg.h +++ b/natives/jpeg.h @@ -4,5 +4,5 @@ using std::string; -char* Jpeg(string type, string* outType, char* BufferData, size_t BufferLength, +char* Jpeg(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/magik.cc b/natives/magik.cc index 4aae8f6..1cbb1b8 100644 --- a/natives/magik.cc +++ b/natives/magik.cc @@ -9,8 +9,8 @@ using namespace std; using namespace Magick; -char *Magik(string type, string *outType, char *BufferData, size_t BufferLength, - [[maybe_unused]] ArgumentMap Arguments, size_t *DataSize) { +char *Magik(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { Blob blob; list frames; @@ -29,13 +29,13 @@ char *Magik(string type, string *outType, char *BufferData, size_t BufferLength, image.scale(Geometry("350x350")); image.liquidRescale(Geometry("175x175")); image.liquidRescale(Geometry("350x350")); - image.magick(*outType); + image.magick(*type); blurred.push_back(image); } optimizeTransparency(blurred.begin(), blurred.end()); - if (*outType == "gif") { + if (*type == "gif") { for (Image &image : blurred) { image.quantizeDitherMethod(FloydSteinbergDitherMethod); image.quantize(); diff --git a/natives/magik.h b/natives/magik.h index b4c1639..37013a9 100644 --- a/natives/magik.h +++ b/natives/magik.h @@ -4,5 +4,5 @@ using std::string; -char* Magik(string type, string* outType, char* BufferData, size_t BufferLength, +char* Magik(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/meme.cc b/natives/meme.cc index f7cb51a..9b3dc5d 100644 --- a/natives/meme.cc +++ b/natives/meme.cc @@ -5,7 +5,7 @@ using namespace std; using namespace vips; -char *Meme(string type, string *outType, char *BufferData, size_t BufferLength, +char *Meme(string *type, char *BufferData, size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { string top = GetArgument(Arguments, "top"); string bottom = GetArgument(Arguments, "bottom"); @@ -16,7 +16,7 @@ char *Meme(string type, string *outType, char *BufferData, size_t BufferLength, VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -110,7 +110,7 @@ char *Meme(string type, string *outType, char *BufferData, size_t BufferLength, vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; if (top != "") { img_frame = img_frame.composite2( topText, VIPS_BLEND_MODE_OVER, @@ -130,10 +130,9 @@ char *Meme(string type, string *outType, char *BufferData, size_t BufferLength, void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" - ? VImage::option()->set("dither", 0)->set("reoptimise", 1) - : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) + : 0); return (char *)buf; } \ No newline at end of file diff --git a/natives/meme.h b/natives/meme.h index 5c05a29..5d7bf58 100644 --- a/natives/meme.h +++ b/natives/meme.h @@ -4,5 +4,5 @@ using std::string; -char* Meme(string type, string* outType, char* BufferData, size_t BufferLength, +char* Meme(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/mirror.cc b/natives/mirror.cc index bb4db00..47bf015 100644 --- a/natives/mirror.cc +++ b/natives/mirror.cc @@ -5,8 +5,8 @@ using namespace std; using namespace vips; -char *Mirror(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Mirror(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { bool vertical = GetArgumentWithFallback(Arguments, "vertical", false); bool first = GetArgumentWithFallback(Arguments, "first", false); @@ -14,14 +14,14 @@ char *Mirror(string type, string *outType, char *BufferData, VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); VImage out; if (vertical) { - if (type == "gif") { + if (*type == "gif") { // once again, libvips gif handling is both a blessing and a curse vector img; int pageHeight = vips_image_get_page_height(in.get_image()); @@ -58,7 +58,7 @@ char *Mirror(string type, string *outType, char *BufferData, } void *buf; - out.write_to_buffer(("." + *outType).c_str(), &buf, DataSize); + out.write_to_buffer(("." + *type).c_str(), &buf, DataSize); return (char *)buf; } diff --git a/natives/mirror.h b/natives/mirror.h index 419f595..3ed6dac 100644 --- a/natives/mirror.h +++ b/natives/mirror.h @@ -4,5 +4,5 @@ using std::string; -char* Mirror(string type, string* outType, char* BufferData, size_t BufferLength, +char* Mirror(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/motivate.cc b/natives/motivate.cc index a2f48bd..11c9b20 100644 --- a/natives/motivate.cc +++ b/natives/motivate.cc @@ -5,8 +5,8 @@ using namespace std; using namespace vips; -char *Motivate(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Motivate(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { string top_text = GetArgument(Arguments, "top"); string bottom_text = GetArgument(Arguments, "bottom"); string font = GetArgument(Arguments, "font"); @@ -16,7 +16,7 @@ char *Motivate(string type, string *outType, char *BufferData, VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -69,7 +69,7 @@ char *Motivate(string type, string *outType, char *BufferData, int height; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; int borderSize = max(2, width / 66); int borderSize2 = borderSize * 0.5; @@ -116,8 +116,8 @@ char *Motivate(string type, string *outType, char *BufferData, void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" ? VImage::option()->set("dither", 1) : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 1) : 0); return (char *)buf; } diff --git a/natives/motivate.h b/natives/motivate.h index 7f7624b..924f640 100644 --- a/natives/motivate.h +++ b/natives/motivate.h @@ -4,5 +4,5 @@ using std::string; -char* Motivate(string type, string* outType, char* BufferData, size_t BufferLength, +char* Motivate(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/reddit.cc b/natives/reddit.cc index c89b6c7..d4b02e7 100644 --- a/natives/reddit.cc +++ b/natives/reddit.cc @@ -5,8 +5,8 @@ using namespace std; using namespace vips; -char *Reddit(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Reddit(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { string text = GetArgument(Arguments, "text"); string basePath = GetArgument(Arguments, "basePath"); @@ -14,7 +14,7 @@ char *Reddit(string type, string *outType, char *BufferData, VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -48,7 +48,7 @@ char *Reddit(string type, string *outType, char *BufferData, vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; VImage frame = img_frame.join(watermark, VIPS_DIRECTION_VERTICAL, VImage::option()->set("expand", true)); img.push_back(frame); @@ -58,10 +58,9 @@ char *Reddit(string type, string *outType, char *BufferData, void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" - ? VImage::option()->set("dither", 0)->set("reoptimise", 1) - : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) + : 0); return (char *)buf; } \ No newline at end of file diff --git a/natives/reddit.h b/natives/reddit.h index 564341f..7acdfd5 100644 --- a/natives/reddit.h +++ b/natives/reddit.h @@ -4,5 +4,5 @@ using std::string; -char* Reddit(string type, string* outType, char* BufferData, size_t BufferLength, +char* Reddit(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/resize.cc b/natives/resize.cc index ae9f93e..595bb30 100644 --- a/natives/resize.cc +++ b/natives/resize.cc @@ -5,8 +5,8 @@ using namespace std; using namespace vips; -char *Resize(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Resize(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { bool stretch = GetArgumentWithFallback(Arguments, "stretch", false); bool wide = GetArgumentWithFallback(Arguments, "wide", false); @@ -14,7 +14,7 @@ char *Resize(string type, string *outType, char *BufferData, VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); VImage out; @@ -37,7 +37,7 @@ char *Resize(string type, string *outType, char *BufferData, vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; VImage resized = img_frame.resize(0.1).resize( 10, VImage::option()->set("kernel", VIPS_KERNEL_NEAREST)); img.push_back(resized); @@ -48,7 +48,7 @@ char *Resize(string type, string *outType, char *BufferData, out.set(VIPS_META_PAGE_HEIGHT, finalHeight); void *buf; - out.write_to_buffer(("." + *outType).c_str(), &buf, DataSize); + out.write_to_buffer(("." + *type).c_str(), &buf, DataSize); return (char *)buf; } \ No newline at end of file diff --git a/natives/resize.h b/natives/resize.h index 61bc26d..cb9d258 100644 --- a/natives/resize.h +++ b/natives/resize.h @@ -4,5 +4,5 @@ using std::string; -char* Resize(string type, string* outType, char* BufferData, size_t BufferLength, +char* Resize(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/reverse.cc b/natives/reverse.cc index 6444bd0..62940b7 100644 --- a/natives/reverse.cc +++ b/natives/reverse.cc @@ -6,8 +6,8 @@ using namespace std; using namespace vips; -char *Reverse(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Reverse(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { bool soos = GetArgumentWithFallback(Arguments, "soos", false); VOption *options = @@ -53,7 +53,7 @@ char *Reverse(string type, string *outType, char *BufferData, final.write_to_buffer(".gif", &buf, DataSize, VImage::option()->set("dither", 0)); - *outType = "gif"; + *type = "gif"; return (char *)buf; } \ No newline at end of file diff --git a/natives/reverse.h b/natives/reverse.h index 9a7db85..a436a7f 100644 --- a/natives/reverse.h +++ b/natives/reverse.h @@ -4,5 +4,5 @@ using std::string; -char* Reverse(string type, string* outType, char* BufferData, size_t BufferLength, +char* Reverse(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/scott.cc b/natives/scott.cc index d6e6ea6..e31ad71 100644 --- a/natives/scott.cc +++ b/natives/scott.cc @@ -1,55 +1,64 @@ -#include +#include + +#include +#include +#include #include "common.h" using namespace std; -using namespace vips; +using namespace Magick; -char *Scott(string type, string *outType, char *BufferData, size_t BufferLength, +char *Scott(string *type, char *BufferData, size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { string basePath = GetArgument(Arguments, "basePath"); - VOption *options = VImage::option()->set("access", "sequential"); + Blob blob; - VImage in = - VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) - .colourspace(VIPS_INTERPRETATION_sRGB); - if (!in.has_alpha()) in = in.bandjoin(255); - - int width = in.width(); - int pageHeight = vips_image_get_page_height(in.get_image()); - int nPages = vips_image_get_n_pages(in.get_image()); - - string assetPath = basePath + "assets/images/scott.png"; - VImage bg = VImage::new_from_file(assetPath.c_str()); - - string distortPath = basePath + "assets/images/scottmap.png"; - VImage distort = VImage::new_from_file(distortPath.c_str()); - - VImage distortImage = - ((distort[1] / 255) * 414).bandjoin((distort[0] / 255) * 233); - - vector img; - for (int i = 0; i < nPages; i++) { - VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; - VImage resized = img_frame.resize( - 415 / (double)width, - VImage::option()->set("vscale", 234 / (double)pageHeight)); - VImage mapped = resized.mapim(distortImage) - .extract_band(0, VImage::option()->set("n", 3)) - .bandjoin(distort[2]); - VImage offset = mapped.embed(127, 181, 864, 481); - VImage composited = bg.composite2(offset, VIPS_BLEND_MODE_OVER); - img.push_back(composited); + list frames; + list coalesced; + list mid; + Image watermark; + try { + readImages(&frames, Blob(BufferData, BufferLength)); + } catch (Magick::WarningCoder &warning) { + cerr << "Coder Warning: " << warning.what() << endl; + } catch (Magick::Warning &warning) { + cerr << "Warning: " << warning.what() << endl; } - VImage final = VImage::arrayjoin(img, VImage::option()->set("across", 1)); - final.set(VIPS_META_PAGE_HEIGHT, 481); + watermark.read(basePath + "assets/images/scott.png"); + coalesceImages(&coalesced, frames.begin(), frames.end()); - void *buf; - final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" ? VImage::option()->set("dither", 1) : 0); - return (char *)buf; + for (Image &image : coalesced) { + Image watermark_new = watermark; + image.virtualPixelMethod(Magick::TransparentVirtualPixelMethod); + image.backgroundColor("none"); + image.scale(Geometry("415x234!")); + double arguments[16] = {0, 0, 129, 187, 415, 0, 517, 182, + 415, 234, 517, 465, 0, 234, 132, 418}; + image.distort(Magick::PerspectiveDistortion, 16, arguments, true); + image.extent(Geometry("864x481"), Magick::CenterGravity); + watermark_new.composite(image, Geometry("-110+83"), + Magick::OverCompositeOp); + watermark_new.magick(*type); + watermark_new.animationDelay(image.animationDelay()); + mid.push_back(watermark_new); + } + + optimizeTransparency(mid.begin(), mid.end()); + + if (*type == "gif") { + for (Image &image : mid) { + image.quantizeDitherMethod(FloydSteinbergDitherMethod); + image.quantize(); + } + } + + writeImages(mid.begin(), mid.end(), &blob); + + *DataSize = blob.length(); + + char *data = (char *)malloc(*DataSize); + memcpy(data, blob.data(), *DataSize); + return data; } \ No newline at end of file diff --git a/natives/scott.h b/natives/scott.h index 45313af..6752c42 100644 --- a/natives/scott.h +++ b/natives/scott.h @@ -4,5 +4,5 @@ using std::string; -char* Scott(string type, string* outType, char* BufferData, size_t BufferLength, +char* Scott(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/snapchat.cc b/natives/snapchat.cc index 7b5a812..8346b56 100644 --- a/natives/snapchat.cc +++ b/natives/snapchat.cc @@ -5,8 +5,8 @@ using namespace std; using namespace vips; -char *Snapchat(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Snapchat(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { string caption = GetArgument(Arguments, "caption"); float pos = GetArgumentWithFallback(Arguments, "pos", 0.5); string basePath = GetArgument(Arguments, "basePath"); @@ -15,7 +15,7 @@ char *Snapchat(string type, string *outType, char *BufferData, VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -52,7 +52,7 @@ char *Snapchat(string type, string *outType, char *BufferData, vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; img_frame = img_frame.composite2( textIn, VIPS_BLEND_MODE_OVER, VImage::option()->set("x", 0)->set("y", pageHeight * pos)); @@ -63,10 +63,9 @@ char *Snapchat(string type, string *outType, char *BufferData, void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" - ? VImage::option()->set("dither", 0)->set("reoptimise", 1) - : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) + : 0); return (char *)buf; } \ No newline at end of file diff --git a/natives/snapchat.h b/natives/snapchat.h index a43a4a3..bc40397 100644 --- a/natives/snapchat.h +++ b/natives/snapchat.h @@ -4,5 +4,5 @@ using std::string; -char* Snapchat(string type, string* outType, char* BufferData, size_t BufferLength, +char* Snapchat(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/sonic.cc b/natives/sonic.cc index 581700c..b4f2bea 100644 --- a/natives/sonic.cc +++ b/natives/sonic.cc @@ -5,8 +5,7 @@ using namespace std; using namespace vips; -char *Sonic(string type, string *outType, ArgumentMap Arguments, - size_t *DataSize) { +char *Sonic(string *type, ArgumentMap Arguments, size_t *DataSize) { string text = GetArgument(Arguments, "text"); string basePath = GetArgument(Arguments, "basePath"); @@ -29,7 +28,9 @@ char *Sonic(string type, string *outType, ArgumentMap Arguments, VImage::option()->set("x", 391)->set("y", 84)); void *buf; - out.write_to_buffer(("." + *outType).c_str(), &buf, DataSize); + out.write_to_buffer(".png", &buf, DataSize); + + *type = "png"; return (char *)buf; } \ No newline at end of file diff --git a/natives/sonic.h b/natives/sonic.h index 6b3df86..10ff4b4 100644 --- a/natives/sonic.h +++ b/natives/sonic.h @@ -4,4 +4,4 @@ using std::string; -char *Sonic(string type, string *outType, ArgumentMap Arguments, size_t *DataSize); \ No newline at end of file +char *Sonic(string *type, ArgumentMap Arguments, size_t *DataSize); \ No newline at end of file diff --git a/natives/speed.cc b/natives/speed.cc index f7fc116..080904f 100644 --- a/natives/speed.cc +++ b/natives/speed.cc @@ -39,8 +39,8 @@ char *vipsRemove(char *data, size_t length, size_t *DataSize, int speed) { return (char *)buf; } -char *Speed([[maybe_unused]] string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Speed(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { bool slow = GetArgumentWithFallback(Arguments, "slow", false); int speed = GetArgumentWithFallback(Arguments, "speed", 2); @@ -53,7 +53,7 @@ char *Speed([[maybe_unused]] string type, string *outType, char *BufferData, bool removeFrames = false; char *lastPos; - // int amount = 0; + int amount = 0; lastPos = (char *)memchr(fileData, '\x00', BufferLength); while (lastPos != NULL) { @@ -62,7 +62,7 @@ char *Speed([[maybe_unused]] string type, string *outType, char *BufferData, (BufferLength - (lastPos - fileData)) - 1); continue; } - //++amount; + ++amount; uint16_t old_delay; memcpy(&old_delay, lastPos + 5, 2); old_delays.push_back(old_delay); diff --git a/natives/speed.h b/natives/speed.h index 0c861ae..6a8afef 100644 --- a/natives/speed.h +++ b/natives/speed.h @@ -4,5 +4,5 @@ using std::string; -char* Speed(string type, string* outType, char* BufferData, size_t BufferLength, +char* Speed(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/spin.cc b/natives/spin.cc index 2c1d07e..56c14d9 100644 --- a/natives/spin.cc +++ b/natives/spin.cc @@ -1,16 +1,15 @@ +#include "common.h" #include #include #include #include -#include "common.h" - using namespace std; using namespace Magick; -char *Spin(string type, string *outType, char *BufferData, size_t BufferLength, - [[maybe_unused]] ArgumentMap Arguments, size_t *DataSize) { +char *Spin(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { int delay = GetArgumentWithFallback(Arguments, "delay", 0); Blob blob; @@ -27,7 +26,7 @@ char *Spin(string type, string *outType, char *BufferData, size_t BufferLength, } coalesceImages(&coalesced, frames.begin(), frames.end()); - if (type != "gif") { + if (*type != "gif") { list::iterator it = coalesced.begin(); for (int i = 0; i < 29; ++i) { coalesced.push_back(*it); @@ -52,7 +51,7 @@ char *Spin(string type, string *outType, char *BufferData, size_t BufferLength, optimizeTransparency(mid.begin(), mid.end()); if (delay != 0) { for_each(mid.begin(), mid.end(), animationDelayImage(delay)); - } else if (type != "gif") { + } else if (*type != "gif") { for_each(mid.begin(), mid.end(), animationDelayImage(5)); } @@ -63,7 +62,7 @@ char *Spin(string type, string *outType, char *BufferData, size_t BufferLength, writeImages(mid.begin(), mid.end(), &blob); - *outType = "gif"; + *type = "gif"; *DataSize = blob.length(); char *data = (char *)malloc(*DataSize); diff --git a/natives/spin.h b/natives/spin.h index 74f16b8..dbd94f0 100644 --- a/natives/spin.h +++ b/natives/spin.h @@ -4,5 +4,5 @@ using std::string; -char* Spin(string type, string* outType, char* BufferData, size_t BufferLength, +char* Spin(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/squish.cc b/natives/squish.cc index a28463b..868c163 100644 --- a/natives/squish.cc +++ b/natives/squish.cc @@ -7,28 +7,27 @@ using namespace std; using namespace vips; -char *Squish(string type, string *outType, char *BufferData, - size_t BufferLength, [[maybe_unused]] ArgumentMap Arguments, - size_t *DataSize) { +char *Squish(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { VOption *options = VImage::option(); VImage in = VImage::new_from_buffer( BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1)->set("access", "sequential") - : options) + *type == "gif" ? options->set("n", -1)->set("access", "sequential") + : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); int width = in.width(); int pageHeight = vips_image_get_page_height(in.get_image()); - int nPages = type == "gif" ? vips_image_get_n_pages(in.get_image()) : 30; + int nPages = *type == "gif" ? vips_image_get_n_pages(in.get_image()) : 30; double mult = (2 * M_PI) / nPages; vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; double newWidth = (sin(i * mult) / 4) + 0.75; double newHeight = (cos(i * mult) / 4) + 0.75; VImage resized = @@ -38,7 +37,7 @@ char *Squish(string type, string *outType, char *BufferData, } VImage final = VImage::arrayjoin(img, VImage::option()->set("across", 1)); final.set(VIPS_META_PAGE_HEIGHT, pageHeight); - if (type != "gif") { + if (*type != "gif") { vector delay(30, 50); final.set("delay", delay); } @@ -46,7 +45,7 @@ char *Squish(string type, string *outType, char *BufferData, void *buf; final.write_to_buffer(".gif", &buf, DataSize); - *outType = "gif"; + *type = "gif"; return (char *)buf; } \ No newline at end of file diff --git a/natives/squish.h b/natives/squish.h index 47c5118..291b6a9 100644 --- a/natives/squish.h +++ b/natives/squish.h @@ -4,5 +4,5 @@ using std::string; -char* Squish(string type, string* outType, char* BufferData, size_t BufferLength, +char* Squish(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/swirl.cc b/natives/swirl.cc index 8ae3be4..5a068ff 100644 --- a/natives/swirl.cc +++ b/natives/swirl.cc @@ -5,13 +5,13 @@ using namespace std; using namespace vips; -char *Swirl(string type, string *outType, char *BufferData, size_t BufferLength, - [[maybe_unused]] ArgumentMap Arguments, size_t *DataSize) { +char *Swirl(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { VOption *options = VImage::option()->set("access", "sequential"); VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -54,7 +54,7 @@ char *Swirl(string type, string *outType, char *BufferData, size_t BufferLength, vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; VImage distort = img_frame @@ -70,7 +70,7 @@ char *Swirl(string type, string *outType, char *BufferData, size_t BufferLength, final.set(VIPS_META_PAGE_HEIGHT, pageHeight); void *buf; - final.write_to_buffer(("." + *outType).c_str(), &buf, DataSize); + final.write_to_buffer(".gif", &buf, DataSize); return (char *)buf; } \ No newline at end of file diff --git a/natives/swirl.h b/natives/swirl.h index fecb25c..eb67aff 100644 --- a/natives/swirl.h +++ b/natives/swirl.h @@ -4,5 +4,5 @@ using std::string; -char* Swirl(string type, string* outType, char* BufferData, size_t BufferLength, +char* Swirl(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/tile.cc b/natives/tile.cc index 30feb7b..ee9ab28 100644 --- a/natives/tile.cc +++ b/natives/tile.cc @@ -9,8 +9,8 @@ using namespace std; using namespace Magick; -char *Tile(string type, string *outType, char *BufferData, size_t BufferLength, - [[maybe_unused]] ArgumentMap Arguments, size_t *DataSize) { +char *Tile(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { Blob blob; list frames; @@ -30,7 +30,7 @@ char *Tile(string type, string *outType, char *BufferData, size_t BufferLength, Image appended; list montage; Image frame; - image.magick(*outType); + image.magick(*type); for (int i = 0; i < 5; ++i) { duplicated.push_back(image); } @@ -48,7 +48,7 @@ char *Tile(string type, string *outType, char *BufferData, size_t BufferLength, optimizeTransparency(mid.begin(), mid.end()); - if (*outType == "gif") { + if (*type == "gif") { for (Image &image : mid) { image.quantizeDitherMethod(FloydSteinbergDitherMethod); image.quantize(); diff --git a/natives/tile.h b/natives/tile.h index a1fe22b..72ea5ca 100644 --- a/natives/tile.h +++ b/natives/tile.h @@ -4,5 +4,5 @@ using std::string; -char* Tile(string type, string* outType, char* BufferData, size_t BufferLength, +char* Tile(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/togif.cc b/natives/togif.cc index 678b537..16ff000 100644 --- a/natives/togif.cc +++ b/natives/togif.cc @@ -5,9 +5,9 @@ using namespace std; using namespace vips; -char *ToGif(string type, string *outType, char *BufferData, size_t BufferLength, - [[maybe_unused]] ArgumentMap Arguments, size_t *DataSize) { - if (type == "gif") { +char *ToGif(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { + if (*type == "gif") { *DataSize = BufferLength; char *data = (char *)malloc(BufferLength); memcpy(data, BufferData, BufferLength); @@ -17,11 +17,11 @@ char *ToGif(string type, string *outType, char *BufferData, size_t BufferLength, VImage in = VImage::new_from_buffer( BufferData, BufferLength, "", - type == "webp" ? options->set("n", -1) : options); + *type == "webp" ? options->set("n", -1) : options); void *buf; in.write_to_buffer(".gif", &buf, DataSize); - *outType = "gif"; + *type = "gif"; return (char *)buf; } diff --git a/natives/togif.h b/natives/togif.h index 5e3f8c0..73b837e 100644 --- a/natives/togif.h +++ b/natives/togif.h @@ -4,5 +4,5 @@ using std::string; -char* ToGif(string type, string* outType, char* BufferData, size_t BufferLength, +char* ToGif(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/uncanny.cc b/natives/uncanny.cc index 16a922b..695acfc 100644 --- a/natives/uncanny.cc +++ b/natives/uncanny.cc @@ -5,8 +5,8 @@ using namespace std; using namespace vips; -char *Uncanny(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Uncanny(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { string caption = GetArgument(Arguments, "caption"); string caption2 = GetArgument(Arguments, "caption2"); string font = GetArgument(Arguments, "font"); @@ -17,7 +17,7 @@ char *Uncanny(string type, string *outType, char *BufferData, VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB) .extract_band(0, VImage::option()->set("n", 3)); @@ -79,7 +79,7 @@ char *Uncanny(string type, string *outType, char *BufferData, vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; VImage resized = img_frame.resize(690.0 / (double)width); if (resized.height() > 590) { double vscale = 590.0 / (double)resized.height(); @@ -94,8 +94,8 @@ char *Uncanny(string type, string *outType, char *BufferData, void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" ? VImage::option()->set("reoptimise", 1) : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("reoptimise", 1) : 0); return (char *)buf; } \ No newline at end of file diff --git a/natives/uncanny.h b/natives/uncanny.h index d9c34e5..018495a 100644 --- a/natives/uncanny.h +++ b/natives/uncanny.h @@ -4,5 +4,5 @@ using std::string; -char* Uncanny(string type, string* outType, char* BufferData, size_t BufferLength, +char* Uncanny(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/uncaption.cc b/natives/uncaption.cc index 0145d87..9481cf0 100644 --- a/natives/uncaption.cc +++ b/natives/uncaption.cc @@ -6,8 +6,8 @@ using namespace std; using namespace vips; -char *Uncaption(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Uncaption(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { float tolerance = GetArgumentWithFallback(Arguments, "tolerance", 0.5); VOption *options = VImage::option(); @@ -15,8 +15,8 @@ char *Uncaption(string type, string *outType, char *BufferData, VImage in = VImage::new_from_buffer( BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1)->set("access", "sequential") - : options) + *type == "gif" ? options->set("n", -1)->set("access", "sequential") + : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -45,10 +45,9 @@ char *Uncaption(string type, string *outType, char *BufferData, void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" - ? VImage::option()->set("dither", 0)->set("reoptimise", 1) - : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) + : 0); return (char *)buf; } diff --git a/natives/uncaption.h b/natives/uncaption.h index 74b9f4d..d90fcf1 100644 --- a/natives/uncaption.h +++ b/natives/uncaption.h @@ -4,5 +4,5 @@ using std::string; -char* Uncaption(string type, string* outType, char* BufferData, size_t BufferLength, +char* Uncaption(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/wall.cc b/natives/wall.cc index aa87fc9..88e007e 100644 --- a/natives/wall.cc +++ b/natives/wall.cc @@ -9,8 +9,8 @@ using namespace std; using namespace Magick; -char *Wall(string type, string *outType, char *BufferData, size_t BufferLength, - [[maybe_unused]] ArgumentMap Arguments, size_t *DataSize) { +char *Wall(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { Blob blob; list frames; @@ -35,13 +35,13 @@ char *Wall(string type, string *outType, char *BufferData, size_t BufferLength, 128, 0, 140, 60, 128, 128, 140, 140}; image.distort(Magick::PerspectiveDistortion, 16, arguments); image.scale(Geometry("800x800>")); - image.magick(*outType); + image.magick(*type); mid.push_back(image); } optimizeTransparency(mid.begin(), mid.end()); - if (*outType == "gif") { + if (*type == "gif") { for (Image &image : mid) { image.quantizeDitherMethod(FloydSteinbergDitherMethod); image.quantize(); diff --git a/natives/wall.h b/natives/wall.h index 93119d3..f90817c 100644 --- a/natives/wall.h +++ b/natives/wall.h @@ -4,5 +4,5 @@ using std::string; -char* Wall(string type, string* outType, char* BufferData, size_t BufferLength, +char* Wall(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/watermark.cc b/natives/watermark.cc index 7193067..208418f 100644 --- a/natives/watermark.cc +++ b/natives/watermark.cc @@ -6,8 +6,8 @@ using namespace std; using namespace vips; -char *Watermark(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Watermark(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { string water = GetArgument(Arguments, "water"); int gravity = GetArgument(Arguments, "gravity"); @@ -28,7 +28,7 @@ char *Watermark(string type, string *outType, char *BufferData, VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -91,7 +91,7 @@ char *Watermark(string type, string *outType, char *BufferData, VImage frame; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; if (append) { VImage appended = img_frame.join(watermark, VIPS_DIRECTION_VERTICAL, VImage::option()->set("expand", true)); @@ -121,8 +121,8 @@ char *Watermark(string type, string *outType, char *BufferData, bg = frameAlpha.new_from_image({0, 0, 0}).copy(VImage::option()->set( "interpretation", VIPS_INTERPRETATION_sRGB)); frame = bg.bandjoin(frameAlpha); - if (*outType == "jpg" || *outType == "jpeg") { - *outType = "png"; + if (*type == "jpg" || *type == "jpeg") { + *type = "png"; } } VImage content = @@ -145,10 +145,9 @@ char *Watermark(string type, string *outType, char *BufferData, void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" - ? VImage::option()->set("dither", 0)->set("reoptimise", 1) - : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) + : 0); return (char *)buf; } diff --git a/natives/watermark.h b/natives/watermark.h index da102dc..c7bec04 100644 --- a/natives/watermark.h +++ b/natives/watermark.h @@ -4,5 +4,5 @@ using std::string; -char* Watermark(string type, string* outType, char* BufferData, size_t BufferLength, +char* Watermark(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/whisper.cc b/natives/whisper.cc index da96542..61f833a 100644 --- a/natives/whisper.cc +++ b/natives/whisper.cc @@ -5,8 +5,8 @@ using namespace std; using namespace vips; -char *Whisper(string type, string *outType, char *BufferData, - size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { +char *Whisper(string *type, char *BufferData, size_t BufferLength, + ArgumentMap Arguments, size_t *DataSize) { string caption = GetArgument(Arguments, "caption"); string basePath = GetArgument(Arguments, "basePath"); @@ -14,7 +14,7 @@ char *Whisper(string type, string *outType, char *BufferData, VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -64,7 +64,7 @@ char *Whisper(string type, string *outType, char *BufferData, vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; img_frame = img_frame.composite2( textImg, VIPS_BLEND_MODE_OVER, VImage::option() @@ -77,10 +77,9 @@ char *Whisper(string type, string *outType, char *BufferData, void *buf; final.write_to_buffer( - ("." + *outType).c_str(), &buf, DataSize, - *outType == "gif" - ? VImage::option()->set("dither", 0)->set("reoptimise", 1) - : 0); + ("." + *type).c_str(), &buf, DataSize, + *type == "gif" ? VImage::option()->set("dither", 0)->set("reoptimise", 1) + : 0); return (char *)buf; } \ No newline at end of file diff --git a/natives/whisper.h b/natives/whisper.h index df9160e..3cf3840 100644 --- a/natives/whisper.h +++ b/natives/whisper.h @@ -4,5 +4,5 @@ using std::string; -char* Whisper(string type, string* outType, char* BufferData, size_t BufferLength, +char* Whisper(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/natives/zamn.cc b/natives/zamn.cc index 55173c3..28c0ee4 100644 --- a/natives/zamn.cc +++ b/natives/zamn.cc @@ -5,7 +5,7 @@ using namespace std; using namespace vips; -char *Zamn(string type, string *outType, char *BufferData, size_t BufferLength, +char *Zamn(string *type, char *BufferData, size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { string basePath = GetArgument(Arguments, "basePath"); @@ -13,7 +13,7 @@ char *Zamn(string type, string *outType, char *BufferData, size_t BufferLength, VImage in = VImage::new_from_buffer(BufferData, BufferLength, "", - type == "gif" ? options->set("n", -1) : options) + *type == "gif" ? options->set("n", -1) : options) .colourspace(VIPS_INTERPRETATION_sRGB); if (!in.has_alpha()) in = in.bandjoin(255); @@ -27,7 +27,7 @@ char *Zamn(string type, string *outType, char *BufferData, size_t BufferLength, vector img; for (int i = 0; i < nPages; i++) { VImage img_frame = - type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; + *type == "gif" ? in.crop(0, i * pageHeight, width, pageHeight) : in; VImage composited = tmpl.insert( img_frame.extract_band(0, VImage::option()->set("n", 3)) .bandjoin(255) @@ -41,7 +41,7 @@ char *Zamn(string type, string *outType, char *BufferData, size_t BufferLength, final.set(VIPS_META_PAGE_HEIGHT, 516); void *buf; - final.write_to_buffer(("." + *outType).c_str(), &buf, DataSize); + final.write_to_buffer(("." + *type).c_str(), &buf, DataSize); return (char *)buf; } \ No newline at end of file diff --git a/natives/zamn.h b/natives/zamn.h index 0eec42c..e18f384 100644 --- a/natives/zamn.h +++ b/natives/zamn.h @@ -4,5 +4,5 @@ using std::string; -char* Zamn(string type, string* outType, char* BufferData, size_t BufferLength, +char* Zamn(string* type, char* BufferData, size_t BufferLength, ArgumentMap Arguments, size_t* DataSize); \ No newline at end of file diff --git a/package.json b/package.json index 8eff11b..27a8d59 100644 --- a/package.json +++ b/package.json @@ -29,37 +29,37 @@ "dependencies": { "dotenv": "^16.0.3", "emoji-regex": "^10.2.1", - "file-type": "^18.2.1", - "format-duration": "^3.0.2", + "file-type": "^18.0.0", + "format-duration": "^2.0.0", "jsqr": "^1.4.0", - "node-addon-api": "^5.1.0", + "node-addon-api": "^5.0.0", "node-emoji": "^1.11.0", - "oceanic.js": "1.5.1", + "oceanic.js": "1.3.2", "qrcode": "^1.5.1", - "sharp": "^0.31.3", - "shoukaku": "^3.3.1", - "undici": "^5.20.0", + "sharp": "^0.31.2", + "shoukaku": "^3.2.2", + "undici": "^5.14.0", "winston": "^3.8.2", "winston-daily-rotate-file": "^4.7.1" }, "devDependencies": { - "@babel/core": "^7.21.0", + "@babel/core": "^7.20.5", "@babel/eslint-parser": "^7.19.1", "@babel/eslint-plugin": "^7.19.1", "@babel/plugin-proposal-class-properties": "^7.18.6", - "cmake-js": "^7.2.1", - "eslint": "^8.35.0", - "eslint-plugin-unicorn": "^46.0.0" + "cmake-js": "^7.0.0", + "eslint": "^8.29.0", + "eslint-plugin-unicorn": "^45.0.2" }, "optionalDependencies": { - "better-sqlite3": "^8.1.0", + "better-sqlite3": "^8.0.1", "bufferutil": "^4.0.7", "erlpack": "^0.1.4", "pm2": "^5.2.2", - "postgres": "^3.3.4", + "postgres": "^3.3.2", "uuid": "^9.0.0", - "ws": "^8.12.1", - "zlib-sync": "^0.1.8" + "ws": "^8.11.0", + "zlib-sync": "^0.1.7" }, "binary": { "napi_versions": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4f4f486..8272822 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,70 +1,70 @@ lockfileVersion: 5.4 specifiers: - '@babel/core': ^7.21.0 + '@babel/core': ^7.20.5 '@babel/eslint-parser': ^7.19.1 '@babel/eslint-plugin': ^7.19.1 '@babel/plugin-proposal-class-properties': ^7.18.6 - better-sqlite3: ^8.1.0 + better-sqlite3: ^8.0.1 bufferutil: ^4.0.7 - cmake-js: ^7.2.1 + cmake-js: ^7.0.0 dotenv: ^16.0.3 emoji-regex: ^10.2.1 erlpack: ^0.1.4 - eslint: ^8.35.0 - eslint-plugin-unicorn: ^46.0.0 - file-type: ^18.2.1 - format-duration: ^3.0.2 + eslint: ^8.29.0 + eslint-plugin-unicorn: ^45.0.2 + file-type: ^18.0.0 + format-duration: ^2.0.0 jsqr: ^1.4.0 - node-addon-api: ^5.1.0 + node-addon-api: ^5.0.0 node-emoji: ^1.11.0 - oceanic.js: 1.5.1 + oceanic.js: 1.3.2 pm2: ^5.2.2 - postgres: ^3.3.4 + postgres: ^3.3.2 qrcode: ^1.5.1 - sharp: ^0.31.3 - shoukaku: ^3.3.1 - undici: ^5.20.0 + sharp: ^0.31.2 + shoukaku: ^3.2.2 + undici: ^5.14.0 uuid: ^9.0.0 winston: ^3.8.2 winston-daily-rotate-file: ^4.7.1 - ws: ^8.12.1 - zlib-sync: ^0.1.8 + ws: ^8.11.0 + zlib-sync: ^0.1.7 dependencies: dotenv: 16.0.3 emoji-regex: 10.2.1 - file-type: 18.2.1 - format-duration: 3.0.2 + file-type: 18.0.0 + format-duration: 2.0.0 jsqr: 1.4.0 - node-addon-api: 5.1.0 + node-addon-api: 5.0.0 node-emoji: 1.11.0 - oceanic.js: 1.5.1_bufferutil@4.0.7 + oceanic.js: 1.3.2_bufferutil@4.0.7 qrcode: 1.5.1 - sharp: 0.31.3 - shoukaku: 3.3.1_bufferutil@4.0.7 - undici: 5.20.0 + sharp: 0.31.2 + shoukaku: 3.2.2_bufferutil@4.0.7 + undici: 5.14.0 winston: 3.8.2 winston-daily-rotate-file: 4.7.1_winston@3.8.2 optionalDependencies: - better-sqlite3: 8.1.0 + better-sqlite3: 8.0.1 bufferutil: 4.0.7 erlpack: 0.1.4 pm2: 5.2.2_bufferutil@4.0.7 - postgres: 3.3.4 + postgres: 3.3.2 uuid: 9.0.0 - ws: 8.12.1_bufferutil@4.0.7 - zlib-sync: 0.1.8 + ws: 8.11.0_bufferutil@4.0.7 + zlib-sync: 0.1.7 devDependencies: - '@babel/core': 7.21.0 - '@babel/eslint-parser': 7.19.1_zt6cfucldurvbyn2isj445jria - '@babel/eslint-plugin': 7.19.1_zsxfaf6nk6oxn6rgpeszjpjh6i - '@babel/plugin-proposal-class-properties': 7.18.6_@babel+core@7.21.0 - cmake-js: 7.2.1 - eslint: 8.35.0 - eslint-plugin-unicorn: 46.0.0_eslint@8.35.0 + '@babel/core': 7.20.5 + '@babel/eslint-parser': 7.19.1_xthtwe2nrrwct2fnasddpvoro4 + '@babel/eslint-plugin': 7.19.1_iw4s3en7fyyxs2py43hgzzlham + '@babel/plugin-proposal-class-properties': 7.18.6_@babel+core@7.20.5 + cmake-js: 7.0.0 + eslint: 8.29.0 + eslint-plugin-unicorn: 45.0.2_eslint@8.29.0 packages: @@ -83,67 +83,66 @@ packages: '@babel/highlight': 7.18.6 dev: true - /@babel/compat-data/7.21.0: - resolution: {integrity: sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g==} + /@babel/compat-data/7.20.5: + resolution: {integrity: sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g==} engines: {node: '>=6.9.0'} dev: true - /@babel/core/7.21.0: - resolution: {integrity: sha512-PuxUbxcW6ZYe656yL3EAhpy7qXKq0DmYsrJLpbB8XrsCP9Nm+XCg9XFMb5vIDliPD7+U/+M+QJlH17XOcB7eXA==} + /@babel/core/7.20.5: + resolution: {integrity: sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.0 '@babel/code-frame': 7.18.6 - '@babel/generator': 7.21.1 - '@babel/helper-compilation-targets': 7.20.7_@babel+core@7.21.0 - '@babel/helper-module-transforms': 7.21.2 - '@babel/helpers': 7.21.0 - '@babel/parser': 7.21.2 - '@babel/template': 7.20.7 - '@babel/traverse': 7.21.2 - '@babel/types': 7.21.2 + '@babel/generator': 7.20.5 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.20.5 + '@babel/helper-module-transforms': 7.20.2 + '@babel/helpers': 7.20.6 + '@babel/parser': 7.20.5 + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.5 + '@babel/types': 7.20.5 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 - json5: 2.2.3 + json5: 2.2.1 semver: 6.3.0 transitivePeerDependencies: - supports-color dev: true - /@babel/eslint-parser/7.19.1_zt6cfucldurvbyn2isj445jria: + /@babel/eslint-parser/7.19.1_xthtwe2nrrwct2fnasddpvoro4: resolution: {integrity: sha512-AqNf2QWt1rtu2/1rLswy6CDP7H9Oh3mMhk177Y67Rg8d7RD9WfOLLv8CGn6tisFvS2htm86yIe1yLF6I1UDaGQ==} engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} peerDependencies: '@babel/core': '>=7.11.0' eslint: ^7.5.0 || ^8.0.0 dependencies: - '@babel/core': 7.21.0 + '@babel/core': 7.20.5 '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 - eslint: 8.35.0 + eslint: 8.29.0 eslint-visitor-keys: 2.1.0 semver: 6.3.0 dev: true - /@babel/eslint-plugin/7.19.1_zsxfaf6nk6oxn6rgpeszjpjh6i: + /@babel/eslint-plugin/7.19.1_iw4s3en7fyyxs2py43hgzzlham: resolution: {integrity: sha512-ElGPkQPapKMa3zVqXHkZYzuL7I5LbRw9UWBUArgWsdWDDb9XcACqOpBib5tRPA9XvbVZYrFUkoQPbiJ4BFvu4w==} engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} peerDependencies: '@babel/eslint-parser': '>=7.11.0' eslint: '>=7.5.0' dependencies: - '@babel/eslint-parser': 7.19.1_zt6cfucldurvbyn2isj445jria - eslint: 8.35.0 + '@babel/eslint-parser': 7.19.1_xthtwe2nrrwct2fnasddpvoro4 + eslint: 8.29.0 eslint-rule-composer: 0.3.0 dev: true - /@babel/generator/7.21.1: - resolution: {integrity: sha512-1lT45bAYlQhFn/BHivJs43AiW2rg3/UbLyShGfF3C0KmHvO5fSghWd5kBJy30kpRRucGzXStvnnCFniCR2kXAA==} + /@babel/generator/7.20.5: + resolution: {integrity: sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.20.5 '@jridgewell/gen-mapping': 0.3.2 - '@jridgewell/trace-mapping': 0.3.17 jsesc: 2.5.2 dev: true @@ -151,37 +150,35 @@ packages: resolution: {integrity: sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.20.5 dev: true - /@babel/helper-compilation-targets/7.20.7_@babel+core@7.21.0: - resolution: {integrity: sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==} + /@babel/helper-compilation-targets/7.20.0_@babel+core@7.20.5: + resolution: {integrity: sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/compat-data': 7.21.0 - '@babel/core': 7.21.0 - '@babel/helper-validator-option': 7.21.0 - browserslist: 4.21.5 - lru-cache: 5.1.1 + '@babel/compat-data': 7.20.5 + '@babel/core': 7.20.5 + '@babel/helper-validator-option': 7.18.6 + browserslist: 4.21.4 semver: 6.3.0 dev: true - /@babel/helper-create-class-features-plugin/7.21.0_@babel+core@7.21.0: - resolution: {integrity: sha512-Q8wNiMIdwsv5la5SPxNYzzkPnjgC0Sy0i7jLkVOCdllu/xcVNkr3TeZzbHBJrj+XXRqzX5uCyCoV9eu6xUG7KQ==} + /@babel/helper-create-class-features-plugin/7.20.5_@babel+core@7.20.5: + resolution: {integrity: sha512-3RCdA/EmEaikrhayahwToF0fpweU/8o2p8vhc1c/1kftHOdTKuC65kik/TLc+qfbS8JKw4qqJbne4ovICDhmww==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.21.0 + '@babel/core': 7.20.5 '@babel/helper-annotate-as-pure': 7.18.6 '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-function-name': 7.21.0 - '@babel/helper-member-expression-to-functions': 7.21.0 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-member-expression-to-functions': 7.18.9 '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/helper-replace-supers': 7.20.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 + '@babel/helper-replace-supers': 7.19.1 '@babel/helper-split-export-declaration': 7.18.6 transitivePeerDependencies: - supports-color @@ -192,37 +189,37 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-function-name/7.21.0: - resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} + /@babel/helper-function-name/7.19.0: + resolution: {integrity: sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.20.7 - '@babel/types': 7.21.2 + '@babel/template': 7.18.10 + '@babel/types': 7.20.5 dev: true /@babel/helper-hoist-variables/7.18.6: resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.20.5 dev: true - /@babel/helper-member-expression-to-functions/7.21.0: - resolution: {integrity: sha512-Muu8cdZwNN6mRRNG6lAYErJ5X3bRevgYR2O8wN0yn7jJSnGDu6eG59RfT29JHxGUovyfrh6Pj0XzmR7drNVL3Q==} + /@babel/helper-member-expression-to-functions/7.18.9: + resolution: {integrity: sha512-RxifAh2ZoVU67PyKIO4AMi1wTenGfMR/O/ae0CCRqwgBAt5v7xjdtRw7UoSbsreKrQn5t7r89eruK/9JjYHuDg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.20.5 dev: true /@babel/helper-module-imports/7.18.6: resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.20.5 dev: true - /@babel/helper-module-transforms/7.21.2: - resolution: {integrity: sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==} + /@babel/helper-module-transforms/7.20.2: + resolution: {integrity: sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-environment-visitor': 7.18.9 @@ -230,9 +227,9 @@ packages: '@babel/helper-simple-access': 7.20.2 '@babel/helper-split-export-declaration': 7.18.6 '@babel/helper-validator-identifier': 7.19.1 - '@babel/template': 7.20.7 - '@babel/traverse': 7.21.2 - '@babel/types': 7.21.2 + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.5 + '@babel/types': 7.20.5 transitivePeerDependencies: - supports-color dev: true @@ -241,7 +238,7 @@ packages: resolution: {integrity: sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.20.5 dev: true /@babel/helper-plugin-utils/7.20.2: @@ -249,16 +246,15 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-replace-supers/7.20.7: - resolution: {integrity: sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A==} + /@babel/helper-replace-supers/7.19.1: + resolution: {integrity: sha512-T7ahH7wV0Hfs46SFh5Jz3s0B6+o8g3c+7TMxu7xKfmHikg7EAZ3I2Qk9LFhjxXq8sL7UkP5JflezNwoZa8WvWw==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-member-expression-to-functions': 7.21.0 + '@babel/helper-member-expression-to-functions': 7.18.9 '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/template': 7.20.7 - '@babel/traverse': 7.21.2 - '@babel/types': 7.21.2 + '@babel/traverse': 7.20.5 + '@babel/types': 7.20.5 transitivePeerDependencies: - supports-color dev: true @@ -267,21 +263,14 @@ packages: resolution: {integrity: sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.2 - dev: true - - /@babel/helper-skip-transparent-expression-wrappers/7.20.0: - resolution: {integrity: sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.20.5 dev: true /@babel/helper-split-export-declaration/7.18.6: resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.20.5 dev: true /@babel/helper-string-parser/7.19.4: @@ -294,18 +283,18 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-option/7.21.0: - resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==} + /@babel/helper-validator-option/7.18.6: + resolution: {integrity: sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==} engines: {node: '>=6.9.0'} dev: true - /@babel/helpers/7.21.0: - resolution: {integrity: sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==} + /@babel/helpers/7.20.6: + resolution: {integrity: sha512-Pf/OjgfgFRW5bApskEz5pvidpim7tEDPlFtKcNRXWmfHGn9IEI2W2flqRQXTFb7gIPTyK++N6rVHuwKut4XK6w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.20.7 - '@babel/traverse': 7.21.2 - '@babel/types': 7.21.2 + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.5 + '@babel/types': 7.20.5 transitivePeerDependencies: - supports-color dev: true @@ -319,56 +308,56 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser/7.21.2: - resolution: {integrity: sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ==} + /@babel/parser/7.20.5: + resolution: {integrity: sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.21.2 + '@babel/types': 7.20.5 dev: true - /@babel/plugin-proposal-class-properties/7.18.6_@babel+core@7.21.0: + /@babel/plugin-proposal-class-properties/7.18.6_@babel+core@7.20.5: resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.0 - '@babel/helper-create-class-features-plugin': 7.21.0_@babel+core@7.21.0 + '@babel/core': 7.20.5 + '@babel/helper-create-class-features-plugin': 7.20.5_@babel+core@7.20.5 '@babel/helper-plugin-utils': 7.20.2 transitivePeerDependencies: - supports-color dev: true - /@babel/template/7.20.7: - resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} + /@babel/template/7.18.10: + resolution: {integrity: sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/parser': 7.21.2 - '@babel/types': 7.21.2 + '@babel/parser': 7.20.5 + '@babel/types': 7.20.5 dev: true - /@babel/traverse/7.21.2: - resolution: {integrity: sha512-ts5FFU/dSUPS13tv8XiEObDu9K+iagEKME9kAbaP7r0Y9KtZJZ+NGndDvWoRAYNpeWafbpFeki3q9QoMD6gxyw==} + /@babel/traverse/7.20.5: + resolution: {integrity: sha512-WM5ZNN3JITQIq9tFZaw1ojLU3WgWdtkxnhM1AegMS+PvHjkM5IXjmYEGY7yukz5XS4sJyEf2VzWjI8uAavhxBQ==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/generator': 7.21.1 + '@babel/generator': 7.20.5 '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-function-name': 7.21.0 + '@babel/helper-function-name': 7.19.0 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.21.2 - '@babel/types': 7.21.2 + '@babel/parser': 7.20.5 + '@babel/types': 7.20.5 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/types/7.21.2: - resolution: {integrity: sha512-3wRZSs7jiFaB8AjxiiD+VqN5DTG2iRvJGQ+qYFrs/654lg6kGTQWIOFjlBo5RaXuAZjBmP3+OQH4dmhqiiyYxw==} + /@babel/types/7.20.5: + resolution: {integrity: sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-string-parser': 7.19.4 @@ -389,16 +378,16 @@ packages: kuler: 2.0.0 dev: false - /@discordjs/voice/0.14.0_bufferutil@4.0.7: - resolution: {integrity: sha512-/LV8LSFuJ1c4OEW1ubPg3al2QNpUpwX8ZL+KL+LORmnUFVCtehSaEh+38uDfWg1O/TgiGI5vOLj4ZKql43drcw==} + /@discordjs/voice/0.13.0_bufferutil@4.0.7: + resolution: {integrity: sha512-ZzwDmVINaLgkoDUeTJfpN9TkjINMLfTVoLMtEygm0YC5jTTw7AvKGqhc+Ae/2kNLywd0joyFVNrLp94yCkQ9SA==} engines: {node: '>=16.9.0'} requiresBuild: true dependencies: - '@types/ws': 8.5.4 - discord-api-types: 0.37.35 - prism-media: 1.3.5 - tslib: 2.5.0 - ws: 8.12.1_bufferutil@4.0.7 + '@types/ws': 8.5.3 + discord-api-types: 0.37.22 + prism-media: 1.3.4 + tslib: 2.4.1 + ws: 8.11.0_bufferutil@4.0.7 transitivePeerDependencies: - '@discordjs/opus' - bufferutil @@ -409,25 +398,25 @@ packages: dev: false optional: true - /@eslint-community/eslint-utils/4.2.0_eslint@8.35.0: - resolution: {integrity: sha512-gB8T4H4DEfX2IV9zGDJPOBgP1e/DbfCPDTtEqUMckpvzS1OYtva8JdFYBqMwYk7xAQ429WGF/UPqn8uQ//h2vQ==} + /@eslint-community/eslint-utils/4.1.2_eslint@8.29.0: + resolution: {integrity: sha512-7qELuQWWjVDdVsFQ5+beUl+KPczrEDA7S3zM4QUd/bJl7oXgsmpXaEVqrRTnOBqenOV4rWf2kVZk2Ot085zPWA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - eslint: 8.35.0 + eslint: 8.29.0 eslint-visitor-keys: 3.3.0 dev: true - /@eslint/eslintrc/2.0.0: - resolution: {integrity: sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A==} + /@eslint/eslintrc/1.3.3: + resolution: {integrity: sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 debug: 4.3.4 espree: 9.4.1 - globals: 13.20.0 - ignore: 5.2.4 + globals: 13.19.0 + ignore: 5.2.1 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -436,13 +425,8 @@ packages: - supports-color dev: true - /@eslint/js/8.35.0: - resolution: {integrity: sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /@humanwhocodes/config-array/0.11.8: - resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==} + /@humanwhocodes/config-array/0.11.7: + resolution: {integrity: sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==} engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 @@ -523,7 +507,7 @@ packages: engines: {node: '>= 8'} dependencies: '@nodelib/fs.scandir': 2.1.5 - fastq: 1.15.0 + fastq: 1.14.0 dev: true /@opencensus/core/0.0.8: @@ -636,8 +620,8 @@ packages: dev: false optional: true - /@types/node/18.14.6: - resolution: {integrity: sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA==} + /@types/node/18.11.13: + resolution: {integrity: sha512-IASpMGVcWpUsx5xBOrxMj7Bl8lqfuTY7FKAnPmu5cHkfQVWF8GulWS1jbRqA934qZL35xh5xN/+Xe/i26Bod4w==} dev: false optional: true @@ -645,23 +629,19 @@ packages: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: true - /@types/triple-beam/1.3.2: - resolution: {integrity: sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==} - dev: false - - /@types/ws/8.5.4: - resolution: {integrity: sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==} + /@types/ws/8.5.3: + resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: - '@types/node': 18.14.6 + '@types/node': 18.11.13 dev: false optional: true - /acorn-jsx/5.3.2_acorn@8.8.2: + /acorn-jsx/5.3.2_acorn@8.8.1: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.8.2 + acorn: 8.8.1 dev: true /acorn-walk/8.2.0: @@ -670,8 +650,8 @@ packages: dev: false optional: true - /acorn/8.8.2: - resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} + /acorn/8.8.1: + resolution: {integrity: sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==} engines: {node: '>=0.4.0'} hasBin: true @@ -747,7 +727,7 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} dependencies: delegates: 1.0.0 - readable-stream: 3.6.1 + readable-stream: 3.6.0 dev: true /argparse/1.0.10: @@ -765,7 +745,7 @@ packages: resolution: {integrity: sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==} engines: {node: '>=4'} dependencies: - tslib: 2.5.0 + tslib: 2.4.1 dev: false optional: true @@ -802,12 +782,11 @@ packages: dev: false optional: true - /axios/1.3.4_debug@4.3.4: - resolution: {integrity: sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==} + /axios/0.27.2_debug@4.3.4: + resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} dependencies: follow-redirects: 1.15.2_debug@4.3.4 form-data: 4.0.0 - proxy-from-env: 1.1.0 transitivePeerDependencies: - debug dev: true @@ -819,8 +798,8 @@ packages: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} dev: false - /better-sqlite3/8.1.0: - resolution: {integrity: sha512-p1m09H+Oi8R9TPj810pdNswMFuVgRNgCJEWypp6jlkOgSwMIrNyuj3hW78xEuBRGok5RzeaUW8aBtTWF3l/TQA==} + /better-sqlite3/8.0.1: + resolution: {integrity: sha512-JhTZjpyapA1icCEjIZB4TSSgkGdFgpWZA2Wszg7Cf4JwJwKQmbvuNnJBeR+EYG/Z29OXvR4G//Rbg31BW/Z7Yg==} requiresBuild: true dependencies: bindings: 1.5.0 @@ -846,7 +825,7 @@ packages: dependencies: buffer: 5.7.1 inherits: 2.0.4 - readable-stream: 3.6.1 + readable-stream: 3.6.0 dev: false /blessed/0.1.81: @@ -875,15 +854,15 @@ packages: dev: false optional: true - /browserslist/4.21.5: - resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} + /browserslist/4.21.4: + resolution: {integrity: sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001462 - electron-to-chromium: 1.4.325 - node-releases: 2.0.10 - update-browserslist-db: 1.0.10_browserslist@4.21.5 + caniuse-lite: 1.0.30001439 + electron-to-chromium: 1.4.284 + node-releases: 2.0.6 + update-browserslist-db: 1.0.10_browserslist@4.21.4 dev: true /buffer-from/1.1.2: @@ -903,7 +882,7 @@ packages: engines: {node: '>=6.14.2'} requiresBuild: true dependencies: - node-gyp-build: 4.6.0 + node-gyp-build: 4.5.0 dev: false /builtin-modules/3.3.0: @@ -934,8 +913,8 @@ packages: engines: {node: '>=6'} dev: false - /caniuse-lite/1.0.30001462: - resolution: {integrity: sha512-PDd20WuOBPiasZ7KbFnmQRyuLE7cFXW2PVd7dmALzbkUXEP46upAuCDm9eY9vho8fgNMGmbAX92QBZHzcnWIqw==} + /caniuse-lite/1.0.30001439: + resolution: {integrity: sha512-1MgUzEkoMO6gKfXflStpYgZDlFM7M/ck/bgfVCACO5vnAf0fXoNVHdWtqGU+MYca+4bL9Z5bpOVmR33cWW9G2A==} dev: true /chalk/2.4.2: @@ -994,8 +973,8 @@ packages: engines: {node: '>=10'} dev: true - /ci-info/3.8.0: - resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==} + /ci-info/3.7.0: + resolution: {integrity: sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog==} engines: {node: '>=8'} dev: true @@ -1031,24 +1010,24 @@ packages: wrap-ansi: 7.0.0 dev: true - /cmake-js/7.2.1: - resolution: {integrity: sha512-AdPSz9cSIJWdKvm0aJgVu3X8i0U3mNTswJkSHzZISqmYVjZk7Td4oDFg0mCBA383wO+9pG5Ix7pEP1CZH9x2BA==} + /cmake-js/7.0.0: + resolution: {integrity: sha512-Xmti54GzAg+70lsPRKsuw18ktAB+NwPS3m+b6dLzh3Zi+7k8QSVi857UWXzn9sjPXGz5BfSfo3vNISRaTVU/4A==} engines: {node: '>= 14.15.0'} hasBin: true dependencies: - axios: 1.3.4_debug@4.3.4 + axios: 0.27.2_debug@4.3.4 debug: 4.3.4 fs-extra: 10.1.0 lodash.isplainobject: 4.0.6 memory-stream: 1.0.0 - node-api-headers: 0.0.2 + node-api-headers: 0.0.1 npmlog: 6.0.2 rc: 1.2.8 semver: 7.3.8 tar: 6.1.13 url-join: 4.0.1 which: 2.0.2 - yargs: 17.7.1 + yargs: 17.6.2 transitivePeerDependencies: - supports-color dev: true @@ -1224,7 +1203,7 @@ packages: ast-types: 0.13.4 escodegen: 1.14.3 esprima: 4.0.1 - vm2: 3.9.14 + vm2: 3.9.13 dev: false optional: true @@ -1252,8 +1231,8 @@ packages: resolution: {integrity: sha512-QV6PMaHTCNmKSeP6QoXhVTw9snc9VD8MulTT0Bd99Pacp4SS1cjcrYPgBPmibqKVtMJJfqC6XvOXgPMEEPH/fg==} dev: false - /discord-api-types/0.37.35: - resolution: {integrity: sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==} + /discord-api-types/0.37.22: + resolution: {integrity: sha512-1FSm5hIUaxt3e+3H6lhY5Hg32DTJCPp3Q5gf3CM2CPSr95ZnqkSNEV0s7EdiBrlv5QoPrpcPIDYC3hWqZT2mIg==} dev: false optional: true @@ -1269,8 +1248,8 @@ packages: engines: {node: '>=12'} dev: false - /electron-to-chromium/1.4.325: - resolution: {integrity: sha512-K1C03NT4I7BuzsRdCU5RWkgZxtswnKDYM6/eMhkEXqKu4e5T+ck610x3FPzu1y7HVFSiQKZqP16gnJzPpji1TQ==} + /electron-to-chromium/1.4.284: + resolution: {integrity: sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==} dev: true /emitter-listener/1.1.2: @@ -1352,20 +1331,20 @@ packages: dev: false optional: true - /eslint-plugin-unicorn/46.0.0_eslint@8.35.0: - resolution: {integrity: sha512-j07WkC+PFZwk8J33LYp6JMoHa1lXc1u6R45pbSAipjpfpb7KIGr17VE2D685zCxR5VL4cjrl65kTJflziQWMDA==} + /eslint-plugin-unicorn/45.0.2_eslint@8.29.0: + resolution: {integrity: sha512-Y0WUDXRyGDMcKLiwgL3zSMpHrXI00xmdyixEGIg90gHnj0PcHY4moNv3Ppje/kDivdAy5vUeUr7z211ImPv2gw==} engines: {node: '>=14.18'} peerDependencies: eslint: '>=8.28.0' dependencies: '@babel/helper-validator-identifier': 7.19.1 - '@eslint-community/eslint-utils': 4.2.0_eslint@8.35.0 - ci-info: 3.8.0 + '@eslint-community/eslint-utils': 4.1.2_eslint@8.29.0 + ci-info: 3.7.0 clean-regexp: 1.0.0 - eslint: 8.35.0 - esquery: 1.5.0 + eslint: 8.29.0 + esquery: 1.4.0 indent-string: 4.0.0 - is-builtin-module: 3.2.1 + is-builtin-module: 3.2.0 jsesc: 3.0.2 lodash: 4.17.21 pluralize: 8.0.0 @@ -1398,13 +1377,13 @@ packages: estraverse: 5.3.0 dev: true - /eslint-utils/3.0.0_eslint@8.35.0: + /eslint-utils/3.0.0_eslint@8.29.0: resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '>=5' dependencies: - eslint: 8.35.0 + eslint: 8.29.0 eslint-visitor-keys: 2.1.0 dev: true @@ -1418,14 +1397,13 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint/8.35.0: - resolution: {integrity: sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw==} + /eslint/8.29.0: + resolution: {integrity: sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint/eslintrc': 2.0.0 - '@eslint/js': 8.35.0 - '@humanwhocodes/config-array': 0.11.8 + '@eslint/eslintrc': 1.3.3 + '@humanwhocodes/config-array': 0.11.7 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 ajv: 6.12.6 @@ -1435,23 +1413,23 @@ packages: doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 - eslint-utils: 3.0.0_eslint@8.35.0 + eslint-utils: 3.0.0_eslint@8.29.0 eslint-visitor-keys: 3.3.0 espree: 9.4.1 - esquery: 1.5.0 + esquery: 1.4.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.20.0 + globals: 13.19.0 grapheme-splitter: 1.0.4 - ignore: 5.2.4 + ignore: 5.2.1 import-fresh: 3.3.0 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 - js-sdsl: 4.3.0 + js-sdsl: 4.2.0 js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 @@ -1471,8 +1449,8 @@ packages: resolution: {integrity: sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.8.2 - acorn-jsx: 5.3.2_acorn@8.8.2 + acorn: 8.8.1 + acorn-jsx: 5.3.2_acorn@8.8.1 eslint-visitor-keys: 3.3.0 dev: true @@ -1483,8 +1461,8 @@ packages: dev: false optional: true - /esquery/1.5.0: - resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + /esquery/1.4.0: + resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==} engines: {node: '>=0.10'} dependencies: estraverse: 5.3.0 @@ -1546,8 +1524,8 @@ packages: /fast-levenshtein/2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - /fastq/1.15.0: - resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} + /fastq/1.14.0: + resolution: {integrity: sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==} dependencies: reusify: 1.0.4 dev: true @@ -1574,8 +1552,8 @@ packages: moment: 2.29.4 dev: false - /file-type/18.2.1: - resolution: {integrity: sha512-Yw5MtnMv7vgD2/6Bjmmuegc8bQEVA9GmAyaR18bMYWKqsWDG9wgYZ1j4I6gNMF5Y5JBDcUcjRQqNQx7Y8uotcg==} + /file-type/18.0.0: + resolution: {integrity: sha512-jjMwFpnW8PKofLE/4ohlhqwDk5k0NC6iy0UHAJFKoY1fQeGMN0GDdLgHQrvCbSpMwbqzoCZhRI5dETCZna5qVA==} engines: {node: '>=14.16'} dependencies: readable-web-to-node-stream: 3.0.2 @@ -1653,8 +1631,8 @@ packages: mime-types: 2.1.35 dev: true - /format-duration/3.0.2: - resolution: {integrity: sha512-pKzJDSRgK2lqAiPW3uizDaIJaJnataZclsahz25UMwfdryBGDa+1HlbXGjzpMvX/2kMh4O0sNevFXKaEfCjHsA==} + /format-duration/2.0.0: + resolution: {integrity: sha512-ARqJ9qXm71pw3SGAY7bibf8lRLvltOXLjWjzzR3UrUjHu1zdeYpA/Z+u+ltdhrfRa440OjEsHNzdmuZViqqQWQ==} dev: false /fs-constants/1.0.0: @@ -1799,8 +1777,8 @@ packages: engines: {node: '>=4'} dev: true - /globals/13.20.0: - resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==} + /globals/13.19.0: + resolution: {integrity: sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -1883,8 +1861,8 @@ packages: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} dev: false - /ignore/5.2.4: - resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} + /ignore/5.2.1: + resolution: {integrity: sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==} engines: {node: '>= 4'} dev: true @@ -1944,8 +1922,8 @@ packages: dev: false optional: true - /is-builtin-module/3.2.1: - resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} + /is-builtin-module/3.2.0: + resolution: {integrity: sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==} engines: {node: '>=6'} dependencies: builtin-modules: 3.3.0 @@ -2005,8 +1983,8 @@ packages: dev: false optional: true - /js-sdsl/4.3.0: - resolution: {integrity: sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==} + /js-sdsl/4.2.0: + resolution: {integrity: sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==} dev: true /js-tokens/4.0.0: @@ -2054,8 +2032,8 @@ packages: dev: false optional: true - /json5/2.2.3: - resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + /json5/2.2.1: + resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==} engines: {node: '>=6'} hasBin: true dev: true @@ -2140,14 +2118,13 @@ packages: dev: false optional: true - /logform/2.5.1: - resolution: {integrity: sha512-9FyqAm9o9NKKfiAKfZoYo9bGXXuwMkxQiQttkT4YjjVtQVIQtK6LmVtlxmCaFswo6N4AfEkHqZTV0taDtPotNg==} + /logform/2.4.2: + resolution: {integrity: sha512-W4c9himeAwXEdZ05dQNerhFz2XG80P9Oj0loPUMV23VC2it0orMHQhJm4hdnnor3rd1HsGf6a2lPwBM1zeXHGw==} dependencies: '@colors/colors': 1.5.0 - '@types/triple-beam': 1.3.2 fecha: 4.2.3 ms: 2.1.3 - safe-stable-stringify: 2.4.2 + safe-stable-stringify: 2.4.1 triple-beam: 1.3.0 dev: false @@ -2155,6 +2132,8 @@ packages: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} dependencies: yallist: 3.1.1 + dev: false + optional: true /lru-cache/6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} @@ -2165,7 +2144,7 @@ packages: /memory-stream/1.0.0: resolution: {integrity: sha512-Wm13VcsPIMdG96dzILfij09PvuS3APtcKNh7M28FsCA/w6+1mjR7hhPmfFNoilX9xU7wTdhsH5lJAm6XNzdtww==} dependencies: - readable-stream: 3.6.1 + readable-stream: 3.6.0 dev: true /mime-db/1.52.0: @@ -2195,8 +2174,8 @@ packages: dependencies: brace-expansion: 1.1.11 - /minimist/1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + /minimist/1.2.7: + resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} /minipass/3.3.6: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} @@ -2205,9 +2184,11 @@ packages: yallist: 4.0.0 dev: true - /minipass/4.2.4: - resolution: {integrity: sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==} + /minipass/4.0.0: + resolution: {integrity: sha512-g2Uuh2jEKoht+zvO6vJqXmYpflPqzRBT+Th2h01DKh5z7wbY/AZ2gCQ78cP70YoHPyFdY30YBV5WxgLOEwOykw==} engines: {node: '>=8'} + dependencies: + yallist: 4.0.0 dev: true /minizlib/2.1.2: @@ -2280,19 +2261,19 @@ packages: dev: false optional: true - /node-abi/3.33.0: - resolution: {integrity: sha512-7GGVawqyHF4pfd0YFybhv/eM9JwTtPqx0mAanQ146O3FlSh3pA24zf9IRQTOsfTSqXTNzPSP5iagAJ94jjuVog==} + /node-abi/3.30.0: + resolution: {integrity: sha512-qWO5l3SCqbwQavymOmtTVuCWZE23++S+rxyoHjXqUmPyzRcaoI4lA2gO55/drddGnedAyjA7sk76SfQ5lfUMnw==} engines: {node: '>=10'} dependencies: semver: 7.3.8 dev: false - /node-addon-api/5.1.0: - resolution: {integrity: sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==} + /node-addon-api/5.0.0: + resolution: {integrity: sha512-CvkDw2OEnme7ybCykJpVcKH+uAOLV2qLqiyla128dN9TkEWfrYmxG6C2boDe5KcNQqZF3orkqzGgOMvZ/JNekA==} dev: false - /node-api-headers/0.0.2: - resolution: {integrity: sha512-YsjmaKGPDkmhoNKIpkChtCsPVaRE0a274IdERKnuc/E8K1UJdBZ4/mvI006OijlQZHCfpRNOH3dfHQs92se8gg==} + /node-api-headers/0.0.1: + resolution: {integrity: sha512-eRxckUSXMRQRV69h+ksfleQzR3BdRwkJuc/Y65KFFwhibC5G1y6wgytYW2WWTB/oG1bt+pf2RwjZDYC0xKqgqQ==} dev: true /node-emoji/1.11.0: @@ -2301,25 +2282,13 @@ packages: lodash: 4.17.21 dev: false - /node-fetch/2.6.9: - resolution: {integrity: sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - dependencies: - whatwg-url: 5.0.0 - dev: false - - /node-gyp-build/4.6.0: - resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==} + /node-gyp-build/4.5.0: + resolution: {integrity: sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==} hasBin: true dev: false - /node-releases/2.0.10: - resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==} + /node-releases/2.0.6: + resolution: {integrity: sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==} dev: true /normalize-package-data/2.5.0: @@ -2361,14 +2330,14 @@ packages: engines: {node: '>= 6'} dev: false - /oceanic.js/1.5.1_bufferutil@4.0.7: - resolution: {integrity: sha512-N4c25J8UCxYJ5BtqTc2EVmcRLyBO/ZGhMhwsIiodYBwBen9AX4ipqwAsAhoosOJi8+WrWiDzAI3mSJ4Lxt2Mww==} + /oceanic.js/1.3.2_bufferutil@4.0.7: + resolution: {integrity: sha512-nLedv0gmtMTnAVJQWIePWf7nz/7fRzYpoQndiwsn8X9CGRDAYDgtmdCtUD+EylkIN5zRNg+aWm6EcriKEXCZUg==} engines: {node: '>=16.16.0'} dependencies: - undici: 5.20.0 - ws: 8.12.1_bufferutil@4.0.7 + undici: 5.14.0 + ws: 8.11.0_bufferutil@4.0.7 optionalDependencies: - '@discordjs/voice': 0.14.0_bufferutil@4.0.7 + '@discordjs/voice': 0.13.0_bufferutil@4.0.7 transitivePeerDependencies: - '@discordjs/opus' - bufferutil @@ -2455,7 +2424,7 @@ packages: http-proxy-agent: 4.0.1 https-proxy-agent: 5.0.1 pac-resolver: 5.0.1 - raw-body: 2.5.2 + raw-body: 2.5.1 socks-proxy-agent: 5.0.1 transitivePeerDependencies: - supports-color @@ -2592,7 +2561,7 @@ packages: async: 3.2.4 debug: 4.3.4 pidusage: 2.0.21 - systeminformation: 5.17.12 + systeminformation: 5.16.6 tx2: 1.0.5 transitivePeerDependencies: - supports-color @@ -2648,8 +2617,8 @@ packages: engines: {node: '>=10.13.0'} dev: false - /postgres/3.3.4: - resolution: {integrity: sha512-XVu0+d/Y56pl2lSaf0c7V19AhAEfpVrhID1IENWN8nf0xch6hFq6dAov5dtUX6ZD46wfr1TxvLhxLtV8WnNsOg==} + /postgres/3.3.2: + resolution: {integrity: sha512-NaPqFpUC6C7aCQkJXLvuO/3RKNKL4en8opY53YrcXK3//xXra6CZ2qX6290lxuQ1dW1LbRGYCmsawRlCxSBonQ==} requiresBuild: true dev: false optional: true @@ -2662,10 +2631,10 @@ packages: detect-libc: 2.0.1 expand-template: 2.0.3 github-from-package: 0.0.0 - minimist: 1.2.8 + minimist: 1.2.7 mkdirp-classic: 0.5.3 napi-build-utils: 1.0.2 - node-abi: 3.33.0 + node-abi: 3.30.0 pump: 3.0.0 rc: 1.2.8 simple-get: 4.0.1 @@ -2684,10 +2653,10 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prism-media/1.3.5: - resolution: {integrity: sha512-IQdl0Q01m4LrkN1EGIE9lphov5Hy7WWlH6ulf5QdGePLlPas9p2mhgddTEHrlaXYjjFToM1/rWuwF37VF4taaA==} + /prism-media/1.3.4: + resolution: {integrity: sha512-eW7LXORkTCQznZs+eqe9VjGOrLBxcBPXgNyHXMTSRVhphvd/RrxgIR7WaWt4fkLuhshcdT5KHL88LAfcvS3f5g==} peerDependencies: - '@discordjs/opus': '>=0.8.0 <1.0.0' + '@discordjs/opus': ^0.8.0 ffmpeg-static: ^5.0.2 || ^4.2.7 || ^3.0.0 || ^2.4.0 node-opus: ^0.3.3 opusscript: ^0.0.8 @@ -2729,6 +2698,8 @@ packages: /proxy-from-env/1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + optional: true /pump/3.0.0: resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} @@ -2737,8 +2708,8 @@ packages: once: 1.4.0 dev: false - /punycode/2.3.0: - resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} + /punycode/2.1.1: + resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} engines: {node: '>=6'} dev: true @@ -2757,8 +2728,8 @@ packages: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true - /raw-body/2.5.2: - resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} + /raw-body/2.5.1: + resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} engines: {node: '>= 0.8'} dependencies: bytes: 3.1.2 @@ -2774,7 +2745,7 @@ packages: dependencies: deep-extend: 0.6.0 ini: 1.3.8 - minimist: 1.2.8 + minimist: 1.2.7 strip-json-comments: 2.0.1 /read-pkg-up/7.0.1: @@ -2814,8 +2785,8 @@ packages: dev: false optional: true - /readable-stream/3.6.1: - resolution: {integrity: sha512-+rQmrWMYGA90yenhTYsLWAsLsqVC8osOw6PKE1HDYiO0gdPeKe/xDHNzIAIn4C91YQ6oenEhfYqqc1883qHbjQ==} + /readable-stream/3.6.0: + resolution: {integrity: sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==} engines: {node: '>= 6'} dependencies: inherits: 2.0.4 @@ -2826,7 +2797,7 @@ packages: resolution: {integrity: sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==} engines: {node: '>=8'} dependencies: - readable-stream: 3.6.1 + readable-stream: 3.6.0 dev: false /readdirp/3.6.0: @@ -2919,8 +2890,8 @@ packages: regexp-tree: 0.1.24 dev: true - /safe-stable-stringify/2.4.2: - resolution: {integrity: sha512-gMxvPJYhP0O9n2pvcfYfIuYgbledAOJFcqRThtPRmjscaipiwcwPPKLytpVzMkG2HAN87Qmo2d4PtGiri1dSLA==} + /safe-stable-stringify/2.4.1: + resolution: {integrity: sha512-dVHE6bMtS/bnL2mwualjc6IxEv1F+OCUpA46pKUj6F8uDbUM0jCCulPqRNPSnWwGNKx5etqMjZYdXtrm5KJZGA==} engines: {node: '>=10'} dev: false @@ -2964,14 +2935,14 @@ packages: dev: false optional: true - /sharp/0.31.3: - resolution: {integrity: sha512-XcR4+FCLBFKw1bdB+GEhnUNXNXvnt0tDo4WsBsraKymuo/IAuPuCBVAL2wIkUw2r/dwFW5Q5+g66Kwl2dgDFVg==} + /sharp/0.31.2: + resolution: {integrity: sha512-DUdNVEXgS5A97cTagSLIIp8dUZ/lZtk78iNVZgHdHbx1qnQR7JAHY0BnXnwwH39Iw+VKhO08CTYhIg0p98vQ5Q==} engines: {node: '>=14.15.0'} requiresBuild: true dependencies: color: 4.2.3 detect-libc: 2.0.1 - node-addon-api: 5.1.0 + node-addon-api: 5.0.0 prebuild-install: 7.1.1 semver: 7.3.8 simple-get: 4.0.1 @@ -2996,15 +2967,14 @@ packages: dev: false optional: true - /shoukaku/3.3.1_bufferutil@4.0.7: - resolution: {integrity: sha512-oyM+fs+6CFjzIsespf6Ajp7780ZwKwMDV1mRnFzCex22MK4ydbIK3IlCY4KjWurgxJz+8DvLVL/8/Xw4NmpdqQ==} + /shoukaku/3.2.2_bufferutil@4.0.7: + resolution: {integrity: sha512-GhgjV4i3gbN9cnX+RtbvIcLk4/dVJqOQFId33Quu5H9Pkm7kYi1ISqjIel4G4gJo4x3hdxAncvTiKCctcgQeaQ==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: - node-fetch: 2.6.9 - ws: 8.12.1_bufferutil@4.0.7 + undici: 5.14.0 + ws: 8.11.0_bufferutil@4.0.7 transitivePeerDependencies: - bufferutil - - encoding - utf-8-validate dev: false @@ -3070,8 +3040,8 @@ packages: dev: false optional: true - /spdx-correct/3.2.0: - resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + /spdx-correct/3.1.1: + resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} dependencies: spdx-expression-parse: 3.0.1 spdx-license-ids: 3.0.12 @@ -3182,8 +3152,8 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - /systeminformation/5.17.12: - resolution: {integrity: sha512-I3pfMW2vue53u+X08BNxaJieaHkRoMMKjWetY9lbYJeWFaeWPO6P4FkNc4XOCX8F9vbQ0HqQ25RJoz3U/B7liw==} + /systeminformation/5.16.6: + resolution: {integrity: sha512-FLljCM7UmCVnilpQvX9b1SptMjuxPrtlqqSsFPI/3nQ19ZDJSalpph/9K707y5N6gT1loJwG42j+xVhX0RwuFw==} engines: {node: '>=8.0.0'} os: [darwin, linux, win32, freebsd, openbsd, netbsd, sunos, android] hasBin: true @@ -3207,7 +3177,7 @@ packages: end-of-stream: 1.4.4 fs-constants: 1.0.0 inherits: 2.0.4 - readable-stream: 3.6.1 + readable-stream: 3.6.0 dev: false /tar/6.1.13: @@ -3216,7 +3186,7 @@ packages: dependencies: chownr: 2.0.0 fs-minipass: 2.1.0 - minipass: 4.2.4 + minipass: 4.0.0 minizlib: 2.1.2 mkdirp: 1.0.4 yallist: 4.0.0 @@ -3257,10 +3227,6 @@ packages: ieee754: 1.2.1 dev: false - /tr46/0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - dev: false - /triple-beam/1.3.0: resolution: {integrity: sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==} dev: false @@ -3270,8 +3236,8 @@ packages: dev: false optional: true - /tslib/2.5.0: - resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} + /tslib/2.4.1: + resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} dev: false optional: true @@ -3324,8 +3290,8 @@ packages: engines: {node: '>=8'} dev: true - /undici/5.20.0: - resolution: {integrity: sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g==} + /undici/5.14.0: + resolution: {integrity: sha512-yJlHYw6yXPPsuOH0x2Ib1Km61vu4hLiRRQoafs+WUgX1vO64vgnxiCEN9dpIrhZyHFsai3F0AEj4P9zy19enEQ==} engines: {node: '>=12.18'} dependencies: busboy: 1.6.0 @@ -3348,13 +3314,13 @@ packages: dev: false optional: true - /update-browserslist-db/1.0.10_browserslist@4.21.5: + /update-browserslist-db/1.0.10_browserslist@4.21.4: resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.21.5 + browserslist: 4.21.4 escalade: 3.1.1 picocolors: 1.0.0 dev: true @@ -3362,7 +3328,7 @@ packages: /uri-js/4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: - punycode: 2.3.0 + punycode: 2.1.1 dev: true /url-join/4.0.1: @@ -3389,7 +3355,7 @@ packages: /validate-npm-package-license/3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} dependencies: - spdx-correct: 3.2.0 + spdx-correct: 3.1.1 spdx-expression-parse: 3.0.1 dev: true @@ -3404,27 +3370,16 @@ packages: dev: false optional: true - /vm2/3.9.14: - resolution: {integrity: sha512-HgvPHYHeQy8+QhzlFryvSteA4uQLBCOub02mgqdR+0bN/akRZ48TGB1v0aCv7ksyc0HXx16AZtMHKS38alc6TA==} + /vm2/3.9.13: + resolution: {integrity: sha512-0rvxpB8P8Shm4wX2EKOiMp7H2zq+HUE/UwodY0pCZXs9IffIKZq6vUti5OgkVCTakKo9e/fgO4X1fkwfjWxE3Q==} engines: {node: '>=6.0'} hasBin: true dependencies: - acorn: 8.8.2 + acorn: 8.8.1 acorn-walk: 8.2.0 dev: false optional: true - /webidl-conversions/3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - dev: false - - /whatwg-url/5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - dev: false - /which-module/2.0.0: resolution: {integrity: sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==} dev: false @@ -3460,8 +3415,8 @@ packages: resolution: {integrity: sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==} engines: {node: '>= 6.4.0'} dependencies: - logform: 2.5.1 - readable-stream: 3.6.1 + logform: 2.4.2 + readable-stream: 3.6.0 triple-beam: 1.3.0 dev: false @@ -3473,10 +3428,10 @@ packages: '@dabh/diagnostics': 2.0.3 async: 3.2.4 is-stream: 2.0.1 - logform: 2.5.1 + logform: 2.4.2 one-time: 1.0.0 - readable-stream: 3.6.1 - safe-stable-stringify: 2.4.2 + readable-stream: 3.6.0 + safe-stable-stringify: 2.4.1 stack-trace: 0.0.10 triple-beam: 1.3.0 winston-transport: 4.5.0 @@ -3539,12 +3494,12 @@ packages: dev: false optional: true - /ws/8.12.1_bufferutil@4.0.7: - resolution: {integrity: sha512-1qo+M9Ba+xNhPB+YTWUlK6M17brTut5EXbcBaMRN5pH5dFrXz7lzz1ChFSUq3bOUl8yEvSenhHmYUNJxFzdJew==} + /ws/8.11.0_bufferutil@4.0.7: + resolution: {integrity: sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' + utf-8-validate: ^5.0.2 peerDependenciesMeta: bufferutil: optional: true @@ -3570,6 +3525,8 @@ packages: /yallist/3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + dev: false + optional: true /yallist/4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} @@ -3613,8 +3570,8 @@ packages: yargs-parser: 18.1.3 dev: false - /yargs/17.7.1: - resolution: {integrity: sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==} + /yargs/17.6.2: + resolution: {integrity: sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==} engines: {node: '>=12'} dependencies: cliui: 8.0.1 @@ -3631,8 +3588,8 @@ packages: engines: {node: '>=10'} dev: true - /zlib-sync/0.1.8: - resolution: {integrity: sha512-Xbu4odT5SbLsa1HFz8X/FvMgUbJYWxJYKB2+bqxJ6UOIIPaVGrqHEB3vyXDltSA6tTqBhSGYLgiVpzPQHYi3lA==} + /zlib-sync/0.1.7: + resolution: {integrity: sha512-UmciU6ZrIwtwPC8noMzq+kGMdiWwNRZ3wC0SbED4Ew5Ikqx14MqDPRs/Pbk+3rZPh5SzsOgUBs1WRE0iieddpg==} requiresBuild: true dependencies: nan: 2.17.0 diff --git a/utils/pagination/pagination.js b/utils/pagination/pagination.js index 4b2ba7f..1c12c86 100644 --- a/utils/pagination/pagination.js +++ b/utils/pagination/pagination.js @@ -138,7 +138,7 @@ export default async (client, info, pages, timeout = 120000) => { } catch { // no-op } - page = Number(response.data.values.raw[0]); + page = Number(response.data.values[0]); currentPage = await currentPage.edit(Object.assign(pages[page], options, components)); ended = true; dropdownCollector.stop();