@factpulse/sdk 3.0.36 → 3.0.37

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 (67) hide show
  1. package/.openapi-generator/FILES +4 -4
  2. package/CHANGELOG.md +3 -3
  3. package/api/invoice-processing-api.ts +2 -2
  4. package/dist/esm/models/chorus-pro-credentials.d.ts +7 -19
  5. package/dist/esm/models/chorus-pro-destination.d.ts +2 -2
  6. package/dist/esm/models/{facture-electronique-rest-api-schemas-cdar-validation-error-response.d.ts → facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.d.ts} +16 -9
  7. package/dist/esm/models/facture-electronique-rest-api-schemas-validation-validation-error-response.d.ts +20 -0
  8. package/dist/esm/models/get-chorus-pro-id-request.d.ts +2 -2
  9. package/dist/esm/models/get-invoice-request.d.ts +2 -2
  10. package/dist/esm/models/get-structure-request.d.ts +2 -2
  11. package/dist/esm/models/index.d.ts +2 -2
  12. package/dist/esm/models/index.js +2 -2
  13. package/dist/esm/models/search-structure-request.d.ts +2 -2
  14. package/dist/esm/models/submit-invoice-request.d.ts +2 -2
  15. package/dist/esm/models/validate-cdarresponse.d.ts +3 -3
  16. package/dist/esm/models/validation-error-response.d.ts +12 -3
  17. package/dist/esm/src/helpers/client.d.ts +2 -2
  18. package/dist/esm/src/helpers/client.js +8 -8
  19. package/dist/models/chorus-pro-credentials.d.ts +7 -19
  20. package/dist/models/chorus-pro-destination.d.ts +2 -2
  21. package/dist/models/{facture-electronique-rest-api-schemas-cdar-validation-error-response.d.ts → facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.d.ts} +16 -9
  22. package/dist/models/facture-electronique-rest-api-schemas-validation-validation-error-response.d.ts +20 -0
  23. package/dist/models/get-chorus-pro-id-request.d.ts +2 -2
  24. package/dist/models/get-invoice-request.d.ts +2 -2
  25. package/dist/models/get-structure-request.d.ts +2 -2
  26. package/dist/models/index.d.ts +2 -2
  27. package/dist/models/index.js +2 -2
  28. package/dist/models/search-structure-request.d.ts +2 -2
  29. package/dist/models/submit-invoice-request.d.ts +2 -2
  30. package/dist/models/validate-cdarresponse.d.ts +3 -3
  31. package/dist/models/validation-error-response.d.ts +12 -3
  32. package/dist/src/helpers/client.d.ts +2 -2
  33. package/dist/src/helpers/client.js +8 -8
  34. package/docs/ChorusProCredentials.md +9 -9
  35. package/docs/ChorusProDestination.md +1 -1
  36. package/docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md +29 -0
  37. package/docs/FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md +21 -0
  38. package/docs/GetChorusProIdRequest.md +1 -1
  39. package/docs/GetInvoiceRequest.md +1 -1
  40. package/docs/GetStructureRequest.md +1 -1
  41. package/docs/SearchStructureRequest.md +1 -1
  42. package/docs/SubmitInvoiceRequest.md +1 -1
  43. package/docs/ValidateCDARResponse.md +2 -2
  44. package/docs/ValidationErrorResponse.md +9 -3
  45. package/models/chorus-pro-credentials.ts +7 -19
  46. package/models/chorus-pro-destination.ts +2 -2
  47. package/models/{facture-electronique-rest-api-schemas-cdar-validation-error-response.ts → facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.ts} +16 -9
  48. package/models/facture-electronique-rest-api-schemas-validation-validation-error-response.ts +26 -0
  49. package/models/get-chorus-pro-id-request.ts +2 -2
  50. package/models/get-invoice-request.ts +2 -2
  51. package/models/get-structure-request.ts +2 -2
  52. package/models/index.ts +2 -2
  53. package/models/search-structure-request.ts +2 -2
  54. package/models/submit-invoice-request.ts +2 -2
  55. package/models/validate-cdarresponse.ts +3 -3
  56. package/models/validation-error-response.ts +12 -3
  57. package/package.json +1 -1
  58. package/src/helpers/client.ts +10 -10
  59. package/dist/esm/models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.d.ts +0 -24
  60. package/dist/models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.d.ts +0 -24
  61. package/docs/FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md +0 -27
  62. package/docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md +0 -29
  63. package/models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.ts +0 -30
  64. /package/dist/esm/models/{facture-electronique-rest-api-schemas-cdar-validation-error-response.js → facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.js} +0 -0
  65. /package/dist/esm/models/{facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.js → facture-electronique-rest-api-schemas-validation-validation-error-response.js} +0 -0
  66. /package/dist/models/{facture-electronique-rest-api-schemas-cdar-validation-error-response.js → facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.js} +0 -0
  67. /package/dist/models/{facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.js → facture-electronique-rest-api-schemas-validation-validation-error-response.js} +0 -0
