@smartbear/mcp 0.12.1 → 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 +156 -93
  4. package/dist/bugsnag/client/api/Project.js +398 -276
  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 -1281
  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,292 +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 releaseStageName The name of the release stage to filter by.
72
- * @param topOnly Whether to only include top-level releases.
73
- * @param visibleOnly Whether to only include visible releases.
74
- * @param perPage The number of results per page.
75
- * @param nextUrl Optional URL for next page (overrides other pagination params).
76
- * @returns A promise that resolves to an array of `ReleaseSummaryResponse` objects.
77
- */
78
- async listProjectReleaseGroups(projectId, releaseStageName, topOnly, visibleOnly, perPage, nextUrl) {
79
- if (nextUrl) {
80
- topOnly = undefined;
81
- visibleOnly = undefined;
82
- }
83
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).listProjectReleaseGroups(projectId, releaseStageName, topOnly, visibleOnly, perPage, undefined, undefined);
84
- const url = new URL(nextUrl ?? localVarFetchArgs.url, this.configuration.basePath);
85
- if (perPage) {
86
- // Allow override of per page, even with nextUrl
87
- url.searchParams.set("per_page", perPage.toString());
88
- }
89
- return await this.requestArray(url.toString(), localVarFetchArgs.options, false, // Paginate results
90
- 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());
91
113
  }
92
- /**
93
- * Retrieves a specific release by its ID.
94
- * GET /release_groups/{release_id}
95
- * @param releaseId The ID of the release to retrieve.
96
- * @returns A promise that resolves to the release data.
97
- */
98
- async getReleaseGroup(releaseId) {
99
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getReleaseGroup(releaseId);
100
- 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;
101
176
  }
102
- /**
103
- * Lists builds associated with a specific release group.
104
- * GET /release_groups/{release_id}/releases
105
- * @param releaseId The ID of the release group.
106
- * @return A promise that resolves to an array of `BuildResponse` objects.
107
- */
108
- async listBuildsInRelease(releaseId) {
109
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getReleaseGroup(releaseId);
110
- 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());
111
196
  }
112
- // ============================================================================
113
- // Performance API Methods
114
- // ============================================================================
115
- /**
116
- * List span groups for a project with optional filtering and pagination.
117
- * GET /projects/{project_id}/span_groups
118
- * @param projectId The ID of the project to which the Span Groups belong.
119
- * @param sort The field to sort the span groups by.
120
- * @param direction The direction to sort the span groups by.
121
- * @param perPage The number of results per page.
122
- * @param offset The offset for the next page of results.
123
- * @param filters The current filters that are being applied.
124
- * @param starredOnly Whether to only return Span Groups the requesting user has starred.
125
- * @param nextUrl Optional URL for next page (overrides other pagination params).
126
- * @returns A promise that resolves to an array of span groups.
127
- */
128
- async listProjectSpanGroups(projectId, sort, direction, perPage, offset, filters, starredOnly, nextUrl) {
129
- if (nextUrl) {
130
- sort = undefined;
131
- direction = undefined;
132
- offset = undefined;
133
- }
134
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).listProjectSpanGroups(projectId, sort, direction, perPage, offset, undefined, // Filters are encoded separately below
135
- starredOnly, undefined);
136
- const url = new URL(nextUrl ?? localVarFetchArgs.url, this.configuration.basePath);
137
- if (perPage) {
138
- // Allow override of per page, even with nextUrl
139
- url.searchParams.set("per_page", perPage.toString());
140
- }
141
- if (!nextUrl && filters) {
142
- // Apply our own encoding of filters
143
- toUrlSearchParams(filters).forEach((value, key) => {
144
- url.searchParams.append(key, value);
145
- });
146
- }
147
- return await this.requestArray(url.toString(), localVarFetchArgs.options, false);
197
+ if (!nextUrl && filters) {
198
+ toUrlSearchParams(filters).forEach((value, key) => {
199
+ url.searchParams.append(key, value);
200
+ });
148
201
  }
149
- /**
150
- * Get detailed information about a specific span group.
151
- * GET /projects/{project_id}/span_groups/{id}
152
- * @param projectId The ID of the project to which the Span Group belongs.
153
- * @param id The ID of the Span Group.
154
- * @param filters The current filters that are being applied.
155
- * @returns A promise that resolves to the span group.
156
- */
157
- async getProjectSpanGroup(projectId, id, filters) {
158
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getProjectSpanGroup(projectId, id, undefined, undefined);
159
- const url = new URL(localVarFetchArgs.url, this.configuration.basePath);
160
- if (filters) {
161
- // Apply our own encoding of filters
162
- toUrlSearchParams(filters).forEach((value, key) => {
163
- url.searchParams.append(key, value);
164
- });
165
- }
166
- return await this.requestObject(url.toString(), 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
+ });
167
226
  }
168
- /**
169
- * Get time-series performance metrics for a span group.
170
- * GET /projects/{project_id}/span_groups/{id}/timeline
171
- * @param projectId The ID of the project to which the Span Group belongs.
172
- * @param id The ID of the Span Group.
173
- * @param filters The current filters that are being applied.
174
- * @returns A promise that resolves to the timeline data.
175
- */
176
- async getProjectSpanGroupTimeline(projectId, id, filters) {
177
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getProjectSpanGroupTimeline(projectId, id, undefined, undefined);
178
- const url = new URL(localVarFetchArgs.url, this.configuration.basePath);
179
- if (filters) {
180
- // Apply our own encoding of filters
181
- toUrlSearchParams(filters).forEach((value, key) => {
182
- url.searchParams.append(key, value);
183
- });
184
- }
185
- return await this.requestObject(url.toString(), 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
+ });
186
249
  }
