@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
|
@@ -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: { user }, } = await this.parse(DeleteCommand);
|
|
8
|
-
await (0, graphql_1.gqlRequest)({
|
|
9
|
-
document: (0, graphql_1.gql) `
|
|
10
|
-
mutation deleteUser($id: ID!) {
|
|
11
|
-
deleteUser(input: { id: $id }) {
|
|
12
|
-
user {
|
|
13
|
-
id
|
|
14
|
-
}
|
|
15
|
-
errors {
|
|
16
|
-
field
|
|
17
|
-
messages
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`,
|
|
22
|
-
variables: {
|
|
23
|
-
id: user,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.default = DeleteCommand;
|
|
29
|
-
DeleteCommand.description = "Delete a Customer User";
|
|
30
|
-
DeleteCommand.args = {
|
|
31
|
-
user: core_1.Args.string({
|
|
32
|
-
required: true,
|
|
33
|
-
description: "ID of the user to delete",
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
@@ -1,65 +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 { args: { customer }, flags, } = await this.parse(ListCommand);
|
|
8
|
-
let customerUsers = [];
|
|
9
|
-
let hasNextPage = true;
|
|
10
|
-
let cursor = "";
|
|
11
|
-
while (hasNextPage) {
|
|
12
|
-
const { customer: { users: { nodes, pageInfo }, }, } = await (0, graphql_1.gqlRequest)({
|
|
13
|
-
document: (0, graphql_1.gql) `
|
|
14
|
-
query listCustomerUsers($id: ID!, $after: String) {
|
|
15
|
-
customer(id: $id) {
|
|
16
|
-
users(after: $after) {
|
|
17
|
-
nodes {
|
|
18
|
-
id
|
|
19
|
-
name
|
|
20
|
-
email
|
|
21
|
-
externalId
|
|
22
|
-
role {
|
|
23
|
-
name
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
pageInfo {
|
|
27
|
-
hasNextPage
|
|
28
|
-
endCursor
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
`,
|
|
34
|
-
variables: { id: customer, after: cursor },
|
|
35
|
-
});
|
|
36
|
-
customerUsers = [...customerUsers, ...nodes];
|
|
37
|
-
cursor = pageInfo.endCursor;
|
|
38
|
-
hasNextPage = pageInfo.hasNextPage;
|
|
39
|
-
}
|
|
40
|
-
core_1.ux.table(customerUsers, {
|
|
41
|
-
id: {
|
|
42
|
-
minWidth: 8,
|
|
43
|
-
extended: true,
|
|
44
|
-
},
|
|
45
|
-
name: {},
|
|
46
|
-
email: {},
|
|
47
|
-
role: { get: ({ role: { name } }) => name },
|
|
48
|
-
externalId: {
|
|
49
|
-
extended: true,
|
|
50
|
-
get: ({ externalId }) => externalId || "",
|
|
51
|
-
},
|
|
52
|
-
}, { ...flags });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.default = ListCommand;
|
|
56
|
-
ListCommand.description = "List Customer Users";
|
|
57
|
-
ListCommand.args = {
|
|
58
|
-
customer: core_1.Args.string({
|
|
59
|
-
description: "ID of the customer",
|
|
60
|
-
required: true,
|
|
61
|
-
}),
|
|
62
|
-
};
|
|
63
|
-
ListCommand.flags = {
|
|
64
|
-
...core_1.ux.table.flags(),
|
|
65
|
-
};
|
|
@@ -1,33 +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 listCustomerRoles {
|
|
11
|
-
customerRoles {
|
|
12
|
-
id
|
|
13
|
-
name
|
|
14
|
-
description
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
`,
|
|
18
|
-
});
|
|
19
|
-
core_1.ux.table(result.customerRoles, {
|
|
20
|
-
id: {
|
|
21
|
-
minWidth: 8,
|
|
22
|
-
extended: true,
|
|
23
|
-
},
|
|
24
|
-
name: {},
|
|
25
|
-
description: {},
|
|
26
|
-
}, { ...flags });
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.default = ListCommand;
|
|
30
|
-
ListCommand.description = "List Roles you can grant to Customer Users";
|
|
31
|
-
ListCommand.flags = {
|
|
32
|
-
...core_1.ux.table.flags(),
|
|
33
|
-
};
|
|
@@ -1,76 +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 { args: { user }, flags: { name, phone, "dark-mode": darkMode, "dark-mode-os-sync": darkModeOsSync, }, } = await this.parse(UpdateCommand);
|
|
8
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
9
|
-
document: (0, graphql_1.gql) `
|
|
10
|
-
mutation updateUser(
|
|
11
|
-
$user: ID!
|
|
12
|
-
$name: String
|
|
13
|
-
$phone: String
|
|
14
|
-
$darkMode: Boolean
|
|
15
|
-
$darkModeOsSync: Boolean
|
|
16
|
-
) {
|
|
17
|
-
updateUser(
|
|
18
|
-
input: {
|
|
19
|
-
id: $user
|
|
20
|
-
name: $name
|
|
21
|
-
phone: $phone
|
|
22
|
-
darkMode: $darkMode
|
|
23
|
-
darkModeSyncWithOs: $darkModeOsSync
|
|
24
|
-
}
|
|
25
|
-
) {
|
|
26
|
-
user {
|
|
27
|
-
id
|
|
28
|
-
}
|
|
29
|
-
errors {
|
|
30
|
-
field
|
|
31
|
-
messages
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
`,
|
|
36
|
-
variables: {
|
|
37
|
-
user,
|
|
38
|
-
name,
|
|
39
|
-
phone,
|
|
40
|
-
darkMode,
|
|
41
|
-
darkModeOsSync,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
this.log(result.updateUser.user.id);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.default = UpdateCommand;
|
|
48
|
-
UpdateCommand.description = "Update a User";
|
|
49
|
-
UpdateCommand.args = {
|
|
50
|
-
user: core_1.Args.string({
|
|
51
|
-
required: true,
|
|
52
|
-
description: "ID of a user",
|
|
53
|
-
}),
|
|
54
|
-
};
|
|
55
|
-
UpdateCommand.flags = {
|
|
56
|
-
name: core_1.Flags.string({
|
|
57
|
-
char: "n",
|
|
58
|
-
description: "name of the user",
|
|
59
|
-
required: false,
|
|
60
|
-
}),
|
|
61
|
-
phone: core_1.Flags.string({
|
|
62
|
-
char: "p",
|
|
63
|
-
description: "phone number of the user",
|
|
64
|
-
required: false,
|
|
65
|
-
}),
|
|
66
|
-
"dark-mode": core_1.Flags.string({
|
|
67
|
-
char: "d",
|
|
68
|
-
description: "whether the user should have dark mode enabled",
|
|
69
|
-
required: false,
|
|
70
|
-
}),
|
|
71
|
-
"dark-mode-os-sync": core_1.Flags.string({
|
|
72
|
-
char: "o",
|
|
73
|
-
description: "whether dark mode should sync with OS settings",
|
|
74
|
-
required: false,
|
|
75
|
-
}),
|
|
76
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const fs_1 = require("../../../fs");
|
|
7
|
-
const core_1 = require("@oclif/core");
|
|
8
|
-
const graphql_1 = require("../../../graphql");
|
|
9
|
-
const axios_1 = __importDefault(require("axios"));
|
|
10
|
-
const stepResults_1 = require("../../../utils/execution/stepResults");
|
|
11
|
-
class GetCommand extends core_1.Command {
|
|
12
|
-
async run() {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
const { flags } = await this.parse(GetCommand);
|
|
15
|
-
const { executionId, stepName, outputPath } = flags;
|
|
16
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
17
|
-
document: (0, graphql_1.gql) `
|
|
18
|
-
query getStepOutputDetails($executionId: ID!, $stepName: String!) {
|
|
19
|
-
executionResult(id: $executionId) {
|
|
20
|
-
id
|
|
21
|
-
stepResults(displayStepName: $stepName) {
|
|
22
|
-
nodes {
|
|
23
|
-
displayStepName
|
|
24
|
-
resultsUrl
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
`,
|
|
30
|
-
variables: {
|
|
31
|
-
executionId: executionId,
|
|
32
|
-
stepName: stepName,
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
const stepResult = (_b = (_a = result === null || result === void 0 ? void 0 : result.executionResult) === null || _a === void 0 ? void 0 : _a.stepResults.nodes) === null || _b === void 0 ? void 0 : _b[0];
|
|
36
|
-
if (stepResult === null || stepResult === void 0 ? void 0 : stepResult.resultsUrl) {
|
|
37
|
-
const response = await axios_1.default.get(stepResult.resultsUrl, {
|
|
38
|
-
responseType: "arraybuffer",
|
|
39
|
-
});
|
|
40
|
-
const resultsBuffer = Buffer.from(await response.data);
|
|
41
|
-
const { data: deserializedResult, contentType } = (0, stepResults_1.deserialize)(resultsBuffer);
|
|
42
|
-
const output = (0, stepResults_1.parseData)(deserializedResult, contentType);
|
|
43
|
-
if (outputPath) {
|
|
44
|
-
await fs_1.fs.writeFile(outputPath, output);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
console.log(output);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
console.error("No step results found. Did you enter the correct step name?");
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.default = GetCommand;
|
|
56
|
-
GetCommand.description = "Gets the Result of a specified Step in an Instance Execution";
|
|
57
|
-
GetCommand.flags = {
|
|
58
|
-
executionId: core_1.Flags.string({
|
|
59
|
-
char: "e",
|
|
60
|
-
required: true,
|
|
61
|
-
description: "ID of an Execution",
|
|
62
|
-
}),
|
|
63
|
-
stepName: core_1.Flags.string({
|
|
64
|
-
char: "s",
|
|
65
|
-
required: true,
|
|
66
|
-
description: "Name of an Integration Step",
|
|
67
|
-
}),
|
|
68
|
-
outputPath: core_1.Flags.string({
|
|
69
|
-
char: "p",
|
|
70
|
-
required: false,
|
|
71
|
-
description: "Output result to a file. Output will be printed to stdout if this is omitted",
|
|
72
|
-
}),
|
|
73
|
-
};
|
|
@@ -1,83 +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 { args: { instance }, flags, } = await this.parse(ListCommand);
|
|
8
|
-
let configVariables = [];
|
|
9
|
-
let hasNextPage = true;
|
|
10
|
-
let cursor = "";
|
|
11
|
-
while (hasNextPage) {
|
|
12
|
-
const { instance: { configVariables: { nodes, pageInfo }, }, } = await (0, graphql_1.gqlRequest)({
|
|
13
|
-
document: (0, graphql_1.gql) `
|
|
14
|
-
query listInstanceConfigVariables($id: ID!) {
|
|
15
|
-
instance(id: $id) {
|
|
16
|
-
configVariables {
|
|
17
|
-
nodes {
|
|
18
|
-
id
|
|
19
|
-
value
|
|
20
|
-
status
|
|
21
|
-
inputs {
|
|
22
|
-
nodes {
|
|
23
|
-
name
|
|
24
|
-
value
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
requiredConfigVariable {
|
|
28
|
-
id
|
|
29
|
-
key
|
|
30
|
-
defaultValue
|
|
31
|
-
dataType
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
pageInfo {
|
|
35
|
-
hasNextPage
|
|
36
|
-
endCursor
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
`,
|
|
42
|
-
variables: {
|
|
43
|
-
id: instance,
|
|
44
|
-
after: cursor,
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
configVariables = [...configVariables, ...nodes];
|
|
48
|
-
cursor = pageInfo.endCursor;
|
|
49
|
-
hasNextPage = pageInfo.hasNextPage;
|
|
50
|
-
}
|
|
51
|
-
core_1.ux.table(configVariables, {
|
|
52
|
-
id: {
|
|
53
|
-
minWidth: 8,
|
|
54
|
-
extended: true,
|
|
55
|
-
},
|
|
56
|
-
requiredVariableId: {
|
|
57
|
-
get: (row) => row.requiredConfigVariable.id,
|
|
58
|
-
extended: true,
|
|
59
|
-
},
|
|
60
|
-
key: {
|
|
61
|
-
get: (row) => row.requiredConfigVariable.key,
|
|
62
|
-
},
|
|
63
|
-
value: {
|
|
64
|
-
get: (row) => row.requiredConfigVariable.dataType === "CONNECTION"
|
|
65
|
-
? row.inputs
|
|
66
|
-
: row.value,
|
|
67
|
-
},
|
|
68
|
-
defaultValue: {
|
|
69
|
-
get: (row) => row.requiredConfigVariable.dataType === "CONNECTION"
|
|
70
|
-
? ""
|
|
71
|
-
: row.requiredConfigVariable.defaultValue,
|
|
72
|
-
},
|
|
73
|
-
}, { ...flags });
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
exports.default = ListCommand;
|
|
77
|
-
ListCommand.description = "List Config Variables used on an Instance";
|
|
78
|
-
ListCommand.args = {
|
|
79
|
-
instance: core_1.Args.string({ description: "ID of an instance", required: true }),
|
|
80
|
-
};
|
|
81
|
-
ListCommand.flags = {
|
|
82
|
-
...core_1.ux.table.flags(),
|
|
83
|
-
};
|
|
@@ -1,84 +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
|
-
const fields_1 = require("../../fields");
|
|
6
|
-
class CreateCommand extends core_1.Command {
|
|
7
|
-
async run() {
|
|
8
|
-
const { flags: { name, description, integration, customer, "config-vars": configVars, label, }, } = await this.parse(CreateCommand);
|
|
9
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
10
|
-
document: (0, graphql_1.gql) `
|
|
11
|
-
mutation createInstance(
|
|
12
|
-
$name: String!
|
|
13
|
-
$description: String
|
|
14
|
-
$integration: ID!
|
|
15
|
-
$customer: ID!
|
|
16
|
-
$configVariables: [InputInstanceConfigVariable]
|
|
17
|
-
$labels: [String]
|
|
18
|
-
) {
|
|
19
|
-
createInstance(
|
|
20
|
-
input: {
|
|
21
|
-
name: $name
|
|
22
|
-
description: $description
|
|
23
|
-
integration: $integration
|
|
24
|
-
customer: $customer
|
|
25
|
-
configVariables: $configVariables
|
|
26
|
-
labels: $labels
|
|
27
|
-
}
|
|
28
|
-
) {
|
|
29
|
-
instance {
|
|
30
|
-
id
|
|
31
|
-
}
|
|
32
|
-
errors {
|
|
33
|
-
field
|
|
34
|
-
messages
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
`,
|
|
39
|
-
variables: {
|
|
40
|
-
name,
|
|
41
|
-
description,
|
|
42
|
-
integration,
|
|
43
|
-
customer,
|
|
44
|
-
configVariables: (0, fields_1.parseJsonOrUndefined)(configVars),
|
|
45
|
-
labels: label,
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
this.log(result.createInstance.instance.id);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.default = CreateCommand;
|
|
52
|
-
CreateCommand.description = "Create an Instance";
|
|
53
|
-
CreateCommand.flags = {
|
|
54
|
-
name: core_1.Flags.string({
|
|
55
|
-
char: "n",
|
|
56
|
-
required: true,
|
|
57
|
-
description: "name of your new instance.",
|
|
58
|
-
}),
|
|
59
|
-
integration: core_1.Flags.string({
|
|
60
|
-
char: "i",
|
|
61
|
-
required: true,
|
|
62
|
-
description: "ID of the integration or a specific integration version ID this is an instance of",
|
|
63
|
-
}),
|
|
64
|
-
customer: core_1.Flags.string({
|
|
65
|
-
char: "c",
|
|
66
|
-
required: true,
|
|
67
|
-
description: "ID of customer to deploy to",
|
|
68
|
-
}),
|
|
69
|
-
description: core_1.Flags.string({
|
|
70
|
-
required: false,
|
|
71
|
-
char: "d",
|
|
72
|
-
description: "longer description of the instance",
|
|
73
|
-
}),
|
|
74
|
-
"config-vars": core_1.Flags.string({
|
|
75
|
-
required: false,
|
|
76
|
-
char: "v",
|
|
77
|
-
description: "config variables to bind to steps of your instance",
|
|
78
|
-
}),
|
|
79
|
-
label: core_1.Flags.string({
|
|
80
|
-
char: "l",
|
|
81
|
-
description: "a label or set of labels to apply to the instance",
|
|
82
|
-
multiple: true,
|
|
83
|
-
}),
|
|
84
|
-
};
|
|
@@ -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: { instance }, } = await this.parse(DeleteCommand);
|
|
8
|
-
await (0, graphql_1.gqlRequest)({
|
|
9
|
-
document: (0, graphql_1.gql) `
|
|
10
|
-
mutation deleteInstance($id: ID!) {
|
|
11
|
-
deleteInstance(input: { id: $id }) {
|
|
12
|
-
instance {
|
|
13
|
-
id
|
|
14
|
-
}
|
|
15
|
-
errors {
|
|
16
|
-
field
|
|
17
|
-
messages
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`,
|
|
22
|
-
variables: {
|
|
23
|
-
id: instance,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.default = DeleteCommand;
|
|
29
|
-
DeleteCommand.description = "Delete an Instance";
|
|
30
|
-
DeleteCommand.args = {
|
|
31
|
-
instance: core_1.Args.string({
|
|
32
|
-
required: true,
|
|
33
|
-
description: "ID of the instance to delete",
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
@@ -1,43 +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 DeployCommand extends core_1.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
const { args: { instance }, flags: { force }, } = await this.parse(DeployCommand);
|
|
8
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
9
|
-
document: (0, graphql_1.gql) `
|
|
10
|
-
mutation deployInstance($id: ID!, $force: Boolean) {
|
|
11
|
-
deployInstance(input: { id: $id, force: $force }) {
|
|
12
|
-
instance {
|
|
13
|
-
id
|
|
14
|
-
}
|
|
15
|
-
errors {
|
|
16
|
-
field
|
|
17
|
-
messages
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`,
|
|
22
|
-
variables: {
|
|
23
|
-
id: instance,
|
|
24
|
-
force,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
this.log(result.deployInstance.instance.id);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.default = DeployCommand;
|
|
31
|
-
DeployCommand.description = "Deploy an Instance";
|
|
32
|
-
DeployCommand.args = {
|
|
33
|
-
instance: core_1.Args.string({
|
|
34
|
-
required: true,
|
|
35
|
-
description: "ID of an instance",
|
|
36
|
-
}),
|
|
37
|
-
};
|
|
38
|
-
DeployCommand.flags = {
|
|
39
|
-
force: core_1.Flags.boolean({
|
|
40
|
-
char: "f",
|
|
41
|
-
description: "Force deployment even when there are certain conditions that would normally prevent it",
|
|
42
|
-
}),
|
|
43
|
-
};
|
|
@@ -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 DisableCommand extends core_1.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
const { args: { instance }, } = await this.parse(DisableCommand);
|
|
8
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
9
|
-
document: (0, graphql_1.gql) `
|
|
10
|
-
mutation disableInstance($id: ID!) {
|
|
11
|
-
updateInstance(input: { id: $id, enabled: false }) {
|
|
12
|
-
instance {
|
|
13
|
-
id
|
|
14
|
-
}
|
|
15
|
-
errors {
|
|
16
|
-
field
|
|
17
|
-
messages
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`,
|
|
22
|
-
variables: {
|
|
23
|
-
id: instance,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
this.log(result.updateInstance.instance.id);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.default = DisableCommand;
|
|
30
|
-
DisableCommand.description = "Disable an Instance";
|
|
31
|
-
DisableCommand.args = {
|
|
32
|
-
instance: core_1.Args.string({
|
|
33
|
-
required: true,
|
|
34
|
-
description: "ID of an instance",
|
|
35
|
-
}),
|
|
36
|
-
};
|
|
@@ -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 EnableCommand extends core_1.Command {
|
|
6
|
-
async run() {
|
|
7
|
-
const { args: { instance }, } = await this.parse(EnableCommand);
|
|
8
|
-
const result = await (0, graphql_1.gqlRequest)({
|
|
9
|
-
document: (0, graphql_1.gql) `
|
|
10
|
-
mutation enableInstance($id: ID!) {
|
|
11
|
-
updateInstance(input: { id: $id, enabled: true }) {
|
|
12
|
-
instance {
|
|
13
|
-
id
|
|
14
|
-
}
|
|
15
|
-
errors {
|
|
16
|
-
field
|
|
17
|
-
messages
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`,
|
|
22
|
-
variables: {
|
|
23
|
-
id: instance,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
this.log(result.updateInstance.instance.id);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.default = EnableCommand;
|
|
30
|
-
EnableCommand.description = "Enable an Instance";
|
|
31
|
-
EnableCommand.args = {
|
|
32
|
-
instance: core_1.Args.string({
|
|
33
|
-
required: true,
|
|
34
|
-
description: "ID of an instance",
|
|
35
|
-
}),
|
|
36
|
-
};
|
|
@@ -1,62 +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 { args: { instance }, flags, } = await this.parse(ListCommand);
|
|
8
|
-
let flowConfigs = [];
|
|
9
|
-
let hasNextPage = true;
|
|
10
|
-
let cursor = "";
|
|
11
|
-
while (hasNextPage) {
|
|
12
|
-
const { instance: { flowConfigs: { nodes, pageInfo }, }, } = await (0, graphql_1.gqlRequest)({
|
|
13
|
-
document: (0, graphql_1.gql) `
|
|
14
|
-
query listInstanceFlowConfigs($id: ID!, $after: String) {
|
|
15
|
-
instance(id: $id) {
|
|
16
|
-
flowConfigs(after: $after) {
|
|
17
|
-
nodes {
|
|
18
|
-
id
|
|
19
|
-
flow {
|
|
20
|
-
name
|
|
21
|
-
}
|
|
22
|
-
webhookUrl
|
|
23
|
-
}
|
|
24
|
-
pageInfo {
|
|
25
|
-
hasNextPage
|
|
26
|
-
endCursor
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
`,
|
|
32
|
-
variables: {
|
|
33
|
-
id: instance,
|
|
34
|
-
after: cursor,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
flowConfigs = [...flowConfigs, ...nodes];
|
|
38
|
-
cursor = pageInfo.endCursor;
|
|
39
|
-
hasNextPage = pageInfo.hasNextPage;
|
|
40
|
-
}
|
|
41
|
-
core_1.ux.table(flowConfigs, {
|
|
42
|
-
id: {
|
|
43
|
-
minWidth: 8,
|
|
44
|
-
extended: true,
|
|
45
|
-
},
|
|
46
|
-
name: {
|
|
47
|
-
get: (row) => row.flow.name,
|
|
48
|
-
},
|
|
49
|
-
webhookUrl: {
|
|
50
|
-
extended: true,
|
|
51
|
-
},
|
|
52
|
-
}, { ...flags });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.default = ListCommand;
|
|
56
|
-
ListCommand.description = "List Instance Flow Configs";
|
|
57
|
-
ListCommand.args = {
|
|
58
|
-
instance: core_1.Args.string({ description: "ID of an Instance", required: true }),
|
|
59
|
-
};
|
|
60
|
-
ListCommand.flags = {
|
|
61
|
-
...core_1.ux.table.flags(),
|
|
62
|
-
};
|