@prismatic-io/prism 3.2.2 → 4.1.0
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/bin/run +9 -8
- package/lib/auth.js +184 -202
- package/lib/commands/alerts/events/list.js +27 -57
- package/lib/commands/alerts/groups/create.js +18 -49
- package/lib/commands/alerts/groups/delete.js +10 -41
- package/lib/commands/alerts/groups/list.js +15 -47
- package/lib/commands/alerts/monitors/clear.js +10 -41
- package/lib/commands/alerts/monitors/create.js +27 -58
- package/lib/commands/alerts/monitors/delete.js +10 -41
- package/lib/commands/alerts/monitors/list.js +16 -48
- package/lib/commands/alerts/triggers/list.js +15 -47
- package/lib/commands/alerts/webhooks/create.js +18 -49
- package/lib/commands/alerts/webhooks/delete.js +10 -41
- package/lib/commands/alerts/webhooks/list.js +25 -57
- package/lib/commands/authorization-methods/list.js +20 -51
- package/lib/commands/components/actions/list.js +29 -61
- package/lib/commands/components/delete.js +10 -41
- package/lib/commands/components/dev/run.js +75 -0
- package/lib/commands/components/dev/test.js +218 -0
- package/lib/commands/components/init/action.js +12 -0
- package/lib/commands/components/init/component.js +12 -0
- package/lib/commands/components/init/connection.js +12 -0
- package/lib/commands/components/init/index.js +203 -0
- package/lib/commands/components/init/trigger.js +12 -0
- package/lib/commands/components/list.js +31 -60
- package/lib/commands/components/publish.js +29 -279
- package/lib/commands/components/triggers/list.js +29 -61
- package/lib/commands/customers/create.js +14 -45
- package/lib/commands/customers/credentials/create.js +19 -50
- package/lib/commands/customers/credentials/delete.js +10 -41
- package/lib/commands/customers/credentials/list.js +30 -59
- package/lib/commands/customers/credentials/update.js +16 -47
- package/lib/commands/customers/delete.js +10 -41
- package/lib/commands/customers/list.js +16 -48
- package/lib/commands/customers/update.js +15 -46
- package/lib/commands/customers/users/create.js +18 -49
- package/lib/commands/customers/users/delete.js +10 -41
- package/lib/commands/customers/users/list.js +21 -51
- package/lib/commands/customers/users/roles.js +18 -48
- package/lib/commands/customers/users/update.js +19 -50
- package/lib/commands/executions/step-result/get.js +36 -66
- package/lib/commands/instances/config-vars/list.js +32 -62
- package/lib/commands/instances/create.js +20 -51
- package/lib/commands/instances/delete.js +10 -41
- package/lib/commands/instances/deploy.js +20 -44
- package/lib/commands/instances/disable.js +11 -42
- package/lib/commands/instances/enable.js +11 -42
- package/lib/commands/instances/flow-configs/list.js +25 -55
- package/lib/commands/instances/flow-configs/test.js +62 -97
- package/lib/commands/instances/list.js +31 -59
- package/lib/commands/instances/update.js +15 -46
- package/lib/commands/integrations/available.js +13 -44
- package/lib/commands/integrations/create.js +14 -45
- package/lib/commands/integrations/delete.js +10 -41
- package/lib/commands/integrations/export.js +16 -59
- package/lib/commands/integrations/flows/list.js +22 -52
- package/lib/commands/integrations/flows/test.js +62 -96
- package/lib/commands/integrations/fork.js +15 -46
- package/lib/commands/integrations/import.js +12 -63
- package/lib/commands/integrations/list.js +25 -54
- package/lib/commands/integrations/publish.js +13 -44
- package/lib/commands/integrations/update.js +18 -49
- package/lib/commands/integrations/versions/index.js +26 -58
- package/lib/commands/login.js +16 -32
- package/lib/commands/logout.js +10 -22
- package/lib/commands/logs/severities/list.js +15 -47
- package/lib/commands/me/index.js +13 -60
- package/lib/commands/me/token/revoke.js +12 -0
- package/lib/commands/me/token.js +10 -22
- package/lib/commands/organization/credentials/create.js +17 -48
- package/lib/commands/organization/credentials/delete.js +10 -41
- package/lib/commands/organization/credentials/list.js +22 -54
- package/lib/commands/organization/credentials/update.js +16 -47
- package/lib/commands/organization/update.js +12 -43
- package/lib/commands/organization/updateAvatarUrl.js +14 -45
- package/lib/commands/organization/users/create.js +16 -47
- package/lib/commands/organization/users/delete.js +10 -41
- package/lib/commands/organization/users/list.js +16 -48
- package/lib/commands/organization/users/roles.js +18 -48
- package/lib/commands/organization/users/update.js +19 -50
- package/lib/config.js +24 -30
- package/lib/errors.js +48 -27
- package/lib/fields.js +6 -4
- package/lib/fs.js +6 -14
- package/lib/generate/action.js +36 -41
- package/lib/generate/client.js +11 -16
- package/lib/generate/connection.js +4 -13
- package/lib/generate/index.js +29 -19
- package/lib/generate/input.js +28 -43
- package/lib/generate/parse.js +38 -44
- package/lib/generate/sourceFile.js +11 -7
- package/lib/generate/util.js +9 -7
- package/lib/graphql.js +37 -65
- package/lib/index.js +3 -3
- package/lib/utils/component/publish.js +219 -0
- package/lib/utils/component/query.js +23 -0
- package/lib/utils/date.js +14 -0
- package/lib/utils/execution/logs.js +86 -0
- package/lib/utils/integration/definition.js +101 -0
- package/lib/utils/integration/export.js +36 -0
- package/lib/utils/integration/import.js +46 -0
- package/lib/utils/integration/invoke.js +64 -0
- package/lib/utils/integration/query.js +59 -0
- package/lib/utils/serialize.js +8 -0
- package/lib/utils/user/query.js +24 -0
- package/lib/yeoman.js +23 -0
- package/oclif.manifest.json +1 -1
- package/package.json +48 -54
- package/templates/component/openapi/client.ts +11 -9
- package/templates/component/openapi/request.ts +6 -4
- package/lib/auth.js.map +0 -1
- package/lib/commands/alerts/events/list.js.map +0 -1
- package/lib/commands/alerts/groups/create.js.map +0 -1
- package/lib/commands/alerts/groups/delete.js.map +0 -1
- package/lib/commands/alerts/groups/list.js.map +0 -1
- package/lib/commands/alerts/monitors/clear.js.map +0 -1
- package/lib/commands/alerts/monitors/create.js.map +0 -1
- package/lib/commands/alerts/monitors/delete.js.map +0 -1
- package/lib/commands/alerts/monitors/list.js.map +0 -1
- package/lib/commands/alerts/triggers/list.js.map +0 -1
- package/lib/commands/alerts/webhooks/create.js.map +0 -1
- package/lib/commands/alerts/webhooks/delete.js.map +0 -1
- package/lib/commands/alerts/webhooks/list.js.map +0 -1
- package/lib/commands/authorization-methods/list.js.map +0 -1
- package/lib/commands/components/actions/list.js.map +0 -1
- package/lib/commands/components/delete.js.map +0 -1
- package/lib/commands/components/init.js +0 -224
- package/lib/commands/components/init.js.map +0 -1
- package/lib/commands/components/list.js.map +0 -1
- package/lib/commands/components/publish.js.map +0 -1
- package/lib/commands/components/triggers/list.js.map +0 -1
- package/lib/commands/customers/create.js.map +0 -1
- package/lib/commands/customers/credentials/create.js.map +0 -1
- package/lib/commands/customers/credentials/delete.js.map +0 -1
- package/lib/commands/customers/credentials/list.js.map +0 -1
- package/lib/commands/customers/credentials/update.js.map +0 -1
- package/lib/commands/customers/delete.js.map +0 -1
- package/lib/commands/customers/list.js.map +0 -1
- package/lib/commands/customers/update.js.map +0 -1
- package/lib/commands/customers/users/create.js.map +0 -1
- package/lib/commands/customers/users/delete.js.map +0 -1
- package/lib/commands/customers/users/list.js.map +0 -1
- package/lib/commands/customers/users/roles.js.map +0 -1
- package/lib/commands/customers/users/update.js.map +0 -1
- package/lib/commands/executions/step-result/get.js.map +0 -1
- package/lib/commands/instances/config-vars/list.js.map +0 -1
- package/lib/commands/instances/create.js.map +0 -1
- package/lib/commands/instances/delete.js.map +0 -1
- package/lib/commands/instances/deploy.js.map +0 -1
- package/lib/commands/instances/disable.js.map +0 -1
- package/lib/commands/instances/enable.js.map +0 -1
- package/lib/commands/instances/flow-configs/list.js.map +0 -1
- package/lib/commands/instances/flow-configs/test.js.map +0 -1
- package/lib/commands/instances/list.js.map +0 -1
- package/lib/commands/instances/update.js.map +0 -1
- package/lib/commands/integrations/available.js.map +0 -1
- package/lib/commands/integrations/create.js.map +0 -1
- package/lib/commands/integrations/delete.js.map +0 -1
- package/lib/commands/integrations/export.js.map +0 -1
- package/lib/commands/integrations/flows/list.js.map +0 -1
- package/lib/commands/integrations/flows/test.js.map +0 -1
- package/lib/commands/integrations/fork.js.map +0 -1
- package/lib/commands/integrations/import.js.map +0 -1
- package/lib/commands/integrations/list.js.map +0 -1
- package/lib/commands/integrations/publish.js.map +0 -1
- package/lib/commands/integrations/update.js.map +0 -1
- package/lib/commands/integrations/versions/index.js.map +0 -1
- package/lib/commands/login.js.map +0 -1
- package/lib/commands/logout.js.map +0 -1
- package/lib/commands/logs/severities/list.js.map +0 -1
- package/lib/commands/me/index.js.map +0 -1
- package/lib/commands/me/token.js.map +0 -1
- package/lib/commands/organization/credentials/create.js.map +0 -1
- package/lib/commands/organization/credentials/delete.js.map +0 -1
- package/lib/commands/organization/credentials/list.js.map +0 -1
- package/lib/commands/organization/credentials/update.js.map +0 -1
- package/lib/commands/organization/update.js.map +0 -1
- package/lib/commands/organization/updateAvatarUrl.js.map +0 -1
- package/lib/commands/organization/users/create.js.map +0 -1
- package/lib/commands/organization/users/delete.js.map +0 -1
- package/lib/commands/organization/users/list.js.map +0 -1
- package/lib/commands/organization/users/roles.js.map +0 -1
- package/lib/commands/organization/users/update.js.map +0 -1
- package/lib/config.js.map +0 -1
- package/lib/errors.js.map +0 -1
- package/lib/fields.js.map +0 -1
- package/lib/fs.js.map +0 -1
- package/lib/generate/action.js.map +0 -1
- package/lib/generate/client.js.map +0 -1
- package/lib/generate/connection.js.map +0 -1
- package/lib/generate/index.js.map +0 -1
- package/lib/generate/input.js.map +0 -1
- package/lib/generate/parse.js.map +0 -1
- package/lib/generate/sourceFile.js.map +0 -1
- package/lib/generate/util.js.map +0 -1
- package/lib/graphql.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/templates/component/jest.config.js +0 -4
- package/templates/component/package.json +0 -24
- package/templates/component/src/actions.ts +0 -33
- package/templates/component/src/client.ts +0 -7
- package/templates/component/src/connections.ts +0 -25
- package/templates/component/src/index.test.ts +0 -32
- package/templates/component/src/index.ts +0 -17
- package/templates/component/src/triggers.ts +0 -18
- package/templates/component/tsconfig.json +0 -19
- package/templates/component/webpack.config.js +0 -44
|
@@ -1,64 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
31
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
|
-
};
|
|
33
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
run() {
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const { args: { integration }, } = this.parse(ExportCommand);
|
|
46
|
-
const result = yield graphql_1.default.query({
|
|
47
|
-
query: graphql_1.gql `
|
|
48
|
-
query exportIntegration($id: ID!, $version: Int!) {
|
|
49
|
-
integration(id: $id) {
|
|
50
|
-
definition(version: $version)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
`,
|
|
54
|
-
variables: {
|
|
55
|
-
id: integration,
|
|
56
|
-
version: INTEGRATION_DEFINITION_VERSION,
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
const integrationDefinition = js_yaml_1.default.safeLoad(result.data.integration.definition);
|
|
60
|
-
this.log(js_yaml_1.default.dump(integrationDefinition));
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const export_1 = require("../../utils/integration/export");
|
|
5
|
+
const serialize_1 = require("../../utils/serialize");
|
|
6
|
+
class ExportCommand extends core_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { args: { integration }, flags: { "latest-components": useLatestComponentVersions }, } = await this.parse(ExportCommand);
|
|
9
|
+
const definition = await (0, export_1.exportDefinition)({
|
|
10
|
+
integrationId: integration,
|
|
11
|
+
latestComponents: useLatestComponentVersions,
|
|
61
12
|
});
|
|
13
|
+
this.log((0, serialize_1.dumpYaml)(definition));
|
|
62
14
|
}
|
|
63
15
|
}
|
|
64
16
|
exports.default = ExportCommand;
|
|
@@ -70,4 +22,9 @@ ExportCommand.args = [
|
|
|
70
22
|
description: "ID of an integration to export",
|
|
71
23
|
},
|
|
72
24
|
];
|
|
73
|
-
|
|
25
|
+
ExportCommand.flags = {
|
|
26
|
+
"latest-components": core_1.Flags.boolean({
|
|
27
|
+
char: "l",
|
|
28
|
+
description: "Use the latest available version of each Component upon import",
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
@@ -1,42 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
const
|
|
32
|
-
const graphql_1 =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const result = yield graphql_1.default.query({
|
|
39
|
-
query: graphql_1.gql `
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const graphql_1 = require("../../../graphql");
|
|
5
|
+
class ListCommand extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { args: { integration }, flags, } = await this.parse(ListCommand);
|
|
8
|
+
const result = await (0, graphql_1.gqlRequest)({
|
|
9
|
+
document: (0, graphql_1.gql) `
|
|
40
10
|
query listIntegrationFlows($id: ID!) {
|
|
41
11
|
integration(id: $id) {
|
|
42
12
|
flows {
|
|
@@ -50,20 +20,19 @@ class ListCommand extends command_1.Command {
|
|
|
50
20
|
}
|
|
51
21
|
}
|
|
52
22
|
`,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
-
cli_ux_1.cli.table(result.data.integration.flows.nodes, {
|
|
58
|
-
id: {
|
|
59
|
-
minWidth: 8,
|
|
60
|
-
extended: true,
|
|
61
|
-
},
|
|
62
|
-
name: {},
|
|
63
|
-
description: {},
|
|
64
|
-
testUrl: { header: "Test URL", extended: true },
|
|
65
|
-
}, Object.assign({}, flags));
|
|
23
|
+
variables: {
|
|
24
|
+
id: integration,
|
|
25
|
+
},
|
|
66
26
|
});
|
|
27
|
+
core_1.CliUx.ux.table(result.integration.flows.nodes, {
|
|
28
|
+
id: {
|
|
29
|
+
minWidth: 8,
|
|
30
|
+
extended: true,
|
|
31
|
+
},
|
|
32
|
+
name: {},
|
|
33
|
+
description: {},
|
|
34
|
+
testUrl: { header: "Test URL", extended: true },
|
|
35
|
+
}, { ...flags });
|
|
67
36
|
}
|
|
68
37
|
}
|
|
69
38
|
exports.default = ListCommand;
|
|
@@ -75,5 +44,6 @@ ListCommand.args = [
|
|
|
75
44
|
required: true,
|
|
76
45
|
},
|
|
77
46
|
];
|
|
78
|
-
ListCommand.flags =
|
|
79
|
-
|
|
47
|
+
ListCommand.flags = {
|
|
48
|
+
...core_1.CliUx.ux.table.flags(),
|
|
49
|
+
};
|
|
@@ -1,42 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
const
|
|
32
|
-
const graphql_1 =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const result = yield graphql_1.default.mutate({
|
|
39
|
-
mutation: graphql_1.gql `
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const graphql_1 = require("../../../graphql");
|
|
5
|
+
class TestCommand extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { args: { flow }, flags: { tail, payload, contentType }, } = await this.parse(TestCommand);
|
|
8
|
+
const result = await (0, graphql_1.gqlRequest)({
|
|
9
|
+
document: (0, graphql_1.gql) `
|
|
40
10
|
mutation testIntegrationFlow(
|
|
41
11
|
$id: ID!
|
|
42
12
|
$payload: String
|
|
@@ -60,49 +30,43 @@ class TestCommand extends command_1.Command {
|
|
|
60
30
|
}
|
|
61
31
|
}
|
|
62
32
|
`,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
const executionId = result.data.testIntegrationFlow.testIntegrationFlowResult.execution.id;
|
|
70
|
-
console.log(`Execution ID: ${executionId}`);
|
|
71
|
-
if (tail) {
|
|
72
|
-
yield this.tailLogs(executionId);
|
|
73
|
-
}
|
|
33
|
+
variables: {
|
|
34
|
+
id: flow,
|
|
35
|
+
payload,
|
|
36
|
+
contentType,
|
|
37
|
+
},
|
|
74
38
|
});
|
|
39
|
+
const executionId = result.testIntegrationFlow.testIntegrationFlowResult.execution.id;
|
|
40
|
+
console.log(`Execution ID: ${executionId}`);
|
|
41
|
+
if (tail) {
|
|
42
|
+
await this.tailLogs(executionId);
|
|
43
|
+
}
|
|
75
44
|
}
|
|
76
|
-
tailLogs(executionId) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (executionComplete)
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
});
|
|
45
|
+
async tailLogs(executionId) {
|
|
46
|
+
const { flags } = await this.parse(TestCommand);
|
|
47
|
+
let nextCursor = undefined;
|
|
48
|
+
// eslint-disable-next-line no-constant-condition
|
|
49
|
+
while (true) {
|
|
50
|
+
await core_1.CliUx.ux.wait(500);
|
|
51
|
+
const result = await this.fetchLogs(executionId, nextCursor);
|
|
52
|
+
if (result === undefined)
|
|
53
|
+
continue;
|
|
54
|
+
const { logs, cursor, executionComplete } = result;
|
|
55
|
+
nextCursor = cursor;
|
|
56
|
+
core_1.CliUx.ux.table(logs, {
|
|
57
|
+
timestamp: {},
|
|
58
|
+
severity: {
|
|
59
|
+
minWidth: 12,
|
|
60
|
+
},
|
|
61
|
+
message: {},
|
|
62
|
+
}, { ...flags, "no-header": true });
|
|
63
|
+
if (executionComplete)
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
101
66
|
}
|
|
102
|
-
fetchLogs(executionId, nextCursor) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
query: graphql_1.gql `
|
|
67
|
+
async fetchLogs(executionId, nextCursor) {
|
|
68
|
+
const results = await (0, graphql_1.gqlRequest)({
|
|
69
|
+
document: (0, graphql_1.gql) `
|
|
106
70
|
query listIntegrationTestLogs($executionId: ID!, $nextCursor: String) {
|
|
107
71
|
logs(
|
|
108
72
|
executionResult: $executionId
|
|
@@ -120,21 +84,19 @@ class TestCommand extends command_1.Command {
|
|
|
120
84
|
}
|
|
121
85
|
}
|
|
122
86
|
`,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
fetchPolicy: "network-only",
|
|
128
|
-
});
|
|
129
|
-
const { edges } = results.data.logs;
|
|
130
|
-
if (!edges || edges.length === 0) {
|
|
131
|
-
return [undefined, undefined];
|
|
132
|
-
}
|
|
133
|
-
const logs = edges.map(({ node }) => node);
|
|
134
|
-
const executionComplete = logs.reduce((result, { message }) => result || message.startsWith("Ending Instance"), false);
|
|
135
|
-
const { cursor } = edges[edges.length - 1];
|
|
136
|
-
return [logs, cursor, executionComplete];
|
|
87
|
+
variables: {
|
|
88
|
+
executionId,
|
|
89
|
+
nextCursor,
|
|
90
|
+
},
|
|
137
91
|
});
|
|
92
|
+
const { edges } = results.logs;
|
|
93
|
+
if (!edges || edges.length === 0) {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
const logs = edges.map(({ node }) => node);
|
|
97
|
+
const executionComplete = logs.reduce((result, { message }) => result || message.startsWith("Ending Instance"), false);
|
|
98
|
+
const { cursor } = edges[edges.length - 1];
|
|
99
|
+
return { logs, cursor, executionComplete };
|
|
138
100
|
}
|
|
139
101
|
}
|
|
140
102
|
exports.default = TestCommand;
|
|
@@ -142,17 +104,21 @@ TestCommand.description = "Run a test of an Integration Flow";
|
|
|
142
104
|
TestCommand.args = [
|
|
143
105
|
{ name: "flow", description: "ID of a flow to test", required: true },
|
|
144
106
|
];
|
|
145
|
-
TestCommand.flags =
|
|
107
|
+
TestCommand.flags = {
|
|
108
|
+
...core_1.CliUx.ux.table.flags({ only: ["extended", "columns"] }),
|
|
109
|
+
tail: core_1.Flags.boolean({
|
|
146
110
|
char: "t",
|
|
147
111
|
description: "Tail logs of the integration test run",
|
|
148
112
|
required: false,
|
|
149
|
-
}),
|
|
113
|
+
}),
|
|
114
|
+
payload: core_1.Flags.string({
|
|
150
115
|
char: "p",
|
|
151
116
|
description: "Optional JSON-formatted data payload to submit with the test",
|
|
152
117
|
required: false,
|
|
153
|
-
}),
|
|
118
|
+
}),
|
|
119
|
+
contentType: core_1.Flags.string({
|
|
154
120
|
char: "c",
|
|
155
121
|
description: "Optional content-type for the test payload",
|
|
156
122
|
required: false,
|
|
157
|
-
})
|
|
158
|
-
|
|
123
|
+
}),
|
|
124
|
+
};
|
|
@@ -1,41 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
const
|
|
32
|
-
const graphql_1 =
|
|
33
|
-
class ForkCommand extends
|
|
34
|
-
run() {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
mutation: graphql_1.gql `
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const graphql_1 = require("../../graphql");
|
|
5
|
+
class ForkCommand extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { flags: { name, description }, args: { parent }, } = await this.parse(ForkCommand);
|
|
8
|
+
const result = await (0, graphql_1.gqlRequest)({
|
|
9
|
+
document: (0, graphql_1.gql) `
|
|
39
10
|
mutation forkIntegration(
|
|
40
11
|
$parentID: ID!
|
|
41
12
|
$name: String!
|
|
@@ -54,25 +25,24 @@ class ForkCommand extends command_1.Command {
|
|
|
54
25
|
}
|
|
55
26
|
}
|
|
56
27
|
`,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
this.log(result.data.forkIntegration.integration.id);
|
|
28
|
+
variables: {
|
|
29
|
+
parentID: parent,
|
|
30
|
+
name,
|
|
31
|
+
description,
|
|
32
|
+
},
|
|
64
33
|
});
|
|
34
|
+
this.log(result.forkIntegration.integration.id);
|
|
65
35
|
}
|
|
66
36
|
}
|
|
67
37
|
exports.default = ForkCommand;
|
|
68
38
|
ForkCommand.description = "Fork an Integration";
|
|
69
39
|
ForkCommand.flags = {
|
|
70
|
-
name:
|
|
40
|
+
name: core_1.Flags.string({
|
|
71
41
|
char: "n",
|
|
72
42
|
required: true,
|
|
73
43
|
description: "name of the forked integration",
|
|
74
44
|
}),
|
|
75
|
-
description:
|
|
45
|
+
description: core_1.Flags.string({
|
|
76
46
|
char: "d",
|
|
77
47
|
required: true,
|
|
78
48
|
description: "longer description of the forked integration",
|
|
@@ -85,4 +55,3 @@ ForkCommand.args = [
|
|
|
85
55
|
description: "ID of the Integration to fork",
|
|
86
56
|
},
|
|
87
57
|
];
|
|
88
|
-
//# sourceMappingURL=fork.js.map
|
|
@@ -1,81 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
const
|
|
32
|
-
const graphql_1 = __importStar(require("../../graphql"));
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
33
4
|
const fs_1 = require("../../fs");
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
const definition = yield fs_1.fs.readFile(path, "utf-8");
|
|
42
|
-
const result = yield graphql_1.default.mutate({
|
|
43
|
-
mutation: graphql_1.gql `
|
|
44
|
-
mutation importIntegration($definition: String!, $integrationId: ID) {
|
|
45
|
-
importIntegration(
|
|
46
|
-
input: { definition: $definition, integrationId: $integrationId }
|
|
47
|
-
) {
|
|
48
|
-
integration {
|
|
49
|
-
id
|
|
50
|
-
}
|
|
51
|
-
errors {
|
|
52
|
-
field
|
|
53
|
-
messages
|
|
54
|
-
}
|
|
55
|
-
}
|
|
5
|
+
const import_1 = require("../../utils/integration/import");
|
|
6
|
+
class ImportCommand extends core_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { flags: { path, integrationId }, } = await this.parse(ImportCommand);
|
|
9
|
+
if (!(await (0, fs_1.exists)(path))) {
|
|
10
|
+
this.error("Cannot find definition file at specified path.", { exit: 2 });
|
|
56
11
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
integrationId,
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
this.log(result.data.importIntegration.integration.id);
|
|
64
|
-
});
|
|
12
|
+
const definition = await fs_1.fs.readFile(path, "utf-8");
|
|
13
|
+
const { integrationId: integrationImportId } = await (0, import_1.importDefinition)(definition, integrationId);
|
|
14
|
+
this.log(integrationImportId);
|
|
65
15
|
}
|
|
66
16
|
}
|
|
67
17
|
exports.default = ImportCommand;
|
|
68
18
|
ImportCommand.description = "Import an Integration using a YAML definition file";
|
|
69
19
|
ImportCommand.flags = {
|
|
70
|
-
path:
|
|
20
|
+
path: core_1.Flags.string({
|
|
71
21
|
char: "p",
|
|
72
22
|
required: true,
|
|
73
23
|
description: "path to the YAML definition of the integration to import",
|
|
74
24
|
}),
|
|
75
|
-
integrationId:
|
|
25
|
+
integrationId: core_1.Flags.string({
|
|
76
26
|
char: "i",
|
|
77
27
|
required: false,
|
|
78
28
|
description: "The ID of the integration being imported",
|
|
79
29
|
}),
|
|
80
30
|
};
|
|
81
|
-
//# sourceMappingURL=import.js.map
|
|
@@ -1,43 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
const
|
|
32
|
-
const graphql_1 =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const result = yield graphql_1.default.query({
|
|
40
|
-
query: graphql_1.gql `
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const graphql_1 = require("../../graphql");
|
|
5
|
+
class ListCommand extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { flags } = await this.parse(ListCommand);
|
|
8
|
+
const { showAllVersions } = flags;
|
|
9
|
+
const result = await (0, graphql_1.gqlRequest)({
|
|
10
|
+
document: (0, graphql_1.gql) `
|
|
41
11
|
query listIntegrations($showAllVersions: Boolean) {
|
|
42
12
|
integrations(allVersions: $showAllVersions) {
|
|
43
13
|
nodes {
|
|
@@ -49,26 +19,27 @@ class ListCommand extends command_1.default {
|
|
|
49
19
|
}
|
|
50
20
|
}
|
|
51
21
|
`,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
cli_ux_1.cli.table(result.data.integrations.nodes, {
|
|
57
|
-
id: {
|
|
58
|
-
minWidth: 8,
|
|
59
|
-
extended: true,
|
|
60
|
-
},
|
|
61
|
-
name: {},
|
|
62
|
-
description: {},
|
|
63
|
-
versionNumber: { header: "Version" },
|
|
64
|
-
}, Object.assign({}, flags));
|
|
22
|
+
variables: {
|
|
23
|
+
showAllVersions,
|
|
24
|
+
},
|
|
65
25
|
});
|
|
26
|
+
core_1.CliUx.ux.table(result.integrations.nodes, {
|
|
27
|
+
id: {
|
|
28
|
+
minWidth: 8,
|
|
29
|
+
extended: true,
|
|
30
|
+
},
|
|
31
|
+
name: {},
|
|
32
|
+
description: {},
|
|
33
|
+
versionNumber: { header: "Version" },
|
|
34
|
+
}, { ...flags });
|
|
66
35
|
}
|
|
67
36
|
}
|
|
68
37
|
exports.default = ListCommand;
|
|
69
38
|
ListCommand.description = "List Integrations";
|
|
70
|
-
ListCommand.flags =
|
|
39
|
+
ListCommand.flags = {
|
|
40
|
+
...core_1.CliUx.ux.table.flags(),
|
|
41
|
+
showAllVersions: core_1.Flags.boolean({
|
|
71
42
|
char: "a",
|
|
72
43
|
description: "If specified this command returns all versions of all integrations rather than only the latest version",
|
|
73
|
-
})
|
|
74
|
-
|
|
44
|
+
}),
|
|
45
|
+
};
|