@adminforth/upload 2.3.0 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.log CHANGED
@@ -11,5 +11,5 @@ custom/preview.vue
11
11
  custom/tsconfig.json
12
12
  custom/uploader.vue
13
13
 
14
- sent 46,940 bytes received 134 bytes 94,148.00 bytes/sec
15
- total size is 46,451 speedup is 0.99
14
+ sent 46,947 bytes received 134 bytes 94,162.00 bytes/sec
15
+ total size is 46,465 speedup is 0.99
@@ -194,7 +194,7 @@ const onFileChange = async (e) => {
194
194
  console.log('File details:', { name, extension, size, type });
195
195
  // validate file extension
196
196
  const allowedExtensions = props.meta.allowedExtensions || []
197
- if (allowedExtensions.length > 0 && !allowedExtensions.includes(extension)) {
197
+ if (allowedExtensions.length > 0 && !allowedExtensions.includes(extension.toLowerCase())) {
198
198
  adminforth.alert({
199
199
  message: t('Sorry but the file type {extension} is not allowed. Please upload a file with one of the following extensions: {allowedExtensionsLabel}', {
200
200
  extension,
@@ -194,7 +194,7 @@ const onFileChange = async (e) => {
194
194
  console.log('File details:', { name, extension, size, type });
195
195
  // validate file extension
196
196
  const allowedExtensions = props.meta.allowedExtensions || []
197
- if (allowedExtensions.length > 0 && !allowedExtensions.includes(extension)) {
197
+ if (allowedExtensions.length > 0 && !allowedExtensions.includes(extension.toLowerCase())) {
198
198
  adminforth.alert({
199
199
  message: t('Sorry but the file type {extension} is not allowed. Please upload a file with one of the following extensions: {allowedExtensionsLabel}', {
200
200
  extension,
package/dist/index.js CHANGED
@@ -248,7 +248,7 @@ export default class UploadPlugin extends AdminForthPlugin {
248
248
  handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body }) {
249
249
  var _b, _c;
250
250
  const { originalFilename, contentType, size, originalExtension, recordPk } = body;
251
- if (this.options.allowedFileExtensions && !this.options.allowedFileExtensions.includes(originalExtension)) {
251
+ if (this.options.allowedFileExtensions && !this.options.allowedFileExtensions.includes(originalExtension.toLowerCase())) {
252
252
  return {
253
253
  error: `File extension "${originalExtension}" is not allowed, allowed extensions are: ${this.options.allowedFileExtensions.join(', ')}`
254
254
  };
package/index.ts CHANGED
@@ -281,7 +281,7 @@ export default class UploadPlugin extends AdminForthPlugin {
281
281
  handler: async ({ body }) => {
282
282
  const { originalFilename, contentType, size, originalExtension, recordPk } = body;
283
283
 
284
- if (this.options.allowedFileExtensions && !this.options.allowedFileExtensions.includes(originalExtension)) {
284
+ if (this.options.allowedFileExtensions && !this.options.allowedFileExtensions.includes(originalExtension.toLowerCase())) {
285
285
  return {
286
286
  error: `File extension "${originalExtension}" is not allowed, allowed extensions are: ${this.options.allowedFileExtensions.join(', ')}`
287
287
  };
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@adminforth/upload",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "Plugin for uploading files for adminforth",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
7
10
  "homepage": "https://adminforth.dev/docs/tutorial/Plugins/upload/",
8
11
  "repository": {
9
12
  "type": "git",