{"id":18862199,"url":"https://github.com/hapinessjs/minio-module","last_synced_at":"2026-02-09T23:30:19.684Z","repository":{"id":51735529,"uuid":"102109069","full_name":"hapinessjs/minio-module","owner":"hapinessjs","description":"MinIO client for Hapiness framework (https://www.minio.io/)","archived":false,"fork":false,"pushed_at":"2023-03-04T03:07:08.000Z","size":449,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-31T14:19:02.651Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hapinessjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-01T12:08:17.000Z","updated_at":"2024-02-29T04:50:01.000Z","dependencies_parsed_at":"2024-11-08T04:34:25.602Z","dependency_job_id":"319795c6-dbde-426b-b176-df78c5cfd918","html_url":"https://github.com/hapinessjs/minio-module","commit_stats":{"total_commits":24,"total_committers":5,"mean_commits":4.8,"dds":0.625,"last_synced_commit":"7da5580ebca05c3c12f5bd70aa1063dd960921fa"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hapinessjs%2Fminio-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hapinessjs%2Fminio-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hapinessjs%2Fminio-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hapinessjs%2Fminio-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hapinessjs","download_url":"https://codeload.github.com/hapinessjs/minio-module/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239803170,"owners_count":19699624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T04:33:37.530Z","updated_at":"2026-02-09T23:30:19.612Z","avatar_url":"https://github.com/hapinessjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"http://bit.ly/2mxmKKI\" width=\"500\" alt=\"Hapiness\" /\u003e\n\n\u003cdiv style=\"margin-bottom:20px;\"\u003e\n\u003cdiv style=\"line-height:60px\"\u003e\n    \u003ca href=\"https://travis-ci.org/hapinessjs/minio-module.svg?branch=master\"\u003e\n        \u003cimg src=\"https://travis-ci.org/hapinessjs/minio-module.svg?branch=master\" alt=\"build\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://coveralls.io/github/hapinessjs/minio-module?branch=master\"\u003e\n        \u003cimg src=\"https://coveralls.io/repos/github/hapinessjs/minio-module/badge.svg?branch=master\" alt=\"coveralls\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://david-dm.org/hapinessjs/minio-module\"\u003e\n        \u003cimg src=\"https://david-dm.org/hapinessjs/minio-module.svg\" alt=\"dependencies\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://david-dm.org/hapinessjs/minio-module?type=dev\"\u003e\n        \u003cimg src=\"https://david-dm.org/hapinessjs/minio-module/dev-status.svg\" alt=\"devDependencies\" /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n    \u003ca href=\"https://www.typescriptlang.org/docs/tutorial.html\"\u003e\n        \u003cimg src=\"https://cdn-images-1.medium.com/max/800/1*8lKzkDJVWuVbqumysxMRYw.png\"\n             align=\"right\" alt=\"Typescript logo\" width=\"50\" height=\"50\" style=\"border:none;\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://reactivex.io/rxjs\"\u003e\n        \u003cimg src=\"http://reactivex.io/assets/Rx_Logo_S.png\"\n             align=\"right\" alt=\"ReactiveX logo\" width=\"50\" height=\"50\" style=\"border:none;\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"http://hapijs.com\"\u003e\n        \u003cimg src=\"http://bit.ly/2lYPYPw\"\n             align=\"right\" alt=\"Hapijs logo\" width=\"75\" style=\"border:none;\" /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n# Minio Module\n\n`Minio` module for the Hapiness framework.\n\n## Table of contents\n\n\n- [Minio Module](#minio-module)\n  - [Table of contents](#table-of-contents)\n  - [Using your module inside Hapiness application](#using-your-module-inside-hapiness-application)\n    - [`yarn` or `npm` it in your `package.json`](#yarn-or-npm-it-in-your-packagejson)\n    - [Importing `MinioModule` from the library](#importing-miniomodule-from-the-library)\n    - [Using `Minio` inside your application](#using-minio-inside-your-application)\n  - [`MinioService` documentation](#minioservice-documentation)\n  - [Contributing](#contributing)\n  - [Change History](#change-history)\n  - [Maintainers](#maintainers)\n  - [License](#license)\n\n## Using your module inside Hapiness application\n\n\n### `yarn` or `npm` it in your `package.json`\n\n```bash\n$ npm install --save @hapiness/core @hapiness/minio rxjs\n\nor\n\n$ yarn add @hapiness/core @hapiness/minio rxjs\n```\n\n```typescript\n\"dependencies\": {\n    \"@hapiness/core\": \"^1.3.0\",\n    \"@hapiness/minio\": \"^1.0.0\",\n    \"rxjs\": \"^5.5.5\"\n    //...\n}\n//...\n```\n\n[Back to top](#table-of-contents)\n\n\n### Importing `MinioModule` from the library\n\nThis module provide an Hapiness extension for Minio.\nTo use it, simply register it during the `bootstrap` step of your project and provide the `MinioExt` with its config\n\n```typescript\n@HapinessModule({\n    version: '1.0.0',\n    providers: [],\n    declarations: [],\n    imports: [MinioModule]\n})\nclass MyApp implements OnStart {\n    constructor() {}\n    onStart() {}\n}\n\nHapiness\n    .bootstrap(\n        MyApp,\n        [\n            /* ... */\n            MinioExt.setConfig(\n                {\n                    connection: {\n                      endPoint: 'minio.mydomain.com',\n                      port: 443,\n                      useSSL: true,\n                      accessKey: 'access_key',\n                      secretKey: 'secret_key',\n                      region: 'us-east-1'\n                    },\n                }\n            )\n        ]\n    )\n    .catch(err =\u003e {\n        /* ... */\n    });\n```\n\nYou need to provide the connection information under the `connection` key in the config object. If you dont provide a `region` in the `connection` object, nor when calling functions that could use one, the value `us-east-1` will be used.\n\nAllowed region values are:\n\n- us-east-1\n- us-west-1\n- us-west-2\n- eu-west-1\n- eu-central-1\n- ap-southeast-1\n- ap-southeast-2\n- ap-northeast-1\n- sa-east-1\n- cn-north-1\n\n[Back to top](#table-of-contents)\n\n### Using `Minio` inside your application\n\nTo use `minio`, you need to inject inside your providers the `MinioService`.\n\n**NOTE:** all functions in the api return `rxjs` Observable\n\n```typescript\nclass FooProvider {\n    constructor(private _minio: MinioService) {}\n\n    createBucketIfNotExists(bucketName: string): Observable\u003cboolean\u003e {\n    \treturn this\n            ._minio\n            .bucketExists(bucketName)\n            .switchMap(\n                _ =\u003e !!_ ?\n                    Observable.of(false) :\n                    this._minio.makeBucket(bucketName)\n            );\n    }\n}\n```\n\n[Back to top](#table-of-contents)\n\n\n## `MinioService` documentation\n\n**NOTES:**\n\n- All functions in the api return `rxjs` Observable\n- We followed the `minio` `nodejs` lib, so for more information, please refer to [the official documentation](https://docs.minio.io/docs/javascript-client-api-reference)\n\n```typescript\n/* Get a new Copy Condition instance */\npublic newMinioCopyCondition(): minio.CopyConditions;\n\n/* Get a new Post Policy instance */\npublic newMinioPostPolicy(): minio.PostPolicy;\n\n/* Create a bucket */\npublic makeBucket(bucketName: string, region?: minio.Region): Observable\u003cboolean\u003e;\n\n/* Check if a bucket already exists */\npublic bucketExists(bucketName: string): Observable\u003cboolean\u003e;\n\n/* List all buckets */\npublic listBuckets(): Observable\u003cminio.BucketItemFromList[]\u003e;\n\n/* Remove a bucket given a bucketName */\npublic removeBucket(bucketName: string): Observable\u003cboolean\u003e;\n\n/* Lists all objects in a bucket */\npublic listObjects(bucketName: string, prefix: string = '', recursive: boolean = false): Observable\u003cminio.BucketItem\u003e;\n\n/* Lists all objects in a bucket using S3 listing objects V2 API */\npublic listObjectsV2(bucketName: string, prefix: string = '', recursive: boolean = false): Observable\u003cminio.BucketItem\u003e;\n\n/* Lists partially uploaded objects in a bucket */\npublic listIncompleteUploads(bucketName: string, prefix: string = '', recursive: boolean = false):\n        Observable\u003cminio.IncompleteUploadedBucketItem\u003e;\n\n/* Downloads an object as a stream */\npublic getObject(bucketName: string, objectName: string): Observable\u003cStream\u003e;\n\n/* Downloads the specified range bytes of an object as a stream */\npublic getPartialObject(bucketName: string, objectName: string, offset: number, length: number = 0):\n        Observable\u003cStream\u003e;\n\n/* Downloads and saves the object as a file in the local filesystem */\npublic fGetObject(bucketName: string, objectName: string, filePath: string): Observable\u003cboolean\u003e;\n\n/* Uploads an object from a stream/Buffer */\npublic putObject(bucketName: string, objectName: string, stream: Stream | string | Buffer, size?: number, metadata?: minio.ItemBucketMetadata | string): Observable\u003cstring\u003e;\n\n/* Uploads contents from a file to objectName */\npublic fPutObject(bucketName: string, objectName: string, filePath: string, metadata?: minio.ItemBucketMetadata | string): Observable\u003cstring\u003e;\n\n/* Copy a source object into a new object in the specied bucket */\npublic copyObject(bucketName: string, objectName: string, sourceObject: string, conditions: minio.CopyConditions):\n        Observable\u003cminio.BucketItemCopy\u003e;\n\n/* Gets metadata of an object */\npublic statObject(bucketName: string, objectName: string): Observable\u003cminio.BucketItemStat\u003e;\n\n/* Removes an object */\npublic removeObject(bucketName: string, objectName: string): Observable\u003cboolean\u003e;\n\n/* Remove multiple objects of a bucket */\npublic removeObjects(bucketName: string, objectNames: string[]): Observable\u003cboolean\u003e;\n\n/* Removes a partially uploaded object */\npublic removeIncompleteUpload(bucketName: string, objectName: string): Observable\u003cboolean\u003e;\n\n/*\n * Generate a presigned URLs for temporary download/upload access to private objects.\n * Generates a presigned URL for the provided HTTP method, 'httpMethod'.\n * Browsers/Mobile clients may point to this URL to directly download objects even if the bucket is private.\n * This presigned URL can have an associated expiration time in seconds after which the URL is no longer valid.\n * The default value is 7 days.\n */\npublic presignedUrl(httpMethod: string, bucketName: string, objectName: string, expiry: number = 604800, reqParams?: { [key: string]: any; }): Observable\u003cstring\u003e;\n\n/*\n * Generates a presigned URL for HTTP GET operations.\n * Browsers/Mobile clients may point to this URL to directly download objects even if the bucket is private.\n * This presigned URL can have an associated expiration time in seconds after which the URL is no longer valid.\n * The default expiry is set to 7 days\n */\npublic presignedGetObject(bucketName: string, objectName: string, expiry: number = 604800): Observable\u003cstring\u003e;\n\n/*\n * Generates a presigned URL for HTTP PUT operations.\n * Browsers/Mobile clients may point to this URL to upload objects directly to a bucket even if it is private.\n * This presigned URL can have an associated expiration time in seconds after which the URL is no longer valid.\n * The default expiry is set to 7 days\n */\npublic presignedPutObject(bucketName: string, objectName: string, expiry: number = 604800): Observable\u003cstring\u003e;\n\n/*\n * Allows setting policy conditions to a presigned URL for POST operations.\n * Policies such as bucket name to receive object uploads, key name prefixes, expiry policy may be set\n */\npublic presignedPostPolicy(policy: minio.PostPolicy): Observable\u003cminio.PostPolicyResult\u003e;\n\n/*\n * Fetch the notification configuration stored in the S3 provider and that belongs to\n * the specified bucket name\n */\npublic getBucketNotification(bucketName: string): Observable\u003cminio.NotificationConfig\u003e;\n\n/*\n * Upload a user-created notification configuration and associate it to the specified bucket name\n */\npublic setBucketNotification(bucketName: string, bucketNotificationConfig: any): Observable\u003cboolean\u003e;\n\n/*\n * Remove the bucket notification configuration associated to the specified bucket\n */\npublic removeAllBucketNotification(bucketName: string): Observable\u003cboolean\u003e;\n\n/*\n * Listen for notifications on a bucket.\n * Additionally one can provider filters for prefix, suffix and events.\n * There is no prior set bucket notification needed to use this API.\n * This is an Minio extension API where unique identifiers are regitered and unregistered\n * by the server automatically based on incoming requests\n */\npublic listenBucketNotification(bucketName: string, prefix: string, suffix: string, events: string[]): EventEmitter;\n\n/*\n * Get the bucket policy associated with the specified bucket.\n * If objectPrefix is not empty, the bucket policy will be filtered based on object permissions as well.\n */\npublic getBucketPolicy(bucketName: string): Observable\u003cstring\u003e;\n\n/*\n * Set the bucket policy associated with the specified bucket.\n * If objectPrefix is not empty, the bucket policy will only be assigned to objects that fit the given prefix\n */\npublic setBucketPolicy(bucketName: string, bucketPolicy: string): Observable\u003cboolean\u003e;\n```\n\n[Back to top](#table-of-contents)\n\n## Contributing\n\nTo set up your development environment:\n\n1. clone the repo to your workspace,\n2. in the shell `cd` to the main folder,\n3. hit `npm or yarn install`,\n4. run `npm or yarn run test`.\n    * It will lint the code and execute all tests.\n    * The test coverage report can be viewed from `./coverage/lcov-report/index.html`.\n    \n[Back to top](#table-of-contents)\n\n## Change History\n\n* v2.0.3 (2020-11-04)\n    * Update the supported region enums\n* v2.0.2 (2019-02-14 🌹)\n    * Update input types of putObject to Stream\n* v2.0.1 (2019-01-29)\n    * fixed 'content-type' key in metadata.\n* v2.0.0 (2018-10-16)\n    * Upgraded minio to 7.0.1\n    * Now use \"useSSL\" instead of \"secure\"\n    * Integrated minio's types\n    * Added Functions:\n        * removeBucket()\n        * removeObjects()\n        * PresignedUrl()\n    * Renamed newMinioPostPolicy() to newPostPolicy()\n    * Updated README\n* v1.0.0 (2017-12-14)\n    * `MinIO` module implementation\n    * Related tests\n    * Documentation\n\n[Back to top](#table-of-contents)\n\n## Maintainers\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd colspan=\"5\" align=\"center\"\u003e\u003ca href=\"https://www.tadaweb.com\"\u003e\u003cimg src=\"http://bit.ly/2xHQkTi\" width=\"117\" alt=\"tadaweb\" /\u003e\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Juneil\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/6546204?v=3\u0026s=117\" width=\"117\"/\u003e\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/antoinegomez\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/997028?v=3\u0026s=117\" width=\"117\"/\u003e\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/reptilbud\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/6841511?v=3\u0026s=117\" width=\"117\"/\u003e\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/njl07\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/1673977?v=3\u0026s=117\" width=\"117\"/\u003e\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/xmaIIoc\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/1898461?v=4\u0026s=117\" width=\"117\"/\u003e\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Juneil\"\u003eJulien Fauville\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/antoinegomez\"\u003eAntoine Gomez\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/reptilbud\"\u003eSébastien Ritz\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/njl07\"\u003eNicolas Jessel\u003c/a\u003e\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/xmaIIoc\"\u003eFlorent Bennani\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n[Back to top](#table-of-contents)\n\n## License\n\nCopyright (c) 2017 **Hapiness** Licensed under the [MIT license](https://github.com/hapinessjs/minio-module/blob/master/LICENSE.md).\n\n[Back to top](#table-of-contents)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhapinessjs%2Fminio-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhapinessjs%2Fminio-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhapinessjs%2Fminio-module/lists"}