@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.
- package/.openapi-generator/FILES +4 -4
- package/CHANGELOG.md +3 -3
- package/api/invoice-processing-api.ts +2 -2
- package/dist/esm/models/chorus-pro-credentials.d.ts +7 -19
- package/dist/esm/models/chorus-pro-destination.d.ts +2 -2
- 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
- package/dist/esm/models/facture-electronique-rest-api-schemas-validation-validation-error-response.d.ts +20 -0
- package/dist/esm/models/get-chorus-pro-id-request.d.ts +2 -2
- package/dist/esm/models/get-invoice-request.d.ts +2 -2
- package/dist/esm/models/get-structure-request.d.ts +2 -2
- package/dist/esm/models/index.d.ts +2 -2
- package/dist/esm/models/index.js +2 -2
- package/dist/esm/models/search-structure-request.d.ts +2 -2
- package/dist/esm/models/submit-invoice-request.d.ts +2 -2
- package/dist/esm/models/validate-cdarresponse.d.ts +3 -3
- package/dist/esm/models/validation-error-response.d.ts +12 -3
- package/dist/esm/src/helpers/client.d.ts +2 -2
- package/dist/esm/src/helpers/client.js +8 -8
- package/dist/models/chorus-pro-credentials.d.ts +7 -19
- package/dist/models/chorus-pro-destination.d.ts +2 -2
- 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
- package/dist/models/facture-electronique-rest-api-schemas-validation-validation-error-response.d.ts +20 -0
- package/dist/models/get-chorus-pro-id-request.d.ts +2 -2
- package/dist/models/get-invoice-request.d.ts +2 -2
- package/dist/models/get-structure-request.d.ts +2 -2
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +2 -2
- package/dist/models/search-structure-request.d.ts +2 -2
- package/dist/models/submit-invoice-request.d.ts +2 -2
- package/dist/models/validate-cdarresponse.d.ts +3 -3
- package/dist/models/validation-error-response.d.ts +12 -3
- package/dist/src/helpers/client.d.ts +2 -2
- package/dist/src/helpers/client.js +8 -8
- package/docs/ChorusProCredentials.md +9 -9
- package/docs/ChorusProDestination.md +1 -1
- package/docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md +29 -0
- package/docs/FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md +21 -0
- package/docs/GetChorusProIdRequest.md +1 -1
- package/docs/GetInvoiceRequest.md +1 -1
- package/docs/GetStructureRequest.md +1 -1
- package/docs/SearchStructureRequest.md +1 -1
- package/docs/SubmitInvoiceRequest.md +1 -1
- package/docs/ValidateCDARResponse.md +2 -2
- package/docs/ValidationErrorResponse.md +9 -3
- package/models/chorus-pro-credentials.ts +7 -19
- package/models/chorus-pro-destination.ts +2 -2
- 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
- package/models/facture-electronique-rest-api-schemas-validation-validation-error-response.ts +26 -0
- package/models/get-chorus-pro-id-request.ts +2 -2
- package/models/get-invoice-request.ts +2 -2
- package/models/get-structure-request.ts +2 -2
- package/models/index.ts +2 -2
- package/models/search-structure-request.ts +2 -2
- package/models/submit-invoice-request.ts +2 -2
- package/models/validate-cdarresponse.ts +3 -3
- package/models/validation-error-response.ts +12 -3
- package/package.json +1 -1
- package/src/helpers/client.ts +10 -10
- package/dist/esm/models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.d.ts +0 -24
- package/dist/models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.d.ts +0 -24
- package/docs/FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md +0 -27
- package/docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md +0 -29
- package/models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.ts +0 -30
- /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
- /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
- /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
- /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
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import type {
|
|
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'?:
|
|
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 {
|
|
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<
|
|
24
|
+
'errors'?: Array<ValidationErrorResponse>;
|
|
25
25
|
/**
|
|
26
26
|
* Liste des avertissements
|
|
27
27
|
*/
|
|
28
|
-
'warnings'?: Array<
|
|
28
|
+
'warnings'?: Array<ValidationErrorResponse>;
|
|
29
29
|
}
|
|
@@ -10,11 +10,20 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Erreur de validation.
|
|
14
14
|
*/
|
|
15
15
|
export interface ValidationErrorResponse {
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Champ concerné
|
|
18
18
|
*/
|
|
19
|
-
'
|
|
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
|
|
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
|
-
|
|
270
|
+
pdfBytes: Buffer;
|
|
271
271
|
validation?: Record<string, unknown>;
|
|
272
272
|
signature?: {
|
|
273
273
|
signed: boolean;
|
|
@@ -856,18 +856,18 @@ class FactPulseClient {
|
|
|
856
856
|
* @param invoiceData Invoice data
|
|
857
857
|
* @param pdfPath Path to the source PDF
|
|
858
858
|
* @param options Workflow options
|
|
859
|
-
* @returns Result with
|
|
859
|
+
* @returns Result with pdfBytes, validation, signature and afnor
|
|
860
860
|
*/
|
|
861
861
|
generateCompleteFacturx(invoiceData_1, pdfPath_1) {
|
|
862
862
|
return __awaiter(this, arguments, void 0, function* (invoiceData, pdfPath, options = {}) {
|
|
863
863
|
const { profile = 'EN16931', validate = true, sign = false, submitAfnor = false, afnorFlowName, afnorTrackingId, timeout, } = options;
|
|
864
|
-
const result = {
|
|
864
|
+
const result = { pdfBytes: Buffer.alloc(0) };
|
|
865
865
|
// 1. Generation
|
|
866
|
-
const
|
|
867
|
-
result.
|
|
866
|
+
const pdfBytes = yield this.generateFacturx(invoiceData, pdfPath, profile, 'pdf', true, timeout);
|
|
867
|
+
result.pdfBytes = pdfBytes;
|
|
868
868
|
// 2. Validation
|
|
869
869
|
if (validate) {
|
|
870
|
-
const validation = yield this.validateFacturxPdf(
|
|
870
|
+
const validation = yield this.validateFacturxPdf(pdfBytes, { profile });
|
|
871
871
|
result.validation = validation;
|
|
872
872
|
if (!validation.isCompliant) {
|
|
873
873
|
return result;
|
|
@@ -875,8 +875,8 @@ class FactPulseClient {
|
|
|
875
875
|
}
|
|
876
876
|
// 3. Signature (uses the server-configured certificate)
|
|
877
877
|
if (sign) {
|
|
878
|
-
const signedPdf = yield this.signPdf(result.
|
|
879
|
-
result.
|
|
878
|
+
const signedPdf = yield this.signPdf(result.pdfBytes);
|
|
879
|
+
result.pdfBytes = signedPdf;
|
|
880
880
|
result.signature = { signed: true };
|
|
881
881
|
}
|
|
882
882
|
// 4. AFNOR submission
|
|
@@ -884,7 +884,7 @@ class FactPulseClient {
|
|
|
884
884
|
const invoiceNumber = (invoiceData.invoiceNumber || invoiceData.invoice_number || 'INVOICE');
|
|
885
885
|
const flowName = afnorFlowName || `Invoice ${invoiceNumber}`;
|
|
886
886
|
const trackingId = afnorTrackingId || invoiceNumber;
|
|
887
|
-
const afnorResult = yield this.submitInvoiceAfnor(result.
|
|
887
|
+
const afnorResult = yield this.submitInvoiceAfnor(result.pdfBytes, flowName, { trackingId });
|
|
888
888
|
result.afnor = afnorResult;
|
|
889
889
|
}
|
|
890
890
|
return result;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# ChorusProCredentials
|
|
2
2
|
|
|
3
|
-
Chorus Pro credentials
|
|
3
|
+
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.
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
7
|
Name | Type | Description | Notes
|
|
8
8
|
------------ | ------------- | ------------- | -------------
|
|
9
|
-
**pisteClientId** | **string** |
|
|
10
|
-
**pisteClientSecret** | **string** |
|
|
11
|
-
**
|
|
12
|
-
**
|
|
13
|
-
**
|
|
9
|
+
**pisteClientId** | **string** | | [optional] [default to undefined]
|
|
10
|
+
**pisteClientSecret** | **string** | | [optional] [default to undefined]
|
|
11
|
+
**chorusLogin** | **string** | | [optional] [default to undefined]
|
|
12
|
+
**chorusPassword** | **string** | | [optional] [default to undefined]
|
|
13
|
+
**sandboxMode** | **boolean** | [MODE 2] Use sandbox mode (default: True) | [optional] [default to true]
|
|
14
14
|
|
|
15
15
|
## Example
|
|
16
16
|
|
|
@@ -20,9 +20,9 @@ import { ChorusProCredentials } from '@factpulse/sdk';
|
|
|
20
20
|
const instance: ChorusProCredentials = {
|
|
21
21
|
pisteClientId,
|
|
22
22
|
pisteClientSecret,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
chorusLogin,
|
|
24
|
+
chorusPassword,
|
|
25
|
+
sandboxMode,
|
|
26
26
|
};
|
|
27
27
|
```
|
|
28
28
|
|
|
@@ -7,7 +7,7 @@ Specific configuration for Chorus Pro destination.
|
|
|
7
7
|
Name | Type | Description | Notes
|
|
8
8
|
------------ | ------------- | ------------- | -------------
|
|
9
9
|
**type** | **string** | | [optional] [default to TypeEnum_ChorusPro]
|
|
10
|
-
**credentials** | [**
|
|
10
|
+
**credentials** | [**ChorusProCredentials**](ChorusProCredentials.md) | | [optional] [default to undefined]
|
|
11
11
|
|
|
12
12
|
## Example
|
|
13
13
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# FactureElectroniqueRestApiSchemasChorusProChorusProCredentials
|
|
2
|
+
|
|
3
|
+
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
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type | Description | Notes
|
|
8
|
+
------------ | ------------- | ------------- | -------------
|
|
9
|
+
**pisteClientId** | **string** | PISTE Client ID (government API portal) | [default to undefined]
|
|
10
|
+
**pisteClientSecret** | **string** | PISTE Client Secret | [default to undefined]
|
|
11
|
+
**chorusProLogin** | **string** | Chorus Pro login | [default to undefined]
|
|
12
|
+
**chorusProPassword** | **string** | Chorus Pro password | [default to undefined]
|
|
13
|
+
**sandbox** | **boolean** | Use sandbox environment (true) or production (false) | [optional] [default to true]
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from '@factpulse/sdk';
|
|
19
|
+
|
|
20
|
+
const instance: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials = {
|
|
21
|
+
pisteClientId,
|
|
22
|
+
pisteClientSecret,
|
|
23
|
+
chorusProLogin,
|
|
24
|
+
chorusProPassword,
|
|
25
|
+
sandbox,
|
|
26
|
+
};
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# FactureElectroniqueRestApiSchemasValidationValidationErrorResponse
|
|
2
|
+
|
|
3
|
+
Response for validation errors.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type | Description | Notes
|
|
8
|
+
------------ | ------------- | ------------- | -------------
|
|
9
|
+
**detail** | **Array<string>** | List of detected validation errors. | [default to undefined]
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { FactureElectroniqueRestApiSchemasValidationValidationErrorResponse } from '@factpulse/sdk';
|
|
15
|
+
|
|
16
|
+
const instance: FactureElectroniqueRestApiSchemasValidationValidationErrorResponse = {
|
|
17
|
+
detail,
|
|
18
|
+
};
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
@@ -6,7 +6,7 @@ Get Chorus Pro ID from SIRET.
|
|
|
6
6
|
|
|
7
7
|
Name | Type | Description | Notes
|
|
8
8
|
------------ | ------------- | ------------- | -------------
|
|
9
|
-
**credentials** | [**
|
|
9
|
+
**credentials** | [**FactureElectroniqueRestApiSchemasChorusProChorusProCredentials**](FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md) | | [optional] [default to undefined]
|
|
10
10
|
**siret** | **string** | Structure SIRET (14 digits) | [default to undefined]
|
|
11
11
|
**identifierType** | **string** | Identifier type (SIRET, SIREN, UE_HORS_FRANCE, etc.) | [optional] [default to 'SIRET']
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Get an invoice.
|
|
|
6
6
|
|
|
7
7
|
Name | Type | Description | Notes
|
|
8
8
|
------------ | ------------- | ------------- | -------------
|
|
9
|
-
**credentials** | [**
|
|
9
|
+
**credentials** | [**FactureElectroniqueRestApiSchemasChorusProChorusProCredentials**](FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md) | | [optional] [default to undefined]
|
|
10
10
|
**chorusInvoiceId** | **number** | Chorus Pro invoice ID | [default to undefined]
|
|
11
11
|
|
|
12
12
|
## Example
|
|
@@ -6,7 +6,7 @@ Get structure details.
|
|
|
6
6
|
|
|
7
7
|
Name | Type | Description | Notes
|
|
8
8
|
------------ | ------------- | ------------- | -------------
|
|
9
|
-
**credentials** | [**
|
|
9
|
+
**credentials** | [**FactureElectroniqueRestApiSchemasChorusProChorusProCredentials**](FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md) | | [optional] [default to undefined]
|
|
10
10
|
**structureId** | **number** | Chorus Pro structure ID | [default to undefined]
|
|
11
11
|
**languageCode** | **string** | Language code (fr, en) | [optional] [default to 'fr']
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Search structures by criteria.
|
|
|
6
6
|
|
|
7
7
|
Name | Type | Description | Notes
|
|
8
8
|
------------ | ------------- | ------------- | -------------
|
|
9
|
-
**credentials** | [**
|
|
9
|
+
**credentials** | [**FactureElectroniqueRestApiSchemasChorusProChorusProCredentials**](FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md) | | [optional] [default to undefined]
|
|
10
10
|
**structureIdentifier** | **string** | | [optional] [default to undefined]
|
|
11
11
|
**structureIdentifierType** | **string** | | [optional] [default to undefined]
|
|
12
12
|
**companyName** | **string** | | [optional] [default to undefined]
|
|
@@ -6,7 +6,7 @@ Submit an invoice to Chorus Pro.
|
|
|
6
6
|
|
|
7
7
|
Name | Type | Description | Notes
|
|
8
8
|
------------ | ------------- | ------------- | -------------
|
|
9
|
-
**credentials** | [**
|
|
9
|
+
**credentials** | [**FactureElectroniqueRestApiSchemasChorusProChorusProCredentials**](FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md) | | [optional] [default to undefined]
|
|
10
10
|
**invoiceNumber** | **string** | Invoice number | [default to undefined]
|
|
11
11
|
**invoiceDate** | **string** | Invoice date (ISO format: YYYY-MM-DD) | [default to undefined]
|
|
12
12
|
**paymentDueDate** | **string** | | [optional] [default to undefined]
|
|
@@ -7,8 +7,8 @@ Réponse de validation CDAR.
|
|
|
7
7
|
Name | Type | Description | Notes
|
|
8
8
|
------------ | ------------- | ------------- | -------------
|
|
9
9
|
**valid** | **boolean** | Résultat de validation | [default to undefined]
|
|
10
|
-
**errors** | [**Array<
|
|
11
|
-
**warnings** | [**Array<
|
|
10
|
+
**errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | Liste des erreurs | [optional] [default to undefined]
|
|
11
|
+
**warnings** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | Liste des avertissements | [optional] [default to undefined]
|
|
12
12
|
|
|
13
13
|
## Example
|
|
14
14
|
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
# ValidationErrorResponse
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Erreur de validation.
|
|
4
4
|
|
|
5
5
|
## Properties
|
|
6
6
|
|
|
7
7
|
Name | Type | Description | Notes
|
|
8
8
|
------------ | ------------- | ------------- | -------------
|
|
9
|
-
**
|
|
9
|
+
**field** | **string** | Champ concerné | [default to undefined]
|
|
10
|
+
**message** | **string** | Message d\'erreur | [default to undefined]
|
|
11
|
+
**rule** | **string** | | [optional] [default to undefined]
|
|
12
|
+
**severity** | **string** | Sévérité (error/warning) | [optional] [default to 'error']
|
|
10
13
|
|
|
11
14
|
## Example
|
|
12
15
|
|
|
@@ -14,7 +17,10 @@ Name | Type | Description | Notes
|
|
|
14
17
|
import { ValidationErrorResponse } from '@factpulse/sdk';
|
|
15
18
|
|
|
16
19
|
const instance: ValidationErrorResponse = {
|
|
17
|
-
|
|
20
|
+
field,
|
|
21
|
+
message,
|
|
22
|
+
rule,
|
|
23
|
+
severity,
|
|
18
24
|
};
|
|
19
25
|
```
|
|
20
26
|
|
|
@@ -15,28 +15,16 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Chorus Pro credentials
|
|
18
|
+
* 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.
|
|
19
19
|
*/
|
|
20
20
|
export interface ChorusProCredentials {
|
|
21
|
+
'pisteClientId'?: string | null;
|
|
22
|
+
'pisteClientSecret'?: string | null;
|
|
23
|
+
'chorusLogin'?: string | null;
|
|
24
|
+
'chorusPassword'?: string | null;
|
|
21
25
|
/**
|
|
22
|
-
*
|
|
26
|
+
* [MODE 2] Use sandbox mode (default: True)
|
|
23
27
|
*/
|
|
24
|
-
'
|
|
25
|
-
/**
|
|
26
|
-
* PISTE Client Secret
|
|
27
|
-
*/
|
|
28
|
-
'pisteClientSecret': string;
|
|
29
|
-
/**
|
|
30
|
-
* Chorus Pro login
|
|
31
|
-
*/
|
|
32
|
-
'chorusProLogin': string;
|
|
33
|
-
/**
|
|
34
|
-
* Chorus Pro password
|
|
35
|
-
*/
|
|
36
|
-
'chorusProPassword': string;
|
|
37
|
-
/**
|
|
38
|
-
* Use sandbox environment (true) or production (false)
|
|
39
|
-
*/
|
|
40
|
-
'sandbox'?: boolean;
|
|
28
|
+
'sandboxMode'?: boolean;
|
|
41
29
|
}
|
|
42
30
|
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
|
|
16
16
|
// May contain unused imports in some cases
|
|
17
17
|
// @ts-ignore
|
|
18
|
-
import type {
|
|
18
|
+
import type { ChorusProCredentials } from './chorus-pro-credentials';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Specific configuration for Chorus Pro destination.
|
|
22
22
|
*/
|
|
23
23
|
export interface ChorusProDestination {
|
|
24
24
|
'type'?: ChorusProDestinationTypeEnum;
|
|
25
|
-
'credentials'?:
|
|
25
|
+
'credentials'?: ChorusProCredentials | null;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const ChorusProDestinationTypeEnum = {
|
|
@@ -15,21 +15,28 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* 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
|
|
19
19
|
*/
|
|
20
|
-
export interface
|
|
20
|
+
export interface FactureElectroniqueRestApiSchemasChorusProChorusProCredentials {
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* PISTE Client ID (government API portal)
|
|
23
23
|
*/
|
|
24
|
-
'
|
|
24
|
+
'pisteClientId': string;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* PISTE Client Secret
|
|
27
27
|
*/
|
|
28
|
-
'
|
|
29
|
-
'rule'?: string | null;
|
|
28
|
+
'pisteClientSecret': string;
|
|
30
29
|
/**
|
|
31
|
-
*
|
|
30
|
+
* Chorus Pro login
|
|
32
31
|
*/
|
|
33
|
-
'
|
|
32
|
+
'chorusProLogin': string;
|
|
33
|
+
/**
|
|
34
|
+
* Chorus Pro password
|
|
35
|
+
*/
|
|
36
|
+
'chorusProPassword': string;
|
|
37
|
+
/**
|
|
38
|
+
* Use sandbox environment (true) or production (false)
|
|
39
|
+
*/
|
|
40
|
+
'sandbox'?: boolean;
|
|
34
41
|
}
|
|
35
42
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* FactPulse REST API
|
|
5
|
+
* 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/
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: contact@factpulse.fr
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Response for validation errors.
|
|
19
|
+
*/
|
|
20
|
+
export interface FactureElectroniqueRestApiSchemasValidationValidationErrorResponse {
|
|
21
|
+
/**
|
|
22
|
+
* List of detected validation errors.
|
|
23
|
+
*/
|
|
24
|
+
'detail': Array<string>;
|
|
25
|
+
}
|
|
26
|
+
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
// May contain unused imports in some cases
|
|
17
17
|
// @ts-ignore
|
|
18
|
-
import type {
|
|
18
|
+
import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Get Chorus Pro ID from SIRET.
|
|
22
22
|
*/
|
|
23
23
|
export interface GetChorusProIdRequest {
|
|
24
|
-
'credentials'?:
|
|
24
|
+
'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
|
|
25
25
|
/**
|
|
26
26
|
* Structure SIRET (14 digits)
|
|
27
27
|
*/
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
// May contain unused imports in some cases
|
|
17
17
|
// @ts-ignore
|
|
18
|
-
import type {
|
|
18
|
+
import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Get an invoice.
|
|
22
22
|
*/
|
|
23
23
|
export interface GetInvoiceRequest {
|
|
24
|
-
'credentials'?:
|
|
24
|
+
'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
|
|
25
25
|
/**
|
|
26
26
|
* Chorus Pro invoice ID
|
|
27
27
|
*/
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
// May contain unused imports in some cases
|
|
17
17
|
// @ts-ignore
|
|
18
|
-
import type {
|
|
18
|
+
import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Get structure details.
|
|
22
22
|
*/
|
|
23
23
|
export interface GetStructureRequest {
|
|
24
|
-
'credentials'?:
|
|
24
|
+
'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
|
|
25
25
|
/**
|
|
26
26
|
* Chorus Pro structure ID
|
|
27
27
|
*/
|
package/models/index.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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';
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
// May contain unused imports in some cases
|
|
17
17
|
// @ts-ignore
|
|
18
|
-
import type {
|
|
18
|
+
import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Search structures by criteria.
|
|
22
22
|
*/
|
|
23
23
|
export interface SearchStructureRequest {
|
|
24
|
-
'credentials'?:
|
|
24
|
+
'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
|
|
25
25
|
'structureIdentifier'?: string | null;
|
|
26
26
|
'structureIdentifierType'?: string | null;
|
|
27
27
|
'companyName'?: string | null;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
// May contain unused imports in some cases
|
|
17
17
|
// @ts-ignore
|
|
18
|
-
import type {
|
|
18
|
+
import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
|
|
19
19
|
// May contain unused imports in some cases
|
|
20
20
|
// @ts-ignore
|
|
21
21
|
import type { SubmitGrossAmount } from './submit-gross-amount';
|
|
@@ -30,7 +30,7 @@ import type { SubmitVatAmount } from './submit-vat-amount';
|
|
|
30
30
|
* Submit an invoice to Chorus Pro.
|
|
31
31
|
*/
|
|
32
32
|
export interface SubmitInvoiceRequest {
|
|
33
|
-
'credentials'?:
|
|
33
|
+
'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
|
|
34
34
|
/**
|
|
35
35
|
* Invoice number
|
|
36
36
|
*/
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
// May contain unused imports in some cases
|
|
17
17
|
// @ts-ignore
|
|
18
|
-
import type {
|
|
18
|
+
import type { ValidationErrorResponse } from './validation-error-response';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Réponse de validation CDAR.
|
|
@@ -28,10 +28,10 @@ export interface ValidateCDARResponse {
|
|
|
28
28
|
/**
|
|
29
29
|
* Liste des erreurs
|
|
30
30
|
*/
|
|
31
|
-
'errors'?: Array<
|
|
31
|
+
'errors'?: Array<ValidationErrorResponse>;
|
|
32
32
|
/**
|
|
33
33
|
* Liste des avertissements
|
|
34
34
|
*/
|
|
35
|
-
'warnings'?: Array<
|
|
35
|
+
'warnings'?: Array<ValidationErrorResponse>;
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -15,12 +15,21 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Erreur de validation.
|
|
19
19
|
*/
|
|
20
20
|
export interface ValidationErrorResponse {
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Champ concerné
|
|
23
23
|
*/
|
|
24
|
-
'
|
|
24
|
+
'field': string;
|
|
25
|
+
/**
|
|
26
|
+
* Message d\'erreur
|
|
27
|
+
*/
|
|
28
|
+
'message': string;
|
|
29
|
+
'rule'?: string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Sévérité (error/warning)
|
|
32
|
+
*/
|
|
33
|
+
'severity'?: string;
|
|
25
34
|
}
|
|
26
35
|
|