{"_id":"@amplication/plugin-storage-local","_rev":"3-fa07d8cfc14e1e06e82cfbee0b93a5ed","name":"@amplication/plugin-storage-local","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@amplication/plugin-storage-local","version":"0.0.1","author":{"name":"Ashish Padhy","email":"100484401+Shurtu-gal@users.noreply.github.com"},"license":"Apache-2.0","_id":"@amplication/plugin-storage-local@0.0.1","maintainers":[{"name":"amplication-bot","email":"engineering@amplication.com"},{"name":"mulygottlieb","email":"muly@amplication.com"},{"name":"levivannoort","email":"vanNoort.levi@protonmail.com"},{"name":"overbit","email":"daniele.iasella@gmail.com"},{"name":"morhag","email":"mor@amplication.com"},{"name":"amitbarletz","email":"amit@amplication.com"},{"name":"yuvalhazaz","email":"hazaz.yuval@gmail.com"}],"nx":{},"dist":{"shasum":"d0e4384ef459eace3a224b5015e069374e2f6f93","tarball":"https://registry.npmjs.org/@amplication/plugin-storage-local/-/plugin-storage-local-0.0.1.tgz","fileCount":26,"integrity":"sha512-QAmPdHcFB4QK6jtsG/iBk08l3Qwi8S0YL0KZr18xsGLMvzJgVS+f5Z0SYDCshjdLPwJCsLryv7d+J8TucBhJgg==","signatures":[{"sig":"MEUCIQDqALtIzD8ujl4pC+G6Z3kLl6lj8DAwV0atet5F70mslAIgZopI9QnHeAzOy/wCqe9hB7zC7H738dEfG7kYCcOEF5M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3133710},"jest":{"rootDir":"src/tests","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"passWithNoTests":true,"testEnvironment":"node","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","gitHead":"7723b83cfb7af46a9eb9db23854dd8e9c653d7d3","scripts":{"dev":"webpack --watch","test":"jest","build":"webpack","prebuild":"rimraf dist","prepublishOnly":"npm run build"},"_npmUser":{"name":"amplication-bot","email":"engineering@amplication.com"},"_npmVersion":"10.5.0","description":"Adds the local storage functionality for file upload to Amplication","directories":{},"_nodeVersion":"18.20.2","dependencies":{"lodash":"^4.17.21","pascal-case":"^3.1.2","@amplication/code-gen-types":"^2.0.27","@amplication/code-gen-utils":"^0.0.9"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.53.0","rimraf":"^5.0.5","ts-jest":"^29.1.1","webpack":"^5.89.0","prettier":"^3.1.0","ts-loader":"^9.5.1","typescript":"^5.2.2","@types/jest":"^29.5.8","webpack-cli":"^5.1.4","@babel/types":"^7.23.3","@babel/parser":"^7.23.3","@types/lodash":"^4.14.201","jest-mock-extended":"^3.0.5","copy-webpack-plugin":"^11.0.0","@typescript-eslint/parser":"^6.11.0","@typescript-eslint/eslint-plugin":"^6.11.0"},"_npmOperationalInternal":{"tmp":"tmp/plugin-storage-local_0.0.1_1714403627716_0.5549890063235099","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@amplication/plugin-storage-local","version":"0.0.2","author":{"name":"Ashish Padhy","email":"100484401+Shurtu-gal@users.noreply.github.com"},"license":"Apache-2.0","_id":"@amplication/plugin-storage-local@0.0.2","maintainers":[{"name":"amplication-bot","email":"engineering@amplication.com"},{"name":"mulygottlieb","email":"muly@amplication.com"},{"name":"levivannoort","email":"vanNoort.levi@protonmail.com"},{"name":"overbit","email":"daniele.iasella@gmail.com"},{"name":"morhag","email":"mor@amplication.com"},{"name":"amitbarletz","email":"amit@amplication.com"},{"name":"yuvalhazaz","email":"hazaz.yuval@gmail.com"}],"nx":{},"dist":{"shasum":"6465b2cee852b1e31a50e49e851bdfcd01a5b069","tarball":"https://registry.npmjs.org/@amplication/plugin-storage-local/-/plugin-storage-local-0.0.2.tgz","fileCount":26,"integrity":"sha512-Wxi8HJeONOlYbZfONlMJo1sKKBxYBrfkSA+iK3bPfEyXqzXmsbbeazT6GY/AcTKwyJRSn1f99Vsr2TxcN5Z7vA==","signatures":[{"sig":"MEQCIEbLKxe0Phmm+XplYyYfpNCf64rbpwzTK5s/E2DzCvVqAiAPbIDXJnLucOnA+0G6Edo8r/XXHtoxobF3p4++Fmi6Iw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3133710},"jest":{"rootDir":"src/tests","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"passWithNoTests":true,"testEnvironment":"node","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","gitHead":"4f08fd12ad0715ae0bc08b994b0ed45fd811ac77","scripts":{"dev":"webpack --watch","test":"jest","build":"webpack","prebuild":"rimraf dist","prepublishOnly":"npm run build"},"_npmUser":{"name":"amplication-bot","email":"engineering@amplication.com"},"_npmVersion":"10.5.0","description":"Adds the local storage functionality for file upload to Amplication","directories":{},"_nodeVersion":"18.20.2","dependencies":{"lodash":"^4.17.21","pascal-case":"^3.1.2","@amplication/code-gen-types":"^2.0.27","@amplication/code-gen-utils":"^0.0.9"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.53.0","rimraf":"^5.0.5","ts-jest":"^29.1.1","webpack":"^5.89.0","prettier":"^3.1.0","ts-loader":"^9.5.1","typescript":"^5.2.2","@types/jest":"^29.5.8","webpack-cli":"^5.1.4","@babel/types":"^7.23.3","@babel/parser":"^7.23.3","@types/lodash":"^4.14.201","jest-mock-extended":"^3.0.5","copy-webpack-plugin":"^11.0.0","@typescript-eslint/parser":"^6.11.0","@typescript-eslint/eslint-plugin":"^6.11.0"},"_npmOperationalInternal":{"tmp":"tmp/plugin-storage-local_0.0.2_1714404697642_0.7363189605193523","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-04-29T15:13:47.553Z","modified":"2024-09-09T13:32:47.962Z","0.0.1":"2024-04-29T15:13:47.962Z","0.0.2":"2024-04-29T15:31:37.846Z"},"author":{"name":"Ashish Padhy","email":"100484401+Shurtu-gal@users.noreply.github.com"},"license":"Apache-2.0","description":"Adds the local storage functionality for file upload to Amplication","maintainers":[{"email":"engineering@amplication.com","name":"amplication-bot"},{"email":"muly@amplication.com","name":"mulygottlieb"},{"email":"vanNoort.levi@protonmail.com","name":"levivannoort"},{"email":"mor@amplication.com","name":"morhag"},{"email":"hazaz.yuval@gmail.com","name":"yuvalhazaz"}],"readme":"# @amplication/plugin-storage-local\n\n[![NPM Downloads](https://img.shields.io/npm/dt/@amplication/plugin-storage-local)](https://www.npmjs.com/package/@amplication/plugin-storage-local)\n\n## Purpose\n\nThis plugin is used for integrating local storage services into your app generated by Amplication.\n\n## Configuration\n\nThe plugin has the following configuration options:\n\n- **fileBasePath**: The base path where the files will be stored. The default value is `./uploads`.\n- **maxFileSize**: The maximum file size in bytes. The default value is `10485760` (10MB).\n\n**Example configuration:**\n\n```json\n{\n  \"fileBasePath\": \"./uploads\",\n  \"maxFileSize\": 10485760\n}\n```\n\n> [!CAUTION]\n> The [storage-core](../storage-core/README.md) plugin should be added through the plugins page of the app settings before adding this plugin. Else code generation will fail and throw an error.\n\n## What the plugin does\n\n### Adds service methods\n\nIt adds the following service methods for **each field of type `File`** in the entities:\n\n- **upload<FieldName in PascalCase>**:\n  This method takes a file and uses the following name schmea to store the file: `<fieldName>-<entityId>-<fileName>`. ( eg: `profileImage-1-image.png` )\n\n- **delete<FieldName in PascalCase>**\n- **download<FieldName in PascalCase>**\n\n### Provides the local storage methods\n\n- **uploadFile**: This method is used to upload a file to the local storage. It takes the following parameters:\n\n  - **file**: The file to be uploaded.\n  - **extension**: The file mimeypes allowed for the file.\n  - **basePath**: The base path where the file will be stored. If not provided, the default value from the configuration will be used.\n  - **maxFileSize**: The maximum file size in bytes. If not provided, the default value from the configuration will be used.\n\n- **deleteFile**: This method is used to delete a file from the local storage.\n\n- **downloadFile**: This method is used to download a file from the local storage.\n\n> [!CAUTION]\n> In case of extensions being empty, no file will be uploaded and an error will be thrown.\n\n## Scripts\n\n### `build`\n\nRunning `npm run build` will bundle your plugin with Webpack for production.\n\n### `dev`\n\nRunning `npm run dev` will watch your plugin's source code and automatically bundle it with every change.\n","readmeFilename":"README.md"}