@@ -173,9 +173,9 @@ docs/ErrorSource.md
173
173
  docs/ExtractionInfo.md
174
174
  docs/FacturXInvoice.md
175
175
  docs/FacturXPDFInfo.md
176
- docs/FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md
176
+ docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md
177
177
  docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md
178
- docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md
178
+ docs/FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md
179
179
  docs/FieldStatus.md
180
180
  docs/FileInfo.md
181
181
  docs/FilesInfo.md
@@ -472,9 +472,9 @@ models/error-source.ts
472
472
  models/extraction-info.ts
473
473
  models/factur-xinvoice.ts
474
474
  models/factur-xpdfinfo.ts
475
- models/facture-electronique-rest-api-schemas-cdar-validation-error-response.ts
475
+ models/facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.ts
476
476
  models/facture-electronique-rest-api-schemas-ereporting-invoice-type-code.ts
477
- models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.ts
477
+ models/facture-electronique-rest-api-schemas-validation-validation-error-response.ts
478
478
  models/field-status.ts
479
479
  models/file-info.ts
480
480
  models/files-info.ts
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.36] - 2026-01-17
10
+ ## [3.0.37] - 2026-01-17
11
11
 
12
12
  ### Added
13
13
  - Version initiale du SDK typescript
@@ -20,5 +20,5 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
20
20
  - Documentation complète et exemples
21
21
 
22
22
 
23
- [Unreleased]: https://github.com/factpulse/sdk-typescript/compare/v3.0.36...HEAD
24
- [3.0.36]: https://github.com/factpulse/sdk-typescript/releases/tag/v3.0.36
23
+ [Unreleased]: https://github.com/factpulse/sdk-typescript/compare/v3.0.37...HEAD
24
+ [3.0.37]: https://github.com/factpulse/sdk-typescript/releases/tag/v3.0.37
@@ -28,6 +28,8 @@ import type { APIProfile } from '../models';
28
28
  // @ts-ignore
29
29
  import type { AsyncTaskStatus } from '../models';
30
30
  // @ts-ignore
31
+ import type { FactureElectroniqueRestApiSchemasValidationValidationErrorResponse } from '../models';
32
+ // @ts-ignore
31
33
  import type { GenerateCertificateRequest } from '../models';
32
34
  // @ts-ignore
33
35
  import type { GenerateCertificateResponse } from '../models';
@@ -44,8 +46,6 @@ import type { SubmitCompleteInvoiceResponse } from '../models';
44
46
  // @ts-ignore
45
47
  import type { TaskResponse } from '../models';
46
48
  // @ts-ignore
47
- import type { ValidationErrorResponse } from '../models';
48
- // @ts-ignore
49
49
  import type { ValidationSuccessResponse } from '../models';
50
50
  /**
51
51
  * InvoiceProcessingApi - axios parameter creator
@@ -10,27 +10,15 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- * Chorus Pro credentials for Zero-Trust mode. **Zero-Trust Mode**: Credentials are passed in each request and are NEVER stored. **Security**: - Credentials are never persisted in the database - They are used only for the duration of the request - Secure transmission via HTTPS **Use cases**: - High-security environments (banks, administrations) - Strict GDPR compliance - Tests with temporary credentials - Users who don\'t want to store their credentials
13
+ * Optional Chorus Pro credentials. **MODE 1 - JWT retrieval (recommended):** Do not provide this `credentials` field in the payload. Credentials will be automatically retrieved via client_uid from JWT (0-trust). **MODE 2 - Credentials in payload:** Provide all required fields below. Useful for tests or third-party integrations.
14
14
  */
