sailpoint-api-client 1.8.24 → 1.8.26

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 (45) hide show
  1. package/beta/README.md +2 -2
  2. package/beta/common.ts +2 -2
  3. package/beta/package.json +1 -1
  4. package/dist/beta/common.js +2 -2
  5. package/dist/nerm/common.js +2 -2
  6. package/dist/nermv2025/common.js +2 -2
  7. package/dist/paginator.d.ts +1 -1
  8. package/dist/paginator.js +144 -87
  9. package/dist/paginator.js.map +1 -1
  10. package/dist/paginator.spec.d.ts +1 -0
  11. package/dist/paginator.spec.js +273 -0
  12. package/dist/paginator.spec.js.map +1 -0
  13. package/dist/v2024/common.js +2 -2
  14. package/dist/v2025/api.d.ts +144 -0
  15. package/dist/v2025/api.js +230 -0
  16. package/dist/v2025/api.js.map +1 -1
  17. package/dist/v2025/common.js +2 -2
  18. package/dist/v2026/api.d.ts +481 -0
  19. package/dist/v2026/api.js +607 -20
  20. package/dist/v2026/api.js.map +1 -1
  21. package/dist/v2026/common.js +2 -2
  22. package/dist/v3/common.js +2 -2
  23. package/nerm/README.md +2 -2
  24. package/nerm/common.ts +2 -2
  25. package/nerm/package.json +1 -1
  26. package/nermv2025/README.md +2 -2
  27. package/nermv2025/common.ts +2 -2
  28. package/nermv2025/package.json +1 -1
  29. package/package.json +1 -1
  30. package/paginator.spec.ts +158 -0
  31. package/paginator.ts +101 -62
  32. package/v2024/README.md +2 -2
  33. package/v2024/common.ts +2 -2
  34. package/v2024/package.json +1 -1
  35. package/v2025/README.md +2 -2
  36. package/v2025/api.ts +256 -0
  37. package/v2025/common.ts +2 -2
  38. package/v2025/package.json +1 -1
  39. package/v2026/README.md +2 -2
  40. package/v2026/api.ts +757 -0
  41. package/v2026/common.ts +2 -2
  42. package/v2026/package.json +1 -1
  43. package/v3/README.md +2 -2
  44. package/v3/common.ts +2 -2
  45. package/v3/package.json +1 -1
@@ -250,12 +250,12 @@ var createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configu
250
250
  if (axios === void 0) { axios = globalAxios; }
251
251
  if (basePath === void 0) { basePath = BASE_PATH; }
252
252
  (0, axios_retry_1.default)(axios, configuration.retriesConfig);
253
- var userAgent = "SailPoint-SDK-TypeScript/1.8.24";
253
+ var userAgent = "SailPoint-SDK-TypeScript/1.8.26";
254
254
  if ((configuration === null || configuration === void 0 ? void 0 : configuration.consumerIdentifier) && (configuration === null || configuration === void 0 ? void 0 : configuration.consumerVersion)) {
255
255
  userAgent += " (".concat(configuration.consumerIdentifier, "/").concat(configuration.consumerVersion, ")");
256
256
  }
257
257
  userAgent += " (".concat(process.platform, "; ").concat(process.arch, ") Node/").concat(process.versions.node, " (openapi-generator/7.12.0)");
258
- var headers = __assign(__assign(__assign({}, axiosArgs.axiosOptions.headers), { 'X-SailPoint-SDK': 'typescript-1.8.24' }), { 'User-Agent': userAgent });
258
+ var headers = __assign(__assign(__assign({}, axiosArgs.axiosOptions.headers), { 'X-SailPoint-SDK': 'typescript-1.8.26' }), { 'User-Agent': userAgent });
259
259
  if (!configuration.experimental && ("X-SailPoint-Experimental" in headers)) {
260
260
  throw new Error("You are using Experimental APIs. Set configuration.experimental = True to enable these APIs in the SDK.");
261
261
  }
