@prismatic-io/prism 5.1.0 → 5.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.
|
@@ -0,0 +1,71 @@
|
|
|
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 ListCommand extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { flags } = await this.parse(ListCommand);
|
|
8
|
+
const { customer } = flags;
|
|
9
|
+
let onPremiseResources = [];
|
|
10
|
+
let hasNextPage = true;
|
|
11
|
+
let cursor = "";
|
|
12
|
+
while (hasNextPage) {
|
|
13
|
+
const { onPremiseResources: { nodes, pageInfo }, } = await (0, graphql_1.gqlRequest)({
|
|
14
|
+
document: (0, graphql_1.gql) `
|
|
15
|
+
query listOnPremiseResources($after: String, $customer: ID) {
|
|
16
|
+
onPremiseResources(after: $after, customer: $customer) {
|
|
17
|
+
nodes {
|
|
18
|
+
id
|
|
19
|
+
name
|
|
20
|
+
customer {
|
|
21
|
+
id
|
|
22
|
+
name
|
|
23
|
+
externalId
|
|
24
|
+
}
|
|
25
|
+
port
|
|
26
|
+
status
|
|
27
|
+
}
|
|
28
|
+
pageInfo {
|
|
29
|
+
hasNextPage
|
|
30
|
+
endCursor
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`,
|
|
35
|
+
variables: {
|
|
36
|
+
after: cursor,
|
|
37
|
+
customer,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
onPremiseResources = [...onPremiseResources, ...nodes];
|
|
41
|
+
cursor = pageInfo.endCursor;
|
|
42
|
+
hasNextPage = pageInfo.hasNextPage;
|
|
43
|
+
}
|
|
44
|
+
core_1.ux.table(onPremiseResources, {
|
|
45
|
+
id: {
|
|
46
|
+
minWidth: 8,
|
|
47
|
+
extended: true,
|
|
48
|
+
},
|
|
49
|
+
name: {},
|
|
50
|
+
customerId: { extended: true, get: (row) => { var _a, _b; return (_b = (_a = row.customer) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : ""; } },
|
|
51
|
+
customer: {
|
|
52
|
+
get: (row) => { var _a, _b; return (_b = (_a = row.customer) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : ""; },
|
|
53
|
+
},
|
|
54
|
+
customerExternalId: {
|
|
55
|
+
extended: true,
|
|
56
|
+
get: (row) => { var _a, _b; return (_b = (_a = row.customer) === null || _a === void 0 ? void 0 : _a.externalId) !== null && _b !== void 0 ? _b : ""; },
|
|
57
|
+
},
|
|
58
|
+
port: {},
|
|
59
|
+
status: {},
|
|
60
|
+
}, { ...flags });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.default = ListCommand;
|
|
64
|
+
ListCommand.description = "List On-Premise Resources";
|
|
65
|
+
ListCommand.flags = {
|
|
66
|
+
...core_1.ux.table.flags(),
|
|
67
|
+
customer: core_1.Flags.string({
|
|
68
|
+
char: "c",
|
|
69
|
+
description: "If specified this command returns only On-Premise Resources that are available to the specified customer ID",
|
|
70
|
+
}),
|
|
71
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
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 CreateCommand extends core_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const result = await (0, graphql_1.gqlRequest)({
|
|
8
|
+
document: (0, graphql_1.gql) `
|
|
9
|
+
mutation createOnPremiseResourceJWT {
|
|
10
|
+
createOnPremiseResourceJWT(input: {}) {
|
|
11
|
+
result {
|
|
12
|
+
jwt
|
|
13
|
+
}
|
|
14
|
+
errors {
|
|
15
|
+
field
|
|
16
|
+
messages
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`,
|
|
21
|
+
variables: {},
|
|
22
|
+
});
|
|
23
|
+
this.log(result.createOnPremiseResourceJWT.result.jwt);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = CreateCommand;
|
|
27
|
+
CreateCommand.description = "Create a short-lived JWT that may be used to perform registration of an On-Premise Resource.";
|
|
28
|
+
CreateCommand.flags = {};
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.
|
|
2
|
+
"version": "5.2.0",
|
|
3
3
|
"commands": {
|
|
4
4
|
"login": {
|
|
5
5
|
"id": "login",
|
|
@@ -1142,6 +1142,109 @@
|
|
|
1142
1142
|
},
|
|
1143
1143
|
"args": {}
|
|
1144
1144
|
},
|
|
1145
|
+
"on-prem-resources:list": {
|
|
1146
|
+
"id": "on-prem-resources:list",
|
|
1147
|
+
"description": "List On-Premise Resources",
|
|
1148
|
+
"strict": true,
|
|
1149
|
+
"pluginName": "@prismatic-io/prism",
|
|
1150
|
+
"pluginAlias": "@prismatic-io/prism",
|
|
1151
|
+
"pluginType": "core",
|
|
1152
|
+
"aliases": [],
|
|
1153
|
+
"flags": {
|
|
1154
|
+
"columns": {
|
|
1155
|
+
"name": "columns",
|
|
1156
|
+
"type": "option",
|
|
1157
|
+
"description": "only show provided columns (comma-separated)",
|
|
1158
|
+
"multiple": false,
|
|
1159
|
+
"exclusive": [
|
|
1160
|
+
"extended"
|
|
1161
|
+
]
|
|
1162
|
+
},
|
|
1163
|
+
"sort": {
|
|
1164
|
+
"name": "sort",
|
|
1165
|
+
"type": "option",
|
|
1166
|
+
"description": "property to sort by (prepend '-' for descending)",
|
|
1167
|
+
"multiple": false
|
|
1168
|
+
},
|
|
1169
|
+
"filter": {
|
|
1170
|
+
"name": "filter",
|
|
1171
|
+
"type": "option",
|
|
1172
|
+
"description": "filter property by partial string matching, ex: name=foo",
|
|
1173
|
+
"multiple": false
|
|
1174
|
+
},
|
|
1175
|
+
"csv": {
|
|
1176
|
+
"name": "csv",
|
|
1177
|
+
"type": "boolean",
|
|
1178
|
+
"description": "output is csv format [alias: --output=csv]",
|
|
1179
|
+
"allowNo": false,
|
|
1180
|
+
"exclusive": [
|
|
1181
|
+
"no-truncate"
|
|
1182
|
+
]
|
|
1183
|
+
},
|
|
1184
|
+
"output": {
|
|
1185
|
+
"name": "output",
|
|
1186
|
+
"type": "option",
|
|
1187
|
+
"description": "output in a more machine friendly format",
|
|
1188
|
+
"multiple": false,
|
|
1189
|
+
"options": [
|
|
1190
|
+
"csv",
|
|
1191
|
+
"json",
|
|
1192
|
+
"yaml"
|
|
1193
|
+
],
|
|
1194
|
+
"exclusive": [
|
|
1195
|
+
"no-truncate",
|
|
1196
|
+
"csv"
|
|
1197
|
+
]
|
|
1198
|
+
},
|
|
1199
|
+
"extended": {
|
|
1200
|
+
"name": "extended",
|
|
1201
|
+
"type": "boolean",
|
|
1202
|
+
"char": "x",
|
|
1203
|
+
"description": "show extra columns",
|
|
1204
|
+
"allowNo": false,
|
|
1205
|
+
"exclusive": [
|
|
1206
|
+
"columns"
|
|
1207
|
+
]
|
|
1208
|
+
},
|
|
1209
|
+
"no-truncate": {
|
|
1210
|
+
"name": "no-truncate",
|
|
1211
|
+
"type": "boolean",
|
|
1212
|
+
"description": "do not truncate output to fit screen",
|
|
1213
|
+
"allowNo": false,
|
|
1214
|
+
"exclusive": [
|
|
1215
|
+
"csv"
|
|
1216
|
+
]
|
|
1217
|
+
},
|
|
1218
|
+
"no-header": {
|
|
1219
|
+
"name": "no-header",
|
|
1220
|
+
"type": "boolean",
|
|
1221
|
+
"description": "hide table header from output",
|
|
1222
|
+
"allowNo": false,
|
|
1223
|
+
"exclusive": [
|
|
1224
|
+
"csv"
|
|
1225
|
+
]
|
|
1226
|
+
},
|
|
1227
|
+
"customer": {
|
|
1228
|
+
"name": "customer",
|
|
1229
|
+
"type": "option",
|
|
1230
|
+
"char": "c",
|
|
1231
|
+
"description": "If specified this command returns only On-Premise Resources that are available to the specified customer ID",
|
|
1232
|
+
"multiple": false
|
|
1233
|
+
}
|
|
1234
|
+
},
|
|
1235
|
+
"args": {}
|
|
1236
|
+
},
|
|
1237
|
+
"on-prem-resources:registration-jwt": {
|
|
1238
|
+
"id": "on-prem-resources:registration-jwt",
|
|
1239
|
+
"description": "Create a short-lived JWT that may be used to perform registration of an On-Premise Resource.",
|
|
1240
|
+
"strict": true,
|
|
1241
|
+
"pluginName": "@prismatic-io/prism",
|
|
1242
|
+
"pluginAlias": "@prismatic-io/prism",
|
|
1243
|
+
"pluginType": "core",
|
|
1244
|
+
"aliases": [],
|
|
1245
|
+
"flags": {},
|
|
1246
|
+
"args": {}
|
|
1247
|
+
},
|
|
1145
1248
|
"organization:update": {
|
|
1146
1249
|
"id": "organization:update",
|
|
1147
1250
|
"description": "Update your Organization",
|