Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Upgrade wretch from 1.7.9 to 2.8.0 #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gr00nd
Copy link
Member

@gr00nd gr00nd commented Feb 6, 2024

This PR was automatically created by Snyk using the credentials of a real user.


Snyk has created this PR to upgrade wretch from 1.7.9 to 2.8.0.

ℹ️ 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.


Warning: This is a major version upgrade, and may be a breaking change.

  • The recommended version is 30 versions ahead of your current version.
  • The recommended version was released a month ago, on 2023-12-30.
Release notes
Package name: wretch
  • 2.8.0 - 2023-12-30

    2.8.0 (2023-12-30)

    🏭 New feature(s)

    • addon.resolver can now be a function (0bf9aa8), closes #212
    https://jsonplaceholder.typicode.com/bad-route 404
    // unhandled error :(
    })()">
    const fetcher = wretch("https://jsonplaceholder.typicode.com").addon({
    // resolver can now be a function and to re-use the previously defined methods of the response chain:
    resolver: (chain) => ['res', 'json', 'text', 'blob', 'formData', 'arrayBuffer'].reduce((acc, method) => ({
    ...acc,
    // overrides .json, .text… methods to chain .then & .catch
    [method](cb) {
    return chain[method](cb)
    .then(ret => (console.log('[hook] ok')))
    .catch(error => {
    console.error('[hook] error', error.response.url, error.response.status)
    throw error
    });
    }
    }), {})
    });

    (async function () {
    await fetcher.get("/todos/1").json(console.log);

    // { userId: 1, id: 1, title: 'delectus aut autem', completed: false }
    // [hook] ok

    await fetcher.get("/bad-route").notFound(error => {
    console.log('handled error :)')
    }).text(console.log);

    // handled error :)
    // [hook] ok

    await fetcher.get("/bad-route").text(console.log).catch(() => console.log('unhandled error :('));

    // [hook] error https://jsonplaceholder.typicode.com/bad-route 404
    // unhandled error :(
    })()




  • 2.7.1 - 2023-11-19

    2.7.1 (2023-11-19)

    🐛 Bug fix(es)

    • Fix passing a HeadersInit (Header / array) argument to headers() (f32845a), closes #205
    const headers1 = new Headers({ "hello": "world" });
    const headers2 = new Headers({ "bonjour": "le monde" });
    const headers3 = { "hola": "mundo " };
    const headers4 = [["hallo", "welt"]]

    let w = wretch().headers(headers1);
    console.log(w._options.headers);
    // Object { hello: "world" }
    w = w.headers(headers2);
    console.log(w._options.headers);
    // Object { hello: "world", bonjour: "le monde" }
    w = w.headers(headers3);
    console.log(w._options.headers);
    // Object { hello: "world", bonjour: "le monde", hola: "mundo " }
    w = w.headers(headers4);
    console.log(w._options.headers);
    // Object { hello: "world", bonjour: "le monde", hola: "mundo ", hallo: "welt" }

    ⬆️ Version update(s)

    • Bump @ babel/traverse from 7.19.4 to 7.23.2 (922005e)
    • Upgrade dependencies (d774826)
  • 2.7.0 - 2023-09-12

    2.7.0 (2023-09-12)

    🏭 New feature(s)

    • Support FileList objects in the form data addon (3582809), closes #201
    <head>
    <script type="module">
    import wretch from 'https://cdn.skypack.dev/wretch';
    import FormDataAddon from 'https://cdn.skypack.dev/wretch/addons/formData';

    <span class="pl-k">const</span> <span class="pl-s1">fileInput</span> <span class="pl-c1">=</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">querySelector</span><span class="pl-kos">(</span><span class="pl-s">"#myfiles"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    
    <span class="pl-s1">fileInput</span><span class="pl-kos">.</span><span class="pl-en">addEventListener</span><span class="pl-kos">(</span><span class="pl-s">"change"</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
      <span class="pl-en">wretch</span><span class="pl-kos">(</span><span class="pl-s">"/post-files"</span><span class="pl-kos">)</span>
        <span class="pl-kos">.</span><span class="pl-en">addon</span><span class="pl-kos">(</span><span class="pl-v">FormDataAddon</span><span class="pl-kos">)</span>
        <span class="pl-kos">.</span><span class="pl-en">formData</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">files</span>: <span class="pl-s1">fileInput</span><span class="pl-kos">.</span><span class="pl-c1">files</span> <span class="pl-kos">}</span><span class="pl-kos">)</span>
        <span class="pl-kos">.</span><span class="pl-en">post</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
        <span class="pl-kos">.</span><span class="pl-en">text</span><span class="pl-kos">(</span><span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-c1">log</span><span class="pl-kos">)</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    

    </script>
    </head>
    <body>
    <input id="myfiles" multiple type="file" />
    </body>

    📝 Documentation update(s)

    • Mention file names in the form data addon doc (411fb09), closes #197
  • 2.6.0 - 2023-06-28

    2.6.0 (2023-06-28)

    ⬆️ Version update(s)

    • Bump engine.io and socket.io (3ef1738)
    • Bump socket.io-parser from 4.2.2 to 4.2.3 (b42aa0f)
    • Upgrade dependencies (b183cf7)

    🏭 New feature(s)

    wretch(url)
      .catcher(404, err => redirect("/routes/notfound", err.message))
      .catcher(500, err => flashMessage("internal.server.error"))
      // this fallback will trigger for any error except if already caught by other means (like above for 404s and 505s)
      .catcherFallback(err => {
        log("Uncaught error:", err)
        throw err
      })

    📝 Documentation update(s)

    • Update node-fetch code snippet (3b6ac7e), closes #179
  • 2.5.2 - 2023-04-11

    2.5.2 (2023-04-11)

    🐛 Bug fix(es)

    • Fix catcher and resolve callback argument type. (76c295f), closes #177

    📝 Documentation update(s)

    • Node.js 18 section wording (b696b1c)
    • Warn to use a custom until function to avoid retrying on 4xx error (1812c73), closes #176
  • 2.5.1 - 2023-02-27

    2.5.1 (2023-02-27)

    🐛 Bug fix(es)

    • Update resolver.ts - Add null verification to .get("Content-Type") (a68a524)
  • 2.5.0 - 2023-02-20

    2.5.0 (2023-02-20)

    🏭 New feature(s)

    • Parse error type as json on proper content-type (ea9adbf), closes #171

    Setting the error type as json manually using .errorType("json") should now not be necessary if the server responds with a Content-Type header set as application/json.

    The response body will be deserialized and the error.json will be set accordingly.

    ⬆️ Version update(s)

    • Bump @ fastify/multipart from 7.3.0 to 7.4.1 (e6074c9)
    • Bump @ sideway/formula from 3.0.0 to 3.0.1 (8208646)
    • Bump ua-parser-js from 0.7.31 to 0.7.33 (1694fe6)
  • 2.4.1 - 2023-01-20

    2.4.1 (2023-01-20)

    🐛 Bug fix(es)

    • Fix abort/progress addons state isolation issue (2b3a659)
  • 2.4.0 - 2023-01-19
    Read more
  • 2.3.2 - 2023-01-11
    Read more
  • 2.3.1 - 2023-01-07
  • 2.3.0 - 2022-12-12
  • 2.2.3 - 2022-12-09
  • 2.2.2 - 2022-12-03
  • 2.2.1 - 2022-12-03
  • 2.2.0 - 2022-12-03
  • 2.1.5 - 2022-10-15
  • 2.1.4 - 2022-09-28
  • 2.1.3 - 2022-09-28
  • 2.1.2 - 2022-09-27
  • 2.1.1 - 2022-09-03
  • 2.1.0 - 2022-09-03
  • 2.0.4 - 2022-08-18
  • 2.0.3 - 2022-08-16
  • 2.0.2 - 2022-08-03
  • 2.0.1 - 2022-08-02
  • 2.0.0 - 2022-08-01
  • 2.0.0-next.1 - 2022-07-08
  • 2.0.0-next.0 - 2022-07-03
  • 1.7.10 - 2022-05-21
  • 1.7.9 - 2022-02-01
from wretch GitHub release notes
Commit messages
Package name: wretch
  • 4c48e5d 2.8.0 tag
  • 0bf9aa8 🏭 addon.resolver can now be a function
  • c65dd5c Revert changelog version
  • 5b17cfd 2.7.1 tag
  • d774826 ⬆️ Upgrade dependencies
  • f32845a 🐛 Fix passing Headers/entries array as an argument to headers()
  • 9e6fa07 Merge pull request #204 from elbywan/dependabot/npm_and_yarn/babel/traverse-7.23.2
  • 922005e ⬆️ Bump @ babel/traverse from 7.19.4 to 7.23.2
  • a804cac 2.7.0 tag
  • 3582809 🏭 Support FileList objects in the form data addon
  • 411fb09 📝 Mention file names in the form data addon doc
  • f445703 Revert changelog version
  • 6647f35 2.6.0 tag
  • b183cf7 ⬆️ Upgrade dependencies
  • 46610cf 🏭 Add fallback catcher method
  • 238d17a Merge pull request #191 from CanRau/patch-1
  • 20f66a5 docs: fix example import in README.md
  • 0b1b9b8 Merge pull request #185 from elbywan/dependabot/npm_and_yarn/socket.io-parser-4.2.3
  • b42aa0f ⬆️ Bump socket.io-parser from 4.2.2 to 4.2.3
  • bf3bc0b Merge pull request #183 from jamiew/patch-1
  • e646004 Fix .addons typo in README
  • 4ada402 Merge pull request #180 from elbywan/dependabot/npm_and_yarn/engine.io-and-socket.io-6.4.2
  • 3ef1738 ⬆️ Bump engine.io and socket.io
  • 3b6ac7e 📝 Update node-fetch code snippet

Compare


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:

🧐 View latest project report

🛠 Adjust upgrade PR settings

🔕 Ignore this dependency or unsubscribe from future upgrade PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants