diff --git a/package.json b/package.json index bfed56d3..4f9c898e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@adonisjs/core", "description": "Core of AdonisJS", - "version": "6.15.1", + "version": "6.15.2", "engines": { "node": ">=20.6.0" }, @@ -100,7 +100,7 @@ "@types/sinon": "^17.0.3", "@types/supertest": "^6.0.2", "@types/test-console": "^2.0.3", - "@vinejs/vine": "^2.1.0", + "@vinejs/vine": "^3.0.0", "argon2": "^0.41.1", "bcrypt": "^5.1.1", "c8": "^10.1.2", @@ -108,7 +108,7 @@ "cross-env": "^7.0.3", "del-cli": "^6.0.0", "edge.js": "^6.2.0", - "eslint": "^9.15.0", + "eslint": "^9.16.0", "execa": "^9.5.1", "get-port": "^7.1.0", "github-label-sync": "^2.3.1", @@ -153,7 +153,7 @@ }, "peerDependencies": { "@adonisjs/assembler": "^7.8.0", - "@vinejs/vine": "^2.1.0", + "@vinejs/vine": "^2.1.0 || ^3.0.0", "argon2": "^0.31.2 || ^0.41.0", "bcrypt": "^5.1.1", "edge.js": "^6.2.0" diff --git a/providers/vinejs_provider.ts b/providers/vinejs_provider.ts index 01ac996a..4ca0e881 100644 --- a/providers/vinejs_provider.ts +++ b/providers/vinejs_provider.ts @@ -7,13 +7,15 @@ * file that was distributed with this source code. */ -import vine, { BaseLiteralType, Vine } from '@vinejs/vine' +import vine, { symbols, BaseLiteralType, Vine } from '@vinejs/vine' import type { Validation, FieldContext, FieldOptions } from '@vinejs/vine/types' import type { MultipartFile, FileValidationOptions } from '@adonisjs/bodyparser/types' import type { ApplicationService } from '../src/types.js' import { Request, RequestValidator } from '../modules/http/main.js' +const MULTIPART_FILE: typeof symbols.SUBTYPE = symbols.SUBTYPE ?? Symbol.for('subtype') + /** * Validation options accepted by the "file" rule */ @@ -95,7 +97,9 @@ const isMultipartFile = vine.createRule((file, option * request. */ class VineMultipartFile extends BaseLiteralType { - #validationOptions?: FileRuleValidationOptions + #validationOptions?: FileRuleValidationOptions; + + [MULTIPART_FILE] = 'multipartFile' constructor( validationOptions?: FileRuleValidationOptions,