made all classes start with capital letters
This commit is contained in:
parent
eb66ed0244
commit
cd6bcb974c
43
.gitlab-ci.yml
Normal file
43
.gitlab-ci.yml
Normal file
@ -0,0 +1,43 @@
|
||||
image: hosttoday/ht-docker-node:latest
|
||||
|
||||
stages:
|
||||
- test
|
||||
- release
|
||||
- page
|
||||
|
||||
testLTS:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test lts
|
||||
tags:
|
||||
- docker
|
||||
|
||||
testSTABLE:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test stable
|
||||
tags:
|
||||
- docker
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci publish
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
|
||||
pages:
|
||||
stage: page
|
||||
script:
|
||||
- npmci test lts
|
||||
- mkdir .public
|
||||
- cp -r test/assets/docs/ .public
|
||||
- cp -r test/assets/coverage/ .public
|
||||
- mv .public public
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
only:
|
||||
- master
|
@ -2,7 +2,6 @@
|
||||
setups SSH quickly and in a painless manner
|
||||
|
||||
> Attention: This is still alpha, so some things won't work, not all things are inplemented.
|
||||
I (Phil from Lossless) expect this to be ready 2016/05/01.
|
||||
|
||||
## Usage
|
||||
|
||||
|
5
dist/index.d.ts
vendored
Normal file
5
dist/index.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import "typings-global";
|
||||
export { Ssh } from "./smartssh.classes.ssh";
|
||||
export { SshKey } from "./smartssh.classes.sshkey";
|
||||
export { SshDir } from "./smartssh.classes.sshdir";
|
||||
export { SshConfig } from "./smartssh.classes.sshconfig";
|
11
dist/index.js
vendored
11
dist/index.js
vendored
@ -1,3 +1,12 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
var smartssh_classes_ssh_1 = require("./smartssh.classes.ssh");
|
||||
exports.Ssh = smartssh_classes_ssh_1.Ssh;
|
||||
var smartssh_classes_sshkey_1 = require("./smartssh.classes.sshkey");
|
||||
exports.SshKey = smartssh_classes_sshkey_1.SshKey;
|
||||
var smartssh_classes_sshdir_1 = require("./smartssh.classes.sshdir");
|
||||
exports.SshDir = smartssh_classes_sshdir_1.SshDir;
|
||||
var smartssh_classes_sshconfig_1 = require("./smartssh.classes.sshconfig");
|
||||
exports.SshConfig = smartssh_classes_sshconfig_1.SshConfig;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUNQLENBQUMsQ0FEc0I7QUFHdkIscUNBQWtCLHdCQUF3QixDQUFDO0FBQW5DLHlDQUFtQztBQUMzQyx3Q0FBcUIsMkJBQTJCLENBQUM7QUFBekMsa0RBQXlDO0FBQ2pELHdDQUFxQiwyQkFBMkIsQ0FBQztBQUF6QyxrREFBeUM7QUFDakQsMkNBQXdCLDhCQUE4QixDQUFDO0FBQS9DLDJEQUErQyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCJcclxuaW1wb3J0ICogYXMgcGx1Z2lucyBmcm9tIFwiLi9zbWFydHNzaC5wbHVnaW5zXCI7XHJcblxyXG5leHBvcnQge1NzaH0gZnJvbSBcIi4vc21hcnRzc2guY2xhc3Nlcy5zc2hcIjtcclxuZXhwb3J0IHtTc2hLZXl9IGZyb20gXCIuL3NtYXJ0c3NoLmNsYXNzZXMuc3Noa2V5XCI7XHJcbmV4cG9ydCB7U3NoRGlyfSBmcm9tIFwiLi9zbWFydHNzaC5jbGFzc2VzLnNzaGRpclwiO1xyXG5leHBvcnQge1NzaENvbmZpZ30gZnJvbSBcIi4vc21hcnRzc2guY2xhc3Nlcy5zc2hjb25maWdcIjsiXX0=
|
||||
|
4
dist/smartssh.classes.helpers.d.ts
vendored
Normal file
4
dist/smartssh.classes.helpers.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import "typings-global";
|
||||
import { SshKey } from "./smartssh.classes.sshkey";
|
||||
export declare let sshKeyArrayFromDir: (dirArg: string) => SshKey[];
|
||||
export declare let getKeyIndex: (hostArg: string) => number;
|
3
dist/smartssh.classes.helpers.js
vendored
3
dist/smartssh.classes.helpers.js
vendored
@ -1,4 +1,5 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
exports.sshKeyArrayFromDir = function (dirArg) {
|
||||
var sshKeyArray = []; //TODO
|
||||
return sshKeyArray;
|
||||
@ -7,4 +8,4 @@ exports.getKeyIndex = function (hostArg) {
|
||||
return 0; //TODO
|
||||
};
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3NoLmNsYXNzZXMuaGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBSVcsMEJBQWtCLEdBQUcsVUFBUyxNQUFhO0lBQ2xELElBQUksV0FBVyxHQUFHLEVBQUUsQ0FBQyxDQUFDLE1BQU07SUFDNUIsTUFBTSxDQUFDLFdBQVcsQ0FBQztBQUN2QixDQUFDLENBQUE7QUFFVSxtQkFBVyxHQUFHLFVBQVMsT0FBYztJQUM1QyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsT0FBTztBQUNyQixDQUFDLENBQUEiLCJmaWxlIjoic21hcnRzc2guY2xhc3Nlcy5oZWxwZXJzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAv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tcclxuaW1wb3J0IHtTc2hLZXl9IGZyb20gXCIuL3NtYXJ0c3NoLmNsYXNzZXMuc3Noa2V5XCI7XHJcblxyXG5leHBvcnQgbGV0IHNzaEtleUFycmF5RnJvbURpciA9IGZ1bmN0aW9uKGRpckFyZzpzdHJpbmcpOlNzaEtleVtde1xyXG4gICAgbGV0IHNzaEtleUFycmF5ID0gW107IC8vVE9ET1xyXG4gICAgcmV0dXJuIHNzaEtleUFycmF5O1xyXG59XHJcblxyXG5leHBvcnQgbGV0IGdldEtleUluZGV4ID0gZnVuY3Rpb24oaG9zdEFyZzpzdHJpbmcpe1xyXG4gICAgcmV0dXJuIDA7IC8vVE9ETyBcclxufSJdfQ==
|
||||
|
163
dist/smartssh.classes.js
vendored
163
dist/smartssh.classes.js
vendored
File diff suppressed because one or more lines are too long
17
dist/smartssh.classes.ssh.d.ts
vendored
Normal file
17
dist/smartssh.classes.ssh.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
import "typings-global";
|
||||
import { SshKey } from "./smartssh.classes.sshkey";
|
||||
export declare class Ssh {
|
||||
private sshConfig;
|
||||
private sshDir;
|
||||
private sshKeys;
|
||||
private sshSync;
|
||||
constructor(optionsArg?: {
|
||||
sshDir?: string;
|
||||
sshSync?: boolean;
|
||||
});
|
||||
addKey(sshKeyArg: SshKey): void;
|
||||
getKey(hostArg: string): SshKey;
|
||||
removeKey(sshKeyArg: SshKey): void;
|
||||
replaceKey(sshKeyOldArg: SshKey, sshKeyNewArg: SshKey): void;
|
||||
sync(): void;
|
||||
}
|
52
dist/smartssh.classes.ssh.js
vendored
Normal file
52
dist/smartssh.classes.ssh.js
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
var helpers = require("./smartssh.classes.helpers");
|
||||
var smartssh_classes_sshdir_1 = require("./smartssh.classes.sshdir");
|
||||
var Ssh = (function () {
|
||||
function Ssh(optionsArg) {
|
||||
if (optionsArg === void 0) { optionsArg = {}; }
|
||||
this.sshDir = new smartssh_classes_sshdir_1.SshDir(optionsArg.sshDir);
|
||||
this.sshKeys = this.sshDir.getKeys();
|
||||
this.sshSync = optionsArg.sshSync;
|
||||
}
|
||||
;
|
||||
Ssh.prototype.addKey = function (sshKeyArg) {
|
||||
this.sshKeys.push(sshKeyArg);
|
||||
this.sync();
|
||||
};
|
||||
;
|
||||
Ssh.prototype.getKey = function (hostArg) {
|
||||
var filteredArray = this.sshKeys.filter(function (keyArg) {
|
||||
return (keyArg.host == hostArg);
|
||||
});
|
||||
if (filteredArray.length > 0) {
|
||||
return filteredArray[0];
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
;
|
||||
Ssh.prototype.removeKey = function (sshKeyArg) {
|
||||
var keyIndex = helpers.getKeyIndex(sshKeyArg.host);
|
||||
this.sshKeys.splice(keyIndex, 1);
|
||||
this.sync();
|
||||
};
|
||||
;
|
||||
Ssh.prototype.replaceKey = function (sshKeyOldArg, sshKeyNewArg) {
|
||||
var keyIndex = helpers.getKeyIndex(sshKeyOldArg.host);
|
||||
this.sshKeys.splice(keyIndex, 1, sshKeyNewArg);
|
||||
this.sync();
|
||||
};
|
||||
;
|
||||
Ssh.prototype.sync = function () {
|
||||
if (this.sshSync) {
|
||||
this.sshDir.sync(this.sshConfig, this.sshKeys); // call sync method of sshDir class;
|
||||
}
|
||||
};
|
||||
;
|
||||
return Ssh;
|
||||
}());
|
||||
exports.Ssh = Ssh;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3NoLmNsYXNzZXMuc3NoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUNQLENBQUMsQ0FEc0I7QUFFdkIsSUFBWSxPQUFPLFdBQU0sNEJBQTRCLENBQUMsQ0FBQTtBQUV0RCx3Q0FBcUIsMkJBQTJCLENBQUMsQ0FBQTtBQU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2Qgb2Ygc3NoRGlyIGNsYXNzO1xyXG4gICAgICAgIH1cclxuICAgIH07XHJcbn1cclxuXHJcblxyXG4iXX0=
|
4
dist/smartssh.classes.sshconfig.d.ts
vendored
Normal file
4
dist/smartssh.classes.sshconfig.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import "typings-global";
|
||||
export declare class SshConfig {
|
||||
constructor();
|
||||
}
|
10
dist/smartssh.classes.sshconfig.js
vendored
Normal file
10
dist/smartssh.classes.sshconfig.js
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
var SshConfig = (function () {
|
||||
function SshConfig() {
|
||||
}
|
||||
return SshConfig;
|
||||
}());
|
||||
exports.SshConfig = SshConfig;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3NoLmNsYXNzZXMuc3NoY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFHeEI7SUFDSTtJQUVBLENBQUM7SUFDTCxnQkFBQztBQUFELENBSkEsQUFJQyxJQUFBO0FBSlksaUJBQVMsWUFJckIsQ0FBQSIsImZpbGUiOiJzbWFydHNzaC5jbGFzc2VzLnNzaGNvbmZpZy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCI7XHJcbmltcG9ydCAqIGFzIHBsdWdpbnMgZnJvbSBcIi4vc21hcnRzc2gucGx1Z2luc1wiO1xyXG5pbXBvcnQgKiBhcyBoZWxwZXJzIGZyb20gXCIuL3NtYXJ0c3NoLmNsYXNzZXMuaGVscGVyc1wiO1xyXG5leHBvcnQgY2xhc3MgU3NoQ29uZmlnIHtcclxuICAgIGNvbnN0cnVjdG9yKCl7XHJcbiAgICAgICAgXHJcbiAgICB9XHJcbn0iXX0=
|
9
dist/smartssh.classes.sshdir.d.ts
vendored
Normal file
9
dist/smartssh.classes.sshdir.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import "typings-global";
|
||||
import { SshKey } from "./smartssh.classes.sshkey";
|
||||
import { SshConfig } from "./smartssh.classes.sshconfig";
|
||||
export declare class SshDir {
|
||||
path: string;
|
||||
constructor(sshDirPathArg: string);
|
||||
sync(sshConfigArg: SshConfig, sshKeysArg: SshKey[]): void;
|
||||
getKeys(): SshKey[];
|
||||
}
|
18
dist/smartssh.classes.sshdir.js
vendored
Normal file
18
dist/smartssh.classes.sshdir.js
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
var helpers = require("./smartssh.classes.helpers");
|
||||
var SshDir = (function () {
|
||||
function SshDir(sshDirPathArg) {
|
||||
this.path = sshDirPathArg;
|
||||
}
|
||||
SshDir.prototype.sync = function (sshConfigArg, sshKeysArg) {
|
||||
};
|
||||
;
|
||||
SshDir.prototype.getKeys = function () {
|
||||
return helpers.sshKeyArrayFromDir(this.path);
|
||||
};
|
||||
return SshDir;
|
||||
}());
|
||||
exports.SshDir = SshDir;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3NoLmNsYXNzZXMuc3NoZGlyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFFeEIsSUFBWSxPQUFPLFdBQU0sNEJBQTRCLENBQUMsQ0FBQTtBQUd0RDtJQUVJLGdCQUFZLGFBQW9CO1FBQzVCLElBQUksQ0FBQyxJQUFJLEdBQUcsYUFBYSxDQUFDO0lBQzlCLENBQUM7SUFDRCxxQkFBSSxHQUFKLFVBQUssWUFBc0IsRUFBQyxVQUFtQjtJQUUvQyxDQUFDOztJQUNELHdCQUFPLEdBQVA7UUFDSSxNQUFNLENBQUMsT0FBTyxDQUF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key.d.ts
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
import "typings-global";
|
||||
export declare class SshKey {
|
||||
private privKey;
|
||||
private pubKey;
|
||||
private hostVar;
|
||||
constructor(optionsArg?: {
|
||||
private?: string;
|
||||
public?: string;
|
||||
host?: string;
|
||||
});
|
||||
host: string;
|
||||
privateKey: string;
|
||||
privateKeyBase64: any;
|
||||
publicKey: string;
|
||||
publicKeyBase64: any;
|
||||
type: string;
|
||||
store(filePathArg?: string): void;
|
||||
}
|
98
dist/smartssh.classes.sshkey.js
vendored
Normal file
98
dist/smartssh.classes.sshkey.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
dist/smartssh.plugins.d.ts
vendored
Normal file
6
dist/smartssh.plugins.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
import "typings-global";
|
||||
export declare let beautylog: any;
|
||||
export declare let base64: any;
|
||||
export declare let fs: any;
|
||||
export declare let path: any;
|
||||
export declare let smartfile: any;
|
4
dist/smartssh.plugins.js
vendored
4
dist/smartssh.plugins.js
vendored
@ -1,9 +1,9 @@
|
||||
"use strict";
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
require("typings-global");
|
||||
exports.beautylog = require("beautylog");
|
||||
exports.base64 = require("js-base64").Base64;
|
||||
exports.fs = require("fs-extra");
|
||||
exports.path = require("path");
|
||||
exports.smartfile = require("smartfile");
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3NoLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDRDQUE0QztBQUNqQyxpQkFBUyxHQUFHLE9BQU8sQ0FBQyxXQUFXLENBQUMsQ0FBQztBQUNqQyxjQUFNLEdBQUcsT0FBTyxDQUFDLFdBQVcsQ0FBQyxDQUFDLE1BQU0sQ0FBQztBQUNyQyxVQUFFLEdBQUcsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0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VnaW5zLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIlxyXG5leHBvcnQgbGV0IGJlYXV0eWxvZyA9IHJlcXVpcmUoXCJiZWF1dHlsb2dcIik7XHJcbmV4cG9ydCBsZXQgYmFzZTY0ID0gcmVxdWlyZShcImpzLWJhc2U2NFwiKS5CYXNlNjQ7XHJcbmV4cG9ydCBsZXQgZnMgPSByZXF1aXJlKFwiZnMtZXh0cmFcIik7XHJcbmV4cG9ydCBsZXQgcGF0aCA9IHJlcXVpcmUoXCJwYXRoXCIpO1xyXG5leHBvcnQgbGV0IHNtYXJ0ZmlsZSA9IHJlcXVpcmUoXCJzbWFydGZpbGVcIik7Il19
|
||||
|
4
npmts.json
Normal file
4
npmts.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"mode":"default",
|
||||
"coverageTreshold":50
|
||||
}
|
1
test/test.d.ts
vendored
Normal file
1
test/test.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
import "typings-test";
|
@ -1,5 +1,6 @@
|
||||
/// <reference path="../ts/typings/main.d.ts" />
|
||||
"use strict";
|
||||
require("typings-test");
|
||||
var should = require("should");
|
||||
var smartssh = require("../dist/index.js");
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksTUFBTSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQztBQUMvQixJQUFJLFFBQVEsR0FBRyxPQUFPLENBQUMsa0JBQWtCLENBQUMsQ0FBQyIsImZpbGUiOiJ0ZXN0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4uL3RzL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbmxldCBzaG91bGQgPSByZXF1aXJlKFwic2hvdWxkXCIpO1xubGV0IHNtYXJ0c3NoID0gcmVxdWlyZShcIi4uL2Rpc3QvaW5kZXguanNcIik7XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FDUCxDQUFDLENBRG9CO0FBQ3JCLElBQUksTUFBTSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQztBQUMvQixJQUFJLFFBQVEsR0FBRyxPQUFPLENBQUMsa0JBQWtCLENBQUMsQ0FBQyIsImZpbGUiOiJ0ZXN0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy10ZXN0XCJcclxubGV0IHNob3VsZCA9IHJlcXVpcmUoXCJzaG91bGRcIik7XHJcbmxldCBzbWFydHNzaCA9IHJlcXVpcmUoXCIuLi9kaXN0L2luZGV4LmpzXCIpO1xyXG4iXX0=
|
||||
|
@ -1,3 +1,7 @@
|
||||
import "typings-global"
|
||||
import * as plugins from "./smartssh.plugins";
|
||||
import {} from "./smartssh.classes.ssh";
|
||||
|
||||
export {Ssh} from "./smartssh.classes.ssh";
|
||||
export {SshKey} from "./smartssh.classes.sshkey";
|
||||
export {SshDir} from "./smartssh.classes.sshdir";
|
||||
export {SshConfig} from "./smartssh.classes.sshconfig";
|
@ -1,8 +1,8 @@
|
||||
import "typings-global"
|
||||
import plugins = require("./smartssh.plugins");
|
||||
import classes = require("./smartssh.classes");
|
||||
import * as plugins from "./smartssh.plugins";
|
||||
import {SshKey} from "./smartssh.classes.sshkey";
|
||||
|
||||
export let sshKeyArrayFromDir = function(dirArg:string):classes.sshKey[]{
|
||||
export let sshKeyArrayFromDir = function(dirArg:string):SshKey[]{
|
||||
let sshKeyArray = []; //TODO
|
||||
return sshKeyArray;
|
||||
}
|
||||
|
@ -2,19 +2,21 @@ import "typings-global"
|
||||
import * as plugins from "./smartssh.plugins";
|
||||
import * as helpers from "./smartssh.classes.helpers";
|
||||
|
||||
import {sshDir} from "./smartssh.classes.sshdir";
|
||||
import {SshDir} from "./smartssh.classes.sshdir";
|
||||
import {SshConfig} from "./smartssh.classes.sshconfig";
|
||||
import {SshKey} from "./smartssh.classes.sshkey";
|
||||
|
||||
export class ssh {
|
||||
private sshConfig:sshConfig; // points to sshConfig class instance
|
||||
private sshDir:sshDir; // points to sshDir class instance.
|
||||
private sshKeys:sshKey[]; //holds all ssh keys
|
||||
export class Ssh {
|
||||
private sshConfig:SshConfig; // points to sshConfig class instance
|
||||
private sshDir:SshDir; // points to sshDir class instance.
|
||||
private sshKeys:SshKey[]; //holds all ssh keys
|
||||
private sshSync:boolean; // if set to true, the ssh dir will be kept in sync automatically
|
||||
constructor(optionsArg:{sshDir?:string,sshSync?:boolean}={}){
|
||||
this.sshDir = new sshDir(optionsArg.sshDir);
|
||||
this.sshDir = new SshDir(optionsArg.sshDir);
|
||||
this.sshKeys = this.sshDir.getKeys();
|
||||
this.sshSync = optionsArg.sshSync;
|
||||
};
|
||||
addKey(sshKeyArg:sshKey){
|
||||
addKey(sshKeyArg:SshKey){
|
||||
this.sshKeys.push(sshKeyArg);
|
||||
this.sync();
|
||||
};
|
||||
@ -28,12 +30,12 @@ export class ssh {
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
removeKey(sshKeyArg:sshKey){
|
||||
removeKey(sshKeyArg:SshKey){
|
||||
let keyIndex = helpers.getKeyIndex(sshKeyArg.host);
|
||||
this.sshKeys.splice(keyIndex,1);
|
||||
this.sync();
|
||||
};
|
||||
replaceKey(sshKeyOldArg:sshKey,sshKeyNewArg:sshKey){
|
||||
replaceKey(sshKeyOldArg:SshKey,sshKeyNewArg:SshKey){
|
||||
let keyIndex = helpers.getKeyIndex(sshKeyOldArg.host);
|
||||
this.sshKeys.splice(keyIndex,1,sshKeyNewArg);
|
||||
this.sync();
|
||||
|
@ -1,7 +1,7 @@
|
||||
import "typings-global";
|
||||
import * as plugins from "./smartssh.plugins";
|
||||
import * as helpers from "./smartssh.classes.helpers";
|
||||
export class sshConfig {
|
||||
export class SshConfig {
|
||||
constructor(){
|
||||
|
||||
}
|
||||
|
@ -1,13 +1,14 @@
|
||||
import "typings-global";
|
||||
import * as plugins from "./smartssh.plugins";
|
||||
import * as helpers from "./smartssh.classes.helpers";
|
||||
import {sshKey} from "./smartssh.classes.sshkey";
|
||||
export class sshDir { // sshDir class -> NOT EXPORTED, ONLY FOR INTERNAL USE
|
||||
import {SshKey} from "./smartssh.classes.sshkey";
|
||||
import {SshConfig} from "./smartssh.classes.sshconfig";
|
||||
export class SshDir { // sshDir class -> NOT EXPORTED, ONLY FOR INTERNAL USE
|
||||
path:string;
|
||||
constructor(sshDirPathArg:string){
|
||||
this.path = sshDirPathArg;
|
||||
}
|
||||
sync(sshConfigArg:sshConfig,sshKeysArg:sshKey[]){
|
||||
sync(sshConfigArg:SshConfig,sshKeysArg:SshKey[]){
|
||||
|
||||
};
|
||||
getKeys(){
|
||||
|
@ -2,7 +2,7 @@ import "typings-global";
|
||||
import * as plugins from "./smartssh.plugins";
|
||||
import * as helpers from "./smartssh.classes.helpers";
|
||||
|
||||
export class sshKey {
|
||||
export class SshKey {
|
||||
private privKey:string;
|
||||
private pubKey:string;
|
||||
private hostVar:string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user