@smartbear/mcp 0.12.0 → 0.13.1
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 +30 -6
- package/dist/bugsnag/client/api/CurrentUser.js +50 -26
- package/dist/bugsnag/client/api/Error.js +158 -57
- package/dist/bugsnag/client/api/Project.js +398 -243
- package/dist/bugsnag/client/api/api.js +4087 -3837
- package/dist/bugsnag/client/api/base.js +155 -173
- package/dist/bugsnag/client/api/configuration.js +28 -25
- package/dist/bugsnag/client/filters.js +11 -20
- package/dist/bugsnag/client.js +1398 -1277
- package/dist/bugsnag/input-schemas.js +39 -57
- package/dist/collaborator/client.js +335 -371
- package/dist/common/bugsnag.js +5 -3
- package/dist/common/cache.js +50 -57
- package/dist/common/client-registry.js +106 -119
- package/dist/common/info.js +7 -3
- package/dist/common/register-clients.js +0 -16
- package/dist/common/server.js +270 -228
- package/dist/common/tools.js +19 -0
- package/dist/common/transport-http.js +252 -343
- package/dist/common/transport-stdio.js +40 -37
- package/dist/common/zod-utils.js +20 -0
- package/dist/index.js +18 -23
- package/dist/package.json.js +11 -0
- package/dist/pactflow/client/ai.js +142 -169
- package/dist/pactflow/client/base.js +41 -51
- package/dist/pactflow/client/prompt-utils.js +93 -84
- package/dist/pactflow/client/prompts.js +95 -92
- package/dist/pactflow/client/tools.js +94 -83
- package/dist/pactflow/client/utils.js +60 -64
- package/dist/pactflow/client.js +399 -320
- package/dist/qmetry/client/api/client-api.js +43 -41
- package/dist/qmetry/client/api/error-handler.js +264 -310
- package/dist/qmetry/client/auto-resolve.js +78 -99
- package/dist/qmetry/client/automation.js +139 -162
- package/dist/qmetry/client/handlers.js +49 -46
- package/dist/qmetry/client/issues.js +133 -115
- package/dist/qmetry/client/project.js +153 -174
- package/dist/qmetry/client/requirement.js +82 -70
- package/dist/qmetry/client/testcase.js +240 -208
- package/dist/qmetry/client/testsuite.js +332 -293
- package/dist/qmetry/client/tools/automation-tools.js +291 -288
- package/dist/qmetry/client/tools/index.js +16 -13
- package/dist/qmetry/client/tools/issue-tools.js +534 -543
- package/dist/qmetry/client/tools/project-tools.js +635 -656
- package/dist/qmetry/client/tools/requirement-tools.js +525 -528
- package/dist/qmetry/client/tools/testcase-tools.js +773 -786
- package/dist/qmetry/client/tools/testsuite-tools.js +1069 -1083
- package/dist/qmetry/client/utils.js +8 -14
- package/dist/qmetry/client.js +111 -109
- package/dist/qmetry/config/constants.js +48 -44
- package/dist/qmetry/config/rest-endpoints.js +51 -48
- package/dist/qmetry/types/automation.js +7 -7
- package/dist/qmetry/types/common.js +763 -1049
- package/dist/qmetry/types/issues.js +26 -19
- package/dist/qmetry/types/project.js +32 -25
- package/dist/qmetry/types/requirements.js +26 -21
- package/dist/qmetry/types/testcase.js +55 -44
- package/dist/qmetry/types/testsuite.js +66 -52
- package/dist/reflect/client.js +284 -226
- package/dist/swagger/client/api.js +645 -662
- package/dist/swagger/client/configuration.js +31 -33
- package/dist/swagger/client/portal-types.js +204 -244
- package/dist/swagger/client/registry-types.js +62 -96
- package/dist/swagger/client/tools.js +148 -158
- package/dist/swagger/client/user-management-types.js +11 -22
- package/dist/swagger/client.js +143 -135
- package/dist/swagger/config-utils.js +10 -16
- package/dist/zephyr/client.js +43 -42
- package/dist/zephyr/common/api-client.js +35 -30
- package/dist/zephyr/common/auth-service.js +16 -13
- package/dist/zephyr/common/rest-api-schemas.js +3173 -5146
- package/dist/zephyr/tool/environment/get-environments.js +66 -66
- package/dist/zephyr/tool/priority/get-priorities.js +41 -41
- package/dist/zephyr/tool/project/get-project.js +37 -37
- package/dist/zephyr/tool/project/get-projects.js +46 -46
- package/dist/zephyr/tool/status/get-statuses.js +47 -47
- package/dist/zephyr/tool/test-case/get-test-case.js +37 -37
- package/dist/zephyr/tool/test-case/get-test-cases.js +62 -62
- package/dist/zephyr/tool/test-cycle/get-test-cycle.js +37 -37
- package/dist/zephyr/tool/test-cycle/get-test-cycles.js +70 -70
- package/dist/zephyr/tool/test-execution/get-test-execution.js +37 -37
- package/dist/zephyr/tool/test-execution/get-test-executions.js +43 -43
- package/package.json +5 -5
- package/dist/bugsnag/client/api/index.js +0 -6
- package/dist/common/types.js +0 -6
- package/dist/qmetry/client/tools/types.js +0 -1
- package/dist/swagger/client/index.js +0 -6
- package/dist/tests/unit/bugsnag/utils/factories.js +0 -86
- package/dist/zephyr/tool/zephyr-tool.js +0 -1
|
@@ -1,259 +1,414 @@
|
|
|
1
1
|
import { toUrlSearchParams } from "../filters.js";
|
|
2
|
-
import { ProjectsApiFetchParamCreator } from "./api.js";
|
|
3
2
|
import { BaseAPI, getQueryParams } from "./base.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
3
|
+
import { ProjectsApiFetchParamCreator } from "./api.js";
|
|
4
|
+
class ProjectAPI extends BaseAPI {
|
|
5
|
+
static projectFields = [
|
|
6
|
+
"id",
|
|
7
|
+
"name",
|
|
8
|
+
"slug",
|
|
9
|
+
"api_key",
|
|
10
|
+
"stability_target_type",
|
|
11
|
+
"target_stability",
|
|
12
|
+
"critical_stability"
|
|
13
|
+
];
|
|
14
|
+
static eventFieldFields = [
|
|
15
|
+
"custom",
|
|
16
|
+
"display_id",
|
|
17
|
+
"filter_options",
|
|
18
|
+
"pivot_options"
|
|
19
|
+
];
|
|
20
|
+
static buildFields = [
|
|
21
|
+
"id",
|
|
22
|
+
"release_time",
|
|
23
|
+
"app_version",
|
|
24
|
+
"release_stage",
|
|
25
|
+
"errors_introduced_count",
|
|
26
|
+
"errors_seen_count",
|
|
27
|
+
"total_sessions_count",
|
|
28
|
+
"unhandled_sessions_count",
|
|
29
|
+
"accumulative_daily_users_seen",
|
|
30
|
+
"accumulative_daily_users_with_unhandled"
|
|
31
|
+
];
|
|
32
|
+
static releaseFields = [
|
|
33
|
+
"id",
|
|
34
|
+
"release_stage_name",
|
|
35
|
+
"app_version",
|
|
36
|
+
"first_released_at",
|
|
37
|
+
"first_release_id",
|
|
38
|
+
"releases_count",
|
|
39
|
+
"visible",
|
|
40
|
+
"total_sessions_count",
|
|
41
|
+
"unhandled_sessions_count",
|
|
42
|
+
"sessions_count_in_last_24h",
|
|
43
|
+
"accumulative_daily_users_seen",
|
|
44
|
+
"accumulative_daily_users_with_unhandled"
|
|
45
|
+
];
|
|
46
|
+
/**
|
|
47
|
+
* List the Event Fields for a Project
|
|
48
|
+
* GET /projects/{project_id}/event_fields
|
|
49
|
+
* @param projectId The project ID
|
|
50
|
+
* @returns A promise that resolves to the list of event fields
|
|
51
|
+
*/
|
|
52
|
+
async listProjectEventFields(projectId) {
|
|
53
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
54
|
+
this.configuration
|
|
55
|
+
).listProjectEventFields(projectId);
|
|
56
|
+
return await this.requestArray(
|
|
57
|
+
localVarFetchArgs.url,
|
|
58
|
+
localVarFetchArgs.options,
|
|
59
|
+
true,
|
|
60
|
+
ProjectAPI.eventFieldFields
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Retrieves a specific build from a project.
|
|
65
|
+
* GET /projects/{project_id}/releases/{release_id}
|
|
66
|
+
* @param projectId The ID of the project.
|
|
67
|
+
* @param releaseId The ID of the release to retrieve.
|
|
68
|
+
* @returns A promise that resolves to the release data.
|
|
69
|
+
*/
|
|
70
|
+
async getProjectReleaseById(projectId, releaseId) {
|
|
71
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
72
|
+
this.configuration
|
|
73
|
+
).getProjectReleaseById(projectId, releaseId);
|
|
74
|
+
return await this.requestObject(
|
|
75
|
+
localVarFetchArgs.url,
|
|
76
|
+
localVarFetchArgs.options,
|
|
77
|
+
ProjectAPI.buildFields
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Lists releases for a specific project.
|
|
82
|
+
* GET /projects/{project_id}/release_groups
|
|
83
|
+
* @param projectId The ID of the project.
|
|
84
|
+
* @param releaseStageName The name of the release stage to filter by.
|
|
85
|
+
* @param topOnly Whether to only include top-level releases.
|
|
86
|
+
* @param visibleOnly Whether to only include visible releases.
|
|
87
|
+
* @param perPage The number of results per page.
|
|
88
|
+
* @param nextUrl Optional URL for next page (overrides other pagination params).
|
|
89
|
+
* @returns A promise that resolves to an array of `ReleaseSummaryResponse` objects.
|
|
90
|
+
*/
|
|
91
|
+
async listProjectReleaseGroups(projectId, releaseStageName, topOnly, visibleOnly, perPage, nextUrl) {
|
|
92
|
+
if (nextUrl) {
|
|
93
|
+
topOnly = void 0;
|
|
94
|
+
visibleOnly = void 0;
|
|
66
95
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
options);
|
|
85
|
-
return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, false, // Paginate results
|
|
86
|
-
ProjectAPI.releaseFields);
|
|
96
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
97
|
+
this.configuration
|
|
98
|
+
).listProjectReleaseGroups(
|
|
99
|
+
projectId,
|
|
100
|
+
releaseStageName,
|
|
101
|
+
topOnly,
|
|
102
|
+
visibleOnly,
|
|
103
|
+
perPage,
|
|
104
|
+
void 0,
|
|
105
|
+
void 0
|
|
106
|
+
);
|
|
107
|
+
const url = new URL(
|
|
108
|
+
nextUrl ?? localVarFetchArgs.url,
|
|
109
|
+
this.configuration.basePath
|
|
110
|
+
);
|
|
111
|
+
if (perPage) {
|
|
112
|
+
url.searchParams.set("per_page", perPage.toString());
|
|
87
113
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
114
|
+
return await this.requestArray(
|
|
115
|
+
url.toString(),
|
|
116
|
+
localVarFetchArgs.options,
|
|
117
|
+
false,
|
|
118
|
+
// Paginate results
|
|
119
|
+
ProjectAPI.releaseFields
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Retrieves a specific release by its ID.
|
|
124
|
+
* GET /release_groups/{release_id}
|
|
125
|
+
* @param releaseId The ID of the release to retrieve.
|
|
126
|
+
* @returns A promise that resolves to the release data.
|
|
127
|
+
*/
|
|
128
|
+
async getReleaseGroup(releaseId) {
|
|
129
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
130
|
+
this.configuration
|
|
131
|
+
).getReleaseGroup(releaseId);
|
|
132
|
+
return await this.requestObject(
|
|
133
|
+
localVarFetchArgs.url,
|
|
134
|
+
localVarFetchArgs.options,
|
|
135
|
+
ProjectAPI.releaseFields
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Lists builds associated with a specific release group.
|
|
140
|
+
* GET /release_groups/{release_id}/releases
|
|
141
|
+
* @param releaseId The ID of the release group.
|
|
142
|
+
* @return A promise that resolves to an array of `BuildResponse` objects.
|
|
143
|
+
*/
|
|
144
|
+
async listBuildsInRelease(releaseId) {
|
|
145
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
146
|
+
this.configuration
|
|
147
|
+
).getReleaseGroup(releaseId);
|
|
148
|
+
return await this.requestArray(
|
|
149
|
+
localVarFetchArgs.url,
|
|
150
|
+
localVarFetchArgs.options,
|
|
151
|
+
true,
|
|
152
|
+
ProjectAPI.buildFields
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
// ============================================================================
|
|
156
|
+
// Performance API Methods
|
|
157
|
+
// ============================================================================
|
|
158
|
+
/**
|
|
159
|
+
* List span groups for a project with optional filtering and pagination.
|
|
160
|
+
* GET /projects/{project_id}/span_groups
|
|
161
|
+
* @param projectId The ID of the project to which the Span Groups belong.
|
|
162
|
+
* @param sort The field to sort the span groups by.
|
|
163
|
+
* @param direction The direction to sort the span groups by.
|
|
164
|
+
* @param perPage The number of results per page.
|
|
165
|
+
* @param offset The offset for the next page of results.
|
|
166
|
+
* @param filters The current filters that are being applied.
|
|
167
|
+
* @param starredOnly Whether to only return Span Groups the requesting user has starred.
|
|
168
|
+
* @param nextUrl Optional URL for next page (overrides other pagination params).
|
|
169
|
+
* @returns A promise that resolves to an array of span groups.
|
|
170
|
+
*/
|
|
171
|
+
async listProjectSpanGroups(projectId, sort, direction, perPage, offset, filters, starredOnly, nextUrl) {
|
|
172
|
+
if (nextUrl) {
|
|
173
|
+
sort = void 0;
|
|
174
|
+
direction = void 0;
|
|
175
|
+
offset = void 0;
|
|
97
176
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
177
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
178
|
+
this.configuration
|
|
179
|
+
).listProjectSpanGroups(
|
|
180
|
+
projectId,
|
|
181
|
+
sort,
|
|
182
|
+
direction,
|
|
183
|
+
perPage,
|
|
184
|
+
offset,
|
|
185
|
+
void 0,
|
|
186
|
+
// Filters are encoded separately below
|
|
187
|
+
starredOnly,
|
|
188
|
+
void 0
|
|
189
|
+
);
|
|
190
|
+
const url = new URL(
|
|
191
|
+
nextUrl ?? localVarFetchArgs.url,
|
|
192
|
+
this.configuration.basePath
|
|
193
|
+
);
|
|
194
|
+
if (perPage) {
|
|
195
|
+
url.searchParams.set("per_page", perPage.toString());
|
|
107
196
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
* List span groups for a project with optional filtering and pagination.
|
|
113
|
-
* GET /projects/{project_id}/span_groups
|
|
114
|
-
* @param projectId The ID of the project to which the Span Groups belong.
|
|
115
|
-
* @param sort The field to sort the span groups by.
|
|
116
|
-
* @param direction The direction to sort the span groups by.
|
|
117
|
-
* @param perPage The number of results per page.
|
|
118
|
-
* @param offset The offset for the next page of results.
|
|
119
|
-
* @param filters The current filters that are being applied.
|
|
120
|
-
* @param starredOnly Whether to only return Span Groups the requesting user has starred.
|
|
121
|
-
* @param nextUrl Optional URL for next page (overrides other pagination params).
|
|
122
|
-
* @returns A promise that resolves to an array of span groups.
|
|
123
|
-
*/
|
|
124
|
-
async listProjectSpanGroups(projectId, sort, direction, perPage, offset, filters, starredOnly, nextUrl) {
|
|
125
|
-
const options = getQueryParams(nextUrl);
|
|
126
|
-
if (nextUrl) {
|
|
127
|
-
options.query.per_page = perPage ? perPage.toString() : undefined;
|
|
128
|
-
}
|
|
129
|
-
// Serialize filters if provided
|
|
130
|
-
if (filters) {
|
|
131
|
-
Object.assign(options.query, toUrlSearchParams(filters));
|
|
132
|
-
}
|
|
133
|
-
const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).listProjectSpanGroups(projectId, sort, direction, perPage, offset, undefined, // Don't pass filters to API - already serialized in options
|
|
134
|
-
starredOnly, options);
|
|
135
|
-
return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, false);
|
|
197
|
+
if (!nextUrl && filters) {
|
|
198
|
+
toUrlSearchParams(filters).forEach((value, key) => {
|
|
199
|
+
url.searchParams.append(key, value);
|
|
200
|
+
});
|
|
136
201
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
202
|
+
return await this.requestArray(
|
|
203
|
+
url.toString(),
|
|
204
|
+
localVarFetchArgs.options,
|
|
205
|
+
false
|
|
206
|
+
// Paginate results
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Get detailed information about a specific span group.
|
|
211
|
+
* GET /projects/{project_id}/span_groups/{id}
|
|
212
|
+
* @param projectId The ID of the project to which the Span Group belongs.
|
|
213
|
+
* @param id The ID of the Span Group.
|
|
214
|
+
* @param filters The current filters that are being applied.
|
|
215
|
+
* @returns A promise that resolves to the span group.
|
|
216
|
+
*/
|
|
217
|
+
async getProjectSpanGroup(projectId, id, filters) {
|
|
218
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
219
|
+
this.configuration
|
|
220
|
+
).getProjectSpanGroup(projectId, id, void 0, void 0);
|
|
221
|
+
const url = new URL(localVarFetchArgs.url, this.configuration.basePath);
|
|
222
|
+
if (filters) {
|
|
223
|
+
toUrlSearchParams(filters).forEach((value, key) => {
|
|
224
|
+
url.searchParams.append(key, value);
|
|
225
|
+
});
|
|
152
226
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
227
|
+
return await this.requestObject(
|
|
228
|
+
url.toString(),
|
|
229
|
+
localVarFetchArgs.options
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Get time-series performance metrics for a span group.
|
|
234
|
+
* GET /projects/{project_id}/span_groups/{id}/timeline
|
|
235
|
+
* @param projectId The ID of the project to which the Span Group belongs.
|
|
236
|
+
* @param id The ID of the Span Group.
|
|
237
|
+
* @param filters The current filters that are being applied.
|
|
238
|
+
* @returns A promise that resolves to the timeline data.
|
|
239
|
+
*/
|
|
240
|
+
async getProjectSpanGroupTimeline(projectId, id, filters) {
|
|
241
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
242
|
+
this.configuration
|
|
243
|
+
).getProjectSpanGroupTimeline(projectId, id, void 0, void 0);
|
|
244
|
+
const url = new URL(localVarFetchArgs.url, this.configuration.basePath);
|
|
245
|
+
if (filters) {
|
|
246
|
+
toUrlSearchParams(filters).forEach((value, key) => {
|
|
247
|
+
url.searchParams.append(key, value);
|
|
248
|
+
});
|
|
168
249
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
250
|
+
return await this.requestObject(
|
|
251
|
+
url.toString(),
|
|
252
|
+
localVarFetchArgs.options
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Get distribution histogram of span durations for a span group.
|
|
257
|
+
* GET /projects/{project_id}/span_groups/{id}/distribution
|
|
258
|
+
* @param projectId The ID of the project to which the Span Group belongs.
|
|
259
|
+
* @param id The ID of the Span Group.
|
|
260
|
+
* @param filters The current filters that are being applied.
|
|
261
|
+
* @returns A promise that resolves to the distribution data.
|
|
262
|
+
*/
|
|
263
|
+
async getProjectSpanGroupDistribution(projectId, id, filters) {
|
|
264
|
+
if (filters) {
|
|
265
|
+
toUrlSearchParams(filters);
|
|
184
266
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
* @param perPage The number of results per page.
|
|
194
|
-
* @param nextUrl Optional URL for next page (overrides other pagination params).
|
|
195
|
-
* @returns A promise that resolves to an array of spans.
|
|
196
|
-
*/
|
|
197
|
-
async listSpansBySpanGroupId(projectId, id, filters, sort, direction, perPage, nextUrl) {
|
|
198
|
-
const options = getQueryParams(nextUrl);
|
|
199
|
-
if (nextUrl) {
|
|
200
|
-
options.query.per_page = perPage ? perPage.toString() : undefined;
|
|
201
|
-
}
|
|
202
|
-
if (filters) {
|
|
203
|
-
Object.assign(options.query, toUrlSearchParams(filters));
|
|
204
|
-
}
|
|
205
|
-
const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).listSpansBySpanGroupId(projectId, id, undefined, sort, direction, perPage, options);
|
|
206
|
-
return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, false);
|
|
267
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
268
|
+
this.configuration
|
|
269
|
+
).getProjectSpanGroupDistribution(projectId, id, void 0, void 0);
|
|
270
|
+
const url = new URL(localVarFetchArgs.url, this.configuration.basePath);
|
|
271
|
+
if (filters) {
|
|
272
|
+
toUrlSearchParams(filters).forEach((value, key) => {
|
|
273
|
+
url.searchParams.append(key, value);
|
|
274
|
+
});
|
|
207
275
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
276
|
+
return await this.requestObject(
|
|
277
|
+
url.toString(),
|
|
278
|
+
localVarFetchArgs.options
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* List individual spans for a specific span group with filtering and sorting.
|
|
283
|
+
* GET /projects/{project_id}/span_groups/{id}/spans
|
|
284
|
+
* @param projectId The ID of the project to which the spans belong.
|
|
285
|
+
* @param id The ID of the Span Group.
|
|
286
|
+
* @param filters The current filters that are being applied.
|
|
287
|
+
* @param sort The field to sort the spans by.
|
|
288
|
+
* @param direction The direction to sort the spans by.
|
|
289
|
+
* @param perPage The number of results per page.
|
|
290
|
+
* @param nextUrl Optional URL for next page (overrides other pagination params).
|
|
291
|
+
* @returns A promise that resolves to an array of spans.
|
|
292
|
+
*/
|
|
293
|
+
async listSpansBySpanGroupId(projectId, id, filters, sort, direction, perPage, nextUrl) {
|
|
294
|
+
if (nextUrl) {
|
|
295
|
+
sort = void 0;
|
|
296
|
+
direction = void 0;
|
|
227
297
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
298
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
299
|
+
this.configuration
|
|
300
|
+
).listSpansBySpanGroupId(
|
|
301
|
+
projectId,
|
|
302
|
+
id,
|
|
303
|
+
void 0,
|
|
304
|
+
sort,
|
|
305
|
+
direction,
|
|
306
|
+
perPage,
|
|
307
|
+
void 0
|
|
308
|
+
);
|
|
309
|
+
const url = new URL(
|
|
310
|
+
nextUrl ?? localVarFetchArgs.url,
|
|
311
|
+
this.configuration.basePath
|
|
312
|
+
);
|
|
313
|
+
if (perPage) {
|
|
314
|
+
url.searchParams.set("per_page", perPage.toString());
|
|
237
315
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
* @returns A promise that resolves to the network grouping ruleset.
|
|
243
|
-
*/
|
|
244
|
-
async getProjectNetworkGroupingRuleset(projectId) {
|
|
245
|
-
const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getProjectNetworkGroupingRuleset(projectId);
|
|
246
|
-
return await this.requestObject(localVarFetchArgs.url, localVarFetchArgs.options);
|
|
316
|
+
if (!nextUrl && filters) {
|
|
317
|
+
toUrlSearchParams(filters).forEach((value, key) => {
|
|
318
|
+
url.searchParams.append(key, value);
|
|
319
|
+
});
|
|
247
320
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
321
|
+
return await this.requestArray(
|
|
322
|
+
url.toString(),
|
|
323
|
+
localVarFetchArgs.options,
|
|
324
|
+
false
|
|
325
|
+
// Paginate results
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* List all spans that belong to a specific trace.
|
|
330
|
+
* GET /projects/{project_id}/traces/{trace_id}/spans
|
|
331
|
+
* @param projectId The ID of the project to which the spans belong.
|
|
332
|
+
* @param traceId The ID of the Trace to which the spans belong.
|
|
333
|
+
* @param from Beginning of window to return spans from (ISO 8601 timestamp).
|
|
334
|
+
* @param to End of window to return spans from (ISO 8601 timestamp).
|
|
335
|
+
* @param targetSpanId The ID of a Span within the Trace to focus on.
|
|
336
|
+
* @param perPage The number of results to return per page.
|
|
337
|
+
* @param nextUrl Optional URL for next page (overrides other pagination params).
|
|
338
|
+
* @returns A promise that resolves to an array of spans.
|
|
339
|
+
*/
|
|
340
|
+
async listSpansByTraceId(projectId, traceId, from, to, targetSpanId, perPage, nextUrl) {
|
|
341
|
+
const options = getQueryParams(nextUrl);
|
|
342
|
+
if (nextUrl) {
|
|
343
|
+
options.query.per_page = perPage ? perPage.toString() : void 0;
|
|
258
344
|
}
|
|
345
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
346
|
+
this.configuration
|
|
347
|
+
).listSpansByTraceId(
|
|
348
|
+
projectId,
|
|
349
|
+
traceId,
|
|
350
|
+
from,
|
|
351
|
+
to,
|
|
352
|
+
targetSpanId,
|
|
353
|
+
perPage,
|
|
354
|
+
options
|
|
355
|
+
);
|
|
356
|
+
return await this.requestArray(
|
|
357
|
+
localVarFetchArgs.url,
|
|
358
|
+
localVarFetchArgs.options,
|
|
359
|
+
false
|
|
360
|
+
// Paginate results
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* List all trace fields available for filtering spans on a project.
|
|
365
|
+
* GET /projects/{project_id}/trace_fields
|
|
366
|
+
* @param projectId The ID of the project to which the Trace Field belongs.
|
|
367
|
+
* @returns A promise that resolves to an array of trace field definitions.
|
|
368
|
+
*/
|
|
369
|
+
async listProjectTraceFields(projectId) {
|
|
370
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
371
|
+
this.configuration
|
|
372
|
+
).listProjectTraceFields(projectId);
|
|
373
|
+
return await this.requestArray(
|
|
374
|
+
localVarFetchArgs.url,
|
|
375
|
+
localVarFetchArgs.options,
|
|
376
|
+
true
|
|
377
|
+
// No pagination
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Get the network endpoint grouping rules for a project.
|
|
382
|
+
* GET /projects/{project_id}/network_endpoint_grouping
|
|
383
|
+
* @param projectId The ID of the project to retrieve the endpoints for.
|
|
384
|
+
* @returns A promise that resolves to the network grouping ruleset.
|
|
385
|
+
*/
|
|
386
|
+
async getProjectNetworkGroupingRuleset(projectId) {
|
|
387
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
388
|
+
this.configuration
|
|
389
|
+
).getProjectNetworkGroupingRuleset(projectId);
|
|
390
|
+
return await this.requestObject(
|
|
391
|
+
localVarFetchArgs.url,
|
|
392
|
+
localVarFetchArgs.options
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Update the network endpoint grouping rules for a project.
|
|
397
|
+
* PUT /projects/{project_id}/network_endpoint_grouping
|
|
398
|
+
* @param projectId The ID of the project to update the endpoints for.
|
|
399
|
+
* @param endpoints Array of URL patterns by which network spans are grouped.
|
|
400
|
+
* @returns A promise that resolves to the updated network grouping ruleset.
|
|
401
|
+
*/
|
|
402
|
+
async updateProjectNetworkGroupingRuleset(projectId, endpoints) {
|
|
403
|
+
const localVarFetchArgs = ProjectsApiFetchParamCreator(
|
|
404
|
+
this.configuration
|
|
405
|
+
).updateProjectNetworkGroupingRuleset(projectId, { endpoints });
|
|
406
|
+
return await this.requestObject(
|
|
407
|
+
localVarFetchArgs.url,
|
|
408
|
+
localVarFetchArgs.options
|
|
409
|
+
);
|
|
410
|
+
}
|
|
259
411
|
}
|
|
412
|
+
export {
|
|
413
|
+
ProjectAPI
|
|
414
|
+
};
|