@smartbear/mcp 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-hub/client/api.js +51 -10
- package/dist/api-hub/client/registry-types.js +8 -0
- package/dist/api-hub/client/tools.js +7 -1
- package/dist/api-hub/client.js +3 -0
- package/dist/bugsnag/client/api/CurrentUser.js +12 -49
- package/dist/bugsnag/client/api/Error.js +29 -142
- package/dist/bugsnag/client/api/Project.js +52 -113
- package/dist/bugsnag/client/api/api.js +3743 -0
- package/dist/bugsnag/client/api/base.js +97 -34
- package/dist/bugsnag/client/api/configuration.js +26 -0
- package/dist/bugsnag/client/api/index.js +2 -0
- package/dist/bugsnag/client/filters.js +28 -0
- package/dist/bugsnag/client.js +100 -151
- package/dist/common/server.js +25 -3
- package/dist/common/types.js +6 -1
- package/dist/pactflow/client/prompt-utils.js +2 -1
- package/dist/pactflow/client/utils.js +5 -4
- package/dist/pactflow/client.js +10 -9
- package/dist/qmetry/client/api/client-api.js +21 -16
- package/dist/qmetry/client/api/error-handler.js +329 -0
- package/dist/qmetry/client/auto-resolve.js +74 -0
- package/dist/qmetry/client/handlers.js +19 -2
- package/dist/qmetry/client/issues.js +26 -0
- package/dist/qmetry/client/project.js +56 -0
- package/dist/qmetry/client/requirement.js +76 -0
- package/dist/qmetry/client/testcase.js +46 -8
- package/dist/qmetry/client/testsuite.js +117 -0
- package/dist/qmetry/client/tools.js +1455 -4
- package/dist/qmetry/client/utils.js +16 -0
- package/dist/qmetry/client.js +19 -16
- package/dist/qmetry/config/constants.js +14 -0
- package/dist/qmetry/config/rest-endpoints.js +20 -0
- package/dist/qmetry/types/common.js +313 -8
- package/dist/qmetry/types/issues.js +6 -0
- package/dist/qmetry/types/project.js +10 -0
- package/dist/qmetry/types/requirements.js +19 -0
- package/dist/qmetry/types/testcase.js +14 -0
- package/dist/qmetry/types/testsuite.js +26 -0
- package/dist/reflect/client.js +7 -6
- package/dist/zephyr/common/auth-service.js +1 -0
- package/package.json +1 -1
- package/dist/bugsnag/client/api/filters.js +0 -167
- package/dist/bugsnag/client/configuration.js +0 -10
- package/dist/bugsnag/client/index.js +0 -2
package/package.json
CHANGED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Filters utility for BugSnag API
|
|
3
|
-
*
|
|
4
|
-
* This file provides utility functions for creating filter URL parameters
|
|
5
|
-
* based on the BugSnag filtering specification described in the Filtering.md document.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from "zod";
|
|
8
|
-
export const FilterValueSchema = z.object({
|
|
9
|
-
type: z.enum(["eq", "ne", "empty"]),
|
|
10
|
-
value: z.union([z.string(), z.boolean(), z.number()]),
|
|
11
|
-
});
|
|
12
|
-
export const FilterObjectSchema = z.record(z.array(FilterValueSchema));
|
|
13
|
-
/**
|
|
14
|
-
* Creates a filter value object for equality comparison
|
|
15
|
-
*
|
|
16
|
-
* @param value The value to compare against
|
|
17
|
-
* @returns FilterValue with type 'eq'
|
|
18
|
-
*/
|
|
19
|
-
export function equals(value) {
|
|
20
|
-
return {
|
|
21
|
-
type: "eq",
|
|
22
|
-
value,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Creates a filter value object for inequality comparison
|
|
27
|
-
*
|
|
28
|
-
* @param value The value to compare against
|
|
29
|
-
* @returns FilterValue with type 'ne'
|
|
30
|
-
*/
|
|
31
|
-
export function notEquals(value) {
|
|
32
|
-
return {
|
|
33
|
-
type: "ne",
|
|
34
|
-
value,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Creates a filter value object for checking if a field is empty or not
|
|
39
|
-
*
|
|
40
|
-
* @param isEmpty Whether the field should be empty (true) or not (false)
|
|
41
|
-
* @returns FilterValue with type 'empty'
|
|
42
|
-
*/
|
|
43
|
-
export function empty(isEmpty) {
|
|
44
|
-
return {
|
|
45
|
-
type: "empty",
|
|
46
|
-
value: isEmpty.toString(),
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Creates a relative time filter for event.since or event.before
|
|
51
|
-
*
|
|
52
|
-
* @param value The amount of time
|
|
53
|
-
* @param unit The time unit ('h' for hours, 'd' for days)
|
|
54
|
-
* @returns FilterValue for the relative time
|
|
55
|
-
*/
|
|
56
|
-
export function relativeTime(value, unit) {
|
|
57
|
-
return {
|
|
58
|
-
type: "eq",
|
|
59
|
-
value: `${value}${unit}`,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Creates an ISO 8601 time filter (must be in UTC format like 2018-05-20T00:00:00Z)
|
|
64
|
-
*
|
|
65
|
-
* @param date The date object to convert to ISO string
|
|
66
|
-
* @returns FilterValue for the ISO time
|
|
67
|
-
*/
|
|
68
|
-
export function isoTime(date) {
|
|
69
|
-
return {
|
|
70
|
-
type: "eq",
|
|
71
|
-
value: date.toISOString(),
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Converts a FilterObject to URL search parameters
|
|
76
|
-
*
|
|
77
|
-
* @param filters The filter object to convert
|
|
78
|
-
* @returns URLSearchParams object with the encoded filters
|
|
79
|
-
*/
|
|
80
|
-
export function toUrlSearchParams(filters) {
|
|
81
|
-
const params = new URLSearchParams();
|
|
82
|
-
Object.entries(filters).forEach(([field, filterValues]) => {
|
|
83
|
-
filterValues.forEach((filterValue) => {
|
|
84
|
-
params.append(`filters[${field}][][type]`, filterValue.type);
|
|
85
|
-
params.append(`filters[${field}][][value]`, filterValue.value.toString());
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
return params;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Converts a FilterObject to a query string
|
|
92
|
-
*
|
|
93
|
-
* @param filters The filter object to convert
|
|
94
|
-
* @returns Query string representation of the filters
|
|
95
|
-
*/
|
|
96
|
-
export function toQueryString(filters) {
|
|
97
|
-
return toUrlSearchParams(filters).toString();
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Helper to build a FilterObject with type safety
|
|
101
|
-
*
|
|
102
|
-
* @returns An empty FilterObject that can be built upon
|
|
103
|
-
*/
|
|
104
|
-
export function createFilter() {
|
|
105
|
-
return {};
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Adds a field filter to an existing FilterObject
|
|
109
|
-
*
|
|
110
|
-
* @param filters The FilterObject to add to
|
|
111
|
-
* @param field The field name (e.g., 'error.status', 'event.since')
|
|
112
|
-
* @param filterValue The FilterValue to add
|
|
113
|
-
* @returns The updated FilterObject for chaining
|
|
114
|
-
*/
|
|
115
|
-
export function addFilter(filters, field, filterValue) {
|
|
116
|
-
if (!filters[field]) {
|
|
117
|
-
filters[field] = [];
|
|
118
|
-
}
|
|
119
|
-
filters[field].push(filterValue);
|
|
120
|
-
return filters;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Utility to create a time range filter between two dates
|
|
124
|
-
*
|
|
125
|
-
* @param filters The FilterObject to add to
|
|
126
|
-
* @param since Start date
|
|
127
|
-
* @param before End date
|
|
128
|
-
* @returns The updated FilterObject for chaining
|
|
129
|
-
*/
|
|
130
|
-
export function addTimeRange(filters, since, before) {
|
|
131
|
-
addFilter(filters, "event.since", isoTime(since));
|
|
132
|
-
addFilter(filters, "event.before", isoTime(before));
|
|
133
|
-
return filters;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Utility to create a relative time range filter
|
|
137
|
-
*
|
|
138
|
-
* @param filters The FilterObject to add to
|
|
139
|
-
* @param amount The amount of time (e.g., 7 for 7 days)
|
|
140
|
-
* @param unit The time unit ('h' for hours, 'd' for days)
|
|
141
|
-
* @returns The updated FilterObject for chaining
|
|
142
|
-
*/
|
|
143
|
-
export function addRelativeTimeRange(filters, amount, unit) {
|
|
144
|
-
addFilter(filters, "event.since", relativeTime(amount, unit));
|
|
145
|
-
return filters;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Usage examples:
|
|
149
|
-
*
|
|
150
|
-
* // Example 1: Open errors with events in the last day
|
|
151
|
-
* const filters = createFilter();
|
|
152
|
-
* addRelativeTimeRange(filters, 1, 'd');
|
|
153
|
-
* addFilter(filters, 'error.status', equals('open'));
|
|
154
|
-
* const queryString = toQueryString(filters);
|
|
155
|
-
*
|
|
156
|
-
* // Example 2: Events affecting specific users on a specific day
|
|
157
|
-
* const filters = createFilter();
|
|
158
|
-
* addTimeRange(filters, new Date('2017-01-01'), new Date('2017-01-02'));
|
|
159
|
-
* addFilter(filters, 'user.email', equals('user1@example.com'));
|
|
160
|
-
* addFilter(filters, 'user.email', equals('user2@example.com'));
|
|
161
|
-
* const queryString = toQueryString(filters);
|
|
162
|
-
*
|
|
163
|
-
* // Example 3: Events that have user data
|
|
164
|
-
* const filters = createFilter();
|
|
165
|
-
* addFilter(filters, 'user.id', empty(false));
|
|
166
|
-
* const queryString = toQueryString(filters);
|
|
167
|
-
*/
|