@prismatic-io/prism 3.3.0 → 4.2.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 +183 -201
- 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 +89 -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 +142 -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 +11 -68
- 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 +15 -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 +43 -100
- package/lib/generate/index.js +27 -23
- package/lib/generate/input.js +28 -43
- package/lib/generate/parse.js +18 -76
- package/lib/generate/sourceFile.js +15 -44
- package/lib/generate/util.js +4 -106
- 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 +24 -0
- package/oclif.manifest.json +1 -1
- package/package.json +50 -58
- 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 +0 -98
- package/lib/generate/client.js.map +0 -1
- package/lib/generate/connection.js +0 -86
- 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/assets/icon.png +0 -0
- package/templates/component/jest.config.js +0 -4
- package/templates/component/openapi/client.ts +0 -73
- package/templates/component/openapi/request.ts +0 -161
- 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,44 +1,15 @@
|
|
|
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 =
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const graphql_1 = require("../../../graphql");
|
|
33
5
|
const fields_1 = require("../../../fields");
|
|
34
|
-
class CreateCommand extends
|
|
35
|
-
run() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
mutation: graphql_1.gql `
|
|
6
|
+
class CreateCommand extends core_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { flags: { name, users: userJson, webhooks: webhookJson }, } = await this.parse(CreateCommand);
|
|
9
|
+
const users = (0, fields_1.parseJsonOrUndefined)(userJson);
|
|
10
|
+
const webhooks = (0, fields_1.parseJsonOrUndefined)(webhookJson);
|
|
11
|
+
const result = await (0, graphql_1.gqlRequest)({
|
|
12
|
+
document: (0, graphql_1.gql) `
|
|
42
13
|
mutation createAlertGroup(
|
|
43
14
|
$name: String!
|
|
44
15
|
$users: [ID]
|
|
@@ -57,33 +28,31 @@ class CreateCommand extends command_1.Command {
|
|
|
57
28
|
}
|
|
58
29
|
}
|
|
59
30
|
`,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
});
|
|
66
|
-
this.log(result.data.createAlertGroup.alertGroup.id);
|
|
31
|
+
variables: {
|
|
32
|
+
name,
|
|
33
|
+
users,
|
|
34
|
+
webhooks,
|
|
35
|
+
},
|
|
67
36
|
});
|
|
37
|
+
this.log(result.createAlertGroup.alertGroup.id);
|
|
68
38
|
}
|
|
69
39
|
}
|
|
70
40
|
exports.default = CreateCommand;
|
|
71
41
|
CreateCommand.description = "Create an Alert Group";
|
|
72
42
|
CreateCommand.flags = {
|
|
73
|
-
name:
|
|
43
|
+
name: core_1.Flags.string({
|
|
74
44
|
char: "n",
|
|
75
45
|
required: true,
|
|
76
46
|
description: "name of the group to be created",
|
|
77
47
|
}),
|
|
78
|
-
users:
|
|
48
|
+
users: core_1.Flags.string({
|
|
79
49
|
required: false,
|
|
80
50
|
char: "u",
|
|
81
51
|
description: "JSON-formatted list of Prismatic user IDs to alert",
|
|
82
52
|
}),
|
|
83
|
-
webhooks:
|
|
53
|
+
webhooks: core_1.Flags.string({
|
|
84
54
|
required: false,
|
|
85
55
|
char: "w",
|
|
86
56
|
description: "JSON-formatted list of Alert Webhook IDs to alert",
|
|
87
57
|
}),
|
|
88
58
|
};
|
|
89
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -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 DeleteCommand 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 DeleteCommand extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { args: { group }, } = await this.parse(DeleteCommand);
|
|
8
|
+
await (0, graphql_1.gqlRequest)({
|
|
9
|
+
document: (0, graphql_1.gql) `
|
|
39
10
|
mutation deleteAlertGroup($id: ID!) {
|
|
40
11
|
deleteAlertGroup(input: { id: $id }) {
|
|
41
12
|
alertGroup {
|
|
@@ -48,10 +19,9 @@ class DeleteCommand extends command_1.Command {
|
|
|
48
19
|
}
|
|
49
20
|
}
|
|
50
21
|
`,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
});
|
|
22
|
+
variables: {
|
|
23
|
+
id: group,
|
|
24
|
+
},
|
|
55
25
|
});
|
|
56
26
|
}
|
|
57
27
|
}
|
|
@@ -64,4 +34,3 @@ DeleteCommand.args = [
|
|
|
64
34
|
description: "ID of the group to delete",
|
|
65
35
|
},
|
|
66
36
|
];
|
|
67
|
-
//# sourceMappingURL=delete.js.map
|
|
@@ -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 { flags } = await this.parse(ListCommand);
|
|
8
|
+
const result = await (0, graphql_1.gqlRequest)({
|
|
9
|
+
document: (0, graphql_1.gql) `
|
|
40
10
|
query listAlertGroups {
|
|
41
11
|
alertGroups {
|
|
42
12
|
nodes {
|
|
@@ -46,18 +16,16 @@ class ListCommand extends command_1.Command {
|
|
|
46
16
|
}
|
|
47
17
|
}
|
|
48
18
|
`,
|
|
49
|
-
});
|
|
50
|
-
cli_ux_1.cli.table(result.data.alertGroups.nodes, {
|
|
51
|
-
id: {
|
|
52
|
-
minWidth: 8,
|
|
53
|
-
extended: true,
|
|
54
|
-
},
|
|
55
|
-
name: {},
|
|
56
|
-
}, Object.assign({}, flags));
|
|
57
19
|
});
|
|
20
|
+
core_1.CliUx.ux.table(result.alertGroups.nodes, {
|
|
21
|
+
id: {
|
|
22
|
+
minWidth: 8,
|
|
23
|
+
extended: true,
|
|
24
|
+
},
|
|
25
|
+
name: {},
|
|
26
|
+
}, { ...flags });
|
|
58
27
|
}
|
|
59
28
|
}
|
|
60
29
|
exports.default = ListCommand;
|
|
61
30
|
ListCommand.description = "List Alert Groups in your Organization";
|
|
62
|
-
ListCommand.flags =
|
|
63
|
-
//# sourceMappingURL=list.js.map
|
|
31
|
+
ListCommand.flags = { ...core_1.CliUx.ux.table.flags() };
|
|
@@ -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 ClearCommand 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 ClearCommand extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { args: { monitor }, } = await this.parse(ClearCommand);
|
|
8
|
+
await (0, graphql_1.gqlRequest)({
|
|
9
|
+
document: (0, graphql_1.gql) `
|
|
39
10
|
mutation clearAlertMonitor($id: ID!) {
|
|
40
11
|
clearAlertMonitor(input: { id: $id }) {
|
|
41
12
|
alertMonitor {
|
|
@@ -48,10 +19,9 @@ class ClearCommand extends command_1.Command {
|
|
|
48
19
|
}
|
|
49
20
|
}
|
|
50
21
|
`,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
});
|
|
22
|
+
variables: {
|
|
23
|
+
id: monitor,
|
|
24
|
+
},
|
|
55
25
|
});
|
|
56
26
|
}
|
|
57
27
|
}
|
|
@@ -64,4 +34,3 @@ ClearCommand.args = [
|
|
|
64
34
|
description: "ID of the monitor to clear",
|
|
65
35
|
},
|
|
66
36
|
];
|
|
67
|
-
//# sourceMappingURL=clear.js.map
|
|
@@ -1,45 +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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
const
|
|
32
|
-
const graphql_1 =
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const graphql_1 = require("../../../graphql");
|
|
33
5
|
const fields_1 = require("../../../fields");
|
|
34
|
-
class CreateCommand extends
|
|
35
|
-
run() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
mutation: graphql_1.gql `
|
|
6
|
+
class CreateCommand extends core_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { flags: { name, instance, triggers: triggerJson, duration, "log-severity": logSeverity, groups: groupJson, users: userJson, }, } = await this.parse(CreateCommand);
|
|
9
|
+
const triggers = (0, fields_1.parseJsonOrUndefined)(triggerJson);
|
|
10
|
+
const groups = (0, fields_1.parseJsonOrUndefined)(groupJson);
|
|
11
|
+
const users = (0, fields_1.parseJsonOrUndefined)(userJson);
|
|
12
|
+
const result = await (0, graphql_1.gqlRequest)({
|
|
13
|
+
document: (0, graphql_1.gql) `
|
|
43
14
|
mutation createAlertMonitor(
|
|
44
15
|
$name: String!
|
|
45
16
|
$instance: ID!
|
|
@@ -70,64 +41,62 @@ class CreateCommand extends command_1.Command {
|
|
|
70
41
|
}
|
|
71
42
|
}
|
|
72
43
|
`,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
});
|
|
83
|
-
this.log(result.data.createAlertMonitor.alertMonitor.id);
|
|
44
|
+
variables: {
|
|
45
|
+
name,
|
|
46
|
+
instance,
|
|
47
|
+
triggers,
|
|
48
|
+
logSeverity,
|
|
49
|
+
duration,
|
|
50
|
+
groups,
|
|
51
|
+
users,
|
|
52
|
+
},
|
|
84
53
|
});
|
|
54
|
+
this.log(result.createAlertMonitor.alertMonitor.id);
|
|
85
55
|
}
|
|
86
56
|
}
|
|
87
57
|
exports.default = CreateCommand;
|
|
88
58
|
CreateCommand.description = "Create an Alert Monitor by attaching an Alert Trigger and a set of users and webhooks to an Instance";
|
|
89
59
|
CreateCommand.flags = {
|
|
90
|
-
name:
|
|
60
|
+
name: core_1.Flags.string({
|
|
91
61
|
name: "name",
|
|
92
62
|
char: "n",
|
|
93
63
|
required: true,
|
|
94
64
|
description: "name of the alert monitor to be created",
|
|
95
65
|
}),
|
|
96
|
-
instance:
|
|
66
|
+
instance: core_1.Flags.string({
|
|
97
67
|
name: "instance",
|
|
98
68
|
char: "i",
|
|
99
69
|
required: true,
|
|
100
70
|
description: "ID of the instance to monitor",
|
|
101
71
|
}),
|
|
102
|
-
triggers:
|
|
72
|
+
triggers: core_1.Flags.string({
|
|
103
73
|
name: "triggers",
|
|
104
74
|
char: "t",
|
|
105
75
|
required: true,
|
|
106
76
|
description: "JSON-formatted list of trigger IDs that should trigger this monitor",
|
|
107
77
|
}),
|
|
108
|
-
duration:
|
|
78
|
+
duration: core_1.Flags.integer({
|
|
109
79
|
name: "duration",
|
|
110
80
|
required: false,
|
|
111
81
|
char: "d",
|
|
112
82
|
description: "greatest time allowed (in seconds) for time-based triggers",
|
|
113
83
|
}),
|
|
114
|
-
"log-severity":
|
|
84
|
+
"log-severity": core_1.Flags.integer({
|
|
115
85
|
name: "log-severity",
|
|
116
86
|
required: false,
|
|
117
87
|
char: "s",
|
|
118
88
|
description: "greatest log level {debug, info, warn, error} allowed for log-based triggers",
|
|
119
89
|
}),
|
|
120
|
-
groups:
|
|
90
|
+
groups: core_1.Flags.string({
|
|
121
91
|
required: false,
|
|
122
92
|
name: "groups",
|
|
123
93
|
char: "g",
|
|
124
94
|
description: "JSON-formatted list of group IDs to alert",
|
|
125
95
|
}),
|
|
126
|
-
users:
|
|
96
|
+
users: core_1.Flags.string({
|
|
127
97
|
required: false,
|
|
128
98
|
name: "users",
|
|
129
99
|
char: "u",
|
|
130
100
|
description: "JSON-formatted list of Prismatic user IDs alert",
|
|
131
101
|
}),
|
|
132
102
|
};
|
|
133
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -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 DeleteCommand 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 DeleteCommand extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { args: { monitor }, } = await this.parse(DeleteCommand);
|
|
8
|
+
await (0, graphql_1.gqlRequest)({
|
|
9
|
+
document: (0, graphql_1.gql) `
|
|
39
10
|
mutation deleteAlertMonitor($id: ID!) {
|
|
40
11
|
deleteAlertMonitor(input: { id: $id }) {
|
|
41
12
|
alertMonitor {
|
|
@@ -48,10 +19,9 @@ class DeleteCommand extends command_1.Command {
|
|
|
48
19
|
}
|
|
49
20
|
}
|
|
50
21
|
`,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
});
|
|
22
|
+
variables: {
|
|
23
|
+
id: monitor,
|
|
24
|
+
},
|
|
55
25
|
});
|
|
56
26
|
}
|
|
57
27
|
}
|
|
@@ -64,4 +34,3 @@ DeleteCommand.args = [
|
|
|
64
34
|
description: "ID of the monitor to delete",
|
|
65
35
|
},
|
|
66
36
|
];
|
|
67
|
-
//# sourceMappingURL=delete.js.map
|
|
@@ -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 { flags } = await this.parse(ListCommand);
|
|
8
|
+
const result = await (0, graphql_1.gqlRequest)({
|
|
9
|
+
document: (0, graphql_1.gql) `
|
|
40
10
|
query listAlertMonitors {
|
|
41
11
|
alertMonitors {
|
|
42
12
|
nodes {
|
|
@@ -47,19 +17,17 @@ class ListCommand extends command_1.Command {
|
|
|
47
17
|
}
|
|
48
18
|
}
|
|
49
19
|
`,
|
|
50
|
-
});
|
|
51
|
-
cli_ux_1.cli.table(result.data.alertMonitors.nodes, {
|
|
52
|
-
id: {
|
|
53
|
-
minWidth: 8,
|
|
54
|
-
extended: true,
|
|
55
|
-
},
|
|
56
|
-
name: {},
|
|
57
|
-
triggered: {},
|
|
58
|
-
}, Object.assign({}, flags));
|
|
59
20
|
});
|
|
21
|
+
core_1.CliUx.ux.table(result.alertMonitors.nodes, {
|
|
22
|
+
id: {
|
|
23
|
+
minWidth: 8,
|
|
24
|
+
extended: true,
|
|
25
|
+
},
|
|
26
|
+
name: {},
|
|
27
|
+
triggered: {},
|
|
28
|
+
}, { ...flags });
|
|
60
29
|
}
|
|
61
30
|
}
|
|
62
31
|
exports.default = ListCommand;
|
|
63
32
|
ListCommand.description = "List Alert Monitors for Customer Instances";
|
|
64
|
-
ListCommand.flags =
|
|
65
|
-
//# sourceMappingURL=list.js.map
|
|
33
|
+
ListCommand.flags = { ...core_1.CliUx.ux.table.flags() };
|