@things-factory/integration-sftp 4.1.28 → 5.0.0-alpha.10
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/controllers/herbalife/apis/index.js +5 -1
- package/dist-server/controllers/herbalife/apis/index.js.map +1 -1
- package/dist-server/controllers/herbalife/index.js +5 -1
- package/dist-server/controllers/herbalife/index.js.map +1 -1
- package/dist-server/controllers/index.js +5 -1
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/index.js +5 -1
- package/dist-server/index.js.map +1 -1
- package/dist-server/service/index.js +5 -1
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/sftp/sftp-mutation.js +56 -39
- package/dist-server/service/sftp/sftp-mutation.js.map +1 -1
- package/dist-server/util/index.js +5 -1
- package/dist-server/util/index.js.map +1 -1
- package/package.json +7 -7
- package/server/service/sftp/sftp-mutation.ts +1 -2
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/controllers/herbalife/apis/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/controllers/herbalife/apis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,uDAAoC;AACpC,oDAAiC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/herbalife/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/herbalife/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAqC;AACrC,6CAA8B;AAC9B,uDAA0C;AAE1C,8CAA2B;AAE3B,kBAAO,CAAC,gBAAgB,CAAC,WAAW,EAAE,wBAAM,EAAE,IAAI,CAAC,CAAA"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uBAAoB;AAEpB,6CAA0B"}
|
package/dist-server/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist-server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oBAAiB;AAEjB,gDAA6B;AAC7B,4CAAyB;AACzB,+CAA4B;AAC5B,gDAA6B;AAC7B,yCAAsB"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yBAAyB;AACzB,8CAA2B;AAE3B,mCAAmC;AACnC,iCAA6E;AAEhE,QAAA,QAAQ,GAAG;IACtB,cAAc;IACf,GAAG,eAAY;CACf,CAAA;AAGY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACxB,GAAG,gBAAa;KACf;CACF,CAAA"}
|
|
@@ -11,6 +11,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
15
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
16
|
+
var m = o[Symbol.asyncIterator], i;
|
|
17
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
18
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
19
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
20
|
+
};
|
|
14
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
22
|
exports.SftpMutation = void 0;
|
|
16
23
|
require("../../sftp-s3");
|
|
@@ -74,6 +81,7 @@ let SftpMutation = class SftpMutation {
|
|
|
74
81
|
return true;
|
|
75
82
|
}
|
|
76
83
|
async syncSftpOrders(customerDomainId, context) {
|
|
84
|
+
var e_1, _a;
|
|
77
85
|
const { tx } = context.state;
|
|
78
86
|
const customerDomain = await tx.getRepository(shell_1.Domain).findOne(customerDomainId);
|
|
79
87
|
const customerBizplace = await tx.getRepository(biz_base_1.Bizplace).findOne({
|
|
@@ -93,42 +101,51 @@ let SftpMutation = class SftpMutation {
|
|
|
93
101
|
let initialDataPath = `${sftpUser.folderPath}/${folderType}${sftp_const_1.SUBMITDATAPATH}/`;
|
|
94
102
|
const results = await (0, util_1.getPermittedDirectories)({ path: initialDataPath }, context);
|
|
95
103
|
const filesDirectories = results.filter(result => result.Size > 0);
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
104
|
+
try {
|
|
105
|
+
for (var filesDirectories_1 = (e_1 = void 0, __asyncValues(filesDirectories)), filesDirectories_1_1; filesDirectories_1_1 = await filesDirectories_1.next(), !filesDirectories_1_1.done;) {
|
|
106
|
+
let fileDirectory = filesDirectories_1_1.value;
|
|
107
|
+
let dataPath = `${sftpUser.folderPath}/${folderType}${sftp_const_1.SUBMITDATAPATH}/`;
|
|
108
|
+
let successPath = `${sftpUser.folderPath}/${folderType}${sftp_const_1.SUCCESSDATAPATH}/`;
|
|
109
|
+
let failedPath = `${sftpUser.folderPath}/${folderType}${sftp_const_1.FAILEDDATAPATH}/`;
|
|
110
|
+
const fileKey = fileDirectory.Key;
|
|
111
|
+
const lastSlashIdx = fileKey.lastIndexOf('/');
|
|
112
|
+
const fileString = fileKey.substring(lastSlashIdx + 1, fileKey.length);
|
|
113
|
+
try {
|
|
114
|
+
const sftp = sftpUser;
|
|
115
|
+
let result = await controllers_1.SftpAPI.getOutboundOrder(sftp, { folderPath, folderType, fileKey: fileString });
|
|
116
|
+
let isAccept = result.isAccept;
|
|
117
|
+
if (isAccept) {
|
|
118
|
+
delete result.isAccept;
|
|
119
|
+
if (result) {
|
|
120
|
+
let { items: releaseOrders } = await integration_fulfillment_1.FulfillmentAPI.getOutboundOrders(fulfilmentCenter, {
|
|
121
|
+
customerBizplaceId,
|
|
122
|
+
refNo: result.refNo
|
|
123
|
+
});
|
|
124
|
+
if (releaseOrders) {
|
|
125
|
+
result.collectionOrderNo = result.collectionOrderNo + ' - ' + (releaseOrders.length + 1);
|
|
126
|
+
}
|
|
127
|
+
const releaseOrder = await integration_fulfillment_1.FulfillmentAPI.createOutboundOrder(fulfilmentCenter, {
|
|
128
|
+
customerBizplaceId,
|
|
129
|
+
releaseOrder: result
|
|
130
|
+
});
|
|
131
|
+
if (releaseOrder) {
|
|
132
|
+
let movePaths = {
|
|
133
|
+
source: (dataPath += fileString),
|
|
134
|
+
destination: (successPath += fileString)
|
|
135
|
+
};
|
|
136
|
+
await sftp_const_1.SFTPFILESTORAGE.moveFile(movePaths);
|
|
137
|
+
}
|
|
128
138
|
}
|
|
129
139
|
}
|
|
140
|
+
else {
|
|
141
|
+
let movePaths = {
|
|
142
|
+
source: (dataPath += fileString),
|
|
143
|
+
destination: (failedPath += fileString)
|
|
144
|
+
};
|
|
145
|
+
await sftp_const_1.SFTPFILESTORAGE.moveFile(movePaths);
|
|
146
|
+
}
|
|
130
147
|
}
|
|
131
|
-
|
|
148
|
+
catch (e) {
|
|
132
149
|
let movePaths = {
|
|
133
150
|
source: (dataPath += fileString),
|
|
134
151
|
destination: (failedPath += fileString)
|
|
@@ -136,13 +153,13 @@ let SftpMutation = class SftpMutation {
|
|
|
136
153
|
await sftp_const_1.SFTPFILESTORAGE.moveFile(movePaths);
|
|
137
154
|
}
|
|
138
155
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
await sftp_const_1.SFTPFILESTORAGE.moveFile(movePaths);
|
|
156
|
+
}
|
|
157
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
158
|
+
finally {
|
|
159
|
+
try {
|
|
160
|
+
if (filesDirectories_1_1 && !filesDirectories_1_1.done && (_a = filesDirectories_1.return)) await _a.call(filesDirectories_1);
|
|
145
161
|
}
|
|
162
|
+
finally { if (e_1) throw e_1.error; }
|
|
146
163
|
}
|
|
147
164
|
}
|
|
148
165
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sftp-mutation.js","sourceRoot":"","sources":["../../../server/service/sftp/sftp-mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sftp-mutation.js","sourceRoot":"","sources":["../../../server/service/sftp/sftp-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,yBAAsB;AAEtB,+CAAsE;AACtE,qCAA4B;AAE5B,uDAAmD;AACnD,qFAA2F;AAC3F,iDAA8C;AAE9C,mDAA2C;AAC3C,iDAAmG;AACnG,qCAAoD;AACpD,iCAA6B;AAC7B,2CAAgD;AAGhD,IAAa,YAAY,GAAzB,MAAa,YAAY;IAGvB,KAAK,CAAC,UAAU,CAAc,IAAa,EAAS,OAAY;QAC9D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAA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CAAC,CAAA;IAAiB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CASpE;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAE3E,WAAA,IAAA,kBAAG,EAAC,kBAAkB,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA;IACvC,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;kDAmFP;AA1LU,YAAY;IADxB,IAAA,uBAAQ,EAAC,WAAI,CAAC;GACF,YAAY,CA2LxB;AA3LY,oCAAY"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/util/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA2C;AAC3C,kDAA+B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/integration-sftp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha.10",
|
|
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": "^
|
|
28
|
-
"@things-factory/biz-base": "^
|
|
29
|
-
"@things-factory/env": "^
|
|
30
|
-
"@things-factory/integration-fulfillment": "^
|
|
31
|
-
"@things-factory/shell": "^
|
|
27
|
+
"@things-factory/auth-base": "^5.0.0-alpha.10",
|
|
28
|
+
"@things-factory/biz-base": "^5.0.0-alpha.10",
|
|
29
|
+
"@things-factory/env": "^5.0.0-alpha.10",
|
|
30
|
+
"@things-factory/integration-fulfillment": "^5.0.0-alpha.10",
|
|
31
|
+
"@things-factory/shell": "^5.0.0-alpha.10",
|
|
32
32
|
"aws-sdk": "^2.960.0",
|
|
33
33
|
"xml-js": "^1.6.11"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "24e85b0265d10cb664b8279bb927ea2a86227775"
|
|
36
36
|
}
|
|
@@ -145,11 +145,10 @@ export class SftpMutation {
|
|
|
145
145
|
const results: any[] = await getPermittedDirectories({ path: initialDataPath }, context)
|
|
146
146
|
const filesDirectories: any[] = results.filter(result => result.Size > 0)
|
|
147
147
|
|
|
148
|
-
for (let
|
|
148
|
+
for await (let fileDirectory of filesDirectories) {
|
|
149
149
|
let dataPath: string = `${sftpUser.folderPath}/${folderType}${SUBMITDATAPATH}/`
|
|
150
150
|
let successPath: string = `${sftpUser.folderPath}/${folderType}${SUCCESSDATAPATH}/`
|
|
151
151
|
let failedPath: string = `${sftpUser.folderPath}/${folderType}${FAILEDDATAPATH}/`
|
|
152
|
-
const fileDirectory: any = filesDirectories[j]
|
|
153
152
|
const fileKey: string = fileDirectory.Key
|
|
154
153
|
const lastSlashIdx = fileKey.lastIndexOf('/')
|
|
155
154
|
const fileString: string = fileKey.substring(lastSlashIdx + 1, fileKey.length)
|