@prismatic-io/prism 5.2.2 → 5.2.4
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.
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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: { resource }, } = await this.parse(DeleteCommand);
|
|
8
|
+
await (0, graphql_1.gqlRequest)({
|
|
9
|
+
document: (0, graphql_1.gql) `
|
|
10
|
+
mutation deleteOnPremiseResource($id: ID!) {
|
|
11
|
+
deleteOnPremiseResource(input: { id: $id }) {
|
|
12
|
+
onPremiseResource {
|
|
13
|
+
id
|
|
14
|
+
}
|
|
15
|
+
errors {
|
|
16
|
+
field
|
|
17
|
+
messages
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`,
|
|
22
|
+
variables: {
|
|
23
|
+
id: resource,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.default = DeleteCommand;
|
|
29
|
+
DeleteCommand.description = "Delete an On-Premise Resource";
|
|
30
|
+
DeleteCommand.args = {
|
|
31
|
+
resource: core_1.Args.string({
|
|
32
|
+
required: true,
|
|
33
|
+
description: "ID of the On-Premise Resource to delete",
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
@@ -4,10 +4,13 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const graphql_1 = require("../../graphql");
|
|
5
5
|
class CreateCommand extends core_1.Command {
|
|
6
6
|
async run() {
|
|
7
|
+
const { flags: { customerId, resourceId }, } = await this.parse(CreateCommand);
|
|
7
8
|
const result = await (0, graphql_1.gqlRequest)({
|
|
8
9
|
document: (0, graphql_1.gql) `
|
|
9
|
-
mutation createOnPremiseResourceJWT {
|
|
10
|
-
createOnPremiseResourceJWT(
|
|
10
|
+
mutation createOnPremiseResourceJWT($customerId: ID, $resourceId: ID) {
|
|
11
|
+
createOnPremiseResourceJWT(
|
|
12
|
+
input: { customerId: $customerId, resourceId: $resourceId }
|
|
13
|
+
) {
|
|
11
14
|
result {
|
|
12
15
|
jwt
|
|
13
16
|
}
|
|
@@ -18,11 +21,25 @@ class CreateCommand extends core_1.Command {
|
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
`,
|
|
21
|
-
variables: {
|
|
24
|
+
variables: {
|
|
25
|
+
customerId,
|
|
26
|
+
resourceId,
|
|
27
|
+
},
|
|
22
28
|
});
|
|
23
29
|
this.log(result.createOnPremiseResourceJWT.result.jwt);
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
32
|
exports.default = CreateCommand;
|
|
27
33
|
CreateCommand.description = "Create a short-lived JWT that may be used to perform registration of an On-Premise Resource.";
|
|
28
|
-
CreateCommand.flags = {
|
|
34
|
+
CreateCommand.flags = {
|
|
35
|
+
customerId: core_1.Flags.string({
|
|
36
|
+
char: "c",
|
|
37
|
+
required: false,
|
|
38
|
+
description: "The ID of the customer for which to create the JWT. Only valid when authenticated as an Organization user.",
|
|
39
|
+
}),
|
|
40
|
+
resourceId: core_1.Flags.string({
|
|
41
|
+
char: "r",
|
|
42
|
+
required: false,
|
|
43
|
+
description: "An optional ID of an existing On-Premise Resource for which to generate a new JWT.",
|
|
44
|
+
}),
|
|
45
|
+
};
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.2.
|
|
2
|
+
"version": "5.2.4",
|
|
3
3
|
"commands": {
|
|
4
4
|
"login": {
|
|
5
5
|
"id": "login",
|
|
@@ -1156,6 +1156,23 @@
|
|
|
1156
1156
|
},
|
|
1157
1157
|
"args": {}
|
|
1158
1158
|
},
|
|
1159
|
+
"on-prem-resources:delete": {
|
|
1160
|
+
"id": "on-prem-resources:delete",
|
|
1161
|
+
"description": "Delete an On-Premise Resource",
|
|
1162
|
+
"strict": true,
|
|
1163
|
+
"pluginName": "@prismatic-io/prism",
|
|
1164
|
+
"pluginAlias": "@prismatic-io/prism",
|
|
1165
|
+
"pluginType": "core",
|
|
1166
|
+
"aliases": [],
|
|
1167
|
+
"flags": {},
|
|
1168
|
+
"args": {
|
|
1169
|
+
"resource": {
|
|
1170
|
+
"name": "resource",
|
|
1171
|
+
"description": "ID of the On-Premise Resource to delete",
|
|
1172
|
+
"required": true
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
},
|
|
1159
1176
|
"on-prem-resources:list": {
|
|
1160
1177
|
"id": "on-prem-resources:list",
|
|
1161
1178
|
"description": "List On-Premise Resources",
|
|
@@ -1256,7 +1273,24 @@
|
|
|
1256
1273
|
"pluginAlias": "@prismatic-io/prism",
|
|
1257
1274
|
"pluginType": "core",
|
|
1258
1275
|
"aliases": [],
|
|
1259
|
-
"flags": {
|
|
1276
|
+
"flags": {
|
|
1277
|
+
"customerId": {
|
|
1278
|
+
"name": "customerId",
|
|
1279
|
+
"type": "option",
|
|
1280
|
+
"char": "c",
|
|
1281
|
+
"description": "The ID of the customer for which to create the JWT. Only valid when authenticated as an Organization user.",
|
|
1282
|
+
"required": false,
|
|
1283
|
+
"multiple": false
|
|
1284
|
+
},
|
|
1285
|
+
"resourceId": {
|
|
1286
|
+
"name": "resourceId",
|
|
1287
|
+
"type": "option",
|
|
1288
|
+
"char": "r",
|
|
1289
|
+
"description": "An optional ID of an existing On-Premise Resource for which to generate a new JWT.",
|
|
1290
|
+
"required": false,
|
|
1291
|
+
"multiple": false
|
|
1292
|
+
}
|
|
1293
|
+
},
|
|
1260
1294
|
"args": {}
|
|
1261
1295
|
},
|
|
1262
1296
|
"organization:update": {
|