Compare commits

...

24 Commits

Author SHA1 Message Date
Miroslav Bajtoš 3b1b432b13
3.7.0
* Update LTS status in README (Miroslav Bajtoš)
 * chore: update copyright year (Diana Lau)
 * Update README.md (Shaun)
 * chore: improve issue and PR templates (Nora)
 * chore: drop Node.js 6 and add Node.js 12 to travis (Nora)
2020-03-06 17:21:12 +01:00
Miroslav Bajtoš 11a3caf2d3
Merge pull request #288 from strongloop/feat/maintenance-lts
Update LTS status in README
2020-03-06 17:19:31 +01:00
Miroslav Bajtoš 479800e419
Update LTS status in README 2020-03-06 10:07:12 +01:00
Agnes Lin 3ada3ddf4e
Merge pull request #287 from strongloop/copyright
chore: update copyright year
2020-02-10 14:08:11 -05:00
Diana Lau 5668fe31f4 chore: update copyright year 2020-02-10 13:57:12 -05:00
Diana Lau c8f3b24141
Merge pull request #286 from syntheticgoo/patch-1
Update README.md
2020-01-29 22:08:03 -05:00
Shaun fd1a2527f2
Update README.md 2020-01-29 19:21:42 +00:00
Nora d020a178c4
Merge pull request #281 from strongloop/chore/improve-issue-templates
chore: improve issue and PR templates
2019-11-21 09:48:27 -05:00
Nora 6a18af7774 chore: improve issue and PR templates 2019-11-19 15:42:35 -05:00
Nora fee0855137
Merge pull request #282 from strongloop/drop-node-6
chore: drop Node.js 6 and add Node.js 12 to travis
2019-11-19 15:42:04 -05:00
Nora 02569bd3b5 chore: drop Node.js 6 and add Node.js 12 to travis 2019-11-19 15:19:39 -05:00
Diana Lau 60963c4415 3.6.3
* Rannig from other paths. Property files to array. (Diego A. Zapata Häntsch)
2019-07-25 13:37:24 -04:00
Diana Lau 963f334ee7
Merge pull request #279 from diegoazh/master
Fixes in PRs 252 and 242
2019-07-20 17:32:08 -04:00
Diego A. Zapata Häntsch 9205c9f079 Rannig from other paths. Property files to array. 2019-07-20 01:27:37 -03:00
Diana Lau 5608021675 3.6.2
* chore: update CODEOWNERS (Diana Lau)
 * Upgrade pkgcloud version (Diego A. Zapata Häntsch)
2019-07-12 11:30:47 -04:00
Diana Lau 351c3e8ebb
Merge pull request #277 from strongloop/codeowner
chore: update CODEOWNERS
2019-07-10 15:09:47 -04:00
Diana Lau 5c10529445 chore: update CODEOWNERS 2019-07-10 15:04:41 -04:00
Diana Lau 6ff4f2b234
Merge pull request #276 from diegoazh/master
Upgrade pkgcloud version
2019-07-10 14:56:40 -04:00
Diego A. Zapata Häntsch 3516cf642d Upgrade pkgcloud version
This upgrade fix the bug uploading files to google cloud storage.
This change solves the problem explained in issue #273.
2019-07-09 20:48:49 -03:00
Diana Lau 609b63c474 3.6.1
* update pkgcloud and use version 2.x (Anis)
 * chore: update copyrights years (Agnes Lin)
2019-05-23 15:56:37 -04:00
Diana Lau d2352bdc4c
Merge pull request #271 from rachedanis/update-pkgcloud-version
update pkgcloud and use version 2.x
2019-05-23 15:51:31 -04:00
Anis 1dc5a4dc81 update pkgcloud and use version 2.x 2019-05-14 10:33:15 +02:00
Agnes Lin a3c8509adf
Merge pull request #270 from strongloop/copyrights
chore: update copyrights years
2019-05-07 14:46:34 -04:00
Agnes Lin 6f8e4284f5 chore: update copyrights years 2019-05-07 09:41:29 -04:00
24 changed files with 249 additions and 76 deletions

View File

