@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.
Files changed (89) hide show
  1. package/README.md +30 -6
  2. package/dist/bugsnag/client/api/CurrentUser.js +50 -26
  3. package/dist/bugsnag/client/api/Error.js +158 -57
  4. package/dist/bugsnag/client/api/Project.js +398 -243
  5. package/dist/bugsnag/client/api/api.js +4087 -3837
  6. package/dist/bugsnag/client/api/base.js +155 -173
  7. package/dist/bugsnag/client/api/configuration.js +28 -25
  8. package/dist/bugsnag/client/filters.js +11 -20
  9. package/dist/bugsnag/client.js +1398 -1277
  10. package/dist/bugsnag/input-schemas.js +39 -57
  11. package/dist/collaborator/client.js +335 -371
  12. package/dist/common/bugsnag.js +5 -3
  13. package/dist/common/cache.js +50 -57
  14. package/dist/common/client-registry.js +106 -119
  15. package/dist/common/info.js +7 -3
  16. package/dist/common/register-clients.js +0 -16
  17. package/dist/common/server.js +270 -228
  18. package/dist/common/tools.js +19 -0
  19. package/dist/common/transport-http.js +252 -343
  20. package/dist/common/transport-stdio.js +40 -37
  21. package/dist/common/zod-utils.js +20 -0
  22. package/dist/index.js +18 -23
  23. package/dist/package.json.js +11 -0
  24. package/dist/pactflow/client/ai.js +142 -169
  25. package/dist/pactflow/client/base.js +41 -51
  26. package/dist/pactflow/client/prompt-utils.js +93 -84
  27. package/dist/pactflow/client/prompts.js +95 -92
  28. package/dist/pactflow/client/tools.js +94 -83
  29. package/dist/pactflow/client/utils.js +60 -64
  30. package/dist/pactflow/client.js +399 -320
  31. package/dist/qmetry/client/api/client-api.js +43 -41
  32. package/dist/qmetry/client/api/error-handler.js +264 -310
  33. package/dist/qmetry/client/auto-resolve.js +78 -99
  34. package/dist/qmetry/client/automation.js +139 -162
  35. package/dist/qmetry/client/handlers.js +49 -46
  36. package/dist/qmetry/client/issues.js +133 -115
  37. package/dist/qmetry/client/project.js +153 -174
  38. package/dist/qmetry/client/requirement.js +82 -70
  39. package/dist/qmetry/client/testcase.js +240 -208
  40. package/dist/qmetry/client/testsuite.js +332 -293
  41. package/dist/qmetry/client/tools/automation-tools.js +291 -288
  42. package/dist/qmetry/client/tools/index.js +16 -13
  43. package/dist/qmetry/client/tools/issue-tools.js +534 -543
  44. package/dist/qmetry/client/tools/project-tools.js +635 -656
  45. package/dist/qmetry/client/tools/requirement-tools.js +525 -528
  46. package/dist/qmetry/client/tools/testcase-tools.js +773 -786
  47. package/dist/qmetry/client/tools/testsuite-tools.js +1069 -1083
  48. package/dist/qmetry/client/utils.js +8 -14
  49. package/dist/qmetry/client.js +111 -109
  50. package/dist/qmetry/config/constants.js +48 -44
  51. package/dist/qmetry/config/rest-endpoints.js +51 -48
  52. package/dist/qmetry/types/automation.js +7 -7
  53. package/dist/qmetry/types/common.js +763 -1049
  54. package/dist/qmetry/types/issues.js +26 -19
  55. package/dist/qmetry/types/project.js +32 -25
  56. package/dist/qmetry/types/requirements.js +26 -21
  57. package/dist/qmetry/types/testcase.js +55 -44
  58. package/dist/qmetry/types/testsuite.js +66 -52
  59. package/dist/reflect/client.js +284 -226
  60. package/dist/swagger/client/api.js +645 -662
  61. package/dist/swagger/client/configuration.js +31 -33
  62. package/dist/swagger/client/portal-types.js +204 -244
  63. package/dist/swagger/client/registry-types.js +62 -96
  64. package/dist/swagger/client/tools.js +148 -158
  65. package/dist/swagger/client/user-management-types.js +11 -22
  66. package/dist/swagger/client.js +143 -135
  67. package/dist/swagger/config-utils.js +10 -16
  68. package/dist/zephyr/client.js +43 -42
  69. package/dist/zephyr/common/api-client.js +35 -30
  70. package/dist/zephyr/common/auth-service.js +16 -13
  71. package/dist/zephyr/common/rest-api-schemas.js +3173 -5146
  72. package/dist/zephyr/tool/environment/get-environments.js +66 -66
  73. package/dist/zephyr/tool/priority/get-priorities.js +41 -41
  74. package/dist/zephyr/tool/project/get-project.js +37 -37
  75. package/dist/zephyr/tool/project/get-projects.js +46 -46
  76. package/dist/zephyr/tool/status/get-statuses.js +47 -47
  77. package/dist/zephyr/tool/test-case/get-test-case.js +37 -37
  78. package/dist/zephyr/tool/test-case/get-test-cases.js +62 -62
  79. package/dist/zephyr/tool/test-cycle/get-test-cycle.js +37 -37
  80. package/dist/zephyr/tool/test-cycle/get-test-cycles.js +70 -70
  81. package/dist/zephyr/tool/test-execution/get-test-execution.js +37 -37
  82. package/dist/zephyr/tool/test-execution/get-test-executions.js +43 -43
  83. package/package.json +5 -5
  84. package/dist/bugsnag/client/api/index.js +0 -6
  85. package/dist/common/types.js +0 -6
  86. package/dist/qmetry/client/tools/types.js +0 -1
  87. package/dist/swagger/client/index.js +0 -6
  88. package/dist/tests/unit/bugsnag/utils/factories.js +0 -86
  89. 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
