@factpulse/sdk 3.0.26 → 3.0.27
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/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,7 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
## [3.0.
|
|
10
|
+
## [3.0.27] - 2026-01-15
|
|
11
11
|
|
|
12
12
|
### Added
|
|
13
13
|
- Version initiale du SDK typescript
|
|
@@ -24,5 +24,5 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
24
24
|
- Guide d'authentification JWT
|
|
25
25
|
- Configuration avancée (timeout, proxy, debug)
|
|
26
26
|
|
|
27
|
-
[Unreleased]: https://github.com/factpulse/sdk-typescript/compare/v3.0.
|
|
28
|
-
[3.0.
|
|
27
|
+
[Unreleased]: https://github.com/factpulse/sdk-typescript/compare/v3.0.27...HEAD
|
|
28
|
+
[3.0.27]: https://github.com/factpulse/sdk-typescript/releases/tag/v3.0.27
|
|
@@ -270,12 +270,12 @@ export class FactPulseClient {
|
|
|
270
270
|
const response = yield this.httpClient.get(`${this.config.apiUrl}/api/v1/processing/tasks/${taskId}/status`, {
|
|
271
271
|
headers: { Authorization: `Bearer ${this.accessToken}` },
|
|
272
272
|
});
|
|
273
|
-
const {
|
|
274
|
-
if (
|
|
275
|
-
return
|
|
276
|
-
if (
|
|
273
|
+
const { status, result } = response.data;
|
|
274
|
+
if (status === 'SUCCESS')
|
|
275
|
+
return result || {};
|
|
276
|
+
if (status === 'FAILURE') {
|
|
277
277
|
// Format AFNOR: errorMessage, details
|
|
278
|
-
const
|
|
278
|
+
const failureResult = result;
|
|
279
279
|
const errors = Array.isArray(result === null || result === void 0 ? void 0 : result.details) ? result.details.filter((e) => typeof e === 'object' && e !== null) : [];
|
|
280
280
|
throw new FactPulseValidationError(`Task ${taskId} failed: ${(result === null || result === void 0 ? void 0 : result.errorMessage) || 'Unknown error'}`, errors);
|
|
281
281
|
}
|
|
@@ -318,12 +318,12 @@ class FactPulseClient {
|
|
|
318
318
|
const response = yield this.httpClient.get(`${this.config.apiUrl}/api/v1/processing/tasks/${taskId}/status`, {
|
|
319
319
|
headers: { Authorization: `Bearer ${this.accessToken}` },
|
|
320
320
|
});
|
|
321
|
-
const {
|
|
322
|
-
if (
|
|
323
|
-
return
|
|
324
|
-
if (
|
|
321
|
+
const { status, result } = response.data;
|
|
322
|
+
if (status === 'SUCCESS')
|
|
323
|
+
return result || {};
|
|
324
|
+
if (status === 'FAILURE') {
|
|
325
325
|
// Format AFNOR: errorMessage, details
|
|
326
|
-
const
|
|
326
|
+
const failureResult = result;
|
|
327
327
|
const errors = Array.isArray(result === null || result === void 0 ? void 0 : result.details) ? result.details.filter((e) => typeof e === 'object' && e !== null) : [];
|
|
328
328
|
throw new exceptions_1.FactPulseValidationError(`Task ${taskId} failed: ${(result === null || result === void 0 ? void 0 : result.errorMessage) || 'Unknown error'}`, errors);
|
|
329
329
|
}
|
package/package.json
CHANGED
package/src/helpers/client.ts
CHANGED
|
@@ -307,12 +307,12 @@ export class FactPulseClient {
|
|
|
307
307
|
const response = await this.httpClient.get(`${this.config.apiUrl}/api/v1/processing/tasks/${taskId}/status`, {
|
|
308
308
|
headers: { Authorization: `Bearer ${this.accessToken}` },
|
|
309
309
|
});
|
|
310
|
-
const {
|
|
311
|
-
if (
|
|
312
|
-
if (
|
|
310
|
+
const { status, result } = response.data;
|
|
311
|
+
if (status === 'SUCCESS') return (result as Record<string, unknown>) || {};
|
|
312
|
+
if (status === 'FAILURE') {
|
|
313
313
|
// Format AFNOR: errorMessage, details
|
|
314
|
-
const
|
|
315
|
-
const errors: ValidationErrorDetail[] = Array.isArray(result?.details) ? result.details.filter((e): e is ValidationErrorDetail => typeof e === 'object' && e !== null) : [];
|
|
314
|
+
const failureResult = result as Record<string, unknown> | undefined;
|
|
315
|
+
const errors: ValidationErrorDetail[] = Array.isArray(result?.details) ? result.details.filter((e: unknown): e is ValidationErrorDetail => typeof e === 'object' && e !== null) : [];
|
|
316
316
|
throw new FactPulseValidationError(`Task ${taskId} failed: ${result?.errorMessage || 'Unknown error'}`, errors);
|
|
317
317
|
}
|
|
318
318
|
await new Promise(resolve => setTimeout(resolve, currentInterval));
|