@smartbear/mcp 0.8.0 → 0.10.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.
- package/README.md +29 -4
- package/dist/api-hub/client/api.js +239 -10
- package/dist/api-hub/client/configuration.js +5 -0
- package/dist/api-hub/client/index.js +1 -0
- package/dist/api-hub/client/portal-types.js +126 -0
- package/dist/api-hub/client/registry-types.js +8 -0
- package/dist/api-hub/client/tools.js +78 -15
- package/dist/api-hub/client/user-management-types.js +24 -0
- package/dist/api-hub/client.js +34 -0
- package/dist/bugsnag/client/api/CurrentUser.js +12 -49
- package/dist/bugsnag/client/api/Error.js +29 -142
- package/dist/bugsnag/client/api/Project.js +52 -113
- package/dist/bugsnag/client/api/api.js +3743 -0
- package/dist/bugsnag/client/api/base.js +97 -34
- package/dist/bugsnag/client/api/configuration.js +26 -0
- package/dist/bugsnag/client/api/index.js +2 -0
- package/dist/bugsnag/client/filters.js +28 -0
- package/dist/bugsnag/client.js +104 -155
- package/dist/collaborator/client.js +364 -0
- package/dist/common/server.js +73 -23
- package/dist/common/types.js +6 -1
- package/dist/index.js +9 -1
- package/dist/pactflow/client/prompt-utils.js +2 -1
- package/dist/pactflow/client/tools.js +4 -4
- package/dist/pactflow/client/utils.js +5 -4
- package/dist/pactflow/client.js +10 -9
- package/dist/qmetry/client/api/client-api.js +21 -16
- package/dist/qmetry/client/api/error-handler.js +329 -0
- package/dist/qmetry/client/auto-resolve.js +96 -0
- package/dist/qmetry/client/handlers.js +33 -2
- package/dist/qmetry/client/issues.js +123 -0
- package/dist/qmetry/client/project.js +73 -0
- package/dist/qmetry/client/requirement.js +76 -0
- package/dist/qmetry/client/testcase.js +122 -6
- package/dist/qmetry/client/testsuite.js +272 -0
- package/dist/qmetry/client/tools/index.js +17 -0
- package/dist/qmetry/client/tools/issue-tools.js +545 -0
- package/dist/qmetry/client/tools/project-tools.js +348 -0
- package/dist/qmetry/client/tools/requirement-tools.js +530 -0
- package/dist/qmetry/client/tools/testcase-tools.js +526 -0
- package/dist/qmetry/client/tools/testsuite-tools.js +772 -0
- package/dist/qmetry/client/tools/types.js +1 -0
- package/dist/qmetry/client/utils.js +16 -0
- package/dist/qmetry/client.js +27 -17
- package/dist/qmetry/config/constants.js +28 -0
- package/dist/qmetry/config/rest-endpoints.js +30 -0
- package/dist/qmetry/types/common.js +599 -9
- package/dist/qmetry/types/issues.js +16 -0
- package/dist/qmetry/types/project.js +17 -0
- package/dist/qmetry/types/requirements.js +19 -0
- package/dist/qmetry/types/testcase.js +20 -0
- package/dist/qmetry/types/testsuite.js +44 -0
- package/dist/reflect/client.js +7 -6
- package/dist/zephyr/client.js +7 -1
- package/dist/zephyr/common/api-client.js +8 -0
- package/dist/zephyr/common/auth-service.js +1 -0
- package/dist/zephyr/common/rest-api-schemas.js +5173 -0
- package/dist/zephyr/tool/project/get-project.js +39 -0
- package/dist/zephyr/tool/project/get-projects.js +7 -13
- package/dist/zephyr/tool/test-cycle/get-test-cycles.js +72 -0
- package/package.json +1 -1
- package/dist/bugsnag/client/api/filters.js +0 -167
- package/dist/bugsnag/client/configuration.js +0 -10
- package/dist/bugsnag/client/index.js +0 -2
- package/dist/qmetry/client/tools.js +0 -222
- package/dist/zephyr/common/types.js +0 -35
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* Each tool includes parameters, descriptions, and handler method names.
|
|
6
6
|
* This follows the pattern established in the pactflow module.
|
|
7
7
|
*/
|
|
8
|
-
import { CreatePortalArgsSchema, CreateProductArgsSchema, PortalArgsSchema, ProductArgsSchema, UpdatePortalArgsSchema, UpdateProductArgsSchema, } from "./portal-types.js";
|
|
9
|
-
import { ApiDefinitionParamsSchema, ApiSearchParamsSchema, CreateApiFromTemplateParamsSchema, CreateApiParamsSchema, } from "./registry-types.js";
|
|
8
|
+
import { CreatePortalArgsSchema, CreateProductArgsSchema, CreateTableOfContentsArgsSchema, DeleteDocumentArgsSchema, DeleteTableOfContentsArgsSchema, GetDocumentArgsSchema, GetProductSectionsArgsSchema, GetTableOfContentsArgsSchema, PortalArgsSchema, ProductArgsSchema, PublishProductArgsSchema, UpdateDocumentArgsSchema, UpdatePortalArgsSchema, UpdateProductArgsSchema, } from "./portal-types.js";
|
|
9
|
+
import { ApiDefinitionParamsSchema, ApiSearchParamsSchema, CreateApiFromTemplateParamsSchema, CreateApiParamsSchema, ScanStandardizationParamsSchema, } from "./registry-types.js";
|
|
10
|
+
import { OrganizationsQuerySchema } from "./user-management-types.js";
|
|
10
11
|
export const TOOLS = [
|
|
11
12
|
{
|
|
12
13
|
title: "List Portals",
|
|
@@ -17,82 +18,144 @@ export const TOOLS = [
|
|
|
17
18
|
{
|
|
18
19
|
title: "Create Portal",
|
|
19
20
|
summary: "Create a new portal within API Hub.",
|
|
20
|
-
|
|
21
|
+
inputSchema: CreatePortalArgsSchema,
|
|
21
22
|
handler: "createPortal",
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
25
|
title: "Get Portal",
|
|
25
26
|
summary: "Retrieve information about a specific portal.",
|
|
26
|
-
|
|
27
|
+
inputSchema: PortalArgsSchema,
|
|
27
28
|
handler: "getPortal",
|
|
28
29
|
},
|
|
29
30
|
{
|
|
30
31
|
title: "Delete Portal",
|
|
31
32
|
summary: "Delete a specific portal.",
|
|
32
|
-
|
|
33
|
+
inputSchema: PortalArgsSchema,
|
|
33
34
|
handler: "deletePortal",
|
|
34
35
|
formatResponse: () => "Portal deleted successfully.",
|
|
35
36
|
},
|
|
36
37
|
{
|
|
37
38
|
title: "Update Portal",
|
|
38
39
|
summary: "Update a specific portal's configuration.",
|
|
39
|
-
|
|
40
|
+
inputSchema: UpdatePortalArgsSchema,
|
|
40
41
|
handler: "updatePortal",
|
|
41
42
|
},
|
|
42
43
|
{
|
|
43
44
|
title: "List Portal Products",
|
|
44
45
|
summary: "Get products for a specific portal that match your criteria.",
|
|
45
|
-
|
|
46
|
+
inputSchema: PortalArgsSchema,
|
|
46
47
|
handler: "getPortalProducts",
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
title: "Create Portal Product",
|
|
50
51
|
summary: "Create a new product for a specific portal.",
|
|
51
|
-
|
|
52
|
+
inputSchema: CreateProductArgsSchema,
|
|
52
53
|
handler: "createPortalProduct",
|
|
53
54
|
},
|
|
54
55
|
{
|
|
55
56
|
title: "Get Portal Product",
|
|
56
57
|
summary: "Retrieve information about a specific product resource.",
|
|
57
|
-
|
|
58
|
+
inputSchema: ProductArgsSchema,
|
|
58
59
|
handler: "getPortalProduct",
|
|
59
60
|
},
|
|
60
61
|
{
|
|
61
62
|
title: "Delete Portal Product",
|
|
62
63
|
summary: "Delete a product from a specific portal",
|
|
63
|
-
|
|
64
|
+
inputSchema: ProductArgsSchema,
|
|
64
65
|
handler: "deletePortalProduct",
|
|
65
66
|
formatResponse: () => "Product deleted successfully.",
|
|
66
67
|
},
|
|
67
68
|
{
|
|
68
69
|
title: "Update Portal Product",
|
|
69
70
|
summary: "Update a product's settings within a specific portal.",
|
|
70
|
-
|
|
71
|
+
inputSchema: UpdateProductArgsSchema,
|
|
71
72
|
handler: "updatePortalProduct",
|
|
72
73
|
},
|
|
74
|
+
{
|
|
75
|
+
title: "Publish Portal Product",
|
|
76
|
+
summary: "Publish a product's content to make it live or as preview. This endpoint publishes the current content of a product, making it visible to portal visitors. Use preview mode to test before going live.",
|
|
77
|
+
inputSchema: PublishProductArgsSchema,
|
|
78
|
+
handler: "publishPortalProduct",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
title: "List Portal Product Sections",
|
|
82
|
+
summary: "Get sections for a specific product within a portal.",
|
|
83
|
+
inputSchema: GetProductSectionsArgsSchema,
|
|
84
|
+
handler: "getPortalProductSections",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: "Create Table Of Contents",
|
|
88
|
+
summary: "Create a new table of contents item in a portal product section. Supports API references, HTML content, and Markdown content types.",
|
|
89
|
+
inputSchema: CreateTableOfContentsArgsSchema,
|
|
90
|
+
handler: "createTableOfContents",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
title: "List Table Of Contents",
|
|
94
|
+
summary: "Get table of contents for a section of a product within a portal.",
|
|
95
|
+
inputSchema: GetTableOfContentsArgsSchema,
|
|
96
|
+
handler: "getTableOfContents",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
title: "Delete Table Of Contents",
|
|
100
|
+
summary: "Delete table of contents entry. Performs a soft-delete of an entry from the table of contents. Supports recursive deletion of nested items.",
|
|
101
|
+
inputSchema: DeleteTableOfContentsArgsSchema,
|
|
102
|
+
handler: "deleteTableOfContents",
|
|
103
|
+
},
|
|
104
|
+
// Document management tools
|
|
105
|
+
{
|
|
106
|
+
title: "Get Document",
|
|
107
|
+
summary: "Get document content and metadata by document ID. Useful for retrieving HTML or Markdown content from table of contents items.",
|
|
108
|
+
inputSchema: GetDocumentArgsSchema,
|
|
109
|
+
handler: "getDocument",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
title: "Update Document",
|
|
113
|
+
summary: "Update the content of an existing document. Supports both HTML and Markdown content types.",
|
|
114
|
+
inputSchema: UpdateDocumentArgsSchema,
|
|
115
|
+
handler: "updateDocument",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
title: "Delete Document",
|
|
119
|
+
summary: "Delete a document by its ID. This will permanently remove the document content.",
|
|
120
|
+
inputSchema: DeleteDocumentArgsSchema,
|
|
121
|
+
handler: "deleteDocument",
|
|
122
|
+
},
|
|
73
123
|
// Registry API tools for SwaggerHub Design functionality
|
|
74
124
|
{
|
|
75
125
|
title: "Search APIs and Domains",
|
|
76
126
|
summary: "Search for APIs and Domains in SwaggerHub Registry using the comprehensive /specs endpoint and retrieve metadata including owner, name, description, summary, version, and specification.",
|
|
77
|
-
|
|
127
|
+
inputSchema: ApiSearchParamsSchema,
|
|
78
128
|
handler: "searchApis",
|
|
79
129
|
},
|
|
80
130
|
{
|
|
81
131
|
title: "Get API Definition",
|
|
82
132
|
summary: "Fetch resolved API definition from SwaggerHub Registry based on owner, API name, and version.",
|
|
83
|
-
|
|
133
|
+
inputSchema: ApiDefinitionParamsSchema,
|
|
84
134
|
handler: "getApiDefinition",
|
|
85
135
|
},
|
|
86
136
|
{
|
|
87
137
|
title: "Create or Update API",
|
|
88
138
|
summary: "Create a new API or update an existing API in SwaggerHub Registry for API Hub for Design. The API specification type (OpenAPI, AsyncAPI) is automatically detected from the definition content. APIs are always created with fixed values: version 1.0.0, private visibility, and automock disabled (these values cannot be changed). Returns HTTP 201 for creation, HTTP 200 for update. Response includes 'operation' field indicating whether it was a 'create' or 'update' operation along with API details and SwaggerHub URL.",
|
|
89
|
-
|
|
139
|
+
inputSchema: CreateApiParamsSchema,
|
|
90
140
|
handler: "createOrUpdateApi",
|
|
91
141
|
},
|
|
92
142
|
{
|
|
93
143
|
title: "Create API from Template",
|
|
94
144
|
summary: "Create a new API in SwaggerHub Registry using a predefined template. This endpoint creates APIs based on existing templates without requiring manual definition content. APIs are always created with fixed values: private visibility, no project assignment, and reconciliation enabled (these values cannot be changed). Returns HTTP 201 for creation, HTTP 200 for update. Response includes 'operation' field and API details with SwaggerHub URL.",
|
|
95
|
-
|
|
145
|
+
inputSchema: CreateApiFromTemplateParamsSchema,
|
|
96
146
|
handler: "createApiFromTemplate",
|
|
97
147
|
},
|
|
148
|
+
// User Management API tools for organization management functionality
|
|
149
|
+
{
|
|
150
|
+
title: "List Organizations",
|
|
151
|
+
summary: "Get organizations for a user. Returns a list of organizations that the authenticating user is a member of. On-Premise admin gets a list of all organizations in the system.",
|
|
152
|
+
inputSchema: OrganizationsQuerySchema,
|
|
153
|
+
handler: "getOrganizations",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
title: "Scan API Standardization",
|
|
157
|
+
summary: "Run a standardization scan against an API definition using the organization's standardization configuration. Accepts a YAML or JSON OpenAPI/AsyncAPI definition and returns a list of standardization errors and validation issues.",
|
|
158
|
+
inputSchema: ScanStandardizationParamsSchema,
|
|
159
|
+
handler: "scanStandardization",
|
|
160
|
+
},
|
|
98
161
|
];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Query parameters for getting organizations
|
|
3
|
+
export const OrganizationsQuerySchema = z.object({
|
|
4
|
+
q: z
|
|
5
|
+
.string()
|
|
6
|
+
.optional()
|
|
7
|
+
.describe("Search organizations by partial or full name (case-insensitive)"),
|
|
8
|
+
sortBy: z
|
|
9
|
+
.enum(["NAME", "EMAIL"])
|
|
10
|
+
.optional()
|
|
11
|
+
.describe("The property to sort the results by"),
|
|
12
|
+
order: z.enum(["ASC", "DESC"]).optional().describe("Sort order"),
|
|
13
|
+
page: z
|
|
14
|
+
.number()
|
|
15
|
+
.min(0)
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("0-based index of the page to return"),
|
|
18
|
+
pageSize: z
|
|
19
|
+
.number()
|
|
20
|
+
.min(1)
|
|
21
|
+
.max(1000)
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Number of results per page to return"),
|
|
24
|
+
});
|
package/dist/api-hub/client.js
CHANGED
|
@@ -44,6 +44,33 @@ export class ApiHubClient {
|
|
|
44
44
|
const { productId, ...body } = args;
|
|
45
45
|
return this.api.updatePortalProduct(productId, body);
|
|
46
46
|
}
|
|
47
|
+
async publishPortalProduct(args) {
|
|
48
|
+
const { productId, preview } = args;
|
|
49
|
+
return this.api.publishPortalProduct(productId, preview);
|
|
50
|
+
}
|
|
51
|
+
async getPortalProductSections(args) {
|
|
52
|
+
const { productId, ...params } = args;
|
|
53
|
+
return this.api.getPortalProductSections(productId, params);
|
|
54
|
+
}
|
|
55
|
+
async createTableOfContents(args) {
|
|
56
|
+
const { sectionId, ...body } = args;
|
|
57
|
+
return this.api.createTableOfContents(sectionId, body);
|
|
58
|
+
}
|
|
59
|
+
async getTableOfContents(args) {
|
|
60
|
+
return this.api.getTableOfContents(args);
|
|
61
|
+
}
|
|
62
|
+
async getDocument(args) {
|
|
63
|
+
return this.api.getDocument(args);
|
|
64
|
+
}
|
|
65
|
+
async updateDocument(args) {
|
|
66
|
+
return this.api.updateDocument(args);
|
|
67
|
+
}
|
|
68
|
+
async deleteDocument(args) {
|
|
69
|
+
return this.api.deleteDocument(args);
|
|
70
|
+
}
|
|
71
|
+
async deleteTableOfContents(args) {
|
|
72
|
+
return this.api.deleteTableOfContents(args);
|
|
73
|
+
}
|
|
47
74
|
// Registry API methods for SwaggerHub Design functionality
|
|
48
75
|
async searchApis(args = {}) {
|
|
49
76
|
return this.api.searchApis(args);
|
|
@@ -57,6 +84,13 @@ export class ApiHubClient {
|
|
|
57
84
|
async createApiFromTemplate(args) {
|
|
58
85
|
return this.api.createApiFromTemplate(args);
|
|
59
86
|
}
|
|
87
|
+
// User Management API methods
|
|
88
|
+
async getOrganizations(args) {
|
|
89
|
+
return this.api.getOrganizations(args);
|
|
90
|
+
}
|
|
91
|
+
async scanStandardization(args) {
|
|
92
|
+
return this.api.scanStandardization(args);
|
|
93
|
+
}
|
|
60
94
|
registerTools(register, _getInput) {
|
|
61
95
|
TOOLS.forEach((tool) => {
|
|
62
96
|
const { handler, formatResponse, ...toolParams } = tool;
|
|
@@ -1,41 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CurrentUserApiFetchParamCreator, } from "./api.js";
|
|
2
|
+
import { BaseAPI } from "./base.js";
|
|
2
3
|
import { ProjectAPI } from "./Project.js";
|
|
3
|
-
// --- API Class ---
|
|
4
4
|
export class CurrentUserAPI extends BaseAPI {
|
|
5
|
-
static
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
5
|
+
static organizationFields = [
|
|
6
|
+
"id",
|
|
7
|
+
"name",
|
|
8
|
+
"slug",
|
|
9
9
|
];
|
|
10
|
-
static organizationFields = ["id", "name", "slug"];
|
|
11
|
-
constructor(configuration) {
|
|
12
|
-
super(configuration, CurrentUserAPI.filterFields);
|
|
13
|
-
}
|
|
14
10
|
/**
|
|
15
11
|
* List the current user's organizations
|
|
16
12
|
* GET /user/organizations
|
|
17
13
|
*/
|
|
18
|
-
async listUserOrganizations(options = {}) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
if (admin !== undefined)
|
|
22
|
-
params.append("admin", String(admin));
|
|
23
|
-
for (const [key, value] of Object.entries(queryOptions)) {
|
|
24
|
-
if (value !== undefined)
|
|
25
|
-
params.append(key, String(value));
|
|
26
|
-
}
|
|
27
|
-
const url = params.toString()
|
|
28
|
-
? `/user/organizations?${params}`
|
|
29
|
-
: "/user/organizations";
|
|
30
|
-
const data = await this.request({
|
|
31
|
-
method: "GET",
|
|
32
|
-
url,
|
|
33
|
-
});
|
|
34
|
-
// Only return allowed fields
|
|
35
|
-
return {
|
|
36
|
-
...data,
|
|
37
|
-
body: pickFieldsFromArray(data.body || [], CurrentUserAPI.organizationFields),
|
|
38
|
-
};
|
|
14
|
+
async listUserOrganizations(admin, perPage, options = {}) {
|
|
15
|
+
const localVarFetchArgs = CurrentUserApiFetchParamCreator(this.configuration).listUserOrganizations(admin, perPage, options);
|
|
16
|
+
return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, true, CurrentUserAPI.organizationFields);
|
|
39
17
|
}
|
|
40
18
|
/**
|
|
41
19
|
* List projects for a given organization
|
|
@@ -44,23 +22,8 @@ export class CurrentUserAPI extends BaseAPI {
|
|
|
44
22
|
* @param options Optional parameters for filtering, pagination, etc.
|
|
45
23
|
* @returns A promise that resolves to the list of projects in the organization
|
|
46
24
|
*/
|
|
47
|
-
async getOrganizationProjects(organizationId,
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
for (const [key, value] of Object.entries(queryOptions)) {
|
|
51
|
-
if (value !== undefined)
|
|
52
|
-
params.append(key, String(value));
|
|
53
|
-
}
|
|
54
|
-
const url = params.toString()
|
|
55
|
-
? `/organizations/${organizationId}/projects?${params}`
|
|
56
|
-
: `/organizations/${organizationId}/projects`;
|
|
57
|
-
const data = await this.request({
|
|
58
|
-
method: "GET",
|
|
59
|
-
url,
|
|
60
|
-
});
|
|
61
|
-
return {
|
|
62
|
-
...data,
|
|
63
|
-
body: pickFieldsFromArray(data.body || [], ProjectAPI.projectFields),
|
|
64
|
-
};
|
|
25
|
+
async getOrganizationProjects(organizationId, q, sort, direction, perPage, options) {
|
|
26
|
+
const localVarFetchArgs = CurrentUserApiFetchParamCreator(this.configuration).getOrganizationProjects(organizationId, q, sort, direction, perPage, options);
|
|
27
|
+
return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, true, ProjectAPI.projectFields);
|
|
65
28
|
}
|
|
66
29
|
}
|
|
@@ -1,177 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export const ErrorOperations = [
|
|
4
|
-
"override_severity",
|
|
5
|
-
"assign",
|
|
6
|
-
"create_issue",
|
|
7
|
-
"link_issue",
|
|
8
|
-
"unlink_issue",
|
|
9
|
-
"open",
|
|
10
|
-
"snooze",
|
|
11
|
-
"fix",
|
|
12
|
-
"ignore",
|
|
13
|
-
"delete",
|
|
14
|
-
"discard",
|
|
15
|
-
"undiscard",
|
|
16
|
-
];
|
|
17
|
-
export const ReopenConditions = [
|
|
18
|
-
"occurs_after",
|
|
19
|
-
"n_occurrences_in_m_hours",
|
|
20
|
-
"n_additional_occurrences",
|
|
21
|
-
"n_additional_users",
|
|
22
|
-
];
|
|
23
|
-
// --- API Class ---
|
|
1
|
+
import { ErrorsApiFetchParamCreator, } from "./api.js";
|
|
2
|
+
import { BaseAPI, getQueryParams } from "./base.js";
|
|
24
3
|
export class ErrorAPI extends BaseAPI {
|
|
25
4
|
static filterFields = ["url", "project_url", "events_url"];
|
|
26
|
-
constructor(configuration) {
|
|
27
|
-
super(configuration, ErrorAPI.filterFields);
|
|
28
|
-
}
|
|
29
5
|
/**
|
|
30
6
|
* View an Error on a Project
|
|
31
7
|
* GET /projects/{project_id}/errors/{error_id}
|
|
32
8
|
*/
|
|
33
|
-
async viewErrorOnProject(projectId, errorId
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
if (value !== undefined)
|
|
37
|
-
params.append(key, String(value));
|
|
38
|
-
}
|
|
39
|
-
const url = params.toString()
|
|
40
|
-
? `/projects/${projectId}/errors/${errorId}?${params}`
|
|
41
|
-
: `/projects/${projectId}/errors/${errorId}`;
|
|
42
|
-
return (await this.request({
|
|
43
|
-
method: "GET",
|
|
44
|
-
url,
|
|
45
|
-
}));
|
|
9
|
+
async viewErrorOnProject(projectId, errorId) {
|
|
10
|
+
const localVarFetchArgs = ErrorsApiFetchParamCreator(this.configuration).viewErrorOnProject(projectId, errorId);
|
|
11
|
+
return await this.requestObject(localVarFetchArgs.url, localVarFetchArgs.options);
|
|
46
12
|
}
|
|
47
13
|
/**
|
|
48
14
|
* Get the latest Event in a Project, with optional filters
|
|
49
15
|
* GET /projects/{project_id}/events
|
|
50
16
|
*/
|
|
51
|
-
async
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
method: "GET",
|
|
55
|
-
url,
|
|
56
|
-
});
|
|
57
|
-
return {
|
|
58
|
-
...response,
|
|
59
|
-
body: response.body && response.body.length > 0
|
|
60
|
-
? response.body[0]
|
|
61
|
-
: undefined, // Return only the latest event
|
|
62
|
-
};
|
|
17
|
+
async listEventsOnProject(projectId, base, sort, direction, perPage, filters, fullReports) {
|
|
18
|
+
const localVarFetchArgs = ErrorsApiFetchParamCreator(this.configuration).listEventsOnProject(projectId, base ?? undefined, sort, direction, perPage, undefined, fullReports, { query: filters });
|
|
19
|
+
return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, false);
|
|
63
20
|
}
|
|
64
21
|
/**
|
|
65
22
|
* View an Event by ID
|
|
66
23
|
* GET /projects/{project_id}/events/{event_id}
|
|
67
24
|
*/
|
|
68
|
-
async viewEventById(projectId, eventId
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
if (value !== undefined)
|
|
72
|
-
params.append(key, String(value));
|
|
73
|
-
}
|
|
74
|
-
const url = params.toString()
|
|
75
|
-
? `/projects/${projectId}/events/${eventId}?${params}`
|
|
76
|
-
: `/projects/${projectId}/events/${eventId}`;
|
|
77
|
-
return (await this.request({
|
|
78
|
-
method: "GET",
|
|
79
|
-
url,
|
|
80
|
-
}));
|
|
25
|
+
async viewEventById(projectId, eventId) {
|
|
26
|
+
const localVarFetchArgs = ErrorsApiFetchParamCreator(this.configuration).viewEventById(projectId, eventId);
|
|
27
|
+
return await this.requestObject(localVarFetchArgs.url, localVarFetchArgs.options);
|
|
81
28
|
}
|
|
82
29
|
/**
|
|
83
30
|
* List the Errors on a Project
|
|
84
31
|
* GET /projects/{project_id}/errors
|
|
85
32
|
*/
|
|
86
|
-
async listProjectErrors(projectId,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
33
|
+
async listProjectErrors(projectId, base, sort, direction, perPage, filters, nextUrl) {
|
|
34
|
+
const options = getQueryParams(nextUrl, nextUrl ? undefined : filters);
|
|
35
|
+
if (nextUrl) {
|
|
36
|
+
if (perPage) {
|
|
37
|
+
// Next links need to be used as-is to ensure results are consistent, so only the page size can be modified
|
|
38
|
+
// the others will get overridden
|
|
39
|
+
options.query.per_page = perPage.toString();
|
|
93
40
|
}
|
|
94
|
-
|
|
41
|
+
direction = undefined;
|
|
42
|
+
sort = undefined;
|
|
43
|
+
base = undefined;
|
|
95
44
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
// Add filter parameters
|
|
99
|
-
if (options.filters) {
|
|
100
|
-
const filterParams = new URLSearchParams(toQueryString(options.filters));
|
|
101
|
-
filterParams.forEach((value, key) => {
|
|
102
|
-
params.append(key, value);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
// Add pagination and sorting parameters
|
|
106
|
-
if (options.base !== undefined) {
|
|
107
|
-
params.append("base", options.base);
|
|
108
|
-
}
|
|
109
|
-
if (options.sort !== undefined) {
|
|
110
|
-
params.append("sort", options.sort);
|
|
111
|
-
}
|
|
112
|
-
if (options.direction !== undefined) {
|
|
113
|
-
params.append("direction", options.direction);
|
|
114
|
-
}
|
|
115
|
-
if (options.per_page !== undefined) {
|
|
116
|
-
params.append("per_page", options.per_page.toString());
|
|
117
|
-
}
|
|
118
|
-
if (params.size > 0) {
|
|
119
|
-
url = `/projects/${projectId}/errors?${params}`;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return (await this.request({
|
|
123
|
-
method: "GET",
|
|
124
|
-
url,
|
|
125
|
-
}, false));
|
|
45
|
+
const localVarFetchArgs = ErrorsApiFetchParamCreator(this.configuration).listProjectErrors(projectId, base ?? undefined, sort, direction, perPage, undefined, options);
|
|
46
|
+
return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, false);
|
|
126
47
|
}
|
|
127
48
|
/**
|
|
128
49
|
* Update an Error on a Project
|
|
129
50
|
* PATCH /projects/{project_id}/errors/{error_id}
|
|
130
51
|
*/
|
|
131
|
-
async updateErrorOnProject(projectId, errorId,
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
if (value !== undefined)
|
|
135
|
-
params.append(key, String(value));
|
|
136
|
-
}
|
|
137
|
-
const url = params.toString()
|
|
138
|
-
? `/projects/${projectId}/errors/${errorId}?${params}`
|
|
139
|
-
: `/projects/${projectId}/errors/${errorId}`;
|
|
140
|
-
return (await this.request({
|
|
141
|
-
method: "PATCH",
|
|
142
|
-
url,
|
|
143
|
-
body: data,
|
|
144
|
-
}));
|
|
52
|
+
async updateErrorOnProject(projectId, errorId, body) {
|
|
53
|
+
const localVarFetchArgs = ErrorsApiFetchParamCreator(this.configuration).updateErrorOnProject(body, projectId, errorId);
|
|
54
|
+
return await this.requestObject(localVarFetchArgs.url, localVarFetchArgs.options);
|
|
145
55
|
}
|
|
146
56
|
/**
|
|
147
57
|
* List Pivots on an Error
|
|
148
58
|
* GET /projects/{project_id}/errors/{error_id}/pivots
|
|
149
59
|
*/
|
|
150
|
-
async
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
const filterParams = new URLSearchParams(toQueryString(options.filters));
|
|
154
|
-
filterParams.forEach((value, key) => {
|
|
155
|
-
params.append(key, value);
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
if (options.summary_size !== undefined) {
|
|
159
|
-
params.append("summary_size", options.summary_size.toString());
|
|
160
|
-
}
|
|
161
|
-
if (options.pivots && options.pivots.length > 0) {
|
|
162
|
-
options.pivots.forEach((pivot) => {
|
|
163
|
-
params.append("pivots[]", pivot);
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
if (options.per_page !== undefined) {
|
|
167
|
-
params.append("per_page", options.per_page.toString());
|
|
168
|
-
}
|
|
169
|
-
const url = params.toString()
|
|
170
|
-
? `/projects/${projectId}/errors/${errorId}/pivots?${params}`
|
|
171
|
-
: `/projects/${projectId}/errors/${errorId}/pivots`;
|
|
172
|
-
return await this.request({
|
|
173
|
-
method: "GET",
|
|
174
|
-
url,
|
|
175
|
-
});
|
|
60
|
+
async getPivotValuesOnAnError(projectId, errorId, filters, summarySize, pivots, perPage) {
|
|
61
|
+
const localVarFetchArgs = ErrorsApiFetchParamCreator(this.configuration).listPivotsOnAnError(projectId, errorId, undefined, summarySize, pivots, perPage, { query: filters });
|
|
62
|
+
return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, false);
|
|
176
63
|
}
|
|
177
64
|
}
|