15
15
  export interface ChorusProCredentials {
16
+ 'pisteClientId'?: string | null;
17
+ 'pisteClientSecret'?: string | null;
18
+ 'chorusLogin'?: string | null;
19
+ 'chorusPassword'?: string | null;
16
20
  /**
17
- * PISTE Client ID (government API portal)
21
+ * [MODE 2] Use sandbox mode (default: True)
18
22
  */
19
- 'pisteClientId': string;
20
- /**
21
- * PISTE Client Secret
22
- */
23
- 'pisteClientSecret': string;
24
- /**
25
- * Chorus Pro login
26
- */
27
- 'chorusProLogin': string;
28
- /**
29
- * Chorus Pro password
30
- */
31
- 'chorusProPassword': string;
32
- /**
33
- * Use sandbox environment (true) or production (false)
34
- */
35
- 'sandbox'?: boolean;
23
+ 'sandboxMode'?: boolean;
36
24
  }
@@ -9,13 +9,13 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { FactureElectroniqueRestApiSchemasProcessingChorusProCredentials } from './facture-electronique-rest-api-schemas-processing-chorus-pro-credentials';
12
+ import type { ChorusProCredentials } from './chorus-pro-credentials';
13
13
  /**
14
14
  * Specific configuration for Chorus Pro destination.
15
15
  */
16
16
  export interface ChorusProDestination {
17
17
  'type'?: ChorusProDestinationTypeEnum;
18
- 'credentials'?: FactureElectroniqueRestApiSchemasProcessingChorusProCredentials | null;
18
+ 'credentials'?: ChorusProCredentials | null;
19
19
  }
