@prismatic-io/prism 5.2.10 → 6.0.0-preview1
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/lib/index.js +32973 -5
- package/lib/run.js +365 -0
- package/lib/templates/action/action.ts.ejs +33 -0
- package/lib/templates/component/assets/icon.png.ejs +0 -0
- package/lib/templates/component/jest.config.js.ejs +4 -0
- package/lib/templates/component/package.json.ejs +6 -0
- package/lib/templates/component/src/client.ts.ejs +10 -0
- package/lib/templates/component/src/index.test.ts.ejs +47 -0
- package/lib/templates/component/src/index.ts.ejs +19 -0
- package/lib/templates/component/tsconfig.json.ejs +12 -0
- package/lib/templates/component/webpack.config.js.ejs +36 -0
- package/lib/templates/connection/basic.ts.ejs +25 -0
- package/lib/templates/connection/oauth.ts.ejs +65 -0
- package/lib/templates/dataSource/dataSource.ts.ejs +34 -0
- package/lib/templates/flow/flow.ts.ejs +37 -0
- package/lib/templates/formats/assets/icon.png.ejs +0 -0
- package/lib/templates/formats/jest.config.js.ejs +4 -0
- package/lib/templates/formats/tsconfig.json.ejs +12 -0
- package/lib/templates/formats/webpack.config.js.ejs +36 -0
- package/lib/templates/integration/assets/icon.png.ejs +0 -0
- package/lib/templates/integration/basic.ts.ejs +29 -0
- package/lib/templates/integration/jest.config.js.ejs +4 -0
- package/lib/templates/integration/oauth.ts.ejs +69 -0
- package/lib/templates/integration/package.json.ejs +6 -0
- package/lib/templates/integration/src/client.ts.ejs +10 -0
- package/lib/templates/integration/src/index.test.ts.ejs +18 -0
- package/lib/templates/integration/src/index.ts.ejs +11 -0
- package/lib/templates/integration/tsconfig.json.ejs +12 -0
- package/lib/templates/integration/webpack.config.js.ejs +36 -0
- package/lib/templates/trigger/trigger.ts.ejs +19 -0
- package/oclif.manifest.json +3153 -2451
- package/package.json +56 -60
- package/bin/run +0 -12
- package/lib/auth.js +0 -323
- package/lib/commands/alerts/events/list.js +0 -56
- package/lib/commands/alerts/groups/create.js +0 -58
- package/lib/commands/alerts/groups/delete.js +0 -35
- package/lib/commands/alerts/groups/list.js +0 -44
- package/lib/commands/alerts/monitors/clear.js +0 -35
- package/lib/commands/alerts/monitors/create.js +0 -102
- package/lib/commands/alerts/monitors/delete.js +0 -35
- package/lib/commands/alerts/monitors/list.js +0 -63
- package/lib/commands/alerts/triggers/list.js +0 -31
- package/lib/commands/alerts/webhooks/create.js +0 -67
- package/lib/commands/alerts/webhooks/delete.js +0 -35
- package/lib/commands/alerts/webhooks/list.js +0 -57
- package/lib/commands/components/actions/list.js +0 -96
- package/lib/commands/components/data-sources/list.js +0 -114
- package/lib/commands/components/delete.js +0 -35
- package/lib/commands/components/dev/run.js +0 -83
- package/lib/commands/components/dev/test.js +0 -266
- package/lib/commands/components/init/action.js +0 -12
- package/lib/commands/components/init/component.js +0 -12
- package/lib/commands/components/init/connection.js +0 -12
- package/lib/commands/components/init/dataSource.js +0 -12
- package/lib/commands/components/init/index.js +0 -126
- package/lib/commands/components/init/trigger.js +0 -12
- package/lib/commands/components/list.js +0 -95
- package/lib/commands/components/publish.js +0 -62
- package/lib/commands/components/triggers/list.js +0 -96
- package/lib/commands/customers/create.js +0 -72
- package/lib/commands/customers/credentials/create.js +0 -68
- package/lib/commands/customers/credentials/delete.js +0 -35
- package/lib/commands/customers/credentials/list.js +0 -56
- package/lib/commands/customers/credentials/update.js +0 -58
- package/lib/commands/customers/delete.js +0 -35
- package/lib/commands/customers/list.js +0 -51
- package/lib/commands/customers/update.js +0 -82
- package/lib/commands/customers/users/create.js +0 -67
- package/lib/commands/customers/users/delete.js +0 -35
- package/lib/commands/customers/users/list.js +0 -65
- package/lib/commands/customers/users/roles.js +0 -33
- package/lib/commands/customers/users/update.js +0 -76
- package/lib/commands/executions/step-result/get.js +0 -73
- package/lib/commands/instances/config-vars/list.js +0 -83
- package/lib/commands/instances/create.js +0 -84
- package/lib/commands/instances/delete.js +0 -35
- package/lib/commands/instances/deploy.js +0 -43
- package/lib/commands/instances/disable.js +0 -36
- package/lib/commands/instances/enable.js +0 -36
- package/lib/commands/instances/flow-configs/list.js +0 -62
- package/lib/commands/instances/flow-configs/test.js +0 -127
- package/lib/commands/instances/list.js +0 -86
- package/lib/commands/instances/update.js +0 -99
- package/lib/commands/integrations/available.js +0 -47
- package/lib/commands/integrations/create.js +0 -58
- package/lib/commands/integrations/delete.js +0 -35
- package/lib/commands/integrations/export.js +0 -29
- package/lib/commands/integrations/flows/list.js +0 -61
- package/lib/commands/integrations/flows/test.js +0 -124
- package/lib/commands/integrations/fork.js +0 -56
- package/lib/commands/integrations/import.js +0 -54
- package/lib/commands/integrations/init/flow.js +0 -12
- package/lib/commands/integrations/init/index.js +0 -45
- package/lib/commands/integrations/init/integration.js +0 -12
- package/lib/commands/integrations/list.js +0 -96
- package/lib/commands/integrations/marketplace.js +0 -80
- package/lib/commands/integrations/open.js +0 -18
- package/lib/commands/integrations/publish.js +0 -44
- package/lib/commands/integrations/update.js +0 -75
- package/lib/commands/integrations/versions/index.js +0 -83
- package/lib/commands/login.js +0 -33
- package/lib/commands/logout.js +0 -23
- package/lib/commands/logs/severities/list.js +0 -29
- package/lib/commands/me/index.js +0 -22
- package/lib/commands/me/token/revoke.js +0 -12
- package/lib/commands/me/token.js +0 -25
- package/lib/commands/on-prem-resources/delete.js +0 -35
- package/lib/commands/on-prem-resources/list.js +0 -69
- package/lib/commands/on-prem-resources/registration-jwt.js +0 -81
- package/lib/commands/organization/credentials/create.js +0 -60
- package/lib/commands/organization/credentials/delete.js +0 -35
- package/lib/commands/organization/credentials/list.js +0 -45
- package/lib/commands/organization/credentials/update.js +0 -58
- package/lib/commands/organization/signingKeys/delete.js +0 -35
- package/lib/commands/organization/signingKeys/generate.js +0 -22
- package/lib/commands/organization/signingKeys/import.js +0 -40
- package/lib/commands/organization/signingKeys/list.js +0 -36
- package/lib/commands/organization/update.js +0 -37
- package/lib/commands/organization/updateAvatarUrl.js +0 -47
- package/lib/commands/organization/users/create.js +0 -51
- package/lib/commands/organization/users/delete.js +0 -35
- package/lib/commands/organization/users/list.js +0 -60
- package/lib/commands/organization/users/roles.js +0 -33
- package/lib/commands/organization/users/update.js +0 -66
- package/lib/commands/translations/list.js +0 -35
- package/lib/config.js +0 -39
- package/lib/errors.js +0 -55
- package/lib/fields.js +0 -12
- package/lib/fs.js +0 -23
- package/lib/generate/action.js +0 -208
- package/lib/generate/index.js +0 -54
- package/lib/generate/input.js +0 -93
- package/lib/generate/parse.js +0 -59
- package/lib/generate/sourceFile.js +0 -90
- package/lib/generate/util.js +0 -17
- package/lib/graphql.js +0 -42
- package/lib/queries.graphql.js +0 -43
- package/lib/types.js +0 -6
- package/lib/utils/avatar.js +0 -48
- package/lib/utils/component/deleteByKey.js +0 -36
- package/lib/utils/component/publish.js +0 -247
- package/lib/utils/component/query.js +0 -23
- package/lib/utils/date.js +0 -14
- package/lib/utils/execution/logs.js +0 -86
- package/lib/utils/execution/stepResults.js +0 -87
- package/lib/utils/generate.js +0 -50
- package/lib/utils/import.js +0 -21
- package/lib/utils/integration/definition.js +0 -101
- package/lib/utils/integration/export.js +0 -36
- package/lib/utils/integration/import.js +0 -179
- package/lib/utils/integration/invoke.js +0 -81
- package/lib/utils/integration/open.js +0 -37
- package/lib/utils/integration/query.js +0 -59
- package/lib/utils/process.js +0 -15
- package/lib/utils/serialize.js +0 -8
- package/lib/utils/translations/processDataForTranslations.js +0 -132
- package/lib/utils/user/query.js +0 -26
- package/lib/yeoman.js +0 -27
- /package/{bin → lib}/run.cmd +0 -0
package/lib/commands/me/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const core_1 = require("@oclif/core");
|
|
4
|
-
const auth_1 = require("../../auth");
|
|
5
|
-
const query_1 = require("../../utils/user/query");
|
|
6
|
-
class WhoAmICommand extends core_1.Command {
|
|
7
|
-
async run() {
|
|
8
|
-
const me = await (0, query_1.whoAmI)();
|
|
9
|
-
const { name, email, org, customer } = me;
|
|
10
|
-
this.log("Name:", name);
|
|
11
|
-
this.log("Email:", email);
|
|
12
|
-
if (org) {
|
|
13
|
-
this.log("Organization:", org.name);
|
|
14
|
-
}
|
|
15
|
-
else if (customer) {
|
|
16
|
-
this.log("Customer:", customer.name);
|
|
17
|
-
}
|
|
18
|
-
this.log("Endpoint URL:", auth_1.prismaticUrl);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.default = WhoAmICommand;
|
|
22
|
-
WhoAmICommand.description = "Print your user profile information";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const core_1 = require("@oclif/core");
|
|
4
|
-
const auth_1 = require("../../../auth");
|
|
5
|
-
class PrintTokenCommand extends core_1.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
await (0, auth_1.revokeRefreshToken)();
|
|
8
|
-
this.log("All refresh tokens for your user have been revoked.");
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.default = PrintTokenCommand;
|
|
12
|
-
PrintTokenCommand.description = "Revoke all refresh tokens for your user";
|
package/lib/commands/me/token.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const core_1 = require("@oclif/core");
|
|
4
|
-
const auth_1 = require("../../auth");
|
|
5
|
-
const config_1 = require("../../config");
|
|
6
|
-
class PrintTokenCommand extends core_1.Command {
|
|
7
|
-
async run() {
|
|
8
|
-
const { flags: { type: tokenType }, } = await this.parse(PrintTokenCommand);
|
|
9
|
-
//refresh before logging token
|
|
10
|
-
await (0, auth_1.getAccessToken)();
|
|
11
|
-
const config = await (0, config_1.readConfig)();
|
|
12
|
-
const token = tokenType === "access" ? config === null || config === void 0 ? void 0 : config.accessToken : config === null || config === void 0 ? void 0 : config.refreshToken;
|
|
13
|
-
this.log(token);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.default = PrintTokenCommand;
|
|
17
|
-
PrintTokenCommand.description = "Print your authorization tokens";
|
|
18
|
-
PrintTokenCommand.flags = {
|
|
19
|
-
type: core_1.Flags.string({
|
|
20
|
-
char: "t",
|
|
21
|
-
description: "Which token type to print",
|
|
22
|
-
options: ["access", "refresh"],
|
|
23
|
-
default: "access",
|
|
24
|
-
}),
|
|
25
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
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
|
-
}
|
|
27
|
-
pageInfo {
|
|
28
|
-
hasNextPage
|
|
29
|
-
endCursor
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
`,
|
|
34
|
-
variables: {
|
|
35
|
-
after: cursor,
|
|
36
|
-
customer,
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
onPremiseResources = [...onPremiseResources, ...nodes];
|
|
40
|
-
cursor = pageInfo.endCursor;
|
|
41
|
-
hasNextPage = pageInfo.hasNextPage;
|
|
42
|
-
}
|
|
43
|
-
core_1.ux.table(onPremiseResources, {
|
|
44
|
-
id: {
|
|
45
|
-
minWidth: 8,
|
|
46
|
-
extended: true,
|
|
47
|
-
},
|
|
48
|
-
name: {},
|
|
49
|
-
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 : ""; } },
|
|
50
|
-
customer: {
|
|
51
|
-
get: (row) => { var _a, _b; return (_b = (_a = row.customer) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : ""; },
|
|
52
|
-
},
|
|
53
|
-
customerExternalId: {
|
|
54
|
-
extended: true,
|
|
55
|
-
get: (row) => { var _a, _b; return (_b = (_a = row.customer) === null || _a === void 0 ? void 0 : _a.externalId) !== null && _b !== void 0 ? _b : ""; },
|
|
56
|
-
},
|
|
57
|
-
port: {},
|
|
58
|
-
}, { ...flags });
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.default = ListCommand;
|
|
62
|
-
ListCommand.description = "List On-Premise Resources";
|
|
63
|
-
ListCommand.flags = {
|
|
64
|
-
...core_1.ux.table.flags(),
|
|
65
|
-
customer: core_1.Flags.string({
|
|
66
|
-
char: "c",
|
|
67
|
-
description: "If specified this command returns only On-Premise Resources that are available to the specified customer ID",
|
|
68
|
-
}),
|
|
69
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
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 { flags: { customerId, resourceId, rotate }, } = await this.parse(CreateCommand);
|
|
8
|
-
if (rotate) {
|
|
9
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
10
|
-
document: (0, graphql_1.gql) `
|
|
11
|
-
mutation rotateOnPremiseResourceJWT(
|
|
12
|
-
$customerId: ID
|
|
13
|
-
$resourceId: ID
|
|
14
|
-
) {
|
|
15
|
-
rotateOnPremiseResourceJWT(
|
|
16
|
-
input: { customerId: $customerId, resourceId: $resourceId }
|
|
17
|
-
) {
|
|
18
|
-
result {
|
|
19
|
-
jwt
|
|
20
|
-
}
|
|
21
|
-
errors {
|
|
22
|
-
field
|
|
23
|
-
messages
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
`,
|
|
28
|
-
variables: {
|
|
29
|
-
customerId,
|
|
30
|
-
resourceId,
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
this.log(result.rotateOnPremiseResourceJWT.result.jwt);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
37
|
-
document: (0, graphql_1.gql) `
|
|
38
|
-
mutation createOnPremiseResourceJWT(
|
|
39
|
-
$customerId: ID
|
|
40
|
-
$resourceId: ID
|
|
41
|
-
) {
|
|
42
|
-
createOnPremiseResourceJWT(
|
|
43
|
-
input: { customerId: $customerId, resourceId: $resourceId }
|
|
44
|
-
) {
|
|
45
|
-
result {
|
|
46
|
-
jwt
|
|
47
|
-
}
|
|
48
|
-
errors {
|
|
49
|
-
field
|
|
50
|
-
messages
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`,
|
|
55
|
-
variables: {
|
|
56
|
-
customerId,
|
|
57
|
-
resourceId,
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
this.log(result.createOnPremiseResourceJWT.result.jwt);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.default = CreateCommand;
|
|
65
|
-
CreateCommand.description = "Create a JWT that may be used to register an On-Premise Resource.";
|
|
66
|
-
CreateCommand.flags = {
|
|
67
|
-
customerId: core_1.Flags.string({
|
|
68
|
-
char: "c",
|
|
69
|
-
required: false,
|
|
70
|
-
description: "The ID of the customer for which to create the JWT. Only valid when authenticated as an Organization user.",
|
|
71
|
-
}),
|
|
72
|
-
resourceId: core_1.Flags.string({
|
|
73
|
-
char: "r",
|
|
74
|
-
required: false,
|
|
75
|
-
description: "An optional ID of an existing On-Premise Resource for which to generate a new JWT.",
|
|
76
|
-
}),
|
|
77
|
-
rotate: core_1.Flags.boolean({
|
|
78
|
-
required: false,
|
|
79
|
-
description: "Invalidate all JWTs for the On-Premise Resource and get a new JWT.",
|
|
80
|
-
}),
|
|
81
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const core_1 = require("@oclif/core");
|
|
4
|
-
const fields_1 = require("../../../fields");
|
|
5
|
-
const graphql_1 = require("../../../graphql");
|
|
6
|
-
class CreateCommand extends core_1.Command {
|
|
7
|
-
async run() {
|
|
8
|
-
const { flags: { label, "authorization-method": authorizationMethod, fields }, } = await this.parse(CreateCommand);
|
|
9
|
-
const values = (0, fields_1.toValues)(fields);
|
|
10
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
11
|
-
document: (0, graphql_1.gql) `
|
|
12
|
-
mutation createOrganizationCredential(
|
|
13
|
-
$label: String!
|
|
14
|
-
$authorizationMethod: ID!
|
|
15
|
-
$values: [InputCredentialFieldValue]
|
|
16
|
-
) {
|
|
17
|
-
createOrganizationCredential(
|
|
18
|
-
input: {
|
|
19
|
-
label: $label
|
|
20
|
-
authorizationMethod: $authorizationMethod
|
|
21
|
-
values: $values
|
|
22
|
-
}
|
|
23
|
-
) {
|
|
24
|
-
errors {
|
|
25
|
-
field
|
|
26
|
-
messages
|
|
27
|
-
}
|
|
28
|
-
credential {
|
|
29
|
-
id
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
`,
|
|
34
|
-
variables: {
|
|
35
|
-
label,
|
|
36
|
-
authorizationMethod,
|
|
37
|
-
values,
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
this.log(result.createOrganizationCredential.credential.id);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.default = CreateCommand;
|
|
44
|
-
CreateCommand.description = "Create a set of Organization-level Credentials for use by Instance Actions";
|
|
45
|
-
CreateCommand.flags = {
|
|
46
|
-
label: core_1.Flags.string({
|
|
47
|
-
char: "l",
|
|
48
|
-
required: true,
|
|
49
|
-
description: "name to give the new credentials",
|
|
50
|
-
}),
|
|
51
|
-
"authorization-method": core_1.Flags.string({
|
|
52
|
-
char: "a",
|
|
53
|
-
required: true,
|
|
54
|
-
description: "ID of the authorization method",
|
|
55
|
-
}),
|
|
56
|
-
fields: core_1.Flags.string({
|
|
57
|
-
char: "f",
|
|
58
|
-
description: "username, password, etc., in JSON format",
|
|
59
|
-
}),
|
|
60
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
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: { credential }, } = await this.parse(DeleteCommand);
|
|
8
|
-
await (0, graphql_1.gqlRequest)({
|
|
9
|
-
document: (0, graphql_1.gql) `
|
|
10
|
-
mutation deleteCredential($id: ID!) {
|
|
11
|
-
deleteCredential(input: { id: $id }) {
|
|
12
|
-
credential {
|
|
13
|
-
id
|
|
14
|
-
}
|
|
15
|
-
errors {
|
|
16
|
-
field
|
|
17
|
-
messages
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`,
|
|
22
|
-
variables: {
|
|
23
|
-
id: credential,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.default = DeleteCommand;
|
|
29
|
-
DeleteCommand.description = "Delete an Organization Credential";
|
|
30
|
-
DeleteCommand.args = {
|
|
31
|
-
credential: core_1.Args.string({
|
|
32
|
-
required: true,
|
|
33
|
-
description: "ID of the credential to delete",
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
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 result = await (0, graphql_1.gqlRequest)({
|
|
9
|
-
document: (0, graphql_1.gql) `
|
|
10
|
-
query listOrganizationCredentials {
|
|
11
|
-
organization {
|
|
12
|
-
credentials {
|
|
13
|
-
nodes {
|
|
14
|
-
id
|
|
15
|
-
label
|
|
16
|
-
authorizationMethod {
|
|
17
|
-
id
|
|
18
|
-
label
|
|
19
|
-
}
|
|
20
|
-
readyForUse
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
`,
|
|
26
|
-
});
|
|
27
|
-
core_1.ux.table(result.organization.credentials.nodes, {
|
|
28
|
-
id: {
|
|
29
|
-
minWidth: 8,
|
|
30
|
-
extended: true,
|
|
31
|
-
},
|
|
32
|
-
label: {},
|
|
33
|
-
authorizationMethod: {
|
|
34
|
-
header: "Authorization Method",
|
|
35
|
-
get: (row) => row.authorizationMethod.label,
|
|
36
|
-
},
|
|
37
|
-
readyForUse: {
|
|
38
|
-
header: "Ready for Use",
|
|
39
|
-
},
|
|
40
|
-
}, { ...flags });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.default = ListCommand;
|
|
44
|
-
ListCommand.description = "List Credentials available to the entire Organization";
|
|
45
|
-
ListCommand.flags = { ...core_1.ux.table.flags() };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const core_1 = require("@oclif/core");
|
|
4
|
-
const fields_1 = require("../../../fields");
|
|
5
|
-
const graphql_1 = require("../../../graphql");
|
|
6
|
-
class UpdateCommand extends core_1.Command {
|
|
7
|
-
async run() {
|
|
8
|
-
const { args: { credential }, flags: { label, fields }, } = await this.parse(UpdateCommand);
|
|
9
|
-
const values = (0, fields_1.toValues)(fields);
|
|
10
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
11
|
-
document: (0, graphql_1.gql) `
|
|
12
|
-
mutation updateCustomerCredential(
|
|
13
|
-
$label: String!
|
|
14
|
-
$values: [InputCredentialFieldValue]!
|
|
15
|
-
$credential: ID!
|
|
16
|
-
) {
|
|
17
|
-
updateCredential(
|
|
18
|
-
input: { label: $label, values: $values, id: $credential }
|
|
19
|
-
) {
|
|
20
|
-
errors {
|
|
21
|
-
field
|
|
22
|
-
messages
|
|
23
|
-
}
|
|
24
|
-
credential {
|
|
25
|
-
id
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
`,
|
|
30
|
-
variables: {
|
|
31
|
-
credential,
|
|
32
|
-
label,
|
|
33
|
-
values,
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
this.log(result.updateCredential.credential.id);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.default = UpdateCommand;
|
|
40
|
-
UpdateCommand.description = "Update a Customer-specific Credential for use by Instance Actions";
|
|
41
|
-
UpdateCommand.args = {
|
|
42
|
-
credential: core_1.Args.string({
|
|
43
|
-
required: true,
|
|
44
|
-
description: "ID of a credential",
|
|
45
|
-
}),
|
|
46
|
-
};
|
|
47
|
-
UpdateCommand.flags = {
|
|
48
|
-
label: core_1.Flags.string({
|
|
49
|
-
char: "l",
|
|
50
|
-
required: true,
|
|
51
|
-
description: "new name to give the credential",
|
|
52
|
-
}),
|
|
53
|
-
fields: core_1.Flags.string({
|
|
54
|
-
char: "f",
|
|
55
|
-
required: true,
|
|
56
|
-
description: "username, password, etc., in JSON format",
|
|
57
|
-
}),
|
|
58
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
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: { signingKeyId }, } = await this.parse(DeleteCommand);
|
|
8
|
-
await (0, graphql_1.gqlRequest)({
|
|
9
|
-
document: (0, graphql_1.gql) `
|
|
10
|
-
mutation ($id: ID!) {
|
|
11
|
-
deleteOrganizationSigningKey(input: { id: $id }) {
|
|
12
|
-
organizationSigningKey {
|
|
13
|
-
id
|
|
14
|
-
}
|
|
15
|
-
errors {
|
|
16
|
-
field
|
|
17
|
-
messages
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`,
|
|
22
|
-
variables: {
|
|
23
|
-
id: signingKeyId,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.default = DeleteCommand;
|
|
29
|
-
DeleteCommand.description = "Delete an embedded marketplace signing key";
|
|
30
|
-
DeleteCommand.args = {
|
|
31
|
-
signingKeyId: core_1.Args.string({
|
|
32
|
-
required: true,
|
|
33
|
-
description: "ID of the signing key to delete",
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
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 GenerateCommand extends core_1.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
8
|
-
document: (0, graphql_1.gql) `
|
|
9
|
-
mutation generateSigningKey {
|
|
10
|
-
createOrganizationSigningKey(input: {}) {
|
|
11
|
-
result {
|
|
12
|
-
privateKey
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
`,
|
|
17
|
-
});
|
|
18
|
-
this.log(result.createOrganizationSigningKey.result.privateKey);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.default = GenerateCommand;
|
|
22
|
-
GenerateCommand.description = "Generate an embedded marketplace signing key";
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const core_1 = require("@oclif/core");
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
const graphql_1 = require("../../../graphql");
|
|
6
|
-
class ImportCommand extends core_1.Command {
|
|
7
|
-
async run() {
|
|
8
|
-
const { flags: { "public-key-file": publicKeyFile }, } = await this.parse(ImportCommand);
|
|
9
|
-
const publicKey = await (0, fs_1.readFileSync)(publicKeyFile, {
|
|
10
|
-
encoding: "utf-8",
|
|
11
|
-
flag: "r",
|
|
12
|
-
});
|
|
13
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
14
|
-
document: (0, graphql_1.gql) `
|
|
15
|
-
mutation importPublicKey($publicKey: String!) {
|
|
16
|
-
importOrganizationSigningKey(input: { publicKey: $publicKey }) {
|
|
17
|
-
organizationSigningKey {
|
|
18
|
-
id
|
|
19
|
-
}
|
|
20
|
-
errors {
|
|
21
|
-
field
|
|
22
|
-
messages
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
`,
|
|
27
|
-
variables: { publicKey },
|
|
28
|
-
});
|
|
29
|
-
this.log(result.importOrganizationSigningKey.organizationSigningKey.id);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.default = ImportCommand;
|
|
33
|
-
ImportCommand.description = "Import a RSA public key for use with embedded marketplace";
|
|
34
|
-
ImportCommand.flags = {
|
|
35
|
-
"public-key-file": core_1.Flags.string({
|
|
36
|
-
char: "p",
|
|
37
|
-
required: true,
|
|
38
|
-
description: "public key file",
|
|
39
|
-
}),
|
|
40
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
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 result = await (0, graphql_1.gqlRequest)({
|
|
9
|
-
document: (0, graphql_1.gql) `
|
|
10
|
-
query listOrganizationSigningKeys {
|
|
11
|
-
organization {
|
|
12
|
-
signingKeys {
|
|
13
|
-
nodes {
|
|
14
|
-
id
|
|
15
|
-
publicKey
|
|
16
|
-
privateKeyPreview
|
|
17
|
-
issuedAt
|
|
18
|
-
imported
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
`,
|
|
24
|
-
});
|
|
25
|
-
core_1.ux.table(result.organization.signingKeys.nodes, {
|
|
26
|
-
id: { minWidth: 8, extended: true },
|
|
27
|
-
privateKeyPreview: { header: "Private Key Preview" },
|
|
28
|
-
publicKey: { header: "Public Key", extended: true },
|
|
29
|
-
issuedAt: { header: "Timestamp" },
|
|
30
|
-
imported: { header: "Imported?" },
|
|
31
|
-
}, { ...flags });
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.default = ListCommand;
|
|
35
|
-
ListCommand.description = "List embedded signing keys for embedded marketplace";
|
|
36
|
-
ListCommand.flags = { ...core_1.ux.table.flags() };
|
|
@@ -1,37 +0,0 @@
|
|
|
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 UpdateCommand extends core_1.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
const { flags: { name }, } = await this.parse(UpdateCommand);
|
|
8
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
9
|
-
document: (0, graphql_1.gql) `
|
|
10
|
-
mutation updateOrganization($name: String) {
|
|
11
|
-
updateOrganization(input: { name: $name }) {
|
|
12
|
-
organization {
|
|
13
|
-
id
|
|
14
|
-
}
|
|
15
|
-
errors {
|
|
16
|
-
field
|
|
17
|
-
messages
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`,
|
|
22
|
-
variables: {
|
|
23
|
-
name,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
this.log(result.updateOrganization.organization.id);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.default = UpdateCommand;
|
|
30
|
-
// TODO: Add more flags once optional updates are implemented
|
|
31
|
-
UpdateCommand.description = "Update your Organization";
|
|
32
|
-
UpdateCommand.flags = {
|
|
33
|
-
name: core_1.Flags.string({
|
|
34
|
-
char: "n",
|
|
35
|
-
description: "name of the organization",
|
|
36
|
-
}),
|
|
37
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
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 UpdateAvatarUrlCommand extends core_1.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
const { flags: { organizationId, avatarUrl }, } = await this.parse(UpdateAvatarUrlCommand);
|
|
8
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
9
|
-
document: (0, graphql_1.gql) `
|
|
10
|
-
mutation commitAvatarUpload($organizationId: ID!, $avatarUrl: String!) {
|
|
11
|
-
updateOrganization(
|
|
12
|
-
input: { id: $organizationId, avatarUrl: $avatarUrl }
|
|
13
|
-
) {
|
|
14
|
-
organization {
|
|
15
|
-
id
|
|
16
|
-
avatarUrl
|
|
17
|
-
}
|
|
18
|
-
errors {
|
|
19
|
-
field
|
|
20
|
-
messages
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
`,
|
|
25
|
-
variables: {
|
|
26
|
-
organizationId,
|
|
27
|
-
avatarUrl,
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
this.log(result.updateOrganization.organization.id);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.default = UpdateAvatarUrlCommand;
|
|
34
|
-
// TODO: Add more flags once optional updates are implemented
|
|
35
|
-
UpdateAvatarUrlCommand.description = "Update your Organization Avatar URL";
|
|
36
|
-
UpdateAvatarUrlCommand.flags = {
|
|
37
|
-
organizationId: core_1.Flags.string({
|
|
38
|
-
name: "organization",
|
|
39
|
-
required: true,
|
|
40
|
-
description: "ID of an organization",
|
|
41
|
-
}),
|
|
42
|
-
avatarUrl: core_1.Flags.string({
|
|
43
|
-
char: "n",
|
|
44
|
-
required: false,
|
|
45
|
-
description: "Url of the organization avatar",
|
|
46
|
-
}),
|
|
47
|
-
};
|