Skip to content

Commit

Permalink
Merge pull request #574 from VeliovGroup/dev
Browse files Browse the repository at this point in the history
v1.9.7
  • Loading branch information
dr-dimitru authored Feb 10, 2018
2 parents 15de3a1 + ef2ea60 commit f08f897
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 54 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
- Where this issue appears? OS (Mac/Win/Linux)? Browser name and its version?
- Is it *Client* or *Server* issue?
- Post *Client* and/or *Server* logs with enabled `debug` option, you can enable "debug" mode in [*Constructor*](https://github.com/VeliovGroup/Meteor-Files/wiki/Constructor)

### I had an issue and I've solved it on my own:
- Provide a description of steps that you've followed to solve the problem.
- Provide links to websites and/or pages with the information that helped you (*if there are any*).


### I have a suggestion:
- Describe your feature / request
Expand Down
18 changes: 9 additions & 9 deletions .npm/package/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 28 additions & 25 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,43 +1,46 @@
[email protected]
babel-compiler@6.24.7
babel-runtime@1.1.1
babel-compiler@7.0.3
babel-runtime@1.2.0
[email protected]
[email protected]
boilerplate-generator@1.3.0
callback-hook@1.0.10
check@1.2.5
boilerplate-generator@1.4.0
callback-hook@1.1.0
check@1.3.0
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
ecmascript-runtime-client@0.5.0
ecmascript-runtime-client@0.6.0
[email protected]
[email protected]
[email protected]
http@1.3.0
id-map@1.0.9
http@1.4.0
id-map@1.1.0
[email protected]
[email protected].0
[email protected].0
[email protected].0
[email protected].0
mongo@1.3.1
[email protected].2
[email protected].3
[email protected].3
[email protected].1
mongo@1.4.2
[email protected]
[email protected]
[email protected]
ordered-dict@1.0.9
ordered-dict@1.1.0
ostrio:[email protected]
ostrio:[email protected].6
[email protected].0
random@1.0.10
ostrio:[email protected].7
[email protected].1
random@1.1.0
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
url@1.1.0
webapp@1.4.0
url@1.2.0
webapp@1.5.0
[email protected]
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
1. Search [issues](https://github.com/VeliovGroup/Meteor-Files/issues), maybe your issue is already solved
2. We have useful threads makred as [`In a case of the fire - Read This`](https://github.com/VeliovGroup/Meteor-Files/issues?utf8=✓&q=label%3A%22In%20a%20case%20of%20the%20fire%20-%20Read%20This%22), read them too
3. Before submitting an issue make sure it's only related to `Meteor-Files` package
4. If your issue not solved:
4. If your issue is not solved:
- Give an expressive description of what is went wrong
- Version of `Meteor-Files` you're experiencing this issue
- Version of `Meteor` you're experiencing this issue
- Is it *Client* or *Server* issue?
- Post *Client* and/or *Server* logs with enabled `debug` option, you can enable "debug" mode in [*Constructor*](https://github.com/VeliovGroup/Meteor-Files/wiki/Constructor)

### I have a suggestion:
1. PRs is always welcome - [send a PR](https://github.com/VeliovGroup/Meteor-Files/compare)
1. PRs are always welcome - [send a PR](https://github.com/VeliovGroup/Meteor-Files/compare)
- Always send PRs only to [`dev` branch](https://github.com/VeliovGroup/Meteor-Files/compare/dev), thank you
2. If you you can not send a PR for some reason:
2. If you're can not send a PR for some reason:
- Create a new issue ticket
- Describe your feature / request
- How you going to use it? Give a usage example(s)

### Documentation is missing something or incorrect (have typos, etc.):
1. PRs is always welcome - [send a PR](https://github.com/VeliovGroup/Meteor-Files/compare)
1. PRs are always welcome - [send a PR](https://github.com/VeliovGroup/Meteor-Files/compare)
- Always send PRs only to [`dev` branch](https://github.com/VeliovGroup/Meteor-Files/compare/dev), thank you
2. If you you can not send a PR for some reason:
2. If you're can not send a PR to docs for some reason:
- Create a new issue ticket
- Give an expressive description what you have changed/added and why
- Make sure you're using correct markdown markup
- Make sure all code blocks starts with tripple ``` (*backtick*) and have a syntax tag, for more read [this docs](https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting)
- Post your addition/changes as issue ticket, we will manage it
- Make sure all code blocks starts with triple ``` (*backtick*) and have a syntax tag, for more read [this docs](https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting)
- Post addition/changes as issue ticket, we will manage it
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017, Dmitriy A. (Veliov Group, LLC)
Copyright (c) 2018, dr.dimitru (Dmitriy A.; Veliov Group, LLC)
All rights reserved.

Redistribution and use in source and binary forms,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Support Meteor-Files project:

Contribution:
========
All PRs is always welcome on [`dev` branch](https://github.com/VeliovGroup/Meteor-Files/tree/dev). Please, always give expressive description to your changes and additions.
All PRs are always welcome on [`dev` branch](https://github.com/VeliovGroup/Meteor-Files/tree/dev). Please, always give expressive description to your changes and additions.

Awards:
========
Expand Down
3 changes: 2 additions & 1 deletion client.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class FilesCollection extends FilesCollectionCore {
check(this.collectionName, String);

if (this.public && !this.downloadRoute) {
throw new Meteor.Error(500, `[FilesCollection.${this.collectionName}]: \"downloadRoute\" must be precisely provided on \"public\" collections! Note: \"downloadRoute\" must be equal or be inside of your web/proxy-server (relative) root.`);
throw new Meteor.Error(500, `[FilesCollection.${this.collectionName}]: "downloadRoute" must be precisely provided on "public" collections! Note: "downloadRoute" must be equal or be inside of your web/proxy-server (relative) root.`);
}

if (!_.isBoolean(this.disableUpload)) {
Expand Down Expand Up @@ -231,6 +231,7 @@ export class FilesCollection extends FilesCollectionCore {
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileReader
* @param {Object} config - Configuration object with next properties:
* {File|Object} file - HTML5 `files` item, like in change event: `e.currentTarget.files[0]`
* {String} fileId - Optionnal `fileId` used at insert
* {Object} meta - Additional data as object, use later for search
* {Boolean} allowWebWorkers- Allow/Deny WebWorkers usage
* {Number|dynamic} streams - Quantity of parallel upload streams, default: 2
Expand Down
11 changes: 11 additions & 0 deletions docs/insert.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@
Set to dataURI {<em>String</em>} for Base64
</td>
</tr>
<tr>
<td align="right">
<code>settings.fileId</code> {<em>String</em>}
</td>
<td>
Explicitly set the fileId for the file
</td>
<td>
This is an optionnal parameters <code>Random.id()</code> will be used otherwise
</td>
</tr>
<tr>
<td align="right">
<code>settings.fileName</code> {<em>String</em>}
Expand Down
6 changes: 3 additions & 3 deletions package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'ostrio:files',
version: '1.9.6',
version: '1.9.7',
summary: 'File upload via DDP/HTTP to server, 3rd party storage support: AWS S3, GridFS, DropBox and others',
git: 'https://github.com/VeliovGroup/Meteor-Files',
documentation: 'README.md'
Expand All @@ -9,8 +9,8 @@ Package.describe({
Npm.depends({
'fs-extra': '5.0.0',
'request': '2.83.0',
'file-type': '7.4.0',
'eventemitter3': '3.0.0'
'file-type': '7.5.0',
'eventemitter3': '3.0.1'
});

Package.onUse(function(api) {
Expand Down
8 changes: 4 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class FilesCollection extends FilesCollectionCore {
check(this.collectionName, String);

if (this.public && !this.downloadRoute) {
throw new Meteor.Error(500, `[FilesCollection.${this.collectionName}]: \"downloadRoute\" must be precisely provided on \"public\" collections! Note: \"downloadRoute\" must be equal or be inside of your web/proxy-server (relative) root.`);
throw new Meteor.Error(500, `[FilesCollection.${this.collectionName}]: "downloadRoute" must be precisely provided on "public" collections! Note: "downloadRoute" must be equal or be inside of your web/proxy-server (relative) root.`);
}

if (!_.isString(this.downloadRoute)) {
Expand Down Expand Up @@ -242,7 +242,7 @@ export class FilesCollection extends FilesCollectionCore {
}

if (this.public && !storagePath) {
throw new Meteor.Error(500, `[FilesCollection.${this.collectionName}] \"storagePath\" must be set on \"public\" collections! Note: \"storagePath\" must be equal on be inside of your web/proxy-server (absolute) root.`);
throw new Meteor.Error(500, `[FilesCollection.${this.collectionName}] "storagePath" must be set on "public" collections! Note: "storagePath" must be equal on be inside of your web/proxy-server (absolute) root.`);
}

if (!storagePath) {
Expand All @@ -257,7 +257,7 @@ export class FilesCollection extends FilesCollectionCore {
this.storagePath = function () {
let sp = storagePath.apply(self, arguments);
if (!_.isString(sp)) {
throw new Meteor.Error(400, `[FilesCollection.${self.collectionName}] \"storagePath\" function must return a String!`);
throw new Meteor.Error(400, `[FilesCollection.${self.collectionName}] "storagePath" function must return a String!`);
}
sp = sp.replace(/\/$/, '');
return nodePath.normalize(sp);
Expand All @@ -268,7 +268,7 @@ export class FilesCollection extends FilesCollectionCore {

fs.mkdirs(this.storagePath({}), { mode: this.parentDirPermissions }, (error) => {
if (error) {
throw new Meteor.Error(401, `[FilesCollection.${self.collectionName}] Path \"${this.storagePath({})}\" is not writable!`, error);
throw new Meteor.Error(401, `[FilesCollection.${self.collectionName}] Path "${this.storagePath({})}" is not writable! ${error}`);
}
});

Expand Down
3 changes: 2 additions & 1 deletion upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export class UploadInstance extends EventEmitter {
check(this.config, {
ddp: Match.Any,
file: Match.Any,
fileId: Match.Optional(String),
meta: Match.Optional(Object),
type: Match.Optional(String),
onError: Match.Optional(Function),
Expand Down Expand Up @@ -151,7 +152,7 @@ export class UploadInstance extends EventEmitter {
this.sentChunks = 0;
this.fileLength = 1;
this.EOFsent = false;
this.fileId = Random.id();
this.fileId = this.config.fileId || Random.id();
this.FSName = this.collection.namingFunction ? this.collection.namingFunction(this.fileData) : this.fileId;
this.pipes = [];

Expand Down
6 changes: 4 additions & 2 deletions write-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ export default class WriteStream {
fs.ensureFile(this.path, (efError) => {
bound(() => {
if (efError) {
throw new Meteor.Error(500, '[FilesCollection] [writeStream] [ensureFile] [Error:]', efError);
this.abort();
throw new Meteor.Error(500, '[FilesCollection] [writeStream] [ensureFile] [Error:] ' + efError);
} else {
fs.open(this.path, 'r+', this.permissions, (oError, fd) => {
bound(() => {
if (oError) {
throw new Meteor.Error(500, '[FilesCollection] [writeStream] [ensureFile] [open] [Error:]', oError);
this.abort();
throw new Meteor.Error(500, '[FilesCollection] [writeStream] [ensureFile] [open] [Error:] ' + oError);
} else {
this.fd = fd;
fdCache[this.path] = this;
Expand Down

0 comments on commit f08f897

Please sign in to comment.