package/dist/v3/common.js CHANGED
@@ -250,12 +250,12 @@ var createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configu
250
250
  if (axios === void 0) { axios = globalAxios; }
251
251
  if (basePath === void 0) { basePath = BASE_PATH; }
252
252
  (0, axios_retry_1.default)(axios, configuration.retriesConfig);
253
- var userAgent = "SailPoint-SDK-TypeScript/1.8.24";
253
+ var userAgent = "SailPoint-SDK-TypeScript/1.8.26";
254
254
  if ((configuration === null || configuration === void 0 ? void 0 : configuration.consumerIdentifier) && (configuration === null || configuration === void 0 ? void 0 : configuration.consumerVersion)) {
255
255
  userAgent += " (".concat(configuration.consumerIdentifier, "/").concat(configuration.consumerVersion, ")");
256
256
  }
257
257
  userAgent += " (".concat(process.platform, "; ").concat(process.arch, ") Node/").concat(process.versions.node, " (openapi-generator/7.12.0)");
258
- var headers = __assign(__assign(__assign({}, axiosArgs.axiosOptions.headers), { 'X-SailPoint-SDK': 'typescript-1.8.24' }), { 'User-Agent': userAgent });
258
+ var headers = __assign(__assign(__assign({}, axiosArgs.axiosOptions.headers), { 'X-SailPoint-SDK': 'typescript-1.8.26' }), { 'User-Agent': userAgent });
259
259
  if (!configuration.experimental && ("X-SailPoint-Experimental" in headers)) {
260
260
  throw new Error("You are using Experimental APIs. Set configuration.experimental = True to enable these APIs in the SDK.");
261
261
  }
