@sw-tsdk/plugin-turbine 0.1.1-next.23
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/LICENSE +8 -0
- package/README.md +113 -0
- package/lib/commands/turbine/connector/keys/generate.d.ts +14 -0
- package/lib/commands/turbine/connector/keys/generate.js +60 -0
- package/lib/commands/turbine/connector/keys/generate.js.map +1 -0
- package/lib/commands/turbine/connector/keys/list.d.ts +9 -0
- package/lib/commands/turbine/connector/keys/list.js +20 -0
- package/lib/commands/turbine/connector/keys/list.js.map +1 -0
- package/lib/commands/turbine/connector/push.d.ts +13 -0
- package/lib/commands/turbine/connector/push.js +34 -0
- package/lib/commands/turbine/connector/push.js.map +1 -0
- package/lib/commands/turbine/login.d.ts +12 -0
- package/lib/commands/turbine/login.js +33 -0
- package/lib/commands/turbine/login.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -0
- package/oclif.manifest.json +1 -0
- package/package.json +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
The ISC License (ISC)
|
|
2
|
+
|
|
3
|
+
Copyright © SWIMLANE 2021
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
8
|
+
{"mode":"full","isActive":false}
|
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
Integration Task CLI Plugin
|
|
2
|
+
============
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
[](https://npmjs.org/package/@tsdk/plugin-task)
|
|
6
|
+
[](https://npmjs.org/package/@tsdk/plugin-task)
|
|
7
|
+
[](https://github.com/swimlane/turbine-developer-kit/blob/main/packages/cli/package.json)
|
|
8
|
+
<!-- toc -->
|
|
9
|
+
* [Usage](#usage)
|
|
10
|
+
* [Commands](#commands)
|
|
11
|
+
<!-- tocstop -->
|
|
12
|
+
# Usage
|
|
13
|
+
<!-- usage -->
|
|
14
|
+
```sh-session
|
|
15
|
+
$ npm install -g @sw-tsdk/plugin-turbine
|
|
16
|
+
$ sw-tsdk-turbine COMMAND
|
|
17
|
+
running command...
|
|
18
|
+
$ sw-tsdk-turbine (--version)
|
|
19
|
+
@sw-tsdk/plugin-turbine/0.1.1-next.23+038e7a6 darwin-x64 node-v16.17.0
|
|
20
|
+
$ sw-tsdk-turbine --help [COMMAND]
|
|
21
|
+
USAGE
|
|
22
|
+
$ sw-tsdk-turbine COMMAND
|
|
23
|
+
...
|
|
24
|
+
```
|
|
25
|
+
<!-- usagestop -->
|
|
26
|
+
# Commands
|
|
27
|
+
<!-- commands -->
|
|
28
|
+
* [`sw-tsdk-turbine turbine:connector:keys:generate`](#sw-tsdk-turbine-turbineconnectorkeysgenerate)
|
|
29
|
+
* [`sw-tsdk-turbine turbine:connector:keys:list`](#sw-tsdk-turbine-turbineconnectorkeyslist)
|
|
30
|
+
* [`sw-tsdk-turbine turbine:connector:push`](#sw-tsdk-turbine-turbineconnectorpush)
|
|
31
|
+
* [`sw-tsdk-turbine turbine:login`](#sw-tsdk-turbine-turbinelogin)
|
|
32
|
+
|
|
33
|
+
## `sw-tsdk-turbine turbine:connector:keys:generate`
|
|
34
|
+
|
|
35
|
+
Use to push an integration to Turbine
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
USAGE
|
|
39
|
+
$ sw-tsdk-turbine turbine:connector:keys:generate --turbine-url <value> [-u <value>] [-p <value>] [--signing-password <value>]
|
|
40
|
+
[--key-name <value>] [-h]
|
|
41
|
+
|
|
42
|
+
FLAGS
|
|
43
|
+
-h, --help Show CLI help.
|
|
44
|
+
-p, --password=<value> Turbine password
|
|
45
|
+
-u, --username=<value> Turbine username
|
|
46
|
+
--key-name=<value> name used for the key (default: username)
|
|
47
|
+
--signing-password=<value> password used for the private key
|
|
48
|
+
--turbine-url=<value> (required) the url of the turbine instance [https://turbine.acme.com]
|
|
49
|
+
|
|
50
|
+
DESCRIPTION
|
|
51
|
+
Use to push an integration to Turbine
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
_See code: [lib/commands/turbine/connector/keys/generate.js](https://github.com/swimlane/turbine-sdk/blob/v0.1.1-next.23+038e7a6/lib/commands/turbine/connector/keys/generate.js)_
|
|
55
|
+
|
|
56
|
+
## `sw-tsdk-turbine turbine:connector:keys:list`
|
|
57
|
+
|
|
58
|
+
Use to push an integration to Turbine
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
USAGE
|
|
62
|
+
$ sw-tsdk-turbine turbine:connector:keys:list [-h]
|
|
63
|
+
|
|
64
|
+
FLAGS
|
|
65
|
+
-h, --help Show CLI help.
|
|
66
|
+
|
|
67
|
+
DESCRIPTION
|
|
68
|
+
Use to push an integration to Turbine
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
_See code: [lib/commands/turbine/connector/keys/list.js](https://github.com/swimlane/turbine-sdk/blob/v0.1.1-next.23+038e7a6/lib/commands/turbine/connector/keys/list.js)_
|
|
72
|
+
|
|
73
|
+
## `sw-tsdk-turbine turbine:connector:push`
|
|
74
|
+
|
|
75
|
+
Use to push an integration to Turbine
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
USAGE
|
|
79
|
+
$ sw-tsdk-turbine turbine:connector:push -f <value> --turbine-url <value> [-u <value>] [-p <value>] [-h]
|
|
80
|
+
|
|
81
|
+
FLAGS
|
|
82
|
+
-f, --file=<value> (required) path of the file to be uploaded to Turbine
|
|
83
|
+
-h, --help Show CLI help.
|
|
84
|
+
-p, --password=<value> Turbine password
|
|
85
|
+
-u, --username=<value> Turbine username
|
|
86
|
+
--turbine-url=<value> (required) the url of the turbine instance [https://turbine.acme.com]
|
|
87
|
+
|
|
88
|
+
DESCRIPTION
|
|
89
|
+
Use to push an integration to Turbine
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
_See code: [lib/commands/turbine/connector/push.js](https://github.com/swimlane/turbine-sdk/blob/v0.1.1-next.23+038e7a6/lib/commands/turbine/connector/push.js)_
|
|
93
|
+
|
|
94
|
+
## `sw-tsdk-turbine turbine:login`
|
|
95
|
+
|
|
96
|
+
Use to login to Turbine
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
USAGE
|
|
100
|
+
$ sw-tsdk-turbine turbine:login --turbine-url <value> [-u <value>] [-p <value>] [-h]
|
|
101
|
+
|
|
102
|
+
FLAGS
|
|
103
|
+
-h, --help Show CLI help.
|
|
104
|
+
-p, --password=<value> Turbine password
|
|
105
|
+
-u, --username=<value> Turbine username
|
|
106
|
+
--turbine-url=<value> (required) the url of the turbine instance [https://turbine.acme.com]
|
|
107
|
+
|
|
108
|
+
DESCRIPTION
|
|
109
|
+
Use to login to Turbine
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
_See code: [lib/commands/turbine/login.js](https://github.com/swimlane/turbine-sdk/blob/v0.1.1-next.23+038e7a6/lib/commands/turbine/login.js)_
|
|
113
|
+
<!-- commandsstop -->
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Base } from '@sw-tsdk/core';
|
|
2
|
+
export declare class Generate extends Base {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
username: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
password: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
7
|
+
'signing-password': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
+
'key-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
9
|
+
'turbine-url': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
10
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
11
|
+
'log-level': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Generate = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const core_2 = require("@sw-tsdk/core");
|
|
6
|
+
const turbine_1 = require("@sw-tsdk/turbine");
|
|
7
|
+
const cosign_1 = require("@swimlane/cosign");
|
|
8
|
+
const node_os_1 = require("node:os");
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
|
+
const promises_1 = require("node:fs/promises");
|
|
11
|
+
const fs_extra_1 = require("fs-extra");
|
|
12
|
+
const promises_2 = require("node:fs/promises");
|
|
13
|
+
const date_fns_1 = require("date-fns");
|
|
14
|
+
// noinspection JSUnusedGlobalSymbols
|
|
15
|
+
class Generate extends core_2.Base {
|
|
16
|
+
async run() {
|
|
17
|
+
const { flags } = await this.parse(Generate);
|
|
18
|
+
const { 'signing-password': signingPassword, username, password,
|
|
19
|
+
// replace,
|
|
20
|
+
} = flags;
|
|
21
|
+
const keyName = flags['key-name'] || `${(0, node_os_1.userInfo)().username}_${(0, date_fns_1.format)(new Date(), 'yyyy-MM-dd')}`;
|
|
22
|
+
const storagePath = (0, node_path_1.join)(this.config.configDir, 'keys', keyName);
|
|
23
|
+
const privateKeyPath = (0, node_path_1.join)(storagePath, 'cosign.key');
|
|
24
|
+
if (await (0, core_2.fileExists)(privateKeyPath)) {
|
|
25
|
+
core_1.CliUx.ux.error(`Key already exists: ${keyName}.`);
|
|
26
|
+
}
|
|
27
|
+
const baseUrl = flags['turbine-url'];
|
|
28
|
+
const turbine = await turbine_1.Turbine.get(baseUrl);
|
|
29
|
+
if (password && turbine) {
|
|
30
|
+
await turbine.login(username, password);
|
|
31
|
+
}
|
|
32
|
+
core_1.CliUx.ux.action.start('Generating the signing key...');
|
|
33
|
+
if (await (0, core_2.directoryExists)(storagePath)) {
|
|
34
|
+
await (0, promises_1.rm)(storagePath, { recursive: true, force: true });
|
|
35
|
+
}
|
|
36
|
+
await (0, fs_extra_1.ensureDir)(storagePath);
|
|
37
|
+
await (0, cosign_1.generateKeyPair)(signingPassword, storagePath);
|
|
38
|
+
core_1.CliUx.ux.action.stop();
|
|
39
|
+
const publicKeyPath = (0, node_path_1.join)(storagePath, 'cosign.pub');
|
|
40
|
+
if (!await (0, core_2.fileExists)(publicKeyPath)) {
|
|
41
|
+
core_1.CliUx.ux.error(`Could not find file public key: ${keyName}`);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const publicKey = await (0, promises_2.readFile)(publicKeyPath);
|
|
45
|
+
const publicKeyContents = publicKey.toString();
|
|
46
|
+
if (!/BEGIN PUBLIC KEY/.test(publicKeyContents)) {
|
|
47
|
+
core_1.CliUx.ux.error(`Invalid public key: ${keyName}`);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
core_1.CliUx.ux.action.start('Uploading the key...');
|
|
51
|
+
const success = await (turbine === null || turbine === void 0 ? void 0 : turbine.uploadKey(keyName, publicKeyContents.toString()));
|
|
52
|
+
core_1.CliUx.ux.action.stop(`${success ? 'done' : 'failed'}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.Generate = Generate;
|
|
56
|
+
Generate.description = 'Use to push an integration to Turbine';
|
|
57
|
+
Generate.flags = Object.assign(Object.assign({}, core_2.Base.BaseFlags), { username: core_1.Flags.string({ char: 'u', description: 'Turbine username', default: '' }), password: core_1.Flags.string({ char: 'p', description: 'Turbine password', default: '' }), 'signing-password': core_1.Flags.string({ description: 'password used for the private key', default: '' }), 'key-name': core_1.Flags.string({ description: 'name used for the key (default: username)' }), 'turbine-url': core_1.Flags.string({ description: 'the url of the turbine instance [https://turbine.acme.com]', required: true }),
|
|
58
|
+
// replace: Flags.boolean({description: 'replaces the existing key'}),
|
|
59
|
+
help: core_1.Flags.help({ char: 'h' }) });
|
|
60
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../../src/commands/turbine/connector/keys/generate.ts"],"names":[],"mappings":";;;AAAA,sCAAwC;AACxC,wCAA+D;AAC/D,8CAAwC;AACxC,6CAAgD;AAChD,qCAAgC;AAChC,yCAA8B;AAC9B,+CAAmC;AACnC,uCAAkC;AAClC,+CAAyC;AACzC,uCAA+B;AAC/B,qCAAqC;AACrC,MAAa,QAAS,SAAQ,WAAI;IAchC,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QAC1C,MAAM,EACJ,kBAAkB,EAAE,eAAe,EACnC,QAAQ,EACR,QAAQ;QACR,WAAW;UACZ,GAAG,KAAK,CAAA;QAET,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,IAAA,kBAAQ,GAAE,CAAC,QAAQ,IAAI,IAAA,iBAAM,EAAC,IAAI,IAAI,EAAE,EAAE,YAAY,CAAC,EAAE,CAAA;QAEjG,MAAM,WAAW,GAAG,IAAA,gBAAI,EAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;QAChE,MAAM,cAAc,GAAG,IAAA,gBAAI,EAAC,WAAW,EAAE,YAAY,CAAC,CAAA;QACtD,IAAI,MAAM,IAAA,iBA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extends Base {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
6
|
+
'log-level': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.List = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const core_2 = require("@sw-tsdk/core");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const promises_1 = require("node:fs/promises");
|
|
8
|
+
// noinspection JSUnusedGlobalSymbols
|
|
9
|
+
class List extends core_2.Base {
|
|
10
|
+
async run() {
|
|
11
|
+
await this.parse(List);
|
|
12
|
+
const storagePath = (0, node_path_1.join)(this.config.configDir, 'keys');
|
|
13
|
+
const directories = await (0, promises_1.readdir)(storagePath);
|
|
14
|
+
console.log(directories.join('\n'));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.List = List;
|
|
18
|
+
List.description = 'Use to push an integration to Turbine';
|
|
19
|
+
List.flags = Object.assign(Object.assign({}, core_2.Base.BaseFlags), { help: core_1.Flags.help({ char: 'h' }) });
|
|
20
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/commands/turbine/connector/keys/list.ts"],"names":[],"mappings":";;;AAAA,sCAAiC;AACjC,wCAAkC;AAClC,yCAA8B;AAC9B,+CAAwC;AAExC,qCAAqC;AACrC,MAAa,IAAK,SAAQ,WAAI;IAQ5B,KAAK,CAAC,GAAG;QACP,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAEtB,MAAM,WAAW,GAAG,IAAA,gBAAI,EAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;QACvD,MAAM,WAAW,GAAG,MAAM,IAAA,kBAAO,EAAC,WAAW,CAAC,CAAA;QAE9C,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACrC,CAAC;;AAfH,oBAgBC;AAfQ,gBAAW,GAAG,uCAAuC,CAAA;AAErD,UAAK,mCACP,WAAI,CAAC,SAAS,KACjB,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,IAC9B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Base } from '@sw-tsdk/core';
|
|
2
|
+
export declare class Push extends Base {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
username: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
7
|
+
password: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
+
'turbine-url': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
9
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
10
|
+
'log-level': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Push = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const core_2 = require("@oclif/core");
|
|
6
|
+
const core_3 = require("@sw-tsdk/core");
|
|
7
|
+
const turbine_1 = require("@sw-tsdk/turbine");
|
|
8
|
+
// noinspection JSUnusedGlobalSymbols
|
|
9
|
+
class Push extends core_3.Base {
|
|
10
|
+
async run() {
|
|
11
|
+
const { flags } = await this.parse(Push);
|
|
12
|
+
const { file, username, password } = flags;
|
|
13
|
+
const baseUrl = flags['turbine-url'];
|
|
14
|
+
const turbine = await turbine_1.Turbine.get(baseUrl);
|
|
15
|
+
if (password && turbine) {
|
|
16
|
+
await turbine.login(username, password);
|
|
17
|
+
}
|
|
18
|
+
core_2.CliUx.ux.action.start('Pushing the connector...');
|
|
19
|
+
if (!await (0, core_3.fileExists)(file)) {
|
|
20
|
+
core_2.CliUx.ux.error(`Could not find file: ${file}`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const success = await (turbine === null || turbine === void 0 ? void 0 : turbine.uploadConnector(file));
|
|
24
|
+
core_2.CliUx.ux.action.stop(`${success ? 'done' : 'failed'}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.Push = Push;
|
|
28
|
+
Push.description = 'Use to push an integration to Turbine';
|
|
29
|
+
Push.flags = Object.assign(Object.assign({}, core_3.Base.BaseFlags), { file: core_1.Flags.string({
|
|
30
|
+
char: 'f',
|
|
31
|
+
description: 'path of the file to be uploaded to Turbine',
|
|
32
|
+
required: true,
|
|
33
|
+
}), username: core_1.Flags.string({ char: 'u', description: 'Turbine username', default: '' }), password: core_1.Flags.string({ char: 'p', description: 'Turbine password', default: '' }), 'turbine-url': core_1.Flags.string({ description: 'the url of the turbine instance [https://turbine.acme.com]', required: true }), help: core_1.Flags.help({ char: 'h' }) });
|
|
34
|
+
//# sourceMappingURL=push.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../../../src/commands/turbine/connector/push.ts"],"names":[],"mappings":";;;AAAA,sCAAiC;AACjC,sCAAiC;AACjC,wCAA8C;AAC9C,8CAAwC;AAExC,qCAAqC;AACrC,MAAa,IAAK,SAAQ,WAAI;IAgB5B,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACtC,MAAM,EAAC,IAA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E,EAAE,EAAC,CAAC,EACjF,aAAa,EAAE,YAAK,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,4DAA4D,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,EACxH,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,IAC9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Base } from '@sw-tsdk/core';
|
|
2
|
+
export declare class Login extends Base {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
username: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
6
|
+
password: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
+
'turbine-url': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
9
|
+
'log-level': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Login = void 0;
|
|
4
|
+
const inquirer_1 = require("inquirer");
|
|
5
|
+
const turbine_1 = require("@sw-tsdk/turbine");
|
|
6
|
+
const core_1 = require("@sw-tsdk/core");
|
|
7
|
+
const core_2 = require("@oclif/core");
|
|
8
|
+
// noinspection JSUnusedGlobalSymbols
|
|
9
|
+
class Login extends core_1.Base {
|
|
10
|
+
async run() {
|
|
11
|
+
const { flags } = await this.parse(Login);
|
|
12
|
+
const { username, password, 'turbine-url': baseUrl } = flags;
|
|
13
|
+
const answers = await (0, inquirer_1.prompt)([{
|
|
14
|
+
type: 'input',
|
|
15
|
+
name: 'username',
|
|
16
|
+
message: 'Enter a username',
|
|
17
|
+
when: () => !username || username.length === 0,
|
|
18
|
+
}, {
|
|
19
|
+
type: 'password',
|
|
20
|
+
name: 'password',
|
|
21
|
+
message: 'Enter a password',
|
|
22
|
+
when: () => !password || password.length === 0,
|
|
23
|
+
}]);
|
|
24
|
+
const newConfig = Object.assign(flags, answers);
|
|
25
|
+
const turbine = await turbine_1.Turbine.get(baseUrl);
|
|
26
|
+
await (turbine === null || turbine === void 0 ? void 0 : turbine.login(newConfig.username, newConfig.password));
|
|
27
|
+
core_2.CliUx.ux.log('Login successful');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.Login = Login;
|
|
31
|
+
Login.description = 'Use to login to Turbine';
|
|
32
|
+
Login.flags = Object.assign(Object.assign({}, core_1.Base.BaseFlags), { username: core_2.Flags.string({ char: 'u', description: 'Turbine username' }), password: core_2.Flags.string({ char: 'p', description: 'Turbine password' }), 'turbine-url': core_2.Flags.string({ description: 'the url of the turbine instance [https://turbine.acme.com]', required: true }), help: core_2.Flags.help({ char: 'h' }) });
|
|
33
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/turbine/login.ts"],"names":[],"mappings":";;;AAAA,uCAA+B;AAC/B,8CAAwC;AACxC,wCAAkC;AAClC,sCAAwC;AAExC,qCAAqC;AACrC,MAAa,KAAM,SAAQ,WAAI;IAW7B,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACvC,MAAM,EAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAC,GAAG,KAAK,CAAA;QAE1D,MAAM,OAAO,GAAG,MAAM,IAAA,iBAAM,EAAC,CAAC;gBAC5B,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,kBAAkB;gBAC3B,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM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AAe,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"0.1.1-next.23+038e7a6","commands":{"turbine:login":{"id":"turbine:login","description":"Use to login to Turbine","strict":true,"pluginName":"@sw-tsdk/plugin-turbine","pluginAlias":"@sw-tsdk/plugin-turbine","pluginType":"core","aliases":[],"flags":{"log-level":{"name":"log-level","type":"option","hidden":true,"multiple":false,"options":["debug"]},"username":{"name":"username","type":"option","char":"u","description":"Turbine username","multiple":false},"password":{"name":"password","type":"option","char":"p","description":"Turbine password","multiple":false},"turbine-url":{"name":"turbine-url","type":"option","description":"the url of the turbine instance [https://turbine.acme.com]","required":true,"multiple":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[]},"turbine:connector:push":{"id":"turbine:connector:push","description":"Use to push an integration to Turbine","strict":true,"pluginName":"@sw-tsdk/plugin-turbine","pluginAlias":"@sw-tsdk/plugin-turbine","pluginType":"core","aliases":[],"flags":{"log-level":{"name":"log-level","type":"option","hidden":true,"multiple":false,"options":["debug"]},"file":{"name":"file","type":"option","char":"f","description":"path of the file to be uploaded to Turbine","required":true,"multiple":false},"username":{"name":"username","type":"option","char":"u","description":"Turbine username","multiple":false,"default":""},"password":{"name":"password","type":"option","char":"p","description":"Turbine password","multiple":false,"default":""},"turbine-url":{"name":"turbine-url","type":"option","description":"the url of the turbine instance [https://turbine.acme.com]","required":true,"multiple":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[]},"turbine:connector:keys:generate":{"id":"turbine:connector:keys:generate","description":"Use to push an integration to Turbine","strict":true,"pluginName":"@sw-tsdk/plugin-turbine","pluginAlias":"@sw-tsdk/plugin-turbine","pluginType":"core","aliases":[],"flags":{"log-level":{"name":"log-level","type":"option","hidden":true,"multiple":false,"options":["debug"]},"username":{"name":"username","type":"option","char":"u","description":"Turbine username","multiple":false,"default":""},"password":{"name":"password","type":"option","char":"p","description":"Turbine password","multiple":false,"default":""},"signing-password":{"name":"signing-password","type":"option","description":"password used for the private key","multiple":false,"default":""},"key-name":{"name":"key-name","type":"option","description":"name used for the key (default: username)","multiple":false},"turbine-url":{"name":"turbine-url","type":"option","description":"the url of the turbine instance [https://turbine.acme.com]","required":true,"multiple":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[]},"turbine:connector:keys:list":{"id":"turbine:connector:keys:list","description":"Use to push an integration to Turbine","strict":true,"pluginName":"@sw-tsdk/plugin-turbine","pluginAlias":"@sw-tsdk/plugin-turbine","pluginType":"core","aliases":[],"flags":{"log-level":{"name":"log-level","type":"option","hidden":true,"multiple":false,"options":["debug"]},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[]}}}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "Swimlane",
|
|
3
|
+
"bugs": {
|
|
4
|
+
"url": "https://github.com/swimlane/turbine-sdk/issues"
|
|
5
|
+
},
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@oclif/core": "1.16.4",
|
|
8
|
+
"@sw-tsdk/common": "^0.1.1-next.23+038e7a6",
|
|
9
|
+
"@sw-tsdk/connector": "^0.1.1-next.23+038e7a6",
|
|
10
|
+
"@sw-tsdk/core": "^0.1.1-next.23+038e7a6",
|
|
11
|
+
"@sw-tsdk/docker": "^0.1.1-next.23+038e7a6",
|
|
12
|
+
"@sw-tsdk/turbine": "^0.1.1-next.23+038e7a6",
|
|
13
|
+
"@swimlane/cosign": "1.3.0",
|
|
14
|
+
"date-fns": "2.29.3",
|
|
15
|
+
"fs-extra": "10.1.0",
|
|
16
|
+
"inquirer": "8.2.2"
|
|
17
|
+
},
|
|
18
|
+
"description": "Plugin for managing connectors.",
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=16.0.0"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"/npm-shrinkwrap.json",
|
|
24
|
+
"/oclif.manifest.json",
|
|
25
|
+
"/yarn.lock",
|
|
26
|
+
"lib"
|
|
27
|
+
],
|
|
28
|
+
"homepage": "https://github.com/swimlane/turbine-sdk#readme",
|
|
29
|
+
"keywords": [
|
|
30
|
+
"oclif-plugin"
|
|
31
|
+
],
|
|
32
|
+
"license": "ISC",
|
|
33
|
+
"main": "lib/index.js",
|
|
34
|
+
"name": "@sw-tsdk/plugin-turbine",
|
|
35
|
+
"directories": {
|
|
36
|
+
"templates": "./lib/templates",
|
|
37
|
+
"lib": "lib"
|
|
38
|
+
},
|
|
39
|
+
"oclif": {
|
|
40
|
+
"commands": "./lib/commands",
|
|
41
|
+
"bin": "sw-tsdk-turbine",
|
|
42
|
+
"devPlugins": [
|
|
43
|
+
"@oclif/plugin-help"
|
|
44
|
+
],
|
|
45
|
+
"topics": {
|
|
46
|
+
"turbine": {
|
|
47
|
+
"description": "Turbine connector commands"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
54
|
+
"repository": {
|
|
55
|
+
"type": "git",
|
|
56
|
+
"url": "git+https://github.com/swimlane/turbine-sdk.git"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "rm -rf lib && tsc",
|
|
60
|
+
"lint": "eslint . --ext .ts --config .eslintrc",
|
|
61
|
+
"pretest": "tsc -p test --noEmit",
|
|
62
|
+
"postpack": "shx rm -f oclif.manifest.json",
|
|
63
|
+
"prepack": "yarn build && oclif manifest && oclif readme",
|
|
64
|
+
"version": "oclif readme",
|
|
65
|
+
"test": "echo NO TESTS",
|
|
66
|
+
"posttest": "yarn lint",
|
|
67
|
+
"link": "yarn link"
|
|
68
|
+
},
|
|
69
|
+
"version": "0.1.1-next.23+038e7a6",
|
|
70
|
+
"gitHead": "038e7a68d45b2d93f39c7f7b2edce9798019007e"
|
|
71
|
+
}
|