[Snyk] Upgrade: debug, mongoose, shutterstock-api, telegraf #198
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade multiple dependencies.
👯♂ The following dependencies are linked and will therefore be updated together.ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
debug
from 4.3.3 to 4.3.6 | 3 versions ahead of your current version | 2 months ago
on 2024-07-27
mongoose
from 6.0.12 to 6.13.0 | 97 versions ahead of your current version | 3 months ago
on 2024-06-06
shutterstock-api
from 1.1.12 to 1.1.41 | 26 versions ahead of your current version | 3 months ago
on 2024-06-20
telegraf
from 4.5.2 to 4.16.3 | 58 versions ahead of your current version | 7 months ago
on 2024-02-29
Issues fixed by the recommended upgrade:
SNYK-JS-MONGOOSE-2961688
SNYK-JS-MONGOOSE-5777721
SNYK-JS-MONGODB-5871303
SNYK-JS-MINIMIST-2429795
Release notes
Package name: debug
-
4.3.6 - 2024-07-27
- Avoid using deprecated RegExp.$1 by @ bluwy in #969
- @ bluwy made their first contribution in #969
-
4.3.5 - 2024-05-31
- cac39b1 Fix/debug depth (#926)
-
4.3.4 - 2022-03-17
- Add section about configuring JS console to show debug messages by @ gitname in #866
- Replace deprecated String.prototype.substr() by @ CommanderRoot in #876
- @ gitname made their first contribution in #866
- @ CommanderRoot made their first contribution in #876
-
4.3.3 - 2021-11-27
- Migrates repository from https://github.com/visionmedia/debug to https://github.com/debug-js/debug. Please see notes below as to why this change was made.
- Updates repository maintainership information
- Updates the copyright (no license terms change has been made)
- Removes accidental epizeuxis (#828)
- Adds README section regarding usage in child procs (#850)
- The old organization was defunct and abandoned.
- I was not an owner of the old organization and thus could not ban the non-trivial amount of spam users or the few truly abusive users from the org. This hindered my ability to properly maintain this package.
- The
- The old org has way, way too many approved members with push access, for which there was nothing I could do. This presented a pretty sizable security risk given that many packages in recent years have fallen victim to backdoors and the like due to lax security access.
from debug GitHub release notesWhat's Changed
New Contributors
Full Changelog: 4.3.5...4.3.6
Patch
Thank you @ calvintwr for the fix.
What's Changed
New Contributors
Full Changelog: 4.3.3...4.3.4
Patch Release 4.3.3
This is a documentation-only release. Further, the repository was transferred. Please see notes below.
Thank you to @ taylor1791 and @ kristofkalocsai for their contributions.
Repository Migration Information
I've formatted this as a FAQ, please feel free to open an issue for any additional question and I'll add the response here.
Q: What impact will this have on me?
In most cases, you shouldn't notice any change.
The only exception I can think of is if you pull code directly from https://github.com/visionmedia/debug, e.g. via a
"debug": "visionmedia/debug"-type version entry in your package.json - in which case, you should still be fine due to the automatic redirection Github sets up, but you should also update any references as soon as possible.Q: What are the security implications of this change?
If you pull code directly from the old URL, you should update the URL to https://github.com/debug-js/debug as soon as possible. The old organization has many approved owners and thus a new repository could (in theory) be created at the old URL, circumventing Github's automatic redirect that is in place now and serving malicious code. I (@ Qix-) also wouldn't have access to that repository, so while I don't think it would happen, it's still something to consider.
Even in such a case, however, the officially released package on npm (
debug) would not be affected. That package is still very much under control (even more than it used to be).Q: What should I do if I encounter an issue related to the migration?
Search the issues first to see if someone has already reported it, and then open a new issue if someone has not.
Q: Why was this done as a 'patch' release? Isn't this breaking?
No, it shouldn't be breaking. The package on npm shouldn't be affected (aside from this patch release) and any references to the old repository should automatically redirect.
Thus, according to all of the "APIs" (loosely put) involved, nothing should have broken.
I understand there are a lot of edge cases so please open issues as needed so I can assist in any way necessary.
Q: Why was the repository transferred?
I'll just list them off in no particular order.
debugecosystem intends to grow beyond a single package, and since new packages could not be created in the old org (nor did it make sense for them to live there), a new org made the most sense - especially from a security point of view.Q: Was this approved?
Yes.[archive]
Q: Do I need to worry about another migration sometime in the future?
No.
Package name: mongoose
-
6.13.0 - 2024-06-06
-
6.12.9 - 2024-05-24
-
6.12.8 - 2024-04-10
-
6.12.7 - 2024-03-01
-
6.12.6 - 2024-01-22
-
6.12.5 - 2024-01-03
-
6.12.4 - 2023-12-27
-
6.12.3 - 2023-11-07
-
6.12.2 - 2023-10-25
-
6.12.1 - 2023-10-12
-
6.12.0 - 2023-08-24
-
6.11.6 - 2023-08-21
-
6.11.5 - 2023-08-01
-
6.11.4 - 2023-07-17
-
6.11.3 - 2023-07-11
-
6.11.2 - 2023-06-08
-
6.11.1 - 2023-05-08
-
6.11.0 - 2023-05-01
-
6.10.5 - 2023-04-06
-
6.10.4 - 2023-03-21
-
6.10.3 - 2023-03-13
-
6.10.2 - 2023-03-07
-
6.10.1 - 2023-03-03
-
6.10.0 - 2023-02-22
-
6.9.3 - 2023-02-22
-
6.9.2 - 2023-02-16
-
6.9.1 - 2023-02-06
-
6.9.0 - 2023-01-25
-
6.8.4 - 2023-01-17
-
6.8.3 - 2023-01-06
-
6.8.2 - 2022-12-28
-
6.8.1 - 2022-12-19
-
6.8.0 - 2022-12-05
-
6.7.5 - 2022-11-30
-
6.7.4 - 2022-11-28
-
6.7.3 - 2022-11-22
-
6.7.2 - 2022-11-07
-
6.7.1 - 2022-11-02
-
6.7.0 - 2022-10-24
-
6.6.7 - 2022-10-21
-
6.6.6 - 2022-10-20
-
6.6.5 - 2022-10-05
-
6.6.4 - 2022-10-03
-
6.6.3 - 2022-09-30
-
6.6.2 - 2022-09-26
-
6.6.1 - 2022-09-14
-
6.6.0 - 2022-09-08
-
6.5.5 - 2022-09-07
-
6.5.4 - 2022-08-30
-
6.5.3 - 2022-08-25
-
6.5.2 - 2022-08-10
-
6.5.1 - 2022-08-03
-
6.5.0 - 2022-07-26
-
6.4.7 - 2022-07-25
-
6.4.6 - 2022-07-20
-
6.4.5 - 2022-07-18
-
6.4.4 - 2022-07-08
-
6.4.3 - 2022-07-05
-
6.4.2 - 2022-07-01
-
6.4.1 - 2022-06-27
-
6.4.0 - 2022-06-17
-
6.3.9 - 2022-06-17
-
6.3.8 - 2022-06-13
-
6.3.7 - 2022-06-13
-
6.3.6 - 2022-06-07
-
6.3.5 - 2022-05-30
-
6.3.4 - 2022-05-19
-
6.3.3 - 2022-05-09
-
6.3.2 - 2022-05-02
-
6.3.1 - 2022-04-21
-
6.3.0 - 2022-04-14
-
6.2.11 - 2022-04-13
-
6.2.10 - 2022-04-04
-
6.2.9 - 2022-03-28
-
6.2.8 - 2022-03-23
-
6.2.7 - 2022-03-16
-
6.2.6 - 2022-03-11
-
6.2.5 - 2022-03-09
-
6.2.4 - 2022-02-28
-
6.2.3 - 2022-02-21
-
6.2.2 - 2022-02-16
-
6.2.1 - 2022-02-07
-
6.2.0 - 2022-02-02
-
6.1.10 - 2022-02-01
-
6.1.9 - 2022-01-31
-
6.1.8 - 2022-01-24
-
6.1.7 - 2022-01-17
-
6.1.6 - 2022-01-10
-
6.1.5 - 2022-01-04
-
6.1.4 - 2021-12-27
-
6.1.3 - 2021-12-21
-
6.1.2 - 2021-12-15
-
6.1.1 - 2021-12-09
-
6.1.0 - 2021-12-07
-
6.0.15 - 2021-12-06
-
6.0.14 - 2021-11-29
-
6.0.13 - 2021-11-15
-
6.0.12 - 2021-10-21
from mongoose GitHub release notesPackage name: telegraf
-
4.16.3 - 2024-02-29
- Fix: bug with
- Fix: add
-
4.16.2 - 2024-02-26
-
4.16.1 - 2024-02-25
-
4.16.0 - 2024-02-25
- Support for API 7.0. Highlights are Reactions, Replies 2.0, Link Previews, Blockquotes, and Chat Boosts.
- Support for API 7.1.
- All methods and update types from these API versions are now fully supported.
-
bot.reaction("👍", (ctx) => {
bot.reaction("5368742036629364794", (ctx) => {
-
bot.on("message_reaction", async (ctx) => {
-
-
-
bot.on(message("text"), (ctx) => {
-
-
if (ctx.msg.isAccessible()) {
-
-
- Added
- Stricter types for format helpers. For example, it will now be a type-error to try to nest
- Added
- Fixed thumbnail uploads in media groups (#1947).
- The shorthand
- The shorthand
- The following modules are now directly importable:
- (Breaking)
- (Breaking)
- (Types breaking)
- (Types breaking)
- Bug fixes and security updates will still be released for Telegraf v4.
- The existing documentation for Telegraf v4 will remain available.
- New API updates will only focus on ensuring compatibility with the latest Telegram Bot API. No new convenience features will be added to Telegraf v4.
-
4.16.0-rc.2 - 2024-02-21
-
4.16.0-rc.1 - 2024-02-21
-
4.15.3 - 2023-12-03
- Fix: unable to upload media
- Fix:
-
4.15.2 - 2023-11-30
-
4.15.1 - 2023-11-29
-
-
⚠️ Set the env var
-
4.15.0 - 2023-10-23
import { anyOf, allOf } from "telegraf/filters";
-
4.14.0 - 2023-09-22
- ⬆️ Bot API 6.9 support
- Added missing
-
4.13.1 - 2023-09-02
- Fix README to mention API 6.8
-
4.13.0 - 2023-09-02
-
4.12.3-canary.1 - 2023-04-01
-
4.12.2 - 2023-03-09
-
4.12.1 - 2023-03-07
-
4.12.0 - 2023-03-05
-
4.11.2 - 2022-11-19
-
4.11.1 - 2022-11-19
-
4.11.1-canary.2 - 2022-11-19
-
4.11.1-canary.1 - 2022-11-19
-
4.11.0 - 2022-11-18
-
4.11.0-canary.1 - 2022-11-12
-
4.10.0 - 2022-10-01
-
4.9.2 - 2022-09-13
-
4.9.1 - 2022-08-29
-
4.9.0 - 2022-08-26
-
4.9.0-canary.12 - 2022-08-24
-
4.9.0-canary.11 - 2022-08-24
-
4.9.0-canary.10 - 2022-08-18
-
4.9.0-canary.9 - 2022-05-18
-
4.9.0-canary.8 - 2022-05-18
-
4.9.0-canary.7 - 2022-05-18
-
4.9.0-canary.6 - 2022-05-15
-
4.9.0-canary.5 - 2022-05-15
-
4.9.0-canary.4 - 2022-05-15
-
4.9.0-canary.3 - 2022-05-15
-
4.9.0-canary.2 - 2022-05-15
-
4.9.0-canary.1 - 2022-05-15
-
4.8.6 - 2022-07-25
-
4.8.5 - 2022-06-08
-
4.8.5-canary.1 - 2022-06-08
-
4.8.4 - 2022-06-07
-
4.8.3 - 2022-05-29
-
4.8.2 - 2022-05-13
-
4.8.1 - 2022-04-29
-
4.8.0 - 2022-04-29
-
4.8.0-canary.8 - 2022-04-29
-
4.8.0-canary.7 - 2022-04-29
-
4.8.0-canary.6 - 2022-04-29
-
4.8.0-canary.5 - 2022-04-28
-
4.8.0-canary.4 - 2022-04-28
-
4.8.0-canary.3 - 2022-04-28
-
4.8.0-canary.2 - 2022-04-28
-
4.8.0-canary.1 - 2022-04-28
-
4.7.0 - 2022-02-05
-
4.7.0-canary.1 - 2022-02-04
-
4.6.0 - 2022-01-15
-
4.5.2 - 2021-12-08
from telegraf GitHub release noteslink_preview_options.urlcaused client to try sending it as mediaCommandContextExtntype toComposer::{start|help|settings}(adds ctx.command, payload, args)Fixed
Context::text: was undefined if entities was undefined. Thanks to @ AnotiaWang.Fixed
Context::from: now usescallbackQuery.frominstead ofmsg.fromPhew, what a feature-packed release! 🎉
🆙 Bot API Updates
👍 Working with Reactions
To listen on reaction addition and removal, use
Composer.reaction:// user added a 👍 reaction
});
// prefix with - to listen to reaction removal
bot.reaction("-👍", (ctx) => {
// user removed a 👍 reaction
});
This also just works with custom emoji IDs.
// user added a reaction with the given custom emoji ID
});
bot.reaction("-5368742036629364794", (ctx) => {
// user removed a reaction with the given custom emoji ID
});
You can probe and inspect the reaction list with the
ctx.reactionssmart object:// remember that ctx.reactions is a smart object, but not an array
// message has a 👍 reaction
ctx.reactions.has("👍");
// message has a reaction with the given custom emoji ID
ctx.reactions.has("5368742036629364794");
// number of reactions from this user on the message
ctx.reaction.count;
// indexed access is allowed:
const first = ctx.reactions[0];
// the 👍 emoji was added in this update
if (ctx.reactions.added.has("👍")) {
// user added a 👍 reaction
await User.updateOne({ id: ctx.from.id }, { $inc: { likes: 1 } });
}
// the 👍 emoji was removed in this update
if (ctx.reactions.removed.has("👍")) {
// user removed a 👍 reaction
await User.updateOne({ id: ctx.from.id }, { $inc: { likes: -1 } });
};
// to copy any of these smart objects into an array, call the
toArraymethodconst reactions = ctx.reactions.toArray();
const added = ctx.reactions.added.toArray();
const removed = ctx.reactions.removed.toArray();
});
To react to a message, use
ctx.react:You can also react to a message with a custom emoji ID:
The
bot.telegram.setMessageReactionmethod is also available.💅
Context::textandContext::entities()helpersAdded the
ctx.entities()method to fetch entities in any message.Not only does this method fetch entities from any message, but also works with captions, game text, and poll explanations. In short, if an update has any text and entities, this method will find them.
ctx.textis the companion toctx.entities(). It fetches the text from the update, and works with any message type. This includes message text, media captions, game text, and poll explanations.// fetch the text from the update
const text = ctx.text;
});
bot.on(message("photo"), (ctx) => {
// fetch the caption from the photo
const caption = ctx.text;
});
🎁 Bonus! Every entity in the
ctx.entities()array will have a fragment of the text they represent!📬
Context::msgandContext::msgIdshorthandsContext::msgshorthand to get any message in the update.ctx.msgis decorated with theisAccessibleandhasmethods. Thehasmethod works similarly to themessage()filter inbot.on. It checks if the message has a certain property.// msg is accessible, not deleted or otherwise unavailable
// this is a type-guard based on the runtime check for msg.date === 0
}
if (ctx.msg.has("text")) {
// ctx.msg.text exists
}
Context::msgIdshorthand to get any available message ID in the update. This also includesmessage_idpresent in updates that do not contain a message, such asmessage_reaction, andmessage_reaction_count.🚀
bot.launchtakes an onLaunch callbackbot.launchnow takes an optional callback that is called when the bot is launched.If you pass LaunchOptions, the callback goes after the options.
This is useful for running some code when the bot is launched, such as logging to the console, or sending a message to a channel. Remember that errors thrown in this callback will not be caught by the bot's error handler. You must handle them yourself.
🖍 Format helpers
quoteformat helper for Blockquotes.prewithin another entity.🔧 Other fixes and improvements
ctx.matchforComposer.command(#1938).ctx.chatnow includeschatfromthis.messageReaction ?? this.messageReactionCount ?? this.removedChatBoost.ctx.fromnow includes the fielduserfromctx.messageReaction ?? ctx.pollAnswer ?? ctx.chatBoost?.boost.source, in addition to fetchingfromin other updates.useNewRepliesusesctx.msgIdinstead ofctx.message.message_idto reply to messages, which works for more update types than before.types,scenes,filters,format,future,utils,markup,session. For example, viaimport { WizardScene } from "telegraf/scenes". This was previously available in v3, and was removed in v4.💔 Minor breaking changes
Markup.button.userRequestwill takeextrainstead ofuser_is_premiumas the third parameter.Markup.button.botRequestwill takeextrabeforehideas the third parameter.reply_to_message_idandallow_sending_without_replyreplaced byreply_parameters.disable_web_page_previewandlink_preview_optionsreplaced bylink_preview_options.🎉 BIG announcement 🥳
Telegraf v4 - Last Major Update
This will be the last major update for Telegraf v4.
What to Expect
If you are currently using Telegraf v4, you can continue using it as you have been. Telegraf v4 will be supported until February 2025, with the following commitments:
Introducing Telegraf v5
In the coming weeks, we plan to release Telegraf v5. v5 will bring a revamped API, new functionalities, numerous convenient helpers, an improved approach to handling updates, and enhanced documentation.
One of the key highlights of Telegraf v5 is its platform-agnostic nature, allowing you to run it on any JavaScript runtime environment, including Deno, Bun, edge runtimes (such as Cloudflare Workers and Vercel), browsers, and more.
Smooth Transition to v5
If you have closely followed the development of v4 in the past year and stayed updated with deprecation notices, the transition to v5 will be relatively seamless for you. For those still using v4, we will provide a comprehensive migration guide to assist you in upgrading to v5. Stay tuned for more information on the release of v5!
Thanks for all the love ❤️! Go follow the releases channel on Telegram: t.me/Telegraf_JS.
You can sponsor the maintainer (@ MKRhere) via GitHub Sponsors, Patreon, or Ko-fi.
thumbnailis now respected in all APIs that accept itEXPERIMENTAL_SESSION_CHECKSintroduced in the last minor release had been reporting false positives. This has been fixed; it will now work as intended.🔧 Fixed
sendPhotoand friends irrecoverably erroring if passed an invalid path, such as a directory.EXPERIMENTAL_SESSION_CHECKS=1to catch session bugs in your code.When this is enabled, Telegraf will throw errors if you access/assign to session after Telegraf thinks the middleware chain has exhausted. This can happen if you're missing awaits in async code, and session changes might not get persisted! Previously, these bugs were silently ignored until someone noticed their session was not saved. It's always safe to enable this feature. This behaviour may be default in v5.
This is a rather minor release.
anyOfandallOffilter combinatorsv4.11.0 introduced support for type-guard filters in
Composer::on, which allowed you to filter updates based on their content.This release adds two new combinators to the filter API:
anyOfandallOf. This will play very nicely with custom filters. For example:// must match all filters
bot.on(allOf(message(), isGroup), ctx => {
// ...
});
Deprecating
hookPathThe confusingly named
hookPathinbot.launchwebhook options is now deprecated. It will be removed in the next major release. You can start usingpathinstead, today.Meanwhile, we're working on new modules to add to the Telegraf ecosystem. Look forward to them, and join discussions in the official Telegraf chat!
Markup.keyboard([]).persistent()methodImportant
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information: