Skip to content

Conversation

thetutlage
Copy link
Contributor

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


Snyk has created this PR to upgrade @vinejs/vine from 1.4.1 to 1.7.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.


  • The recommended version is 6 versions ahead of your current version.
  • The recommended version was released 22 days ago, on 2023-11-22.
Release notes
Package name: @vinejs/vine
  • 1.7.0 - 2023-11-22

    This release adds support for validating dates in VineJS. You may check the documentation here. https://vinejs.dev/docs/types/date

    The vine.date schema type accepts a string value formatted as a date and returns an instance of the JavaScript Date object. The reason we accept a string is because the data submitted over an HTTP request will always represent date/datetime as a string.

    Once you have a date, you may validate it further by comparing it against a fixed value or compare it against values from other fields. You may refer the documentation to view all the available validation rules.

    Commits

    • refactor: changes to vine validator options normalization e85356b
    • chore: update list of files to publish e07cb69
    • docs(README): remove snyk badge 1b5c497
    • docs: update github workflow badge url b39b00c
    • chore: pin typescript to 5.2 02c2945
    • feat: add weekday and weekend rules 223bb93
    • feat: add first set of date validation rules c893f10
    • feat: add support for comparing nested values in sameAs and notSameAs rules 628b4c7
    • chore: update dependencies and generate types using tsc ce6c52c
    • chore: update dependencies cf08e2a
    • feat: Serialize messages and fields when converting toJSON 72d098d
    • refactor(SimpleMessagesProperty): make fields property optional (#18) 16bd6e8
    • Merge pull request #16 from vinejs/snyk-upgrade-ee4daf504d32e111676c4eb19cecf239 5d2a97a
    • feat: upgrade camelcase from 7.0.1 to 8.0.0 f98e099

    v1.6.0...v1.7.0

  • 1.6.0 - 2023-07-28

    v1.5.3...v1.6.0

  • 1.5.3 - 2023-07-25
    • refactor: use validator.js specific imports (#13) 459f3e5

    v1.5.2...v1.5.3

  • 1.5.2 - 2023-07-19
    • refactor: export VineValidator class cfaeeff
    • style: format source code 74ca7e0
    • chore: update dependencies 9b7bc07

    Full Changelog: v1.5.1...v1.5.2

  • 1.5.1 - 2023-07-11
    • ci: fix failing tests 2f5258c
    • ci: remove test.yml workflow file 89efc20
    • test: fix failing tests d04800c
    • test: add test for extending Vine class a417418
    • fix: make schema classes Macroable 41bd3d5

    Full Changelog: v1.5.0...v1.5.1

  • 1.5.0 - 2023-07-10

    In VineJS, you can pass runtime metadata to the validation pipeline, which you can access from the validation rules, union predicates, etc. The metadata API was not type-safe until now. However, this release allows you to define the static metadata types and a validation function to validate them at runtime.

    Note: The metadata API is kept very simple because only a few schemas might need runtime metadata with a few properties to be functional.

    One example is the unique validation rule. You might want the unique validation rule to check all the database rows except the one for the currently logged-in user. In that case, you will pass the currently logged-in userId to the statically compiled validation schema using metadata as follows.

    const updateUserValidator = vine.compile(
      vine.object({
        email: vine.string().email().unique((field) => {
          console.log(field.meta.userId)
        }),
      })
    )
    await updateUserValidator.validate(data, {
      meta: { userId: request.auth.user.id }
    })

    However, there is no way to know that updateUserValidator needs the currently logged-in user id to be functional.

    From @ vinejs/[email protected], you can use the withMetaData method to define static types for the metadata a validator accepts. The schema will look as follows.

    const updateUserValidator = vine
      .withMetaData<{ userId: number }>()
      .compile(
        vine.object({
          email: vine.string().email().unique((field) => {
            console.log(field.meta.userId)
          }),
        })
      )

    You can pass a callback to withMetaData to validate the metadata at runtime if needed.

    vine
      .withMetaData<{ userId: number }>((meta) => {
        // validate id and throw an error
     })

    Commits

    • feat: add support for defining static metadata types and validator function 09c4097
    • chore: use @ adonisjs/tooling presets for tooling config a02908d
    • chore: upgrade japa to v3 4181ee4
    • chore: update dependencies f24ebb8
    • chore: add labels to exempt from stale and lock bot 92697c4
    • docs: fix contributing link fcad2fb

    Full Changelog: v1.4.1...v1.5.0

  • 1.4.1 - 2023-06-16
    • fix: export testing factories ffe8279

    Full Changelog: v1.4.0...v1.4.1

from @vinejs/vine GitHub release notes
Commit messages
Package name: @vinejs/vine
  • 1e5b5c4 chore(release): 1.7.0
  • e85356b refactor: changes to vine validator options normalization
  • e07cb69 chore: update list of files to publish
  • 1b5c497 docs(README): remove snyk badge
  • b39b00c docs: update github workflow badge url
  • 02c2945 chore: pin typescript to 5.2
  • 223bb93 feat: add weekday and weekend rules
  • c893f10 feat: add first set of date validation rules
  • 628b4c7 feat: add support for comparing nested values in sameAs and notSameAs rules
  • ce6c52c chore: update dependencies and generate types using tsc
  • cf08e2a chore: update dependencies
  • 72d098d feat: Serialize messages and fields when converting toJSON
  • 16bd6e8 refactor(SimpleMessagesProperty): make fields property optional (#18)
  • 5d2a97a Merge pull request #16 from vinejs/snyk-upgrade-ee4daf504d32e111676c4eb19cecf239
  • f98e099 feat: upgrade camelcase from 7.0.1 to 8.0.0
  • f8fa0af chore(release): 1.6.0
  • 627ee41 chore: add tsup bundling (#14)
  • 40c5c2e chore(release): 1.5.3
  • 459f3e5 refactor: use validator.js specific imports (#13)
  • 42887b9 chore(release): 1.5.2
  • cfaeeff refactor: export VineValidator class
  • 74ca7e0 style: format source code
  • 9b7bc07 chore: update dependencies
  • 48a3b6a chore(release): 1.5.1

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