Skip to content

Commit b12c2f5

Browse files
committed
use absolute path
1 parent 5c412ed commit b12c2f5

8 files changed

Lines changed: 10 additions & 19 deletions

File tree

sdk/ai/ai-projects/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 2.1.1 (Unreleased)
3+
## 2.1.1 (2026-05-04)
44

55
### Bugs Fixed
66

sdk/ai/ai-projects/src/api/agents/operations.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ export function listVersions(
9999
apiVersion: context.apiVersion,
100100
cursorFieldName: "last_id",
101101
hasMoreFieldName: "has_more",
102-
basePath: `/agents/${agentName}/versions`,
103102
},
104103
);
105104
}
@@ -370,7 +369,6 @@ export function list(
370369
apiVersion: context.apiVersion,
371370
cursorFieldName: "last_id",
372371
hasMoreFieldName: "has_more",
373-
basePath: "/agents",
374372
},
375373
);
376374
}

sdk/ai/ai-projects/src/api/beta/agents/operations.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ export function listSessions(
348348
},
349349
cursorFieldName: "last_id",
350350
hasMoreFieldName: "has_more",
351-
basePath: `/agents/${agentName}/endpoint/sessions`,
352351
},
353352
);
354353
}

sdk/ai/ai-projects/src/api/beta/memoryStores/operations.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ export function list(
406406
},
407407
cursorFieldName: "last_id",
408408
hasMoreFieldName: "has_more",
409-
basePath: "/memory_stores",
410409
},
411410
);
412411
}

sdk/ai/ai-projects/src/api/beta/skills/operations.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ export function list(
192192
nextPageRequestOptions: { headers: { "foundry-features": "Skills=V1Preview" } },
193193
cursorFieldName: "last_id",
194194
hasMoreFieldName: "has_more",
195-
basePath: "/skills",
196195
},
197196
);
198197
}

sdk/ai/ai-projects/src/api/beta/toolboxes/operations.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ export function listVersions(
291291
nextPageRequestOptions: { headers: { "foundry-features": "Toolboxes=V1Preview" } },
292292
cursorFieldName: "last_id",
293293
hasMoreFieldName: "has_more",
294-
basePath: `/toolboxes/${toolboxName}/versions`,
295294
},
296295
);
297296
}
@@ -354,7 +353,6 @@ export function list(
354353
nextPageRequestOptions: { headers: { "foundry-features": "Toolboxes=V1Preview" } },
355354
cursorFieldName: "last_id",
356355
hasMoreFieldName: "has_more",
357-
basePath: "/toolboxes",
358356
},
359357
);
360358
}

sdk/ai/ai-projects/src/models/models.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9008,9 +9008,9 @@ export function _agentsPagedResultSkillObjectDeserializer(
90089008
): _AgentsPagedResultSkillObject {
90099009
return {
90109010
data: skillObjectArrayDeserializer(item?.data ?? []),
9011-
first_id: item["first_id"],
9012-
last_id: item["last_id"],
9013-
has_more: item["has_more"],
9011+
first_id: item?.["first_id"],
9012+
last_id: item?.["last_id"],
9013+
has_more: item?.["has_more"],
90149014
};
90159015
}
90169016

sdk/ai/ai-projects/src/static-helpers/pagingHelpers.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export interface BuildPagedAsyncIteratorOptions {
5555
nextPageRequestOptions?: Record<string, unknown>;
5656
cursorFieldName?: string;
5757
hasMoreFieldName?: string;
58-
basePath?: string;
5958
}
6059

6160
/**
@@ -80,15 +79,14 @@ export function buildPagedAsyncIterator<
8079
const nextPageRequestOptions = options.nextPageRequestOptions;
8180
const cursorFieldName = options.cursorFieldName;
8281
const hasMoreFieldName = options.hasMoreFieldName;
83-
const basePath = options.basePath;
84-
let initialSearchParams: URLSearchParams | undefined;
82+
let initialRequestUrl: URL | undefined;
8583
const pagedResult: PagedResult<TElement, TPage, TPageSettings> = {
8684
getPage: async (pageLink?: string) => {
8785
let result;
8886
if (pageLink === undefined) {
8987
result = await getInitialResponse();
90-
if (cursorFieldName && hasMoreFieldName && basePath) {
91-
initialSearchParams = new URL(result.request.url).searchParams;
88+
if (cursorFieldName && hasMoreFieldName) {
89+
initialRequestUrl = new URL(result.request.url);
9290
}
9391
} else {
9492
const resolvedPageLink = apiVersion ? addApiVersionToUrl(pageLink, apiVersion) : pageLink;
@@ -101,11 +99,11 @@ export function buildPagedAsyncIterator<
10199
const results = await processResponseBody(result as TResponse);
102100
const nextLink = getNextLink(results, nextLinkName);
103101
let resolvedNextLink = nextLink;
104-
if (!resolvedNextLink && cursorFieldName && hasMoreFieldName && initialSearchParams) {
102+
if (!resolvedNextLink && cursorFieldName && hasMoreFieldName && initialRequestUrl) {
105103
const body = results as Record<string, unknown>;
106104
if (body[hasMoreFieldName] === true && body[cursorFieldName]) {
107-
initialSearchParams.set("after", body[cursorFieldName] as string);
108-
resolvedNextLink = `${basePath}?${initialSearchParams.toString()}`;
105+
initialRequestUrl.searchParams.set("after", body[cursorFieldName] as string);
106+
resolvedNextLink = initialRequestUrl.toString();
109107
}
110108
}
111109
const values = getElements<TElement>(results, itemName) as TPage;

0 commit comments

Comments
 (0)