@ -1,37 +0,0 @@
<!--
Questions:
https://groups.google.com/forum/#!forum/loopbackjs
https://gitter.im/strongloop/loopback
Immediate support:
https://strongloop.com/api-connect-faqs/
https://strongloop.com/node-js/subscription-plans/
-->
# Description/Steps to reproduce
<!--
If feature: A description of the feature
If bug: Steps to reproduce
-->
# Link to reproduction sandbox
<!--
Link to an app sandbox for reproduction
Note: Failure to provide a sandbox application for reproduction purposes will result in the issue being closed.
-->
# Expected result
<!--
Also include actual results if bug
-->
# Additional information
<!--
Copy+paste the output of these two commands:
node -e 'console.log(process.platform, process.arch, process.versions.node)'
npm ls --prod --depth 0 | grep loopback
-->

50
.github/ISSUE_TEMPLATE/Bug_report.md vendored Normal file
View File

@ -0,0 +1,50 @@
---
name: Bug report
about: Create a report to help us improve
labels: bug
---
<!-- 🚨 STOP 🚨 STOP 🚨 STOP 🚨
HELP US HELP YOU, PLEASE
- Do a quick search to avoid duplicate issues
- Provide as much information as possible (reproduction sandbox, use case for features, etc.)
- Consider using a more suitable venue for questions such as Stack Overflow, Gitter, etc.
Please fill in the *entire* template below.
-->
## Steps to reproduce
<!-- Describe how to reproduce the issue -->
## Current Behavior
<!-- Describe the observed result -->
## Expected Behavior
<!-- Describe what did you expect instead, what is the desired outcome? -->
## Link to reproduction sandbox
<!--
See https://loopback.io/doc/en/contrib/Reporting-issues.html#loopback-3x-bugs
Note: Failure to provide a sandbox application for reproduction purposes will result in the issue being closed.
-->
## Additional information
<!--
Copy+paste the output of these two commands:
node -e 'console.log(process.platform, process.arch, process.versions.node)'
npm ls --prod --depth 0 | grep loopback
-->
## Related Issues
<!-- Did you find other bugs that looked similar? -->
_See [Reporting Issues](http://loopback.io/doc/en/contrib/Reporting-issues.html) for more tips on writing good issues_

View File

@ -0,0 +1,25 @@
---
name: Feature request
about: Suggest an idea for this project
labels: feature
---
## Suggestion
<!-- A summary of what you'd like to see added or changed -->
## Use Cases
<!--
What do you want to use this for?
What shortcomings exist with current approaches?
-->
## Examples
<!-- Show how this would be used and what the behavior would be -->
## Acceptance criteria
TBD - will be filled by the team.

27
.github/ISSUE_TEMPLATE/Question.md vendored Normal file
View File

@ -0,0 +1,27 @@
---
name: Question
about: The issue tracker is not for questions. Please use Stack Overflow or other resources for help.
labels: question
---
<!-- 🚨 STOP 🚨 STOP 🚨 STOP 🚨
THE ISSUE TRACKER IS NOT FOR QUESTIONS.
DO NOT CREATE A NEW ISSUE TO ASK A QUESTION.
Please use one of the following resources for help:
**Questions**
- https://stackoverflow.com/tags/loopbackjs
- https://groups.google.com/forum/#!forum/loopbackjs
- https://gitter.im/strongloop/loopback
**Immediate support**
- https://strongloop.com/api-connect-faqs/
- https://strongloop.com/node-js/subscription-plans/
-->

11
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Report a security vulnerability
url: https://loopback.io/doc/en/contrib/Reporting-issues.html#security-issues
about: Do not report security vulnerabilities using GitHub issues. Please send an email to `reachsl@us.ibm.com` instead.
- name: Get help on StackOverflow
url: https://stackoverflow.com/tags/loopbackjs
about: Please ask and answer questions on StackOverflow.
- name: Join our mailing list
url: https://groups.google.com/forum/#!forum/loopbackjs
about: You can also post your question to our mailing list.

View File

@ -1,25 +1,18 @@
### Description
#### Related issues
<!--
Please use the following link syntaxes:
Please provide a high-level description of the changes made by your pull request.
- connect to #49 (to reference issues in the current repository)
- connect to strongloop/loopback#49 (to reference issues in another repository)
Include references to all related GitHub issues and other pull requests, for example:
Fixes #123
Implements #254
See also #23
-->
- connect to <link_to_referenced_issue>
## Checklist
### Checklist
<!--
- Please mark your choice with an "x" (i.e. [x], see
https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments)
- PR's without test coverage will be closed.
-->
👉 [Read and sign the CLA (Contributor License Agreement)](https://cla.strongloop.com/agreements/strongloop/loopback-component-storage) 👈
- [ ] `npm test` passes on your machine
- [ ] New tests added or existing tests modified to cover all changes
- [ ] Code conforms with the [style
guide](http://loopback.io/doc/en/contrib/style-guide.html)
- [ ] Code conforms with the [style guide](https://loopback.io/doc/en/contrib/style-guide-es6.html)
- [ ] Commit messages are following our [guidelines](https://loopback.io/doc/en/contrib/git-commit-messages.html)

View File

@ -1,5 +1,5 @@
language: node_js
node_js:
- "6"
- "8"
- "10"
- "12"

View File

@ -1,3 +1,39 @@
2020-03-06, Version 3.7.0
=========================
* Update LTS status in README (Miroslav Bajtoš)
* chore: update copyright year (Diana Lau)
* Update README.md (Shaun)
* chore: improve issue and PR templates (Nora)
* chore: drop Node.js 6 and add Node.js 12 to travis (Nora)
2019-07-25, Version 3.6.3
=========================
* Rannig from other paths. Property files to array. (Diego A. Zapata Häntsch)
2019-07-12, Version 3.6.2
=========================
* chore: update CODEOWNERS (Diana Lau)
* Upgrade pkgcloud version (Diego A. Zapata Häntsch)
2019-05-23, Version 3.6.1
=========================
* update pkgcloud and use version 2.x (Anis)
* chore: update copyrights years (Agnes Lin)
2019-03-28, Version 3.6.0
=========================

View File

@ -1,6 +1,9 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners,
# the last matching pattern has the most precendence.
# the last matching pattern has the most precedence.
# Alumni members
# @kjdelisle @loay @ssh24 @virkt25
# Core team members from IBM
* @kjdelisle @jannyHou @loay @b-admike @ssh24 @virkt25 @dhmlau
* @jannyHou @b-admike @dhmlau @hacksparrow

View File

@ -1,6 +1,15 @@
# LoopBack Storage Component
**NOTE: The loopback-component-storage module supersedes [loopback-storage-service](https://www.npmjs.org/package/loopback-storage-service). Please update your package.json accordingly.**
**⚠️ LoopBack 3 is in Maintenance LTS mode, only critical bugs and critical
security fixes will be provided. (See
[Module Long Term Support Policy](#module-long-term-support-policy) below.)**
We urge all LoopBack 3 users to migrate their applications to LoopBack 4 as
soon as possible. Refer to our
[Migration Guide](https://loopback.io/doc/en/lb4/migration-overview.html)
for more information on how to upgrade.
## Overview
LoopBack storage component provides Node.js and REST APIs to manage binary file contents
using pluggable storage providers, such as local file systems, Amazon S3, or
@ -13,10 +22,22 @@ storage services including:
- Openstack
- Rackspace
> Please see the [Storage Service Documentaion](http://loopback.io/doc/en/lb3/Storage-component.html).
> Please see the [Storage Service Documentation](http://loopback.io/doc/en/lb3/Storage-component.html).
For more details on the architecture of the module, please see the introduction section of the [blog post](https://strongloop.com/strongblog/managing-nodejs-loopback-storage-service-provider/).
## Examples
See https://github.com/strongloop/loopback-example-storage.
## Module Long Term Support Policy
This module adopts the [
Module Long Term Support (LTS)](http://github.com/CloudNativeJS/ModuleLTS) policy,
with the following End Of Life (EOL) dates:
| Version | Status | Published | EOL |
| ------- | --------------- | --------- | -------- |
| 3.x | Maintenance LTS | Dec 2016 | Dec 2020 |
Learn more about our LTS plan in [docs](https://loopback.io/doc/en/contrib/Long-term-support.html).

View File

@ -1,7 +1,8 @@
// Copyright IBM Corp. 2014,2016. All Rights Reserved.
// Copyright IBM Corp. 2014,2019. All Rights Reserved.
// Node module: loopback-component-storage
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
'use strict';
var SG = require('strong-globalize');

View File

@ -1,7 +1,8 @@
// Copyright IBM Corp. 2013,2014. All Rights Reserved.
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Node module: loopback-component-storage
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
'use strict';
var pkgcloud = require('pkgcloud');

View File

@ -1,7 +1,8 @@
// Copyright IBM Corp. 2013,2014. All Rights Reserved.
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Node module: loopback-component-storage
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
'use strict';
var base = require('pkgcloud').storage;

View File

@ -1,7 +1,8 @@
// Copyright IBM Corp. 2013,2014. All Rights Reserved.
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Node module: loopback-component-storage
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
'use strict';
var base = require('pkgcloud').storage;

View File

@ -1,7 +1,8 @@
// Copyright IBM Corp. 2013,2015. All Rights Reserved.
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Node module: loopback-component-storage
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
'use strict';
// Globalization
@ -31,6 +32,12 @@ module.exports.createClient = function(options) {
function FileSystemProvider(options) {
options = options || {};
if (!path.isAbsolute(options.root)) {
var basePath = path.dirname(path.dirname(require.main.filename));
options.root = path.join(basePath, options.root);
}
this.root = options.root;
var exists = fs.existsSync(this.root);
if (!exists) {
@ -103,6 +110,11 @@ FileSystemProvider.prototype.getContainers = function(cb) {
fs.readdir(self.root, function(err, files) {
var containers = [];
var tasks = [];
if (!files) {
files = [];
}
files.forEach(function(f) {
tasks.push(fs.stat.bind(fs, path.join(self.root, f)));
});

View File

@ -1,7 +1,8 @@
// Copyright IBM Corp. 2013,2014. All Rights Reserved.
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Node module: loopback-component-storage
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
'use strict';
var StorageService = require('./storage-service');

View File

@ -1,7 +1,8 @@
// Copyright IBM Corp. 2013,2015. All Rights Reserved.
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Node module: loopback-component-storage
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
'use strict';
// Globalization

View File

@ -1,7 +1,8 @@
// Copyright IBM Corp. 2014,2016. All Rights Reserved.
// Copyright IBM Corp. 2014,2019. All Rights Reserved.
// Node module: loopback-component-storage
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
'use strict';
var factory = require('./factory');

View File

@ -1,3 +1,8 @@
// Copyright IBM Corp. 2018,2019. All Rights Reserved.
// Node module: loopback-component-storage
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
'use strict';
exports.createPromiseCallback = createPromiseCallback;

View File

@ -2,9 +2,9 @@
"name": "loopback-component-storage",
"description": "Loopback Storage Service",
"engines": {
"node": ">=6"
"node": ">=8"
},
"version": "3.6.0",
"version": "3.7.0",
"main": "index.js",
"scripts": {
"lint": "eslint .",
@ -15,7 +15,7 @@
"async": "^2.6.1",
"debug": "^3.1.0",
"formidable": "^1.2.1",
"pkgcloud": "^1.5.0",
"pkgcloud": "^2.1.1",
"strong-globalize": "^4.1.1",
"uuid": "^3.2.1"
},
@ -33,5 +33,6 @@
"type": "git",
"url": "https://github.com/strongloop/loopback-component-storage.git"
},
"license": "Artistic-2.0"
"license": "Artistic-2.0",
"author": "IBM Corp."
}

View File

@ -1,7 +1,8 @@
// Copyright IBM Corp. 2016. All Rights Reserved.
// Copyright IBM Corp. 2016,2019. All Rights Reserved.
// Node module: loopback-component-storage
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
'use strict';
var loopback = require('loopback');

View File

@ -1,7 +1,8 @@
// Copyright IBM Corp. 2013,2014. All Rights Reserved.
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Node module: loopback-component-storage
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
'use strict';
var FileSystemProvider = require('../lib/providers/filesystem/index.js').Client;
@ -30,6 +31,21 @@ describe('FileSystem based storage provider', function() {
process.nextTick(done);
});
it('should work even it is ran from other path', function(done) {
process.chdir('../../../');
try {
console.log(`running from ${process.cwd()}`);
client = new FileSystemProvider({
root: path.join(__dirname, 'storage'),
});
process.nextTick(done);
} catch (error) {
process.nextTick(done(error));
}
});
it('should complain if the root directory doesn\'t exist', function(done) {
try {
client = new FileSystemProvider({

View File

@ -1,7 +1,8 @@
// Copyright IBM Corp. 2013,2015. All Rights Reserved.
// Copyright IBM Corp. 2013,2019. All Rights Reserved.
// Node module: loopback-component-storage
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
'use strict';
var StorageService = require('../lib/storage-service.js');

View File

@ -1,7 +1,8 @@
// Copyright IBM Corp. 2014,2016. All Rights Reserved.
// Copyright IBM Corp. 2014,2019. All Rights Reserved.
// Node module: loopback-component-storage
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
'use strict';
var request = require('supertest');