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.
- package/beta/README.md +2 -2
- package/beta/common.ts +2 -2
- package/beta/package.json +1 -1
- package/dist/beta/common.js +2 -2
- package/dist/nerm/common.js +2 -2
- package/dist/nermv2025/common.js +2 -2
- package/dist/paginator.d.ts +1 -1
- package/dist/paginator.js +144 -87
- package/dist/paginator.js.map +1 -1
- package/dist/paginator.spec.d.ts +1 -0
- package/dist/paginator.spec.js +273 -0
- package/dist/paginator.spec.js.map +1 -0
- package/dist/v2024/common.js +2 -2
- package/dist/v2025/api.d.ts +144 -0
- package/dist/v2025/api.js +230 -0
- package/dist/v2025/api.js.map +1 -1
- package/dist/v2025/common.js +2 -2
- package/dist/v2026/api.d.ts +481 -0
- package/dist/v2026/api.js +607 -20
- package/dist/v2026/api.js.map +1 -1
- package/dist/v2026/common.js +2 -2
- package/dist/v3/common.js +2 -2
- package/nerm/README.md +2 -2
- package/nerm/common.ts +2 -2
- package/nerm/package.json +1 -1
- package/nermv2025/README.md +2 -2
- package/nermv2025/common.ts +2 -2
- package/nermv2025/package.json +1 -1
- package/package.json +1 -1
- package/paginator.spec.ts +158 -0
- package/paginator.ts +101 -62
- package/v2024/README.md +2 -2
- package/v2024/common.ts +2 -2
- package/v2024/package.json +1 -1
- package/v2025/README.md +2 -2
- package/v2025/api.ts +256 -0
- package/v2025/common.ts +2 -2
- package/v2025/package.json +1 -1
- package/v2026/README.md +2 -2
- package/v2026/api.ts +757 -0
- package/v2026/common.ts +2 -2
- package/v2026/package.json +1 -1
- package/v3/README.md +2 -2
- package/v3/common.ts +2 -2
- package/v3/package.json +1 -1
package/dist/v2026/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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
157
|
+
...{'X-SailPoint-SDK':'typescript-1.8.26'},
|
|
158
158
|
...{'User-Agent': userAgent},
|
|
159
159
|
}
|
|
160
160
|
|
package/nerm/package.json
CHANGED
package/nermv2025/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## sailpoint-nerm-sdk@1.8.
|
|
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.
|
|
39
|
+
npm install sailpoint-nerm-sdk@1.8.26 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
package/nermv2025/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.
|
|
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.
|
|
157
|
+
...{'X-SailPoint-SDK':'typescript-1.8.26'},
|
|
158
158
|
...{'User-Agent': userAgent},
|
|
159
159
|
}
|
|
160
160
|
|
package/nermv2025/package.json
CHANGED
package/package.json
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
156
|
+
...{'X-SailPoint-SDK':'typescript-1.8.26'},
|
|
157
157
|
...{'User-Agent': userAgent},
|
|
158
158
|
}
|
|
159
159
|
|
package/v2024/package.json
CHANGED
package/v2025/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## sailpoint-sdk@1.8.
|
|
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.
|
|
39
|
+
npm install sailpoint-sdk@1.8.26 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|