187
- /**
188
- * Get distribution histogram of span durations for a span group.
189
- * GET /projects/{project_id}/span_groups/{id}/distribution
190
- * @param projectId The ID of the project to which the Span Group belongs.
191
- * @param id The ID of the Span Group.
192
- * @param filters The current filters that are being applied.
193
- * @returns A promise that resolves to the distribution data.
194
- */
195
- async getProjectSpanGroupDistribution(projectId, id, filters) {
196
- const options = {};
197
- if (filters) {
198
- options.query = toUrlSearchParams(filters);
199
- }
200
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getProjectSpanGroupDistribution(projectId, id, undefined, undefined);
201
- const url = new URL(localVarFetchArgs.url, this.configuration.basePath);
202
- if (filters) {
203
- // Apply our own encoding of filters
204
- toUrlSearchParams(filters).forEach((value, key) => {
205
- url.searchParams.append(key, value);
206
- });
207
- }
208
- return await this.requestObject(url.toString(), 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);
209
266
  }
210
- /**
211
- * List individual spans for a specific span group with filtering and sorting.
212
- * GET /projects/{project_id}/span_groups/{id}/spans
213
- * @param projectId The ID of the project to which the spans belong.
214
- * @param id The ID of the Span Group.
215
- * @param filters The current filters that are being applied.
216
- * @param sort The field to sort the spans by.
217
- * @param direction The direction to sort the spans by.
218
- * @param perPage The number of results per page.
219
- * @param nextUrl Optional URL for next page (overrides other pagination params).
220
- * @returns A promise that resolves to an array of spans.
221
- */
222
- async listSpansBySpanGroupId(projectId, id, filters, sort, direction, perPage, nextUrl) {
223
- if (nextUrl) {
224
- sort = undefined;
225
- direction = undefined;
226
- }
227
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).listSpansBySpanGroupId(projectId, id, undefined, sort, direction, perPage, undefined);
228
- const url = new URL(nextUrl ?? localVarFetchArgs.url, this.configuration.basePath);
229
- if (perPage) {
230
- // Allow override of per page, even with nextUrl
231
- url.searchParams.set("per_page", perPage.toString());
232
- }
233
- if (!nextUrl && filters) {
234
- // Apply our own encoding of filters
235
- toUrlSearchParams(filters).forEach((value, key) => {
236
- url.searchParams.append(key, value);
237
- });
238
- }
239
- return await this.requestArray(url.toString(), 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
+ });
240
275
  }
241
- /**
242
- * List all spans that belong to a specific trace.
243
- * GET /projects/{project_id}/traces/{trace_id}/spans
244
- * @param projectId The ID of the project to which the spans belong.
245
- * @param traceId The ID of the Trace to which the spans belong.
246
- * @param from Beginning of window to return spans from (ISO 8601 timestamp).
247
- * @param to End of window to return spans from (ISO 8601 timestamp).
248
- * @param targetSpanId The ID of a Span within the Trace to focus on.
249
- * @param perPage The number of results to return per page.
250
- * @param nextUrl Optional URL for next page (overrides other pagination params).
251
- * @returns A promise that resolves to an array of spans.
252
- */
253
- async listSpansByTraceId(projectId, traceId, from, to, targetSpanId, perPage, nextUrl) {
254
- const options = getQueryParams(nextUrl);
255
- if (nextUrl) {
256
- options.query.per_page = perPage ? perPage.toString() : undefined;
257
- }
258
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).listSpansByTraceId(projectId, traceId, from, to, targetSpanId, perPage, options);
259
- 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;
260
297
  }
261
- /**
262
- * List all trace fields available for filtering spans on a project.
263
- * GET /projects/{project_id}/trace_fields
264
- * @param projectId The ID of the project to which the Trace Field belongs.
265
- * @returns A promise that resolves to an array of trace field definitions.
266
- */
267
- async listProjectTraceFields(projectId) {
268
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).listProjectTraceFields(projectId);
269
- 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());
270
315
  }
271
- /**
272
- * Get the network endpoint grouping rules for a project.
273
- * GET /projects/{project_id}/network_endpoint_grouping
274
- * @param projectId The ID of the project to retrieve the endpoints for.
275
- * @returns A promise that resolves to the network grouping ruleset.
276
- */
277
- async getProjectNetworkGroupingRuleset(projectId) {
278
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).getProjectNetworkGroupingRuleset(projectId);
279
- 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
+ });
280
320
  }
281
- /**
282
- * Update the network endpoint grouping rules for a project.
283
- * PUT /projects/{project_id}/network_endpoint_grouping
284
- * @param projectId The ID of the project to update the endpoints for.
285
- * @param endpoints Array of URL patterns by which network spans are grouped.
286
- * @returns A promise that resolves to the updated network grouping ruleset.
287
- */
288
- async updateProjectNetworkGroupingRuleset(projectId, endpoints) {
289
- const localVarFetchArgs = ProjectsApiFetchParamCreator(this.configuration).updateProjectNetworkGroupingRuleset(projectId, { endpoints });
290
- 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;
291
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
+ }
292
411
  }
412
+ export {
413
+ ProjectAPI
414
+ };