- export class ProjectAPI extends BaseAPI {
5
- static projectFields = [
6
- "id",
7
- "name",
8
- "slug",
9
- "apiKey",
10
- "stabilityTargetType",
11
- "targetStability",
12
- "criticalStability",
13
- ];
14
- static eventFieldFields = [
15
- "custom",
16
- "displayId",
17
- "filterOptions",
18
- "pivotOptions",
19
- ];
20
- static buildFields = [
21
- "id",
22
- "releaseTime",
23
- "appVersion",
24
- "releaseStage",
25
- "errorsIntroducedCount",
26
- "errorsSeenCount",
27
- "totalSessionsCount",
28
- "unhandledSessionsCount",
29
- "accumulativeDailyUsersSeen",
30
- "accumulativeDailyUsersWithUnhandled",
31
- ];
32
- static releaseFields = [
33
- "id",
34
- "releaseStageName",
35
- "appVersion",
36
- "firstReleasedAt",
37
- "firstReleaseId",
38
- "releasesCount",
39
- "visible",
40
- "totalSessionsCount",
41
- "unhandledSessionsCount",
42
- "sessionsCountInLast24h",
43
- "accumulativeDailyUsersSeen",
44
- "accumulativeDailyUsersWithUnhandled",
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(this.configuration).listProjectEventFields(projectId);
54
- return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, true, ProjectAPI.eventFieldFields);
55
- }
56
- /**
57
- * Retrieves a specific build from a project.
58
- * GET /projects/{project_id}/releases/{release_id}
59
- * @param projectId The ID of the project.
60
- * @param releaseId The ID of the release to retrieve.
61
- * @returns A promise that resolves to the release data.
62
- */
63
- async getProjectReleaseById(projectId, releaseId) {
64
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getProjectReleaseById(projectId, releaseId);
65
- return await this.requestObject(localVarFetchArgs.url, localVarFetchArgs.options, ProjectAPI.buildFields);
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
- * Lists releases for a specific project.
69
- * GET /projects/{project_id}/release_groups
70
- * @param projectId The ID of the project.
71
- * @param opts Options for listing releases, including filtering by release stage and visibility.
72
- * @returns A promise that resolves to an array of `ReleaseSummaryResponse` objects.
73
- */
74
- async listProjectReleaseGroups(projectId, releaseStageName, topOnly, visibleOnly, perPage, nextUrl) {
75
- const options = getQueryParams(nextUrl);
76
- // Next links need to be used as-is to ensure results are consistent, so only the page size can be modified
77
- // the others will get overridden
78
- if (nextUrl) {
79
- options.query.per_page = perPage ? perPage.toString() : undefined;
80
- topOnly = undefined;
81
- visibleOnly = undefined;
82
- }
83
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).listProjectReleaseGroups(projectId, releaseStageName, topOnly, visibleOnly, perPage, undefined, // pageToken passed in through options
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
- * Retrieves a specific release by its ID.
90
- * GET /release_groups/{release_id}
91
- * @param releaseId The ID of the release to retrieve.
92
- * @returns A promise that resolves to the release data.
93
- */
94
- async getReleaseGroup(releaseId) {
95
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getReleaseGroup(releaseId);
96
- return await this.requestObject(localVarFetchArgs.url, localVarFetchArgs.options, ProjectAPI.releaseFields);
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
- * Lists builds associated with a specific release group.
100
- * GET /release_groups/{release_id}/releases
101
- * @param releaseId The ID of the release group.
102
- * @return A promise that resolves to an array of `BuildResponse` objects.
103
- */
104
- async listBuildsInRelease(releaseId) {
105
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getReleaseGroup(releaseId);
106
- return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, true, ProjectAPI.buildFields);
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
- // Performance API Methods
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
- * Get detailed information about a specific span group.
139
- * GET /projects/{project_id}/span_groups/{id}
140
- * @param projectId The ID of the project to which the Span Group belongs.
141
- * @param id The ID of the Span Group.
142
- * @param filters The current filters that are being applied.
143
- * @returns A promise that resolves to the span group.
144
- */
145
- async getProjectSpanGroup(projectId, id, filters) {
146
- const options = {};
147
- if (filters) {
148
- options.query = toUrlSearchParams(filters);
149
- }
150
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getProjectSpanGroup(projectId, id, undefined, options);
151
- return await this.requestObject(localVarFetchArgs.url, localVarFetchArgs.options);
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
- * Get time-series performance metrics for a span group.
155
- * GET /projects/{project_id}/span_groups/{id}/timeline
156
- * @param projectId The ID of the project to which the Span Group belongs.
157
- * @param id The ID of the Span Group.
158
- * @param filters The current filters that are being applied.
159
- * @returns A promise that resolves to the timeline data.
160
- */
161
- async getProjectSpanGroupTimeline(projectId, id, filters) {
162
- const options = {};
163
- if (filters) {
164
- options.query = toUrlSearchParams(filters);
165
- }
166
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getProjectSpanGroupTimeline(projectId, id, undefined, options);
167
- return await this.requestObject(localVarFetchArgs.url, localVarFetchArgs.options);
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
- * Get distribution histogram of span durations for a span group.
171
- * GET /projects/{project_id}/span_groups/{id}/distribution
172
- * @param projectId The ID of the project to which the Span Group belongs.
173
- * @param id The ID of the Span Group.
174
- * @param filters The current filters that are being applied.
175
- * @returns A promise that resolves to the distribution data.
176
- */
177
- async getProjectSpanGroupDistribution(projectId, id, filters) {
178
- const options = {};
179
- if (filters) {
180
- options.query = toUrlSearchParams(filters);
181
- }
182
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getProjectSpanGroupDistribution(projectId, id, undefined, options);
183
- return await this.requestObject(localVarFetchArgs.url, localVarFetchArgs.options);
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
- * List individual spans for a specific span group with filtering and sorting.
187
- * GET /projects/{project_id}/span_groups/{id}/spans
188
- * @param projectId The ID of the project to which the spans belong.
189
- * @param id The ID of the Span Group.
190
- * @param filters The current filters that are being applied.
191
- * @param sort The field to sort the spans by.
192
- * @param direction The direction to sort the spans by.
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
- * List all spans that belong to a specific trace.
210
- * GET /projects/{project_id}/traces/{trace_id}/spans
211
- * @param projectId The ID of the project to which the spans belong.
212
- * @param traceId The ID of the Trace to which the spans belong.
213
- * @param from Beginning of window to return spans from (ISO 8601 timestamp).
214
- * @param to End of window to return spans from (ISO 8601 timestamp).
215
- * @param targetSpanId The ID of a Span within the Trace to focus on.
216
- * @param perPage The number of results to return per page.
217
- * @param nextUrl Optional URL for next page (overrides other pagination params).
218
- * @returns A promise that resolves to an array of spans.
219
- */
220
- async listSpansByTraceId(projectId, traceId, from, to, targetSpanId, perPage, nextUrl) {
221
- const options = getQueryParams(nextUrl);
222
- if (nextUrl) {
223
- options.query.per_page = perPage ? perPage.toString() : undefined;
224
- }
225
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).listSpansByTraceId(projectId, traceId, from, to, targetSpanId, perPage, options);
226
- return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, false);
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
- * List all trace fields available for filtering spans on a project.
230
- * GET /projects/{project_id}/trace_fields
231
- * @param projectId The ID of the project to which the Trace Field belongs.
232
- * @returns A promise that resolves to an array of trace field definitions.
233
- */
234
- async listProjectTraceFields(projectId) {
235
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).listProjectTraceFields(projectId);
236
- return await this.requestArray(localVarFetchArgs.url, localVarFetchArgs.options, true);
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
- * Get the network endpoint grouping rules for a project.
240
- * GET /projects/{project_id}/network_endpoint_grouping
241
- * @param projectId The ID of the project to retrieve the endpoints for.
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
- * Update the network endpoint grouping rules for a project.
250
- * PUT /projects/{project_id}/network_endpoint_grouping
251
- * @param projectId The ID of the project to update the endpoints for.
252
- * @param endpoints Array of URL patterns by which network spans are grouped.
253
- * @returns A promise that resolves to the updated network grouping ruleset.
254
- */
255
- async updateProjectNetworkGroupingRuleset(projectId, endpoints) {
256
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).updateProjectNetworkGroupingRuleset(projectId, { endpoints });
257
- return await this.requestObject(localVarFetchArgs.url, localVarFetchArgs.options);
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
+ };