20
20
  export declare const ChorusProDestinationTypeEnum: {
21
21
  readonly ChorusPro: "chorus_pro";
@@ -10,20 +10,27 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- * Erreur de validation.
13
+ * Chorus Pro credentials for Zero-Trust mode. **Zero-Trust Mode**: Credentials are passed in each request and are NEVER stored. **Security**: - Credentials are never persisted in the database - They are used only for the duration of the request - Secure transmission via HTTPS **Use cases**: - High-security environments (banks, administrations) - Strict GDPR compliance - Tests with temporary credentials - Users who don\'t want to store their credentials
14
14
  */
15
- export interface FactureElectroniqueRestApiSchemasCdarValidationErrorResponse {
15
+ export interface FactureElectroniqueRestApiSchemasChorusProChorusProCredentials {
16
16
  /**
17
- * Champ concerné
17
+ * PISTE Client ID (government API portal)
18
18
  */
19
- 'field': string;
19
+ 'pisteClientId': string;
20
20
  /**
21
- * Message d\'erreur
21
+ * PISTE Client Secret
22
22
  */
23
- 'message': string;
24
- 'rule'?: string | null;
23
+ 'pisteClientSecret': string;
25
24
  /**
26
- * Sévérité (error/warning)
25
+ * Chorus Pro login
27
26
  */
28
- 'severity'?: string;
27
+ 'chorusProLogin': string;
28
+ /**
29
+ * Chorus Pro password
30
+ */
31
+ 'chorusProPassword': string;
32
+ /**
33
+ * Use sandbox environment (true) or production (false)
34
+ */
35
+ 'sandbox'?: boolean;
29
36
  }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * FactPulse REST API
3
+ * REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }\' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }\' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: contact@factpulse.fr
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Response for validation errors.
14
+ */
15
+ export interface FactureElectroniqueRestApiSchemasValidationValidationErrorResponse {
16
+ /**
17
+ * List of detected validation errors.
18
+ */
19
+ 'detail': Array<string>;
20
+ }
@@ -9,12 +9,12 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { ChorusProCredentials } from './chorus-pro-credentials';
12
+ import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
13
13
  /**
14
14
  * Get Chorus Pro ID from SIRET.
15
15
  */
16
16
  export interface GetChorusProIdRequest {
17
- 'credentials'?: ChorusProCredentials | null;
17
+ 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
18
18
  /**
19
19
  * Structure SIRET (14 digits)
20
20
  */
@@ -9,12 +9,12 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { ChorusProCredentials } from './chorus-pro-credentials';
12
+ import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
13
13
  /**
14
14
  * Get an invoice.
15
15
  */
16
16
  export interface GetInvoiceRequest {
17
- 'credentials'?: ChorusProCredentials | null;
17
+ 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
18
18
  /**
19
19
  * Chorus Pro invoice ID
20
20
  */
@@ -9,12 +9,12 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { ChorusProCredentials } from './chorus-pro-credentials';
12
+ import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
13
13
  /**
14
14
  * Get structure details.
15
15
  */
16
16
  export interface GetStructureRequest {
17
- 'credentials'?: ChorusProCredentials | null;
17
+ 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
18
18
  /**
19
19
  * Chorus Pro structure ID
20
20
  */
@@ -145,9 +145,9 @@ export * from './error-source';
145
145
  export * from './extraction-info';
146
146
  export * from './factur-xinvoice';
147
147
  export * from './factur-xpdfinfo';
148
- export * from './facture-electronique-rest-api-schemas-cdar-validation-error-response';
148
+ export * from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
149
149
  export * from './facture-electronique-rest-api-schemas-ereporting-invoice-type-code';
150
- export * from './facture-electronique-rest-api-schemas-processing-chorus-pro-credentials';
150
+ export * from './facture-electronique-rest-api-schemas-validation-validation-error-response';
151
151
  export * from './field-status';
152
152
  export * from './file-info';
153
153
  export * from './files-info';
@@ -145,9 +145,9 @@ export * from './error-source';
145
145
  export * from './extraction-info';
146
146
  export * from './factur-xinvoice';
147
147
  export * from './factur-xpdfinfo';
148
- export * from './facture-electronique-rest-api-schemas-cdar-validation-error-response';
148
+ export * from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
149
149
  export * from './facture-electronique-rest-api-schemas-ereporting-invoice-type-code';
150
- export * from './facture-electronique-rest-api-schemas-processing-chorus-pro-credentials';
150
+ export * from './facture-electronique-rest-api-schemas-validation-validation-error-response';
151
151
  export * from './field-status';
152
152
  export * from './file-info';
153
153
  export * from './files-info';
@@ -9,12 +9,12 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { ChorusProCredentials } from './chorus-pro-credentials';
12
+ import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
13
13
  /**
14
14
  * Search structures by criteria.
15
15
  */
16
16
  export interface SearchStructureRequest {
17
- 'credentials'?: ChorusProCredentials | null;
17
+ 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
18
18
  'structureIdentifier'?: string | null;
19
19
  'structureIdentifierType'?: string | null;
20
20
  'companyName'?: string | null;
@@ -9,7 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { ChorusProCredentials } from './chorus-pro-credentials';
12
+ import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
13
13
  import type { SubmitGrossAmount } from './submit-gross-amount';
14
14
  import type { SubmitNetAmount } from './submit-net-amount';
15
15
  import type { SubmitVatAmount } from './submit-vat-amount';
@@ -17,7 +17,7 @@ import type { SubmitVatAmount } from './submit-vat-amount';
17
17
  * Submit an invoice to Chorus Pro.
18
18
  */
19
19
  export interface SubmitInvoiceRequest {
20
- 'credentials'?: ChorusProCredentials | null;
20
+ 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
21
21
  /**
22
22
  * Invoice number
23
23
  */
@@ -9,7 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { FactureElectroniqueRestApiSchemasCdarValidationErrorResponse } from './facture-electronique-rest-api-schemas-cdar-validation-error-response';
12
+ import type { ValidationErrorResponse } from './validation-error-response';
13
13
  /**
14
14
  * Réponse de validation CDAR.
15
15
  */
@@ -21,9 +21,9 @@ export interface ValidateCDARResponse {
21
21
  /**
22
22
  * Liste des erreurs
23
23
  */
24
- 'errors'?: Array<FactureElectroniqueRestApiSchemasCdarValidationErrorResponse>;
24
+ 'errors'?: Array<ValidationErrorResponse>;
25
25
  /**
26
26
  * Liste des avertissements
27
27
  */
28
- 'warnings'?: Array<FactureElectroniqueRestApiSchemasCdarValidationErrorResponse>;
28
+ 'warnings'?: Array<ValidationErrorResponse>;
29
29
  }
@@ -10,11 +10,20 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- * Response for validation errors.
13
+ * Erreur de validation.
14
14
  */
15
15
  export interface ValidationErrorResponse {
16
16
  /**
17
- * List of detected validation errors.
17
+ * Champ concerné
18
18
  */
19
- 'detail': Array<string>;
19
+ 'field': string;
20
+ /**
21
+ * Message d\'erreur
22
+ */
23
+ 'message': string;
24
+ 'rule'?: string | null;
25
+ /**
26
+ * Sévérité (error/warning)
27
+ */
28
+ 'severity'?: string;
20
29
  }
@@ -256,7 +256,7 @@ export declare class FactPulseClient {
256
256
  * @param invoiceData Invoice data
257
257
  * @param pdfPath Path to the source PDF
258
258
  * @param options Workflow options
259
- * @returns Result with pdfBuffer, validation, signature and afnor
259
+ * @returns Result with pdfBytes, validation, signature and afnor
260
260
  */
261
261
  generateCompleteFacturx(invoiceData: Record<string, unknown>, pdfPath: string, options?: {
262
262
  profile?: string;
@@ -267,7 +267,7 @@ export declare class FactPulseClient {
267
267
  afnorTrackingId?: string;
268
268
  timeout?: number;
269
269
  }): Promise<{
270
- pdfBuffer: Buffer;
270
+ pdfBytes: Buffer;
271
271
  validation?: Record<string, unknown>;
272
272
  signature?: {
273
273
  signed: boolean;
@@ -808,18 +808,18 @@ export class FactPulseClient {
808
808
  * @param invoiceData Invoice data
809
809
  * @param pdfPath Path to the source PDF
810
810
  * @param options Workflow options
811
- * @returns Result with pdfBuffer, validation, signature and afnor
811
+ * @returns Result with pdfBytes, validation, signature and afnor
812
812
  */
813
813
  generateCompleteFacturx(invoiceData_1, pdfPath_1) {
814
814
  return __awaiter(this, arguments, void 0, function* (invoiceData, pdfPath, options = {}) {
815
815
  const { profile = 'EN16931', validate = true, sign = false, submitAfnor = false, afnorFlowName, afnorTrackingId, timeout, } = options;
816
- const result = { pdfBuffer: Buffer.alloc(0) };
816
+ const result = { pdfBytes: Buffer.alloc(0) };
817
817
  // 1. Generation
818
- const pdfBuffer = yield this.generateFacturx(invoiceData, pdfPath, profile, 'pdf', true, timeout);
819
- result.pdfBuffer = pdfBuffer;
818
+ const pdfBytes = yield this.generateFacturx(invoiceData, pdfPath, profile, 'pdf', true, timeout);
819
+ result.pdfBytes = pdfBytes;
820
820
  // 2. Validation
821
821
  if (validate) {
822
- const validation = yield this.validateFacturxPdf(pdfBuffer, { profile });
822
+ const validation = yield this.validateFacturxPdf(pdfBytes, { profile });
823
823
  result.validation = validation;
824
824
  if (!validation.isCompliant) {
825
825
  return result;
@@ -827,8 +827,8 @@ export class FactPulseClient {
827
827
  }
828
828
  // 3. Signature (uses the server-configured certificate)
829
829
  if (sign) {
830
- const signedPdf = yield this.signPdf(result.pdfBuffer);
831
- result.pdfBuffer = signedPdf;
830
+ const signedPdf = yield this.signPdf(result.pdfBytes);
831
+ result.pdfBytes = signedPdf;
832
832
  result.signature = { signed: true };
833
833
  }
834
834
  // 4. AFNOR submission
@@ -836,7 +836,7 @@ export class FactPulseClient {
836
836
  const invoiceNumber = (invoiceData.invoiceNumber || invoiceData.invoice_number || 'INVOICE');
837
837
  const flowName = afnorFlowName || `Invoice ${invoiceNumber}`;
838
838
  const trackingId = afnorTrackingId || invoiceNumber;
839
- const afnorResult = yield this.submitInvoiceAfnor(result.pdfBuffer, flowName, { trackingId });
839
+ const afnorResult = yield this.submitInvoiceAfnor(result.pdfBytes, flowName, { trackingId });
840
840
  result.afnor = afnorResult;
841
841
  }
842
842
  return result;
@@ -10,27 +10,15 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- * Chorus Pro credentials for Zero-Trust mode. **Zero-Trust Mode**: Credentials are passed in each request and are NEVER stored. **Security**: - Credentials are never persisted in the database - They are used only for the duration of the request - Secure transmission via HTTPS **Use cases**: - High-security environments (banks, administrations) - Strict GDPR compliance - Tests with temporary credentials - Users who don\'t want to store their credentials
13
+ * Optional Chorus Pro credentials. **MODE 1 - JWT retrieval (recommended):** Do not provide this `credentials` field in the payload. Credentials will be automatically retrieved via client_uid from JWT (0-trust). **MODE 2 - Credentials in payload:** Provide all required fields below. Useful for tests or third-party integrations.
14
14
  */
15
15
  export interface ChorusProCredentials {
16
+ 'pisteClientId'?: string | null;
17
+ 'pisteClientSecret'?: string | null;
18
+ 'chorusLogin'?: string | null;
19
+ 'chorusPassword'?: string | null;
16
20
  /**
17
- * PISTE Client ID (government API portal)
21
+ * [MODE 2] Use sandbox mode (default: True)
18
22
  */
19
- 'pisteClientId': string;
20
- /**
21
- * PISTE Client Secret
22
- */
23
- 'pisteClientSecret': string;
24
- /**
25
- * Chorus Pro login
26
- */
27
- 'chorusProLogin': string;
28
- /**
29
- * Chorus Pro password
30
- */
31
- 'chorusProPassword': string;
32
- /**
33
- * Use sandbox environment (true) or production (false)
34
- */
35
- 'sandbox'?: boolean;
23
+ 'sandboxMode'?: boolean;
36
24
  }
@@ -9,13 +9,13 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { FactureElectroniqueRestApiSchemasProcessingChorusProCredentials } from './facture-electronique-rest-api-schemas-processing-chorus-pro-credentials';
12
+ import type { ChorusProCredentials } from './chorus-pro-credentials';
13
13
  /**
14
14
  * Specific configuration for Chorus Pro destination.
15
15
  */
16
16
  export interface ChorusProDestination {
17
17
  'type'?: ChorusProDestinationTypeEnum;
18
- 'credentials'?: FactureElectroniqueRestApiSchemasProcessingChorusProCredentials | null;
18
+ 'credentials'?: ChorusProCredentials | null;
19
19
  }
20
20
  export declare const ChorusProDestinationTypeEnum: {
21
21
  readonly ChorusPro: "chorus_pro";
@@ -10,20 +10,27 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- * Erreur de validation.
13
+ * Chorus Pro credentials for Zero-Trust mode. **Zero-Trust Mode**: Credentials are passed in each request and are NEVER stored. **Security**: - Credentials are never persisted in the database - They are used only for the duration of the request - Secure transmission via HTTPS **Use cases**: - High-security environments (banks, administrations) - Strict GDPR compliance - Tests with temporary credentials - Users who don\'t want to store their credentials
14
14
  */
15
- export interface FactureElectroniqueRestApiSchemasCdarValidationErrorResponse {
15
+ export interface FactureElectroniqueRestApiSchemasChorusProChorusProCredentials {
16
16
  /**
17
- * Champ concerné
17
+ * PISTE Client ID (government API portal)
18
18
  */
19
- 'field': string;
19
+ 'pisteClientId': string;
20
20
  /**
21
- * Message d\'erreur
21
+ * PISTE Client Secret
22
22
  */
23
- 'message': string;
24
- 'rule'?: string | null;
23
+ 'pisteClientSecret': string;
25
24
  /**
26
- * Sévérité (error/warning)
25
+ * Chorus Pro login
27
26
  */
28
- 'severity'?: string;
27
+ 'chorusProLogin': string;
28
+ /**
29
+ * Chorus Pro password
30
+ */
31
+ 'chorusProPassword': string;
32
+ /**
33
+ * Use sandbox environment (true) or production (false)
34
+ */
35
+ 'sandbox'?: boolean;
29
36
  }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * FactPulse REST API
3
+ * REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }\' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }\' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: contact@factpulse.fr
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Response for validation errors.
14
+ */
15
+ export interface FactureElectroniqueRestApiSchemasValidationValidationErrorResponse {
16
+ /**
17
+ * List of detected validation errors.
18
+ */
19
+ 'detail': Array<string>;
20
+ }
@@ -9,12 +9,12 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { ChorusProCredentials } from './chorus-pro-credentials';
12
+ import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
13
13
  /**
14
14
  * Get Chorus Pro ID from SIRET.
15
15
  */
16
16
  export interface GetChorusProIdRequest {
17
- 'credentials'?: ChorusProCredentials | null;
17
+ 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
18
18
  /**
19
19
  * Structure SIRET (14 digits)
20
20
  */
@@ -9,12 +9,12 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { ChorusProCredentials } from './chorus-pro-credentials';
12
+ import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
13
13
  /**
14
14
  * Get an invoice.
15
15
  */
16
16
  export interface GetInvoiceRequest {
17
- 'credentials'?: ChorusProCredentials | null;
17
+ 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
18
18
  /**
19
19
  * Chorus Pro invoice ID
20
20
  */
@@ -9,12 +9,12 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { ChorusProCredentials } from './chorus-pro-credentials';
12
+ import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
13
13
  /**
14
14
  * Get structure details.
15
15
  */
16
16
  export interface GetStructureRequest {
17
- 'credentials'?: ChorusProCredentials | null;
17
+ 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
18
18
  /**
19
19
  * Chorus Pro structure ID
20
20
  */
@@ -145,9 +145,9 @@ export * from './error-source';
145
145
  export * from './extraction-info';
146
146
  export * from './factur-xinvoice';
147
147
  export * from './factur-xpdfinfo';
148
- export * from './facture-electronique-rest-api-schemas-cdar-validation-error-response';
148
+ export * from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
149
149
  export * from './facture-electronique-rest-api-schemas-ereporting-invoice-type-code';
150
- export * from './facture-electronique-rest-api-schemas-processing-chorus-pro-credentials';
150
+ export * from './facture-electronique-rest-api-schemas-validation-validation-error-response';
151
151
  export * from './field-status';
152
152
  export * from './file-info';
153
153
  export * from './files-info';
@@ -161,9 +161,9 @@ __exportStar(require("./error-source"), exports);
161
161
  __exportStar(require("./extraction-info"), exports);
162
162
  __exportStar(require("./factur-xinvoice"), exports);
163
163
  __exportStar(require("./factur-xpdfinfo"), exports);
164
- __exportStar(require("./facture-electronique-rest-api-schemas-cdar-validation-error-response"), exports);
164
+ __exportStar(require("./facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials"), exports);
165
165
  __exportStar(require("./facture-electronique-rest-api-schemas-ereporting-invoice-type-code"), exports);
166
- __exportStar(require("./facture-electronique-rest-api-schemas-processing-chorus-pro-credentials"), exports);
166
+ __exportStar(require("./facture-electronique-rest-api-schemas-validation-validation-error-response"), exports);
167
167
  __exportStar(require("./field-status"), exports);
168
168
  __exportStar(require("./file-info"), exports);
169
169
  __exportStar(require("./files-info"), exports);
@@ -9,12 +9,12 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { ChorusProCredentials } from './chorus-pro-credentials';
12
+ import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
13
13
  /**
14
14
  * Search structures by criteria.
15
15
  */
16
16
  export interface SearchStructureRequest {
17
- 'credentials'?: ChorusProCredentials | null;
17
+ 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
18
18
  'structureIdentifier'?: string | null;
19
19
  'structureIdentifierType'?: string | null;
20
20
  'companyName'?: string | null;