@mablhq/mabl-cli 2.78.5 → 2.79.7

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.
@@ -143,7 +143,7 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
143
143
  }
144
144
  async getExternalTcmBindingById(testCaseId) {
145
145
  try {
146
- return await this.makeGetRequest(`${this.baseApiUrl}/testCases/${testCaseId}`);
146
+ return await this.makeGetRequest(`${this.baseApiUrl}/tcm/external/bindings/xray/test_case/${testCaseId}`);
147
147
  }
148
148
  catch (error) {
149
149
  throw toApiError(`Failed to query external tcm`, error);
@@ -312,9 +312,12 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
312
312
  throw toApiError(`Failed to get integrations`, error);
313
313
  }
314
314
  }
315
- async queryXrayTests(xrayProjectId) {
315
+ async queryXrayTests(xrayProjectId, limit, offset) {
316
316
  try {
317
- return await this.makeGetRequest(`${this.baseApiUrl}/integrations/${xrayProjectId}/xray/tests`);
317
+ return await this.makeGetRequest(`${this.baseApiUrl}/integrations/${xrayProjectId}/xray/tests?${query_string_1.default.stringify({
318
+ limit,
319
+ start: offset,
320
+ })}`);
318
321
  }
319
322
  catch (error) {
320
323
  throw toApiError(`Failed to get xray test cases`, error);
@@ -1246,25 +1249,33 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
1246
1249
  throw toApiError(`Failed to terminate mobile training session ${id}`, error);
1247
1250
  }
1248
1251
  }
1249
- async findElementImage(screenshot, findPrompt, workspaceId, context) {
1252
+ async generateElementDescription(workspaceId, request) {
1253
+ try {
1254
+ return await this.makePostRequest(`${this.baseApiUrl}/generate/elementDescription?workspaceId=${workspaceId}`, request);
1255
+ }
1256
+ catch (error) {
1257
+ throw toApiError(`Failed to generate element description`, error);
1258
+ }
1259
+ }
1260
+ async findElementImage(screenshot, findPrompt, workspaceId, includeElementImage, context) {
1250
1261
  try {
1251
- const { bounding_box: boundingBox, found } = await this.makePostRequest(`${this.baseApiAgentUrl}/agent/find/findElementImage?workspaceId=${workspaceId}`, {
1262
+ const response = await this.makePostRequest(`${this.baseApiAgentUrl}/agent/find/findElementImage?workspaceId=${workspaceId}`, {
1252
1263
  screenshot,
1253
1264
  description: findPrompt,
1254
1265
  context,
1266
+ include_element_image: includeElementImage,
1255
1267
  });
1256
- if (!found) {
1268
+ if (!response.found) {
1257
1269
  return undefined;
1258
1270
  }
1259
- if (boundingBox?.x === undefined ||
1260
- boundingBox.y === undefined ||
1261
- boundingBox.width === undefined ||
1262
- boundingBox.height === undefined) {
1263
- console.debug(`Incomplete bounding box for ${findPrompt}:`, boundingBox);
1271
+ if (response.bounding_box?.x === undefined ||
1272
+ response.bounding_box?.y === undefined ||
1273
+ response.bounding_box?.width === undefined ||
1274
+ response.bounding_box?.height === undefined) {
1275
+ console.debug(`Incomplete bounding box for ${findPrompt}:`, response.bounding_box);
1264
1276
  return undefined;
1265
1277
  }
1266
- const { x, y, width, height } = boundingBox;
1267
- return { x, y, width, height };
1278
+ return response;
1268
1279
  }
1269
1280
  catch (error) {
1270
1281
  throw toApiError(`Failed to find element image ${findPrompt}`, error);