@prismatic-io/prism 4.1.1 → 4.2.2
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/commands/alerts/events/list.js +4 -1
- package/lib/commands/alerts/groups/list.js +23 -10
- package/lib/commands/alerts/monitors/list.js +41 -11
- package/lib/commands/alerts/webhooks/list.js +26 -13
- package/lib/commands/components/actions/list.js +60 -19
- package/lib/commands/components/dev/run.js +19 -5
- package/lib/commands/components/dev/test.js +1 -1
- package/lib/commands/components/init/index.js +39 -100
- package/lib/commands/components/list.js +42 -19
- package/lib/commands/components/triggers/list.js +61 -20
- package/lib/commands/customers/list.js +29 -11
- package/lib/commands/customers/users/list.js +34 -15
- package/lib/commands/instances/config-vars/list.js +44 -19
- package/lib/commands/instances/flow-configs/list.js +29 -16
- package/lib/commands/instances/list.js +45 -21
- package/lib/commands/integrations/flows/list.js +29 -16
- package/lib/commands/integrations/list.js +32 -15
- package/lib/commands/organization/users/list.js +37 -12
- package/lib/generate/action.js +14 -66
- package/lib/generate/index.js +3 -9
- package/lib/generate/parse.js +8 -60
- package/lib/generate/sourceFile.js +7 -40
- package/lib/generate/util.js +1 -105
- package/lib/yeoman.js +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +5 -7
- package/lib/generate/client.js +0 -93
- package/lib/generate/connection.js +0 -77
- package/templates/component/assets/icon.png +0 -0
- package/templates/component/openapi/client.ts +0 -75
- package/templates/component/openapi/request.ts +0 -163
|
@@ -4,31 +4,55 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const graphql_1 = require("../../../graphql");
|
|
5
5
|
class ListCommand extends core_1.Command {
|
|
6
6
|
async run() {
|
|
7
|
-
const { flags } = await this.parse(ListCommand);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
const { flags, args: { "Component Key": componentKey }, } = await this.parse(ListCommand);
|
|
8
|
+
let triggers = [];
|
|
9
|
+
let componentId;
|
|
10
|
+
let hasNextPage = true;
|
|
11
|
+
let cursor = "";
|
|
12
|
+
while (hasNextPage) {
|
|
13
|
+
const { components: { nodes: [component], }, } = await (0, graphql_1.gqlRequest)({
|
|
14
|
+
document: (0, graphql_1.gql) `
|
|
15
|
+
query listComponentTriggers(
|
|
16
|
+
$componentKey: String
|
|
17
|
+
$after: String
|
|
18
|
+
$public: Boolean
|
|
19
|
+
) {
|
|
20
|
+
components(key: $componentKey, public: $public) {
|
|
21
|
+
nodes {
|
|
22
|
+
id
|
|
23
|
+
key
|
|
24
|
+
actions(isTrigger: true, after: $after) {
|
|
25
|
+
nodes {
|
|
20
26
|
id
|
|
21
27
|
key
|
|
28
|
+
label
|
|
29
|
+
description
|
|
30
|
+
}
|
|
31
|
+
pageInfo {
|
|
32
|
+
hasNextPage
|
|
33
|
+
endCursor
|
|
22
34
|
}
|
|
23
35
|
}
|
|
24
36
|
}
|
|
25
37
|
}
|
|
26
38
|
}
|
|
39
|
+
`,
|
|
40
|
+
variables: {
|
|
41
|
+
after: cursor,
|
|
42
|
+
componentKey,
|
|
43
|
+
public: flags.public ? true : flags.private ? false : null,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
if (!component) {
|
|
47
|
+
console.log("The key you provided is not valid. Please run 'prism components:list -x' and identify a valid component key.");
|
|
48
|
+
this.exit(1);
|
|
49
|
+
}
|
|
50
|
+
triggers = [...triggers, ...component.actions.nodes];
|
|
51
|
+
componentId = component.id;
|
|
52
|
+
cursor = component.actions.pageInfo.endCursor;
|
|
53
|
+
hasNextPage = component.actions.hasNextPage;
|
|
27
54
|
}
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
const actions = result.components.nodes.flatMap(({ actions }) => actions.nodes);
|
|
31
|
-
core_1.CliUx.ux.table(actions, {
|
|
55
|
+
core_1.CliUx.ux.table(triggers, {
|
|
32
56
|
id: {
|
|
33
57
|
minWidth: 8,
|
|
34
58
|
extended: true,
|
|
@@ -40,11 +64,11 @@ class ListCommand extends core_1.Command {
|
|
|
40
64
|
label: {},
|
|
41
65
|
description: {},
|
|
42
66
|
componentid: {
|
|
43
|
-
get: (
|
|
67
|
+
get: () => componentId,
|
|
44
68
|
extended: true,
|
|
45
69
|
},
|
|
46
70
|
componentkey: {
|
|
47
|
-
get: (
|
|
71
|
+
get: () => componentKey,
|
|
48
72
|
extended: true,
|
|
49
73
|
},
|
|
50
74
|
}, { ...flags });
|
|
@@ -52,4 +76,21 @@ class ListCommand extends core_1.Command {
|
|
|
52
76
|
}
|
|
53
77
|
exports.default = ListCommand;
|
|
54
78
|
ListCommand.description = "List Triggers that Components implement";
|
|
55
|
-
ListCommand.flags = {
|
|
79
|
+
ListCommand.flags = {
|
|
80
|
+
...core_1.CliUx.ux.table.flags(),
|
|
81
|
+
public: core_1.Flags.boolean({
|
|
82
|
+
required: false,
|
|
83
|
+
description: "Show actions for the public component with the given key. Use this flag when you have a private component with the same key as a public component.",
|
|
84
|
+
}),
|
|
85
|
+
private: core_1.Flags.boolean({
|
|
86
|
+
required: false,
|
|
87
|
+
description: "Show actions for the private component with the given key. Use this flag when you have a private component with the same key as a public component.",
|
|
88
|
+
}),
|
|
89
|
+
};
|
|
90
|
+
ListCommand.args = [
|
|
91
|
+
{
|
|
92
|
+
name: "Component Key",
|
|
93
|
+
required: true,
|
|
94
|
+
description: "The key of the component to show triggers for (e.g. 'salesforce')",
|
|
95
|
+
},
|
|
96
|
+
];
|
|
@@ -5,24 +5,42 @@ const graphql_1 = require("../../graphql");
|
|
|
5
5
|
class ListCommand extends core_1.Command {
|
|
6
6
|
async run() {
|
|
7
7
|
const { flags } = await this.parse(ListCommand);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
nodes {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
let customers = [];
|
|
9
|
+
let hasNextPage = true;
|
|
10
|
+
let cursor = "";
|
|
11
|
+
while (hasNextPage) {
|
|
12
|
+
const { customers: { nodes, pageInfo }, } = await (0, graphql_1.gqlRequest)({
|
|
13
|
+
document: (0, graphql_1.gql) `
|
|
14
|
+
query listCustomers($after: String) {
|
|
15
|
+
customers(isSystem: false, after: $after) {
|
|
16
|
+
nodes {
|
|
17
|
+
id
|
|
18
|
+
name
|
|
19
|
+
externalId
|
|
20
|
+
description
|
|
21
|
+
}
|
|
22
|
+
pageInfo {
|
|
23
|
+
hasNextPage
|
|
24
|
+
endCursor
|
|
25
|
+
}
|
|
16
26
|
}
|
|
17
27
|
}
|
|
28
|
+
`,
|
|
29
|
+
variables: { after: cursor },
|
|
30
|
+
});
|
|
31
|
+
customers = [...customers, ...nodes];
|
|
32
|
+
cursor = pageInfo.endCursor;
|
|
33
|
+
hasNextPage = pageInfo.hasNextPage;
|
|
18
34
|
}
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
core_1.CliUx.ux.table(result.customers.nodes, {
|
|
35
|
+
core_1.CliUx.ux.table(customers, {
|
|
22
36
|
id: {
|
|
23
37
|
minWidth: 8,
|
|
24
38
|
extended: true,
|
|
25
39
|
},
|
|
40
|
+
externalId: {
|
|
41
|
+
extended: true,
|
|
42
|
+
get: ({ externalId }) => externalId || "",
|
|
43
|
+
},
|
|
26
44
|
name: {},
|
|
27
45
|
description: {},
|
|
28
46
|
}, { ...flags });
|
|
@@ -5,31 +5,50 @@ const graphql_1 = require("../../../graphql");
|
|
|
5
5
|
class ListCommand extends core_1.Command {
|
|
6
6
|
async run() {
|
|
7
7
|
const { args: { customer }, flags, } = await this.parse(ListCommand);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
users {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
}
|
|
17
30
|
}
|
|
18
31
|
}
|
|
19
32
|
}
|
|
33
|
+
`,
|
|
34
|
+
variables: { id: customer, after: cursor },
|
|
35
|
+
});
|
|
36
|
+
customerUsers = [...customerUsers, ...nodes];
|
|
37
|
+
cursor = pageInfo.endCursor;
|
|
38
|
+
hasNextPage = pageInfo.hasNextPage;
|
|
20
39
|
}
|
|
21
|
-
|
|
22
|
-
variables: {
|
|
23
|
-
id: customer,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
core_1.CliUx.ux.table(result.customer.users.nodes, {
|
|
40
|
+
core_1.CliUx.ux.table(customerUsers, {
|
|
27
41
|
id: {
|
|
28
42
|
minWidth: 8,
|
|
29
43
|
extended: true,
|
|
30
44
|
},
|
|
31
45
|
name: {},
|
|
32
46
|
email: {},
|
|
47
|
+
role: { get: ({ role: { name } }) => name },
|
|
48
|
+
externalId: {
|
|
49
|
+
extended: true,
|
|
50
|
+
get: ({ externalId }) => externalId || "",
|
|
51
|
+
},
|
|
33
52
|
}, { ...flags });
|
|
34
53
|
}
|
|
35
54
|
}
|
|
@@ -5,29 +5,50 @@ const graphql_1 = require("../../../graphql");
|
|
|
5
5
|
class ListCommand extends core_1.Command {
|
|
6
6
|
async run() {
|
|
7
7
|
const { args: { instance }, flags, } = await this.parse(ListCommand);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
configVariables {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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 {
|
|
17
18
|
id
|
|
18
|
-
|
|
19
|
-
|
|
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
|
|
20
37
|
}
|
|
21
38
|
}
|
|
22
39
|
}
|
|
23
40
|
}
|
|
41
|
+
`,
|
|
42
|
+
variables: {
|
|
43
|
+
id: instance,
|
|
44
|
+
after: cursor,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
configVariables = [...configVariables, ...nodes];
|
|
48
|
+
cursor = pageInfo.endCursor;
|
|
49
|
+
hasNextPage = pageInfo.hasNextPage;
|
|
24
50
|
}
|
|
25
|
-
|
|
26
|
-
variables: {
|
|
27
|
-
id: instance,
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
core_1.CliUx.ux.table(result.instance.configVariables.nodes, {
|
|
51
|
+
core_1.CliUx.ux.table(configVariables, {
|
|
31
52
|
id: {
|
|
32
53
|
minWidth: 8,
|
|
33
54
|
extended: true,
|
|
@@ -40,10 +61,14 @@ class ListCommand extends core_1.Command {
|
|
|
40
61
|
get: (row) => row.requiredConfigVariable.key,
|
|
41
62
|
},
|
|
42
63
|
value: {
|
|
43
|
-
get: (row) => row.
|
|
64
|
+
get: (row) => row.requiredConfigVariable.dataType === "CONNECTION"
|
|
65
|
+
? row.inputs
|
|
66
|
+
: row.value,
|
|
44
67
|
},
|
|
45
68
|
defaultValue: {
|
|
46
|
-
get: (row) => row.requiredConfigVariable.
|
|
69
|
+
get: (row) => row.requiredConfigVariable.dataType === "CONNECTION"
|
|
70
|
+
? ""
|
|
71
|
+
: row.requiredConfigVariable.defaultValue,
|
|
47
72
|
},
|
|
48
73
|
}, { ...flags });
|
|
49
74
|
}
|
|
@@ -5,27 +5,40 @@ const graphql_1 = require("../../../graphql");
|
|
|
5
5
|
class ListCommand extends core_1.Command {
|
|
6
6
|
async run() {
|
|
7
7
|
const { args: { instance }, flags, } = await this.parse(ListCommand);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
flowConfigs {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
17
27
|
}
|
|
18
|
-
webhookUrl
|
|
19
28
|
}
|
|
20
29
|
}
|
|
21
30
|
}
|
|
31
|
+
`,
|
|
32
|
+
variables: {
|
|
33
|
+
id: instance,
|
|
34
|
+
after: cursor,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
flowConfigs = [...flowConfigs, ...nodes];
|
|
38
|
+
cursor = pageInfo.endCursor;
|
|
39
|
+
hasNextPage = pageInfo.hasNextPage;
|
|
22
40
|
}
|
|
23
|
-
|
|
24
|
-
variables: {
|
|
25
|
-
id: instance,
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
core_1.CliUx.ux.table(result.instance.flowConfigs.nodes, {
|
|
41
|
+
core_1.CliUx.ux.table(flowConfigs, {
|
|
29
42
|
id: {
|
|
30
43
|
minWidth: 8,
|
|
31
44
|
extended: true,
|
|
@@ -6,42 +6,66 @@ class ListCommand extends core_1.Command {
|
|
|
6
6
|
async run() {
|
|
7
7
|
const { flags } = await this.parse(ListCommand);
|
|
8
8
|
const { customer, integration } = flags;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
let instances = [];
|
|
10
|
+
let hasNextPage = true;
|
|
11
|
+
let cursor = "";
|
|
12
|
+
while (hasNextPage) {
|
|
13
|
+
const { instances: { nodes, pageInfo }, } = await (0, graphql_1.gqlRequest)({
|
|
14
|
+
document: (0, graphql_1.gql) `
|
|
15
|
+
query listInstances($customer: ID, $integration: ID, $after: String) {
|
|
16
|
+
instances(
|
|
17
|
+
customer: $customer
|
|
18
|
+
integration: $integration
|
|
19
|
+
isSystem: false
|
|
20
|
+
after: $after
|
|
21
|
+
) {
|
|
22
|
+
nodes {
|
|
22
23
|
id
|
|
23
24
|
name
|
|
25
|
+
description
|
|
26
|
+
enabled
|
|
27
|
+
customer {
|
|
28
|
+
id
|
|
29
|
+
name
|
|
30
|
+
externalId
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
pageInfo {
|
|
34
|
+
hasNextPage
|
|
35
|
+
endCursor
|
|
24
36
|
}
|
|
25
37
|
}
|
|
26
38
|
}
|
|
39
|
+
`,
|
|
40
|
+
variables: {
|
|
41
|
+
customer,
|
|
42
|
+
integration,
|
|
43
|
+
after: cursor,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
instances = [...instances, ...nodes];
|
|
47
|
+
cursor = pageInfo.endCursor;
|
|
48
|
+
hasNextPage = pageInfo.hasNextPage;
|
|
27
49
|
}
|
|
28
|
-
|
|
29
|
-
variables: {
|
|
30
|
-
customer,
|
|
31
|
-
integration,
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
core_1.CliUx.ux.table(result.instances.nodes, {
|
|
50
|
+
core_1.CliUx.ux.table(instances, {
|
|
35
51
|
id: {
|
|
36
52
|
minWidth: 8,
|
|
37
53
|
extended: true,
|
|
38
54
|
},
|
|
39
55
|
name: {},
|
|
40
56
|
customer: {
|
|
41
|
-
get: (
|
|
57
|
+
get: ({ customer }) => customer.name,
|
|
58
|
+
},
|
|
59
|
+
customerid: {
|
|
60
|
+
get: ({ customer }) => customer.id,
|
|
61
|
+
extended: true,
|
|
62
|
+
},
|
|
63
|
+
customerExternalId: {
|
|
64
|
+
get: ({ customer }) => customer.externalId || "",
|
|
42
65
|
extended: true,
|
|
43
66
|
},
|
|
44
67
|
description: {},
|
|
68
|
+
enabled: { extended: true },
|
|
45
69
|
}, { ...flags });
|
|
46
70
|
}
|
|
47
71
|
}
|
|
@@ -5,26 +5,39 @@ const graphql_1 = require("../../../graphql");
|
|
|
5
5
|
class ListCommand extends core_1.Command {
|
|
6
6
|
async run() {
|
|
7
7
|
const { args: { integration }, flags, } = await this.parse(ListCommand);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
flows {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
let flows = [];
|
|
9
|
+
let hasNextPage = true;
|
|
10
|
+
let cursor = "";
|
|
11
|
+
while (hasNextPage) {
|
|
12
|
+
const { integration: { flows: { nodes, pageInfo }, }, } = await (0, graphql_1.gqlRequest)({
|
|
13
|
+
document: (0, graphql_1.gql) `
|
|
14
|
+
query listIntegrationFlows($id: ID!, $after: String) {
|
|
15
|
+
integration(id: $id) {
|
|
16
|
+
flows(after: $after) {
|
|
17
|
+
nodes {
|
|
18
|
+
id
|
|
19
|
+
name
|
|
20
|
+
description
|
|
21
|
+
testUrl
|
|
22
|
+
}
|
|
23
|
+
pageInfo {
|
|
24
|
+
hasNextPage
|
|
25
|
+
endCursor
|
|
26
|
+
}
|
|
18
27
|
}
|
|
19
28
|
}
|
|
20
29
|
}
|
|
30
|
+
`,
|
|
31
|
+
variables: {
|
|
32
|
+
id: integration,
|
|
33
|
+
after: cursor,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
flows = [...flows, ...nodes];
|
|
37
|
+
cursor = pageInfo.endCursor;
|
|
38
|
+
hasNextPage = pageInfo.hasNextPage;
|
|
21
39
|
}
|
|
22
|
-
|
|
23
|
-
variables: {
|
|
24
|
-
id: integration,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
core_1.CliUx.ux.table(result.integration.flows.nodes, {
|
|
40
|
+
core_1.CliUx.ux.table(flows, {
|
|
28
41
|
id: {
|
|
29
42
|
minWidth: 8,
|
|
30
43
|
extended: true,
|
|
@@ -6,24 +6,39 @@ class ListCommand extends core_1.Command {
|
|
|
6
6
|
async run() {
|
|
7
7
|
const { flags } = await this.parse(ListCommand);
|
|
8
8
|
const { showAllVersions } = flags;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
nodes {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
let integrations = [];
|
|
10
|
+
let hasNextPage = true;
|
|
11
|
+
let cursor = "";
|
|
12
|
+
while (hasNextPage) {
|
|
13
|
+
const { integrations: { nodes, pageInfo }, } = await (0, graphql_1.gqlRequest)({
|
|
14
|
+
document: (0, graphql_1.gql) `
|
|
15
|
+
query listIntegrations($showAllVersions: Boolean, $after: String) {
|
|
16
|
+
integrations(allVersions: $showAllVersions, after: $after) {
|
|
17
|
+
nodes {
|
|
18
|
+
id
|
|
19
|
+
name
|
|
20
|
+
description
|
|
21
|
+
versionNumber
|
|
22
|
+
labels
|
|
23
|
+
category
|
|
24
|
+
}
|
|
25
|
+
pageInfo {
|
|
26
|
+
hasNextPage
|
|
27
|
+
endCursor
|
|
28
|
+
}
|
|
18
29
|
}
|
|
19
30
|
}
|
|
31
|
+
`,
|
|
32
|
+
variables: {
|
|
33
|
+
showAllVersions,
|
|
34
|
+
after: cursor,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
integrations = [...integrations, ...nodes];
|
|
38
|
+
cursor = pageInfo.endCursor;
|
|
39
|
+
hasNextPage = pageInfo.hasNextPage;
|
|
20
40
|
}
|
|
21
|
-
|
|
22
|
-
variables: {
|
|
23
|
-
showAllVersions,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
core_1.CliUx.ux.table(result.integrations.nodes, {
|
|
41
|
+
core_1.CliUx.ux.table(integrations, {
|
|
27
42
|
id: {
|
|
28
43
|
minWidth: 8,
|
|
29
44
|
extended: true,
|
|
@@ -31,6 +46,8 @@ class ListCommand extends core_1.Command {
|
|
|
31
46
|
name: {},
|
|
32
47
|
description: {},
|
|
33
48
|
versionNumber: { header: "Version" },
|
|
49
|
+
labels: { extended: true },
|
|
50
|
+
category: { extended: true },
|
|
34
51
|
}, { ...flags });
|
|
35
52
|
}
|
|
36
53
|
}
|
|
@@ -5,28 +5,53 @@ const graphql_1 = require("../../../graphql");
|
|
|
5
5
|
class ListCommand extends core_1.Command {
|
|
6
6
|
async run() {
|
|
7
7
|
const { flags } = await this.parse(ListCommand);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
users {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
let customerUsers = [];
|
|
9
|
+
let hasNextPage = true;
|
|
10
|
+
let cursor = "";
|
|
11
|
+
while (hasNextPage) {
|
|
12
|
+
const { organization: { users: { nodes, pageInfo }, }, } = await (0, graphql_1.gqlRequest)({
|
|
13
|
+
document: (0, graphql_1.gql) `
|
|
14
|
+
query listUsers($after: String) {
|
|
15
|
+
organization {
|
|
16
|
+
users(after: $after) {
|
|
17
|
+
nodes {
|
|
18
|
+
id
|
|
19
|
+
name
|
|
20
|
+
email
|
|
21
|
+
externalId
|
|
22
|
+
phone
|
|
23
|
+
role {
|
|
24
|
+
name
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
pageInfo {
|
|
28
|
+
hasNextPage
|
|
29
|
+
endCursor
|
|
30
|
+
}
|
|
17
31
|
}
|
|
18
32
|
}
|
|
19
33
|
}
|
|
34
|
+
`,
|
|
35
|
+
variables: { after: cursor },
|
|
36
|
+
});
|
|
37
|
+
customerUsers = [...customerUsers, ...nodes];
|
|
38
|
+
cursor = pageInfo.endCursor;
|
|
39
|
+
hasNextPage = pageInfo.hasNextPage;
|
|
20
40
|
}
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
core_1.CliUx.ux.table(result.organization.users.nodes, {
|
|
41
|
+
core_1.CliUx.ux.table(customerUsers, {
|
|
24
42
|
id: {
|
|
25
43
|
minWidth: 8,
|
|
26
44
|
extended: true,
|
|
27
45
|
},
|
|
28
46
|
name: {},
|
|
29
47
|
email: {},
|
|
48
|
+
phone: {},
|
|
49
|
+
role: {
|
|
50
|
+
get: ({ role }) => role.name,
|
|
51
|
+
},
|
|
52
|
+
externalId: {
|
|
53
|
+
get: ({ externalId }) => externalId || "",
|
|
54
|
+
},
|
|
30
55
|
}, { ...flags });
|
|
31
56
|
}
|
|
32
57
|
}
|