package/nerm/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## sailpoint-nerm-sdk@1.8.24
1
+ ## sailpoint-nerm-sdk@1.8.26
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install sailpoint-nerm-sdk@1.8.24 --save
39
+ npm install sailpoint-nerm-sdk@1.8.26 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
package/nerm/common.ts CHANGED
@@ -146,7 +146,7 @@ export const toPathString = function (url: URL) {
146
146
  export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
147
147
  return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
148
148
  axiosRetry(axios, configuration.retriesConfig)
149
- let userAgent = `SailPoint-SDK-TypeScript/1.8.24`;
149
+ let userAgent = `SailPoint-SDK-TypeScript/1.8.26`;
150
150
  if (configuration?.consumerIdentifier && configuration?.consumerVersion) {
151
151
  userAgent += ` (${configuration.consumerIdentifier}/${configuration.consumerVersion})`;
152
152
  }
@@ -154,7 +154,7 @@ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxi
154
154
  const headers = {
155
155
  ...{'Accept': 'application/json'},
156
156
  ...axiosArgs.axiosOptions.headers,
157
- ...{'X-SailPoint-SDK':'typescript-1.8.24'},
157
+ ...{'X-SailPoint-SDK':'typescript-1.8.26'},
158
158
  ...{'User-Agent': userAgent},
159
159
  }
160
160
 
package/nerm/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sailpoint-nerm-sdk",
3
- "version": "1.8.24",
3
+ "version": "1.8.26",
4
4
  "description": "OpenAPI client for sailpoint-nerm-sdk",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "repository": {
@@ -1,4 +1,4 @@
1
- ## sailpoint-nerm-sdk@1.8.24
1
+ ## sailpoint-nerm-sdk@1.8.26
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install sailpoint-nerm-sdk@1.8.24 --save
39
+ npm install sailpoint-nerm-sdk@1.8.26 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -146,7 +146,7 @@ export const toPathString = function (url: URL) {
146
146
  export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
147
147
  return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
148
148
  axiosRetry(axios, configuration.retriesConfig)
149
- let userAgent = `SailPoint-SDK-TypeScript/1.8.24`;
149
+ let userAgent = `SailPoint-SDK-TypeScript/1.8.26`;
150
150
  if (configuration?.consumerIdentifier && configuration?.consumerVersion) {
151
151
  userAgent += ` (${configuration.consumerIdentifier}/${configuration.consumerVersion})`;
152
152
  }
@@ -154,7 +154,7 @@ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxi
154
154
  const headers = {
155
155
  ...{'Accept': 'application/json'},
156
156
  ...axiosArgs.axiosOptions.headers,
157
- ...{'X-SailPoint-SDK':'typescript-1.8.24'},
157
+ ...{'X-SailPoint-SDK':'typescript-1.8.26'},
158
158
  ...{'User-Agent': userAgent},
159
159
  }
160
160
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sailpoint-nerm-sdk",
3
- "version": "1.8.24",
3
+ "version": "1.8.26",
4
4
  "description": "OpenAPI client for sailpoint-nerm-sdk",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "repository": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sailpoint-api-client",
3
- "version": "1.8.24",
3
+ "version": "1.8.26",
4
4
  "description": "Official library for using the SailPoint API",
5
5
  "author": "SailPoint DevOps",
6
6
  "repository": {
@@ -0,0 +1,158 @@
1
+ import type { AxiosResponse } from "axios";
2
+ import { Paginator } from "./paginator";
3
+
4
+ type Item = { id: number };
5
+
6
+ function makeResponse(count: number): AxiosResponse<Item[], any> {
7
+ return {
8
+ data: Array.from({ length: count }, (_, i) => ({ id: i })),
9
+ status: 200,
10
+ statusText: "OK",
11
+ headers: {},
12
+ config: {} as any,
13
+ };
14
+ }
15
+
16
+ function makeAxiosError(status: number): Error {
17
+ const err: any = new Error(`Request failed with status code ${status}`);
18
+ err.response = { status };
19
+ return err;
20
+ }
21
+
22
+ // Collects all items from an async generator without relying on for-await-of
23
+ // so we don't need ES2018.asyncIterable in the tsconfig lib.
24
+ async function collect(generator: any): Promise<any[]> {
25
+ const items: any[] = [];
26
+ let result = await generator.next();
27
+ while (!result.done) {
28
+ items.push(result.value);
29
+ result = await generator.next();
30
+ }
31
+ return items;
32
+ }
33
+
34
+ describe("Paginator.paginate", () => {
35
+ it("returns all results when the total is less than the increment", async () => {
36
+ const mockFn = jest.fn().mockResolvedValueOnce(makeResponse(123));
37
+
38
+ const result = await Paginator.paginate({} as any, mockFn, {} as any, 250);
39
+
40
+ expect(result.data).toHaveLength(123);
41
+ expect(mockFn).toHaveBeenCalledTimes(1);
42
+ });
43
+
44
+ it("returns all results when the total is an exact multiple of the increment (the boundary bug)", async () => {
45
+ const mockFn = jest.fn()
46
+ .mockResolvedValueOnce(makeResponse(250))
47
+ .mockRejectedValueOnce(makeAxiosError(400));
48
+
49
+ const result = await Paginator.paginate({} as any, mockFn, {} as any, 250);
50
+
51
+ expect(result.data).toHaveLength(250);
52
+ expect(mockFn).toHaveBeenCalledTimes(2);
53
+ });
54
+
55
+ it("returns all results across multiple pages when the total is an exact multiple of the increment", async () => {
56
+ const mockFn = jest.fn()
57
+ .mockResolvedValueOnce(makeResponse(250))
58
+ .mockResolvedValueOnce(makeResponse(250))
59
+ .mockRejectedValueOnce(makeAxiosError(400));
60
+
61
+ const result = await Paginator.paginate({} as any, mockFn, {} as any, 250);
62
+
63
+ expect(result.data).toHaveLength(500);
64
+ expect(mockFn).toHaveBeenCalledTimes(3);
65
+ });
66
+
67
+ it("returns all results across multiple full pages followed by a partial page", async () => {
68
+ const mockFn = jest.fn()
69
+ .mockResolvedValueOnce(makeResponse(250))
70
+ .mockResolvedValueOnce(makeResponse(87));
71
+
72
+ const result = await Paginator.paginate({} as any, mockFn, {} as any, 250);
73
+
74
+ expect(result.data).toHaveLength(337);
75
+ expect(mockFn).toHaveBeenCalledTimes(2);
76
+ });
77
+
78
+ it("re-throws a 4xx error on the first call", async () => {
79
+ const mockFn = jest.fn().mockRejectedValueOnce(makeAxiosError(400));
80
+
81
+ await expect(
82
+ Paginator.paginate({} as any, mockFn, {} as any, 250)
83
+ ).rejects.toMatchObject({ response: { status: 400 } });
84
+ });
85
+
86
+ it("re-throws a 5xx error on a subsequent page", async () => {
87
+ const mockFn = jest.fn()
88
+ .mockResolvedValueOnce(makeResponse(250))
89
+ .mockRejectedValueOnce(makeAxiosError(500));
90
+
91
+ await expect(
92
+ Paginator.paginate({} as any, mockFn, {} as any, 250)
93
+ ).rejects.toMatchObject({ response: { status: 500 } });
94
+ });
95
+ });
96
+
97
+ describe("Paginator.paginateGenerator", () => {
98
+ it("yields all results when the total is less than the increment", async () => {
99
+ const mockFn = jest.fn().mockResolvedValueOnce(makeResponse(123));
100
+
101
+ const items = await collect(Paginator.paginateGenerator({} as any, mockFn, {} as any, 250));
102
+
103
+ expect(items).toHaveLength(123);
104
+ expect(mockFn).toHaveBeenCalledTimes(1);
105
+ });
106
+
107
+ it("yields all results when the total is an exact multiple of the increment (the boundary bug)", async () => {
108
+ const mockFn = jest.fn()
109
+ .mockResolvedValueOnce(makeResponse(250))
110
+ .mockRejectedValueOnce(makeAxiosError(400));
111
+
112
+ const items = await collect(Paginator.paginateGenerator({} as any, mockFn, {} as any, 250));
113
+
114
+ expect(items).toHaveLength(250);
115
+ expect(mockFn).toHaveBeenCalledTimes(2);
116
+ });
117
+
118
+ it("yields all results across multiple pages when the total is an exact multiple of the increment", async () => {
119
+ const mockFn = jest.fn()
120
+ .mockResolvedValueOnce(makeResponse(250))
121
+ .mockResolvedValueOnce(makeResponse(250))
122
+ .mockRejectedValueOnce(makeAxiosError(400));
123
+
124
+ const items = await collect(Paginator.paginateGenerator({} as any, mockFn, {} as any, 250));
125
+
126
+ expect(items).toHaveLength(500);
127
+ expect(mockFn).toHaveBeenCalledTimes(3);
128
+ });
129
+
130
+ it("yields all results across multiple full pages followed by a partial page", async () => {
131
+ const mockFn = jest.fn()
132
+ .mockResolvedValueOnce(makeResponse(250))
133
+ .mockResolvedValueOnce(makeResponse(87));
134
+
135
+ const items = await collect(Paginator.paginateGenerator({} as any, mockFn, {} as any, 250));
136
+
137
+ expect(items).toHaveLength(337);
138
+ expect(mockFn).toHaveBeenCalledTimes(2);
139
+ });
140
+
141
+ it("re-throws a 4xx error on the first call", async () => {
142
+ const mockFn = jest.fn().mockRejectedValueOnce(makeAxiosError(400));
143
+
144
+ await expect(
145
+ collect(Paginator.paginateGenerator({} as any, mockFn, {} as any, 250))
146
+ ).rejects.toMatchObject({ response: { status: 400 } });
147
+ });
148
+
149
+ it("re-throws a 5xx error on a subsequent page", async () => {
150
+ const mockFn = jest.fn()
151
+ .mockResolvedValueOnce(makeResponse(250))
152
+ .mockRejectedValueOnce(makeAxiosError(500));
153
+
154
+ await expect(
155
+ collect(Paginator.paginateGenerator({} as any, mockFn, {} as any, 250))
156
+ ).rejects.toMatchObject({ response: { status: 500 } });
157
+ });
158
+ });
package/paginator.ts CHANGED
@@ -102,8 +102,22 @@ export class Paginator {
102
102
  params.limit = increment;
103
103
 
104
104
  let modified: TResult[] = [];
105
+ let lastResults: AxiosResponse<TResult[], any> | undefined;
105
106
  while (true) {
106
- let results = await callbackFn.call(thisArg, params);
107
+ let results: AxiosResponse<TResult[], any>;
108
+ try {
109
+ results = await callbackFn.call(thisArg, params);
110
+ } catch (e: any) {
111
+ // When total results are an exact multiple of increment, some APIs return a
112
+ // 4xx error instead of an empty array for the out-of-bounds offset request.
113
+ // Return whatever we've accumulated rather than surfacing the error.
114
+ if (lastResults && modified.length > 0 && e?.response?.status >= 400 && e?.response?.status < 500) {
115
+ lastResults.data = modified;
116
+ return lastResults;
117
+ }
118
+ throw e;
119
+ }
120
+ lastResults = results;
107
121
  modified.push.apply(modified, results.data);
108
122
  if (
109
123
  results.data.length < increment ||
@@ -138,19 +152,27 @@ export class Paginator {
138
152
 
139
153
  let totalYielded = 0;
140
154
  while (true) {
141
- const results = await callbackFn.call(thisArg, params);
155
+ let results: AxiosResponse<TResult[], any>;
156
+ try {
157
+ results = await callbackFn.call(thisArg, params);
158
+ } catch (e: any) {
159
+ // When total results are an exact multiple of increment, some APIs return a
160
+ // 4xx error instead of an empty array for the out-of-bounds offset request.
161
+ if (totalYielded > 0 && e?.response?.status >= 400 && e?.response?.status < 500) {
162
+ return;
163
+ }
164
+ throw e;
165
+ }
142
166
 
143
167
  for (const item of results.data) {
144
168
  yield item;
145
169
  totalYielded++;
146
170
 
147
- // Stop if we've reached the max limit
148
171
  if (maxLimit > 0 && totalYielded >= maxLimit) {
149
172
  return;
150
173
  }
151
174
  }
152
175
 
153
- // Stop if we got fewer results than requested
154
176
  if (results.data.length < increment) {
155
177
  return;
156
178
  }
@@ -170,6 +192,7 @@ export class Paginator {
170
192
  let offset = 0;
171
193
  const maxLimit = limit ? limit : 0;
172
194
  let modified: SearchApiTypeMap[T]["document"][] = [];
195
+ let lastResults: AxiosResponse<SearchApiTypeMap[T]["document"][], any> | undefined;
173
196
 
174
197
  if (!search.sort || search.sort.length != 1) {
175
198
  throw "search must include exactly one sort parameter to paginate properly";
@@ -179,35 +202,46 @@ export class Paginator {
179
202
  console.log(`Paginating call, offset = ${offset}`);
180
203
  let results: AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
181
204
 
182
- // Handle each API type separately to avoid type conflicts
183
- if (searchAPI instanceof SearchApi) {
184
- const searchParams: SearchApiSearchPostRequest = {
185
- search: search as Search,
186
- limit: increment,
187
- };
188
- results = (await (searchAPI as SearchApi).searchPost(
189
- searchParams
190
- )) as AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
191
- } else if (searchAPI instanceof SearchV2024Api) {
192
- const searchParams: SearchV2024ApiSearchPostRequest = {
193
- searchV2024: search as SearchV2024,
194
- limit: increment,
195
- };
196
- results = (await (searchAPI as SearchV2024Api).searchPost(
197
- searchParams
198
- )) as AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
199
- } else if (searchAPI instanceof SearchV2025Api) {
200
- const searchParams: SearchV2025ApiSearchPostRequest = {
201
- searchV2025: search as SearchV2025,
202
- limit: increment,
203
- };
204
- results = (await (searchAPI as SearchV2025Api).searchPost(
205
- searchParams
206
- )) as AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
207
- } else {
208
- throw new Error("Unsupported API type");
205
+ try {
206
+ // Handle each API type separately to avoid type conflicts
207
+ if (searchAPI instanceof SearchApi) {
208
+ const searchParams: SearchApiSearchPostRequest = {
209
+ search: search as Search,
210
+ limit: increment,
211
+ };
212
+ results = (await (searchAPI as SearchApi).searchPost(
213
+ searchParams
214
+ )) as AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
215
+ } else if (searchAPI instanceof SearchV2024Api) {
216
+ const searchParams: SearchV2024ApiSearchPostRequest = {
217
+ searchV2024: search as SearchV2024,
218
+ limit: increment,
219
+ };
220
+ results = (await (searchAPI as SearchV2024Api).searchPost(
221
+ searchParams
222
+ )) as AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
223
+ } else if (searchAPI instanceof SearchV2025Api) {
224
+ const searchParams: SearchV2025ApiSearchPostRequest = {
225
+ searchV2025: search as SearchV2025,
226
+ limit: increment,
227
+ };
228
+ results = (await (searchAPI as SearchV2025Api).searchPost(
229
+ searchParams
230
+ )) as AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
231
+ } else {
232
+ throw new Error("Unsupported API type");
233
+ }
234
+ } catch (e: any) {
235
+ // When total results are an exact multiple of increment, some APIs return a
236
+ // 4xx error instead of an empty array for the out-of-bounds offset request.
237
+ if (lastResults && modified.length > 0 && e?.response?.status >= 400 && e?.response?.status < 500) {
238
+ lastResults.data = modified;
239
+ return lastResults;
240
+ }
241
+ throw e;
209
242
  }
210
243
 
244
+ lastResults = results;
211
245
  modified.push.apply(modified, results.data);
212
246
 
213
247
  if (
@@ -250,52 +284,57 @@ export class Paginator {
250
284
  console.log(`Paginating call, offset = ${offset}`);
251
285
  let results: AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
252
286
 
253
- // Handle each API type separately to avoid type conflicts
254
- if (searchAPI instanceof SearchApi) {
255
- const searchParams: SearchApiSearchPostRequest = {
256
- search: search as Search,
257
- limit: increment,
258
- };
259
- results = (await (searchAPI as SearchApi).searchPost(
260
- searchParams
261
- )) as AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
262
- } else if (searchAPI instanceof SearchV2024Api) {
263
- const searchParams: SearchV2024ApiSearchPostRequest = {
264
- searchV2024: search as SearchV2024,
265
- limit: increment,
266
- };
267
- results = (await (searchAPI as SearchV2024Api).searchPost(
268
- searchParams
269
- )) as AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
270
- } else if (searchAPI instanceof SearchV2025Api) {
271
- const searchParams: SearchV2025ApiSearchPostRequest = {
272
- searchV2025: search as SearchV2025,
273
- limit: increment,
274
- };
275
- results = (await (searchAPI as SearchV2025Api).searchPost(
276
- searchParams
277
- )) as AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
278
- } else {
279
- throw new Error("Unsupported API type");
287
+ try {
288
+ // Handle each API type separately to avoid type conflicts
289
+ if (searchAPI instanceof SearchApi) {
290
+ const searchParams: SearchApiSearchPostRequest = {
291
+ search: search as Search,
292
+ limit: increment,
293
+ };
294
+ results = (await (searchAPI as SearchApi).searchPost(
295
+ searchParams
296
+ )) as AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
297
+ } else if (searchAPI instanceof SearchV2024Api) {
298
+ const searchParams: SearchV2024ApiSearchPostRequest = {
299
+ searchV2024: search as SearchV2024,
300
+ limit: increment,
301
+ };
302
+ results = (await (searchAPI as SearchV2024Api).searchPost(
303
+ searchParams
304
+ )) as AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
305
+ } else if (searchAPI instanceof SearchV2025Api) {
306
+ const searchParams: SearchV2025ApiSearchPostRequest = {
307
+ searchV2025: search as SearchV2025,
308
+ limit: increment,
309
+ };
310
+ results = (await (searchAPI as SearchV2025Api).searchPost(
311
+ searchParams
312
+ )) as AxiosResponse<SearchApiTypeMap[T]["document"][], any>;
313
+ } else {
314
+ throw new Error("Unsupported API type");
315
+ }
316
+ } catch (e: any) {
317
+ // When total results are an exact multiple of increment, some APIs return a
318
+ // 4xx error instead of an empty array for the out-of-bounds offset request.
319
+ if (totalYielded > 0 && e?.response?.status >= 400 && e?.response?.status < 500) {
320
+ return;
321
+ }
322
+ throw e;
280
323
  }
281
324
 
282
- // Yield each document as it arrives
283
325
  for (const doc of results.data) {
284
326
  yield doc;
285
327
  totalYielded++;
286
328
 
287
- // Stop if we've reached the max limit
288
329
  if (maxLimit > 0 && totalYielded >= maxLimit) {
289
330
  return;
290
331
  }
291
332
  }
292
333
 
293
- // Stop if we got fewer results than requested
294
334
  if (results.data.length < increment) {
295
335
  return;
296
336
  }
297
337
 
298
- // Update search after for next iteration
299
338
  const result = <any>results.data[results.data.length - 1];
300
339
  if (search.sort) {
301
340
  (search as any).searchAfter = [result[search.sort[0].replace("-", "")]];
package/v2024/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## sailpoint-sdk@1.8.24
1
+ ## sailpoint-sdk@1.8.26
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install sailpoint-sdk@1.8.24 --save
39
+ npm install sailpoint-sdk@1.8.26 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
package/v2024/common.ts CHANGED
@@ -146,14 +146,14 @@ export const toPathString = function (url: URL) {
146
146
  export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
147
147
  return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
148
148
  axiosRetry(axios, configuration.retriesConfig)
149
- let userAgent = `SailPoint-SDK-TypeScript/1.8.24`;
149
+ let userAgent = `SailPoint-SDK-TypeScript/1.8.26`;
150
150
  if (configuration?.consumerIdentifier && configuration?.consumerVersion) {
151
151
  userAgent += ` (${configuration.consumerIdentifier}/${configuration.consumerVersion})`;
152
152
  }
153
153
  userAgent += ` (${process.platform}; ${process.arch}) Node/${process.versions.node} (openapi-generator/7.12.0)`;
154
154
  const headers = {
155
155
  ...axiosArgs.axiosOptions.headers,
156
- ...{'X-SailPoint-SDK':'typescript-1.8.24'},
156
+ ...{'X-SailPoint-SDK':'typescript-1.8.26'},
157
157
  ...{'User-Agent': userAgent},
158
158
  }
159
159
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sailpoint-sdk",
3
- "version": "1.8.24",
3
+ "version": "1.8.26",
4
4
  "description": "OpenAPI client for sailpoint-sdk",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "repository": {
package/v2025/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## sailpoint-sdk@1.8.24
1
+ ## sailpoint-sdk@1.8.26
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install sailpoint-sdk@1.8.24 --save
39
+ npm install sailpoint-sdk@1.8.26 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_