@things-factory/integration-sftp 5.0.0-alpha.45 → 5.0.0-alpha.48
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/dist-server/sftp-s3.js
CHANGED
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const aws_sdk_1 = __importDefault(require("aws-sdk"));
|
|
7
|
-
const v4_1 = __importDefault(require("uuid/v4"));
|
|
8
7
|
const env_1 = require("@things-factory/env");
|
|
9
8
|
const sftp_const_1 = require("./sftp-const");
|
|
9
|
+
const crypto = require('crypto');
|
|
10
10
|
const { PassThrough } = require('stream');
|
|
11
11
|
const path = require('path');
|
|
12
12
|
const { fs } = require('memfs');
|
|
@@ -51,7 +51,7 @@ if (sftp_const_1.SFTPFILESTORAGE && sftp_const_1.SFTPFILESTORAGE.type == 's3') {
|
|
|
51
51
|
};
|
|
52
52
|
/* upload file */
|
|
53
53
|
sftp_const_1.SFTPFILESTORAGE.uploadFile = ({ stream, filename, uploadPath }) => {
|
|
54
|
-
const id =
|
|
54
|
+
const id = crypto.randomUUID();
|
|
55
55
|
let size = 0;
|
|
56
56
|
return new Promise((resolve, reject) => stream
|
|
57
57
|
.pipe((() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sftp-s3.js","sourceRoot":"","sources":["../server/sftp-s3.ts"],"names":[],"mappings":";;;;;AAAA,sDAAyB;
|
|
1
|
+
{"version":3,"file":"sftp-s3.js","sourceRoot":"","sources":["../server/sftp-s3.ts"],"names":[],"mappings":";;;;;AAAA,sDAAyB;AAEzB,6CAA4C;AAE5C,6CAA8C;AAE9C,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEhC,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;AACzC,MAAM,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AE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aACnC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAC/C,CAAA;IACH,CAAC,CAAA;IAED,YAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAA;CAC3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/integration-sftp",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.48",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@things-factory/auth-base": "^5.0.0-alpha.
|
|
28
|
-
"@things-factory/biz-base": "^5.0.0-alpha.
|
|
29
|
-
"@things-factory/env": "^5.0.0-alpha.
|
|
30
|
-
"@things-factory/integration-fulfillment": "^5.0.0-alpha.
|
|
31
|
-
"@things-factory/shell": "^5.0.0-alpha.
|
|
27
|
+
"@things-factory/auth-base": "^5.0.0-alpha.48",
|
|
28
|
+
"@things-factory/biz-base": "^5.0.0-alpha.48",
|
|
29
|
+
"@things-factory/env": "^5.0.0-alpha.48",
|
|
30
|
+
"@things-factory/integration-fulfillment": "^5.0.0-alpha.48",
|
|
31
|
+
"@things-factory/shell": "^5.0.0-alpha.48",
|
|
32
32
|
"aws-sdk": "^2.960.0",
|
|
33
33
|
"xml-js": "^1.6.11"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "0fa9b26abce176fa96d820fb50cc5565760d50c9"
|
|
36
36
|
}
|
package/server/sftp-s3.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import AWS from 'aws-sdk'
|
|
2
|
-
import uuid from 'uuid/v4'
|
|
3
2
|
|
|
4
3
|
import { logger } from '@things-factory/env'
|
|
5
4
|
|
|
6
5
|
import { SFTPFILESTORAGE } from './sftp-const'
|
|
7
6
|
|
|
7
|
+
const crypto = require('crypto')
|
|
8
|
+
|
|
8
9
|
const { PassThrough } = require('stream')
|
|
9
10
|
const path = require('path')
|
|
10
11
|
const { fs } = require('memfs')
|
|
@@ -63,7 +64,7 @@ if (SFTPFILESTORAGE && SFTPFILESTORAGE.type == 's3') {
|
|
|
63
64
|
|
|
64
65
|
/* upload file */
|
|
65
66
|
SFTPFILESTORAGE.uploadFile = ({ stream, filename, uploadPath }) => {
|
|
66
|
-
const id =
|
|
67
|
+
const id = crypto.randomUUID()
|
|
67
68
|
let size: number = 0
|
|
68
69
|
|
|
69
70
|
return new Promise<{ id: string; path: string; size: number }>((resolve, reject) =>
|