@convisoappsec/mcp 0.5.0 → 0.6.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.
@@ -1,198 +0,0 @@
1
- import 'dotenv/config';
2
- import { GraphQLClient } from './graphql_client.js';
3
- import { listMutations, describeMutation } from './mutations.js';
4
-
5
- class FeedGateway {
6
- constructor(graphql_api_key = '') {
7
- this.base_url = 'https://app.convisoappsec.com';
8
- const apiKey = process.env.CONVISO_API_KEY || graphql_api_key || '';
9
- this.graphql = new GraphQLClient(`${this.base_url}/graphql`, apiKey);
10
- }
11
-
12
- // search = name contains; label_eq = exact name match.
13
- async get_companies(page = 1, limit = 10, search = '', label_eq = null) {
14
- return this.graphql.get_companies(page, limit, search, label_eq);
15
- }
16
-
17
- async get_company_by_id(company_id) {
18
- return this.graphql.get_company_by_id(company_id);
19
- }
20
-
21
- async get_issue_by_id(issue_id, return_snippets = false) {
22
- return this.graphql.get_issue_by_id(issue_id, return_snippets);
23
- }
24
-
25
- // Single rich issues passthrough (parity with Python gateway.get_issues kwargs).
26
- async getIssues(company_id, opts = {}) {
27
- return this.graphql.getIssues(company_id, opts);
28
- }
29
-
30
- async get_issue_with_company_id(company_id, issue_id) {
31
- return this.graphql.get_issues(company_id, '', 1, 5, null, [issue_id]);
32
- }
33
-
34
- async get_issues_by_asset_ids(company_id, page = 1, limit = 10, asset_ids = [], search = '', opts = {}) {
35
- return this.graphql.getIssues(company_id, {
36
- ...opts,
37
- page,
38
- limit,
39
- search,
40
- assetIds: asset_ids,
41
- });
42
- }
43
-
44
- async get_projects(company_id, page = 1, limit = 1000, search = '', opts = {}) {
45
- return this.graphql.get_projects(company_id, page, limit, search, opts);
46
- }
47
-
48
- async get_project_by_id(project_id) {
49
- return this.graphql.get_project_by_id(project_id);
50
- }
51
-
52
- async get_assets(company_id, page = 1, limit = 1000, opts = {}) {
53
- return this.graphql.get_assets_by_company(company_id, page, limit, opts);
54
- }
55
-
56
- async get_asset_by_id(asset_id) {
57
- return this.graphql.get_asset_by_id(asset_id);
58
- }
59
-
60
- async get_top_vulnerabilities(company_id, opts = {}) {
61
- return this.graphql.get_top_vulnerabilities(company_id, opts);
62
- }
63
-
64
- async generate_project_report(project_id, language = 'en', vulnerability_criticity = null, vulnerability_statuses = null, requirements = true, evidences = true) {
65
- return this.graphql.generate_project_report(project_id, language, vulnerability_criticity, vulnerability_statuses, requirements, evidences);
66
- }
67
-
68
- async generate_project_report_progress(project_id, report_id) {
69
- return this.graphql.generate_project_report_progress(project_id, report_id);
70
- }
71
-
72
- create_project_url(company_id, project_id) {
73
- return `${this.base_url}/spa/company/${company_id}/projects/${project_id}`;
74
- }
75
-
76
- create_issue_url(company_id, issue_id) {
77
- return `${this.base_url}/spa/company/${company_id}/vulnerabilities?title=&search=${issue_id}`;
78
- }
79
-
80
- async get_mttr_over_time(company_id, start_date, end_date, severities = null, statuses = null, asset_ids = null, asset_tags = null) {
81
- return this.graphql.get_mttr_over_time(company_id, start_date, end_date, severities, statuses, asset_ids, asset_tags);
82
- }
83
-
84
- async get_overall_risk_score_history(company_id) {
85
- return this.graphql.get_overall_risk_score_history(company_id);
86
- }
87
-
88
- // --- Mutations -------------------------------------------------------------
89
-
90
- // Discovery/introspection are pure (no network) — answered straight from the catalog.
91
- list_mutations(opts = {}) {
92
- return listMutations(opts);
93
- }
94
-
95
- describe_mutation(name) {
96
- return describeMutation(name);
97
- }
98
-
99
- async execute_mutation(name, variables = {}, returnFields = null) {
100
- return this.graphql.executeMutation(name, variables, returnFields);
101
- }
102
-
103
- async change_issue_status(a = {}) {
104
- return this.graphql.change_issue_status(a);
105
- }
106
-
107
- async create_source_code_vulnerability(a = {}) {
108
- return this.graphql.create_source_code_vulnerability(a);
109
- }
110
-
111
- async create_project(a = {}) {
112
- return this.graphql.create_project(a);
113
- }
114
-
115
- async create_asset(a = {}) {
116
- return this.graphql.create_asset(a);
117
- }
118
-
119
- async create_ticket(a = {}) {
120
- return this.graphql.create_ticket(a);
121
- }
122
-
123
- async run_dast(a = {}) {
124
- return this.graphql.run_dast(a);
125
- }
126
-
127
- async trigger_pentest(a = {}) {
128
- return this.graphql.trigger_pentest(a);
129
- }
130
-
131
- async create_pentest_artifact(a = {}) {
132
- return this.graphql.create_pentest_artifact(a);
133
- }
134
-
135
- // --- Reads (curated query tools) -------------------------------------------
136
-
137
- async get_tickets(company_id, opts = {}) {
138
- return this.graphql.get_tickets(company_id, opts);
139
- }
140
-
141
- async get_ticket(company_id, ticket_id) {
142
- return this.graphql.get_ticket(company_id, ticket_id);
143
- }
144
-
145
- async get_requirements(scope_id, opts = {}) {
146
- return this.graphql.get_requirements(scope_id, opts);
147
- }
148
-
149
- async get_requirement(company_id, requirement_id) {
150
- return this.graphql.get_requirement(company_id, requirement_id);
151
- }
152
-
153
- async get_project_requirements(project_id) {
154
- return this.graphql.get_project_requirements(project_id);
155
- }
156
-
157
- async get_applications(company_id, search = null) {
158
- return this.graphql.get_applications(company_id, search);
159
- }
160
-
161
- async get_application(company_id, application_id) {
162
- return this.graphql.get_application(company_id, application_id);
163
- }
164
-
165
- async get_scan_histories(company_id, opts = {}) {
166
- return this.graphql.get_scan_histories(company_id, opts);
167
- }
168
-
169
- async get_asset_scans_count(company_id) {
170
- return this.graphql.get_asset_scans_count(company_id);
171
- }
172
-
173
- async get_sbom_components(company_id, opts = {}) {
174
- return this.graphql.get_sbom_components(company_id, opts);
175
- }
176
-
177
- async get_pentest_artifacts(company_id, opts = {}) {
178
- return this.graphql.get_pentest_artifacts(company_id, opts);
179
- }
180
-
181
- async get_pentest_artifact(artifact_id) {
182
- return this.graphql.get_pentest_artifact(artifact_id);
183
- }
184
-
185
- async get_pentest_execution(execution_id) {
186
- return this.graphql.get_pentest_execution(execution_id);
187
- }
188
-
189
- async get_threat_model_artifacts(company_id, opts = {}) {
190
- return this.graphql.get_threat_model_artifacts(company_id, opts);
191
- }
192
-
193
- async get_threat_model_artifact(artifact_id) {
194
- return this.graphql.get_threat_model_artifact(artifact_id);
195
- }
196
- }
197
-
198
- export { FeedGateway };