@things-factory/integration-sftp 5.0.1 → 5.0.14
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/create-serial-number.js.map +1 -1
- package/dist-server/controllers/herbalife/apis/create-shipment.js.map +1 -1
- package/dist-server/controllers/herbalife/apis/echo.js.map +1 -1
- package/dist-server/controllers/herbalife/apis/get-outbound-order.js.map +1 -1
- package/dist-server/controllers/herbalife/apis/index.js +5 -18
- package/dist-server/controllers/herbalife/apis/index.js.map +1 -1
- package/dist-server/controllers/herbalife/herbalife.js.map +1 -1
- package/dist-server/controllers/herbalife/index.js +3 -28
- package/dist-server/controllers/herbalife/index.js.map +1 -1
- package/dist-server/controllers/herbalife/platform-action.js.map +1 -1
- package/dist-server/controllers/index.js +2 -15
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/controllers/sftp-api/decorators.js +2 -4
- package/dist-server/controllers/sftp-api/decorators.js.map +1 -1
- package/dist-server/controllers/sftp-api/index.js +17 -25
- package/dist-server/controllers/sftp-api/index.js.map +1 -1
- package/dist-server/controllers/sftp-api/types.js.map +1 -1
- package/dist-server/index.js +6 -19
- package/dist-server/index.js.map +1 -1
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/index.js +2 -15
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/sftp/index.js.map +1 -1
- package/dist-server/service/sftp/sftp-mutation.js +40 -58
- package/dist-server/service/sftp/sftp-mutation.js.map +1 -1
- package/dist-server/service/sftp/sftp-query.js +29 -40
- package/dist-server/service/sftp/sftp-query.js.map +1 -1
- package/dist-server/service/sftp/sftp-type.js +48 -56
- package/dist-server/service/sftp/sftp-type.js.map +1 -1
- package/dist-server/service/sftp/sftp.js +46 -54
- package/dist-server/service/sftp/sftp.js.map +1 -1
- package/dist-server/sftp-const.js.map +1 -1
- package/dist-server/sftp-s3.js +2 -4
- package/dist-server/sftp-s3.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/dist-server/util/generate-files.js.map +1 -1
- package/dist-server/util/get-permitted-directories.js.map +1 -1
- package/dist-server/util/index.js +3 -16
- package/dist-server/util/index.js.map +1 -1
- package/package.json +6 -6
- package/server/service/sftp/sftp-mutation.ts +2 -2
@@ -1,19 +1,8 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
-
};
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
13
|
-
};
|
14
2
|
var _a;
|
15
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
16
4
|
exports.SftpQuery = void 0;
|
5
|
+
const tslib_1 = require("tslib");
|
17
6
|
const type_graphql_1 = require("type-graphql");
|
18
7
|
const typeorm_1 = require("typeorm");
|
19
8
|
const auth_base_1 = require("@things-factory/auth-base");
|
@@ -43,44 +32,44 @@ let SftpQuery = class SftpQuery {
|
|
43
32
|
return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(sftp.creatorId);
|
44
33
|
}
|
45
34
|
};
|
46
|
-
__decorate([
|
35
|
+
tslib_1.__decorate([
|
47
36
|
(0, type_graphql_1.Query)(returns => sftp_1.Sftp, { description: 'To fetch a Sftp' }),
|
48
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
49
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
50
|
-
__metadata("design:type", Function),
|
51
|
-
__metadata("design:paramtypes", [String, Object]),
|
52
|
-
__metadata("design:returntype", Promise)
|
37
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
38
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
39
|
+
tslib_1.__metadata("design:type", Function),
|
40
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
41
|
+
tslib_1.__metadata("design:returntype", Promise)
|
53
42
|
], SftpQuery.prototype, "sftp", null);
|
54
|
-
__decorate([
|
43
|
+
tslib_1.__decorate([
|
55
44
|
(0, type_graphql_1.Query)(returns => sftp_type_1.SftpList, { description: 'To fetch multiple Sftps' }),
|
56
|
-
__param(0, (0, type_graphql_1.Args)()),
|
57
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
58
|
-
__metadata("design:type", Function),
|
59
|
-
__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
60
|
-
__metadata("design:returntype", Promise)
|
45
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
46
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
47
|
+
tslib_1.__metadata("design:type", Function),
|
48
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
49
|
+
tslib_1.__metadata("design:returntype", Promise)
|
61
50
|
], SftpQuery.prototype, "sftps", null);
|
62
|
-
__decorate([
|
51
|
+
tslib_1.__decorate([
|
63
52
|
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
64
|
-
__param(0, (0, type_graphql_1.Root)()),
|
65
|
-
__metadata("design:type", Function),
|
66
|
-
__metadata("design:paramtypes", [sftp_1.Sftp]),
|
67
|
-
__metadata("design:returntype", Promise)
|
53
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
54
|
+
tslib_1.__metadata("design:type", Function),
|
55
|
+
tslib_1.__metadata("design:paramtypes", [sftp_1.Sftp]),
|
56
|
+
tslib_1.__metadata("design:returntype", Promise)
|
68
57
|
], SftpQuery.prototype, "domain", null);
|
69
|
-
__decorate([
|
58
|
+
tslib_1.__decorate([
|
70
59
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
71
|
-
__param(0, (0, type_graphql_1.Root)()),
|
72
|
-
__metadata("design:type", Function),
|
73
|
-
__metadata("design:paramtypes", [sftp_1.Sftp]),
|
74
|
-
__metadata("design:returntype", Promise)
|
60
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
61
|
+
tslib_1.__metadata("design:type", Function),
|
62
|
+
tslib_1.__metadata("design:paramtypes", [sftp_1.Sftp]),
|
63
|
+
tslib_1.__metadata("design:returntype", Promise)
|
75
64
|
], SftpQuery.prototype, "updater", null);
|
76
|
-
__decorate([
|
65
|
+
tslib_1.__decorate([
|
77
66
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
78
|
-
__param(0, (0, type_graphql_1.Root)()),
|
79
|
-
__metadata("design:type", Function),
|
80
|
-
__metadata("design:paramtypes", [sftp_1.Sftp]),
|
81
|
-
__metadata("design:returntype", Promise)
|
67
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
68
|
+
tslib_1.__metadata("design:type", Function),
|
69
|
+
tslib_1.__metadata("design:paramtypes", [sftp_1.Sftp]),
|
70
|
+
tslib_1.__metadata("design:returntype", Promise)
|
82
71
|
], SftpQuery.prototype, "creator", null);
|
83
|
-
SftpQuery = __decorate([
|
72
|
+
SftpQuery = tslib_1.__decorate([
|
84
73
|
(0, type_graphql_1.Resolver)(sftp_1.Sftp)
|
85
74
|
], SftpQuery);
|
86
75
|
exports.SftpQuery = SftpQuery;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sftp-query.js","sourceRoot":"","sources":["../../../server/service/sftp/sftp-query.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"sftp-query.js","sourceRoot":"","sources":["../../../server/service/sftp/sftp-query.ts"],"names":[],"mappings":";;;;;AAAA,+CAAmF;AACnF,qCAAuC;AAEvC,yDAAgD;AAChD,iDAA4E;AAE5E,iCAA6B;AAC7B,2CAAsC;AAGtC,IAAa,SAAS,GAAtB,MAAa,SAAS;IAEpB,KAAK,CAAC,IAAI,CAAY,EAAU,EAAS,OAAY;QACnD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,uBAAa,EAAC,WAAI,CAAC,CAAC,OAAO,CAAC;YACvC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;SACtB,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,KAAK,CAAS,MAAiB,EAAS,OAAY;QACxD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;QAC7D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,WAAI,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAE9E,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGD,KAAK,CAAC,MAAM,CAAS,IAAU;QAC7B,OAAO,MAAM,IAAA,uBAAa,EAAC,cAAM,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC3D,CAAC;IAGD,KAAK,CAAC,OAAO,CAAS,IAAU;QAC9B,OAAO,MAAM,IAAA,uBAAa,EAAC,gBAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAC1D,CAAC;IAGD,KAAK,CAAC,OAAO,CAAS,IAAU;QAC9B,OAAO,MAAM,IAAA,uBAAa,EAAC,gBAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAC1D,CAAC;CACF,CAAA;AAhCC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,WAAI,EAAE,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IAC/C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qCAMvC;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,oBAAQ,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;IAC1D,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;iEAAjB,iBAAS,oBAAT,iBAAS;;sCAOpC;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAO,WAAI;;uCAE9B;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAO,WAAI;;wCAE/B;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAO,WAAI;;wCAE/B;AAjCU,SAAS;IADrB,IAAA,uBAAQ,EAAC,WAAI,CAAC;GACF,SAAS,CAkCrB;AAlCY,8BAAS","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { getRepository } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { convertListParams, Domain, ListParam } from '@things-factory/shell'\n\nimport { Sftp } from './sftp'\nimport { SftpList } from './sftp-type'\n\n@Resolver(Sftp)\nexport class SftpQuery {\n @Query(returns => Sftp, { description: 'To fetch a Sftp' })\n async sftp(@Arg('id') id: string, @Ctx() context: any): Promise<Sftp> {\n const { domain } = context.state\n\n return await getRepository(Sftp).findOne({\n where: { domain, id }\n })\n }\n\n @Query(returns => SftpList, { description: 'To fetch multiple Sftps' })\n async sftps(@Args() params: ListParam, @Ctx() context: any): Promise<SftpList> {\n const { domain } = context.state\n\n const convertedParams = convertListParams(params, { domain })\n const [items, total] = await getRepository(Sftp).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() sftp: Sftp): Promise<Domain> {\n return await getRepository(Domain).findOne(sftp.domainId)\n }\n\n @FieldResolver(type => User)\n async updater(@Root() sftp: Sftp): Promise<User> {\n return await getRepository(User).findOne(sftp.updaterId)\n }\n\n @FieldResolver(type => User)\n async creator(@Root() sftp: Sftp): Promise<User> {\n return await getRepository(User).findOne(sftp.creatorId)\n }\n}\n"]}
|
@@ -1,120 +1,112 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
-
};
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
3
|
exports.SftpList = exports.SftpPatch = exports.NewSftp = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
13
5
|
const type_graphql_1 = require("type-graphql");
|
14
6
|
const sftp_1 = require("./sftp");
|
15
7
|
let NewSftp = class NewSftp {
|
16
8
|
};
|
17
|
-
__decorate([
|
9
|
+
tslib_1.__decorate([
|
18
10
|
(0, type_graphql_1.Field)(),
|
19
|
-
__metadata("design:type", String)
|
11
|
+
tslib_1.__metadata("design:type", String)
|
20
12
|
], NewSftp.prototype, "name", void 0);
|
21
|
-
__decorate([
|
13
|
+
tslib_1.__decorate([
|
22
14
|
(0, type_graphql_1.Field)({ nullable: true }),
|
23
|
-
__metadata("design:type", String)
|
15
|
+
tslib_1.__metadata("design:type", String)
|
24
16
|
], NewSftp.prototype, "description", void 0);
|
25
|
-
__decorate([
|
17
|
+
tslib_1.__decorate([
|
26
18
|
(0, type_graphql_1.Field)(type => sftp_1.SftpStatus, { nullable: true }),
|
27
|
-
__metadata("design:type", String)
|
19
|
+
tslib_1.__metadata("design:type", String)
|
28
20
|
], NewSftp.prototype, "status", void 0);
|
29
|
-
__decorate([
|
21
|
+
tslib_1.__decorate([
|
30
22
|
(0, type_graphql_1.Field)({ nullable: true }),
|
31
|
-
__metadata("design:type", String)
|
23
|
+
tslib_1.__metadata("design:type", String)
|
32
24
|
], NewSftp.prototype, "username", void 0);
|
33
|
-
__decorate([
|
25
|
+
tslib_1.__decorate([
|
34
26
|
(0, type_graphql_1.Field)({ nullable: true }),
|
35
|
-
__metadata("design:type", String)
|
27
|
+
tslib_1.__metadata("design:type", String)
|
36
28
|
], NewSftp.prototype, "publicKey", void 0);
|
37
|
-
__decorate([
|
29
|
+
tslib_1.__decorate([
|
38
30
|
(0, type_graphql_1.Field)({ nullable: true }),
|
39
|
-
__metadata("design:type", String)
|
31
|
+
tslib_1.__metadata("design:type", String)
|
40
32
|
], NewSftp.prototype, "privateKey", void 0);
|
41
|
-
__decorate([
|
33
|
+
tslib_1.__decorate([
|
42
34
|
(0, type_graphql_1.Field)({ nullable: true }),
|
43
|
-
__metadata("design:type", String)
|
35
|
+
tslib_1.__metadata("design:type", String)
|
44
36
|
], NewSftp.prototype, "folderPath", void 0);
|
45
|
-
__decorate([
|
37
|
+
tslib_1.__decorate([
|
46
38
|
(0, type_graphql_1.Field)({ nullable: true }),
|
47
|
-
__metadata("design:type", Boolean)
|
39
|
+
tslib_1.__metadata("design:type", Boolean)
|
48
40
|
], NewSftp.prototype, "isDevelopment", void 0);
|
49
|
-
__decorate([
|
41
|
+
tslib_1.__decorate([
|
50
42
|
(0, type_graphql_1.Field)({ nullable: true }),
|
51
|
-
__metadata("design:type", String)
|
43
|
+
tslib_1.__metadata("design:type", String)
|
52
44
|
], NewSftp.prototype, "platform", void 0);
|
53
|
-
NewSftp = __decorate([
|
45
|
+
NewSftp = tslib_1.__decorate([
|
54
46
|
(0, type_graphql_1.InputType)()
|
55
47
|
], NewSftp);
|
56
48
|
exports.NewSftp = NewSftp;
|
57
49
|
let SftpPatch = class SftpPatch {
|
58
50
|
};
|
59
|
-
__decorate([
|
51
|
+
tslib_1.__decorate([
|
60
52
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
61
|
-
__metadata("design:type", String)
|
53
|
+
tslib_1.__metadata("design:type", String)
|
62
54
|
], SftpPatch.prototype, "id", void 0);
|
63
|
-
__decorate([
|
55
|
+
tslib_1.__decorate([
|
64
56
|
(0, type_graphql_1.Field)({ nullable: true }),
|
65
|
-
__metadata("design:type", String)
|
57
|
+
tslib_1.__metadata("design:type", String)
|
66
58
|
], SftpPatch.prototype, "name", void 0);
|
67
|
-
__decorate([
|
59
|
+
tslib_1.__decorate([
|
68
60
|
(0, type_graphql_1.Field)({ nullable: true }),
|
69
|
-
__metadata("design:type", String)
|
61
|
+
tslib_1.__metadata("design:type", String)
|
70
62
|
], SftpPatch.prototype, "description", void 0);
|
71
|
-
__decorate([
|
63
|
+
tslib_1.__decorate([
|
72
64
|
(0, type_graphql_1.Field)(type => sftp_1.SftpStatus, { nullable: true }),
|
73
|
-
__metadata("design:type", String)
|
65
|
+
tslib_1.__metadata("design:type", String)
|
74
66
|
], SftpPatch.prototype, "status", void 0);
|
75
|
-
__decorate([
|
67
|
+
tslib_1.__decorate([
|
76
68
|
(0, type_graphql_1.Field)({ nullable: true }),
|
77
|
-
__metadata("design:type", String)
|
69
|
+
tslib_1.__metadata("design:type", String)
|
78
70
|
], SftpPatch.prototype, "username", void 0);
|
79
|
-
__decorate([
|
71
|
+
tslib_1.__decorate([
|
80
72
|
(0, type_graphql_1.Field)({ nullable: true }),
|
81
|
-
__metadata("design:type", String)
|
73
|
+
tslib_1.__metadata("design:type", String)
|
82
74
|
], SftpPatch.prototype, "publicKey", void 0);
|
83
|
-
__decorate([
|
75
|
+
tslib_1.__decorate([
|
84
76
|
(0, type_graphql_1.Field)({ nullable: true }),
|
85
|
-
__metadata("design:type", String)
|
77
|
+
tslib_1.__metadata("design:type", String)
|
86
78
|
], SftpPatch.prototype, "privateKey", void 0);
|
87
|
-
__decorate([
|
79
|
+
tslib_1.__decorate([
|
88
80
|
(0, type_graphql_1.Field)({ nullable: true }),
|
89
|
-
__metadata("design:type", String)
|
81
|
+
tslib_1.__metadata("design:type", String)
|
90
82
|
], SftpPatch.prototype, "folderPath", void 0);
|
91
|
-
__decorate([
|
83
|
+
tslib_1.__decorate([
|
92
84
|
(0, type_graphql_1.Field)({ nullable: true }),
|
93
|
-
__metadata("design:type", Boolean)
|
85
|
+
tslib_1.__metadata("design:type", Boolean)
|
94
86
|
], SftpPatch.prototype, "isDevelopment", void 0);
|
95
|
-
__decorate([
|
87
|
+
tslib_1.__decorate([
|
96
88
|
(0, type_graphql_1.Field)({ nullable: true }),
|
97
|
-
__metadata("design:type", String)
|
89
|
+
tslib_1.__metadata("design:type", String)
|
98
90
|
], SftpPatch.prototype, "platform", void 0);
|
99
|
-
__decorate([
|
91
|
+
tslib_1.__decorate([
|
100
92
|
(0, type_graphql_1.Field)(),
|
101
|
-
__metadata("design:type", String)
|
93
|
+
tslib_1.__metadata("design:type", String)
|
102
94
|
], SftpPatch.prototype, "cuFlag", void 0);
|
103
|
-
SftpPatch = __decorate([
|
95
|
+
SftpPatch = tslib_1.__decorate([
|
104
96
|
(0, type_graphql_1.InputType)()
|
105
97
|
], SftpPatch);
|
106
98
|
exports.SftpPatch = SftpPatch;
|
107
99
|
let SftpList = class SftpList {
|
108
100
|
};
|
109
|
-
__decorate([
|
101
|
+
tslib_1.__decorate([
|
110
102
|
(0, type_graphql_1.Field)(type => [sftp_1.Sftp]),
|
111
|
-
__metadata("design:type", Array)
|
103
|
+
tslib_1.__metadata("design:type", Array)
|
112
104
|
], SftpList.prototype, "items", void 0);
|
113
|
-
__decorate([
|
105
|
+
tslib_1.__decorate([
|
114
106
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
115
|
-
__metadata("design:type", Number)
|
107
|
+
tslib_1.__metadata("design:type", Number)
|
116
108
|
], SftpList.prototype, "total", void 0);
|
117
|
-
SftpList = __decorate([
|
109
|
+
SftpList = tslib_1.__decorate([
|
118
110
|
(0, type_graphql_1.ObjectType)()
|
119
111
|
], SftpList);
|
120
112
|
exports.SftpList = SftpList;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sftp-type.js","sourceRoot":"","sources":["../../../server/service/sftp/sftp-type.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"sftp-type.js","sourceRoot":"","sources":["../../../server/service/sftp/sftp-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,iCAAyC;AAGzC,IAAa,OAAO,GAApB,MAAa,OAAO;CA2BnB,CAAA;AAzBC;IADC,IAAA,oBAAK,GAAE;;qCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCAC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AQ,EAAE,IAAI,EAAE,CAAC;;6CACP;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACH;AAGvB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACT;AAGjB;IADC,IAAA,oBAAK,GAAE;;yCACM;AAhCH,SAAS;IADrB,IAAA,wBAAS,GAAE;GACC,SAAS,CAiCrB;AAjCY,8BAAS;AAoCtB,IAAa,QAAQ,GAArB,MAAa,QAAQ;CAMpB,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,WAAI,CAAC,CAAC;;uCACT;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;uCACN;AALF,QAAQ;IADpB,IAAA,yBAAU,GAAE;GACA,QAAQ,CAMpB;AANY,4BAAQ","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { Sftp, SftpStatus } from './sftp'\n\n@InputType()\nexport class NewSftp {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => SftpStatus, { nullable: true })\n status?: SftpStatus\n\n @Field({ nullable: true })\n username?: string\n\n @Field({ nullable: true })\n publicKey?: string\n\n @Field({ nullable: true })\n privateKey?: string\n\n @Field({ nullable: true })\n folderPath?: string\n\n @Field({ nullable: true })\n isDevelopment?: boolean\n\n @Field({ nullable: true })\n platform?: string\n}\n\n@InputType()\nexport class SftpPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => SftpStatus, { nullable: true })\n status?: SftpStatus\n\n @Field({ nullable: true })\n username?: string\n\n @Field({ nullable: true })\n publicKey?: string\n\n @Field({ nullable: true })\n privateKey?: string\n\n @Field({ nullable: true })\n folderPath?: string\n\n @Field({ nullable: true })\n isDevelopment?: boolean\n\n @Field({ nullable: true })\n platform?: string\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class SftpList {\n @Field(type => [Sftp])\n items: Sftp[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
@@ -1,16 +1,8 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
-
};
|
11
2
|
var _a, _b, _c, _d;
|
12
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
13
4
|
exports.Sftp = exports.SftpStatus = void 0;
|
5
|
+
const tslib_1 = require("tslib");
|
14
6
|
const type_graphql_1 = require("type-graphql");
|
15
7
|
const typeorm_1 = require("typeorm");
|
16
8
|
const auth_base_1 = require("@things-factory/auth-base");
|
@@ -28,137 +20,137 @@ var SftpStatus;
|
|
28
20
|
});
|
29
21
|
let Sftp = class Sftp {
|
30
22
|
};
|
31
|
-
__decorate([
|
23
|
+
tslib_1.__decorate([
|
32
24
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
33
25
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
34
|
-
__metadata("design:type", String)
|
26
|
+
tslib_1.__metadata("design:type", String)
|
35
27
|
], Sftp.prototype, "id", void 0);
|
36
|
-
__decorate([
|
28
|
+
tslib_1.__decorate([
|
37
29
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
38
30
|
(0, type_graphql_1.Field)({ nullable: true }),
|
39
|
-
__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
31
|
+
tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
40
32
|
], Sftp.prototype, "domain", void 0);
|
41
|
-
__decorate([
|
33
|
+
tslib_1.__decorate([
|
42
34
|
(0, typeorm_1.RelationId)((sftp) => sftp.domain),
|
43
|
-
__metadata("design:type", String)
|
35
|
+
tslib_1.__metadata("design:type", String)
|
44
36
|
], Sftp.prototype, "domainId", void 0);
|
45
|
-
__decorate([
|
37
|
+
tslib_1.__decorate([
|
46
38
|
(0, typeorm_1.Column)(),
|
47
39
|
(0, type_graphql_1.Field)(),
|
48
|
-
__metadata("design:type", String)
|
40
|
+
tslib_1.__metadata("design:type", String)
|
49
41
|
], Sftp.prototype, "name", void 0);
|
50
|
-
__decorate([
|
42
|
+
tslib_1.__decorate([
|
51
43
|
(0, typeorm_1.Column)({
|
52
44
|
nullable: true
|
53
45
|
}),
|
54
46
|
(0, type_graphql_1.Field)({ nullable: true }),
|
55
|
-
__metadata("design:type", String)
|
47
|
+
tslib_1.__metadata("design:type", String)
|
56
48
|
], Sftp.prototype, "description", void 0);
|
57
|
-
__decorate([
|
49
|
+
tslib_1.__decorate([
|
58
50
|
(0, typeorm_1.Column)({ nullable: true }),
|
59
51
|
(0, type_graphql_1.Field)({ nullable: true }),
|
60
|
-
__metadata("design:type", String)
|
52
|
+
tslib_1.__metadata("design:type", String)
|
61
53
|
], Sftp.prototype, "status", void 0);
|
62
|
-
__decorate([
|
54
|
+
tslib_1.__decorate([
|
63
55
|
(0, typeorm_1.Column)({
|
64
56
|
nullable: true
|
65
57
|
}),
|
66
58
|
(0, type_graphql_1.Field)({ nullable: true }),
|
67
|
-
__metadata("design:type", String)
|
59
|
+
tslib_1.__metadata("design:type", String)
|
68
60
|
], Sftp.prototype, "username", void 0);
|
69
|
-
__decorate([
|
61
|
+
tslib_1.__decorate([
|
70
62
|
(0, typeorm_1.Column)({
|
71
63
|
nullable: true
|
72
64
|
}),
|
73
65
|
(0, type_graphql_1.Field)({ nullable: true }),
|
74
|
-
__metadata("design:type", String)
|
66
|
+
tslib_1.__metadata("design:type", String)
|
75
67
|
], Sftp.prototype, "publicKey", void 0);
|
76
|
-
__decorate([
|
68
|
+
tslib_1.__decorate([
|
77
69
|
(0, typeorm_1.Column)({
|
78
70
|
nullable: true
|
79
71
|
}),
|
80
72
|
(0, type_graphql_1.Field)({ nullable: true }),
|
81
|
-
__metadata("design:type", String)
|
73
|
+
tslib_1.__metadata("design:type", String)
|
82
74
|
], Sftp.prototype, "privateKey", void 0);
|
83
|
-
__decorate([
|
75
|
+
tslib_1.__decorate([
|
84
76
|
(0, typeorm_1.Column)({
|
85
77
|
nullable: true
|
86
78
|
}),
|
87
79
|
(0, type_graphql_1.Field)({ nullable: true }),
|
88
|
-
__metadata("design:type", String)
|
80
|
+
tslib_1.__metadata("design:type", String)
|
89
81
|
], Sftp.prototype, "folderPath", void 0);
|
90
|
-
__decorate([
|
82
|
+
tslib_1.__decorate([
|
91
83
|
(0, typeorm_1.Column)({
|
92
84
|
nullable: true
|
93
85
|
}),
|
94
86
|
(0, type_graphql_1.Field)({ nullable: true }),
|
95
|
-
__metadata("design:type", Boolean)
|
87
|
+
tslib_1.__metadata("design:type", Boolean)
|
96
88
|
], Sftp.prototype, "isDevelopment", void 0);
|
97
|
-
__decorate([
|
89
|
+
tslib_1.__decorate([
|
98
90
|
(0, typeorm_1.Column)({
|
99
91
|
nullable: true
|
100
92
|
}),
|
101
93
|
(0, type_graphql_1.Field)({ nullable: true }),
|
102
|
-
__metadata("design:type", String)
|
94
|
+
tslib_1.__metadata("design:type", String)
|
103
95
|
], Sftp.prototype, "platform", void 0);
|
104
|
-
__decorate([
|
96
|
+
tslib_1.__decorate([
|
105
97
|
(0, typeorm_1.ManyToOne)(type => integration_fulfillment_1.FulfillmentCenter, { nullable: true }),
|
106
|
-
__metadata("design:type", typeof (_b = typeof integration_fulfillment_1.FulfillmentCenter !== "undefined" && integration_fulfillment_1.FulfillmentCenter) === "function" ? _b : Object)
|
98
|
+
tslib_1.__metadata("design:type", typeof (_b = typeof integration_fulfillment_1.FulfillmentCenter !== "undefined" && integration_fulfillment_1.FulfillmentCenter) === "function" ? _b : Object)
|
107
99
|
], Sftp.prototype, "fulfillmentCenter", void 0);
|
108
|
-
__decorate([
|
100
|
+
tslib_1.__decorate([
|
109
101
|
(0, typeorm_1.Column)({
|
110
102
|
nullable: true
|
111
103
|
}),
|
112
104
|
(0, type_graphql_1.Field)({ nullable: true }),
|
113
|
-
__metadata("design:type", String)
|
105
|
+
tslib_1.__metadata("design:type", String)
|
114
106
|
], Sftp.prototype, "responseType", void 0);
|
115
|
-
__decorate([
|
107
|
+
tslib_1.__decorate([
|
116
108
|
(0, typeorm_1.Column)({
|
117
109
|
nullable: true
|
118
110
|
}),
|
119
111
|
(0, type_graphql_1.Field)({ nullable: true }),
|
120
|
-
__metadata("design:type", String)
|
112
|
+
tslib_1.__metadata("design:type", String)
|
121
113
|
], Sftp.prototype, "responseFilePattern", void 0);
|
122
|
-
__decorate([
|
114
|
+
tslib_1.__decorate([
|
123
115
|
(0, typeorm_1.Column)({
|
124
116
|
nullable: true
|
125
117
|
}),
|
126
118
|
(0, type_graphql_1.Field)({ nullable: true }),
|
127
|
-
__metadata("design:type", String)
|
119
|
+
tslib_1.__metadata("design:type", String)
|
128
120
|
], Sftp.prototype, "responseFileTypes", void 0);
|
129
|
-
__decorate([
|
121
|
+
tslib_1.__decorate([
|
130
122
|
(0, typeorm_1.CreateDateColumn)(),
|
131
123
|
(0, type_graphql_1.Field)({ nullable: true }),
|
132
|
-
__metadata("design:type", Date)
|
124
|
+
tslib_1.__metadata("design:type", Date)
|
133
125
|
], Sftp.prototype, "createdAt", void 0);
|
134
|
-
__decorate([
|
126
|
+
tslib_1.__decorate([
|
135
127
|
(0, typeorm_1.UpdateDateColumn)(),
|
136
128
|
(0, type_graphql_1.Field)({ nullable: true }),
|
137
|
-
__metadata("design:type", Date)
|
129
|
+
tslib_1.__metadata("design:type", Date)
|
138
130
|
], Sftp.prototype, "updatedAt", void 0);
|
139
|
-
__decorate([
|
131
|
+
tslib_1.__decorate([
|
140
132
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
141
133
|
nullable: true
|
142
134
|
}),
|
143
135
|
(0, type_graphql_1.Field)({ nullable: true }),
|
144
|
-
__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
136
|
+
tslib_1.__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
145
137
|
], Sftp.prototype, "creator", void 0);
|
146
|
-
__decorate([
|
138
|
+
tslib_1.__decorate([
|
147
139
|
(0, typeorm_1.RelationId)((sftp) => sftp.creator),
|
148
|
-
__metadata("design:type", String)
|
140
|
+
tslib_1.__metadata("design:type", String)
|
149
141
|
], Sftp.prototype, "creatorId", void 0);
|
150
|
-
__decorate([
|
142
|
+
tslib_1.__decorate([
|
151
143
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
152
144
|
nullable: true
|
153
145
|
}),
|
154
146
|
(0, type_graphql_1.Field)({ nullable: true }),
|
155
|
-
__metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
|
147
|
+
tslib_1.__metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
|
156
148
|
], Sftp.prototype, "updater", void 0);
|
157
|
-
__decorate([
|
149
|
+
tslib_1.__decorate([
|
158
150
|
(0, typeorm_1.RelationId)((sftp) => sftp.creator),
|
159
|
-
__metadata("design:type", String)
|
151
|
+
tslib_1.__metadata("design:type", String)
|
160
152
|
], Sftp.prototype, "updaterId", void 0);
|
161
|
-
Sftp = __decorate([
|
153
|
+
Sftp = tslib_1.__decorate([
|
162
154
|
(0, typeorm_1.Entity)(),
|
163
155
|
(0, typeorm_1.Index)('ix_sftp_0', (sftp) => [sftp.domain, sftp.name], { unique: true }),
|
164
156
|
(0, type_graphql_1.ObjectType)({ description: 'Entity for Sftp' })
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sftp.js","sourceRoot":"","sources":["../../../server/service/sftp/sftp.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"sftp.js","sourceRoot":"","sources":["../../../server/service/sftp/sftp.ts"],"names":[],"mappings":";;;;;AAAA,+CAAsE;AACtE,qCASgB;AAEhB,yDAAgD;AAChD,qFAA2E;AAC3E,iDAA8C;AAE9C,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,uCAAyB,CAAA;AAC3B,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB;AAED,IAAA,+BAAgB,EAAC,UAAU,EAAE;IAC3B,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,6BAA6B;CAC3C,CAAC,CAAA;AAKF,IAAa,IAAI,GAAjB,MAAa,IAAI;CA4GhB,CAAA;AAzGC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;gCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;0DACjB,cAAM,oBAAN,cAAM;oCAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;;sCACvB;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,o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,CAAC,OAAO,CAAC;;uCACvB;AA3GP,IAAI;IAHhB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,WAAW,EAAE,CAAC,IAAU,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC9E,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;GAClC,IAAI,CA4GhB;AA5GY,oBAAI","sourcesContent":["import { Field, ID, ObjectType, registerEnumType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { FulfillmentCenter } from '@things-factory/integration-fulfillment'\nimport { Domain } from '@things-factory/shell'\n\nexport enum SftpStatus {\n ACTIVE = 'ACTIVE',\n INACTIVE = 'INACTIVE',\n TERMINATED = 'TERMINATED'\n}\n\nregisterEnumType(SftpStatus, {\n name: 'SftpStatus',\n description: 'state enumeration of a sftp'\n})\n\n@Entity()\n@Index('ix_sftp_0', (sftp: Sftp) => [sftp.domain, sftp.name], { unique: true })\n@ObjectType({ description: 'Entity for Sftp' })\nexport class Sftp {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((sftp: Sftp) => sftp.domain)\n domainId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n status?: SftpStatus\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n username?: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n publicKey?: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n privateKey?: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n folderPath?: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n isDevelopment?: boolean\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n platform?: string\n\n @ManyToOne(type => FulfillmentCenter, { nullable: true })\n fulfillmentCenter: FulfillmentCenter\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n responseType: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n responseFilePattern: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n responseFileTypes: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((sftp: Sftp) => sftp.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((sftp: Sftp) => sftp.creator)\n updaterId?: string\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sftp-const.js","sourceRoot":"","sources":["../server/sftp-const.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAEjC,QAAA,eAAe,GAAQ,YAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;AACpD,QAAA,cAAc,GAAW,WAAW,CAAA;AACpC,QAAA,eAAe,GAAW,cAAc,CAAA;AACxC,QAAA,cAAc,GAAW,aAAa,CAAA;AACtC,QAAA,gBAAgB,GAAW,YAAY,CAAA;AACvC,QAAA,uBAAuB,GAAW,aAAa,CAAA;AAC/C,QAAA,sBAAsB,GAAW,YAAY,CAAA;AAC7C,QAAA,gBAAgB,GAAW,UAAU,CAAA;AACrC,QAAA,iBAAiB,GAAW,aAAa,CAAA;AACzC,QAAA,gBAAgB,GAAW,YAAY,CAAA;AACvC,QAAA,UAAU,GAAW,WAAW,CAAA"}
|
1
|
+
{"version":3,"file":"sftp-const.js","sourceRoot":"","sources":["../server/sftp-const.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAEjC,QAAA,eAAe,GAAQ,YAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;AACpD,QAAA,cAAc,GAAW,WAAW,CAAA;AACpC,QAAA,eAAe,GAAW,cAAc,CAAA;AACxC,QAAA,cAAc,GAAW,aAAa,CAAA;AACtC,QAAA,gBAAgB,GAAW,YAAY,CAAA;AACvC,QAAA,uBAAuB,GAAW,aAAa,CAAA;AAC/C,QAAA,sBAAsB,GAAW,YAAY,CAAA;AAC7C,QAAA,gBAAgB,GAAW,UAAU,CAAA;AACrC,QAAA,iBAAiB,GAAW,aAAa,CAAA;AACzC,QAAA,gBAAgB,GAAW,YAAY,CAAA;AACvC,QAAA,UAAU,GAAW,WAAW,CAAA","sourcesContent":["import { config } from '@things-factory/env'\n\nexport var SFTPFILESTORAGE: any = config.get('sftpFileStorage')\nexport var SUBMITDATAPATH: string = '/sob/data'\nexport var SUCCESSDATAPATH: string = '/sob/success'\nexport var FAILEDDATAPATH: string = '/sob/failed'\nexport var COMPLETEDATAPATH: string = '/oc/data01'\nexport var COMPLETESUCCESSDATAPATH: string = '/oc/success'\nexport var COMPLETEFAILEDDATAPATH: string = '/oc/failed'\nexport var SNSUBMITDATAPATH: string = '/sn/data'\nexport var SNSUCCESSDATAPATH: string = '/sn/success'\nexport var SNFAILEDDATAPATH: string = '/sn/failed'\nexport var BACKUPPATH: string = 'hatiosea/'\n"]}
|
package/dist-server/sftp-s3.js
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
const aws_sdk_1 = tslib_1.__importDefault(require("aws-sdk"));
|
7
5
|
const env_1 = require("@things-factory/env");
|
8
6
|
const sftp_const_1 = require("./sftp-const");
|
9
7
|
const crypto = require('crypto');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sftp-s3.js","sourceRoot":"","sources":["../server/sftp-s3.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"sftp-s3.js","sourceRoot":"","sources":["../server/sftp-s3.ts"],"names":[],"mappings":";;;AAAA,8DAAyB;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,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAE/B,IAAI,4BAAe,IAAI,4BAAe,CAAC,IAAI,IAAI,IAAI,EAAE;IACnD,MAAM,EAAE,GAAG,IAAI,iBAAG,CAAC,EAAE,CAAC;QACpB,WAAW,EAAE,4BAAe,CAAC,WAAW;QACxC,eAAe,EAAE,4BAAe,CAAC,eAAe;KACjD,CAAC,CAAA;IAEF,4BAAe,CAAC,WAAW,GAAG,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;QACvD,IAAI,QAAQ,GAAG;YACb,MAAM,EAAE,4BAAe,CAAC,UAAU;YAClC,SAAS,EAAE,GAAG;YACd,MAAM,EAAE,MAAM,CAAC,IAAI;SACpB,CAAA;QAED,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAA;QAEvD,IAAI,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAA;QAE1B,OAAO,IAAI,CAAA;IACb,CAAC,CAAA;IAED,4BAAe,CAAC,QAAQ,GAAG,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QAClD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,IAAI,WAAW,EAAE,CAAA;YAE5B,EAAE,CAAC,MAAM,CACP;gBACE,MAAM,EAAE,4BAAe,CAAC,UAAU;gBAClC,GAAG,EAAE,UAAU,GAAG,GAAG,GAAG,QAAQ;gBAChC,IAAI,EAAE,IAAI;aACX,EACD,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAC7E,CAAA;YAED,OAAO,IAAI,CAAA;QACb,CAAC,CAAC,EAAE,CACL;aACA,EAAE,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","sourcesContent":["import AWS from 'aws-sdk'\n\nimport { logger } from '@things-factory/env'\n\nimport { SFTPFILESTORAGE } from './sftp-const'\n\nconst crypto = require('crypto')\n\nconst { PassThrough } = require('stream')\nconst path = require('path')\nconst { fs } = require('memfs')\n\nif (SFTPFILESTORAGE && SFTPFILESTORAGE.type == 's3') {\n const S3 = new AWS.S3({\n accessKeyId: SFTPFILESTORAGE.accessKeyId,\n secretAccessKey: SFTPFILESTORAGE.secretAccessKey\n })\n\n SFTPFILESTORAGE.readFolders = async (params, encoding) => {\n let S3params = {\n Bucket: SFTPFILESTORAGE.bucketName,\n Delimiter: '/',\n Prefix: params.path\n }\n\n const result = await S3.listObjects(S3params).promise()\n\n let body = result.Contents\n\n return body\n }\n\n SFTPFILESTORAGE.readFile = async (path, encoding) => {\n const result = await S3.getObject({\n Bucket: SFTPFILESTORAGE.bucketName,\n Key: path\n }).promise()\n\n var body = result.Body\n\n if (encoding) {\n return body.toString(encoding)\n }\n\n return body\n }\n\n SFTPFILESTORAGE.moveFile = async (path, encoding) => {\n const copyResult = await S3.copyObject({\n Bucket: SFTPFILESTORAGE.bucketName,\n CopySource: SFTPFILESTORAGE.bucketName + '/' + path.source,\n Key: path.destination\n }).promise()\n\n const copyBody = copyResult.CopyObjectResult\n\n const deleteResult = await S3.deleteObject({\n Bucket: SFTPFILESTORAGE.bucketName,\n Key: path.source\n }).promise()\n\n return true\n }\n\n /* upload file */\n SFTPFILESTORAGE.uploadFile = ({ stream, filename, uploadPath }) => {\n const id = crypto.randomUUID()\n let size: number = 0\n\n return new Promise<{ id: string; path: string; size: number }>((resolve, reject) =>\n stream\n .pipe(\n (() => {\n var pass = new PassThrough()\n\n S3.upload(\n {\n Bucket: SFTPFILESTORAGE.bucketName,\n Key: uploadPath + '/' + filename,\n Body: pass\n },\n (err, data) => (err ? reject(err) : resolve({ id, path: uploadPath, size }))\n )\n\n return pass\n })()\n )\n .on('error', error => reject(error))\n .on('data', chunk => (size += chunk.length))\n )\n }\n\n logger.info('S3 Bucket Storage is Ready.')\n}\n"]}
|