factpulse 1.0.9__py3-none-any.whl → 2.0.37__py3-none-any.whl
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.
Potentially problematic release.
This version of factpulse might be problematic. Click here for more details.
- factpulse/__init__.py +54 -50
- factpulse/api/__init__.py +1 -0
- factpulse/api/afnorpdppa_api.py +552 -2
- factpulse/api/afnorpdppa_directory_service_api.py +4312 -65
- factpulse/api/afnorpdppa_flow_service_api.py +1 -1
- factpulse/api/chorus_pro_api.py +152 -194
- factpulse/api/sant_api.py +246 -1
- factpulse/api/traitement_facture_api.py +25 -27
- factpulse/api/utilisateur_api.py +1 -1
- factpulse/api/vrification_pdfxml_api.py +1719 -0
- factpulse/api_client.py +5 -5
- factpulse/configuration.py +5 -3
- factpulse/exceptions.py +7 -4
- factpulse/models/__init__.py +26 -25
- factpulse/models/adresse_electronique.py +1 -1
- factpulse/models/adresse_postale.py +1 -1
- factpulse/models/{body_ajouter_fichier_api_v1_chorus_pro_transverses_ajouter_fichier_post.py → api_error.py} +24 -24
- factpulse/models/{body_completer_facture_api_v1_chorus_pro_factures_completer_post.py → bounding_box_schema.py} +23 -27
- factpulse/models/cadre_de_facturation.py +11 -3
- factpulse/models/categorie_tva.py +11 -11
- factpulse/models/certificate_info_response.py +1 -1
- factpulse/models/champ_verifie_schema.py +129 -0
- factpulse/models/chorus_pro_credentials.py +1 -1
- factpulse/models/code_cadre_facturation.py +2 -2
- factpulse/models/code_raison_reduction.py +9 -9
- factpulse/models/consulter_facture_request.py +1 -1
- factpulse/models/consulter_facture_response.py +1 -1
- factpulse/models/consulter_structure_request.py +1 -1
- factpulse/models/consulter_structure_response.py +1 -1
- factpulse/models/credentials_afnor.py +1 -1
- factpulse/models/credentials_chorus_pro.py +1 -1
- factpulse/models/destinataire.py +16 -2
- factpulse/models/destination.py +1 -1
- factpulse/models/destination_afnor.py +1 -1
- factpulse/models/destination_chorus_pro.py +1 -1
- factpulse/models/{quota_info.py → dimension_page_schema.py} +12 -18
- factpulse/models/direction_flux.py +1 -1
- factpulse/models/donnees_facture_simplifiees.py +1 -1
- factpulse/models/error_level.py +37 -0
- factpulse/models/error_source.py +43 -0
- factpulse/models/{facture_enrichie_info_output.py → facture_enrichie_info.py} +4 -4
- factpulse/models/facture_entrante.py +196 -0
- factpulse/models/facture_factur_x.py +12 -2
- factpulse/models/flux_resume.py +1 -1
- factpulse/models/format_facture.py +38 -0
- factpulse/models/format_sortie.py +1 -1
- factpulse/models/fournisseur.py +9 -2
- factpulse/models/fournisseur_entrant.py +144 -0
- factpulse/models/generate_certificate_request.py +1 -1
- factpulse/models/generate_certificate_response.py +1 -1
- factpulse/models/http_validation_error.py +1 -1
- factpulse/models/information_signature_api.py +1 -1
- factpulse/models/ligne_de_poste.py +7 -12
- factpulse/models/ligne_de_poste_montant_remise_ht.py +2 -2
- factpulse/models/ligne_de_poste_taux_tva_manuel.py +2 -2
- factpulse/models/ligne_de_tva.py +24 -10
- factpulse/models/mode_depot.py +1 -1
- factpulse/models/mode_paiement.py +1 -1
- factpulse/models/{montantapayer.py → montant_a_payer.py} +6 -6
- factpulse/models/{montantbaseht.py → montant_base_ht.py} +6 -6
- factpulse/models/montant_ht_total.py +4 -4
- factpulse/models/{montant_total_montant_remise_globale_ttc.py → montant_remise_globale_ttc.py} +7 -13
- factpulse/models/montant_total.py +16 -21
- factpulse/models/montant_total_acompte.py +2 -2
- factpulse/models/{ligne_de_poste_montant_total_ligne_ht.py → montant_total_ligne_ht.py} +7 -13
- factpulse/models/montant_ttc_total.py +4 -4
- factpulse/models/montant_tva.py +2 -2
- factpulse/models/{montanttva1.py → montant_tva_ligne.py} +7 -7
- factpulse/models/{montantttctotal.py → montant_tva_total.py} +7 -7
- factpulse/models/{montantunitaireht.py → montant_unitaire_ht.py} +5 -5
- factpulse/models/nature_operation.py +49 -0
- factpulse/models/{body_valideur_rechercher_factures_api_v1_chorus_pro_factures_valideur_rechercher_post.py → note.py} +14 -24
- factpulse/models/{utilisateur.py → note_obligatoire_schema.py} +40 -44
- factpulse/models/obtenir_id_chorus_pro_request.py +1 -1
- factpulse/models/obtenir_id_chorus_pro_response.py +1 -1
- factpulse/models/options_processing.py +1 -1
- factpulse/models/parametres_signature.py +1 -1
- factpulse/models/parametres_structure.py +1 -1
- factpulse/models/pdf_factur_x_info.py +1 -1
- factpulse/models/pdp_credentials.py +10 -3
- factpulse/models/piece_jointe_complementaire.py +1 -1
- factpulse/models/profil_api.py +1 -1
- factpulse/models/profil_flux.py +1 -1
- factpulse/models/quantite.py +1 -1
- factpulse/models/rechercher_services_response.py +1 -1
- factpulse/models/rechercher_structure_request.py +1 -1
- factpulse/models/rechercher_structure_response.py +1 -1
- factpulse/models/references.py +1 -1
- factpulse/models/reponse_healthcheck_afnor.py +1 -1
- factpulse/models/reponse_recherche_flux.py +1 -1
- factpulse/models/reponse_soumission_flux.py +1 -1
- factpulse/models/reponse_tache.py +1 -1
- factpulse/models/reponse_validation_erreur.py +1 -1
- factpulse/models/reponse_validation_succes.py +1 -1
- factpulse/models/reponse_verification_succes.py +135 -0
- factpulse/models/requete_recherche_flux.py +1 -1
- factpulse/models/requete_soumission_flux.py +1 -1
- factpulse/models/resultat_afnor.py +1 -1
- factpulse/models/resultat_chorus_pro.py +1 -1
- factpulse/models/resultat_validation_pdfapi.py +1 -1
- factpulse/models/scheme_id.py +7 -7
- factpulse/models/service_structure.py +1 -1
- factpulse/models/signature_info.py +1 -1
- factpulse/models/soumettre_facture_complete_request.py +1 -1
- factpulse/models/soumettre_facture_complete_response.py +4 -4
- factpulse/models/soumettre_facture_request.py +19 -7
- factpulse/models/soumettre_facture_response.py +1 -1
- factpulse/models/statut_acquittement.py +1 -1
- factpulse/models/statut_celery.py +40 -0
- factpulse/models/statut_champ_api.py +40 -0
- factpulse/models/statut_facture.py +1 -1
- factpulse/models/statut_tache.py +7 -9
- factpulse/models/structure_info.py +1 -1
- factpulse/models/syntaxe_flux.py +1 -1
- factpulse/models/tauxmanuel.py +2 -2
- factpulse/models/type_document.py +40 -0
- factpulse/models/type_facture.py +1 -1
- factpulse/models/type_flux.py +1 -1
- factpulse/models/type_tva.py +1 -1
- factpulse/models/unite.py +1 -1
- factpulse/models/validation_error.py +1 -1
- factpulse/models/{body_rechercher_factures_fournisseur_api_v1_chorus_pro_factures_rechercher_fournisseur_post.py → validation_error_detail.py} +27 -24
- factpulse/models/validation_error_loc_inner.py +1 -1
- factpulse/rest.py +8 -3
- factpulse-2.0.37.dist-info/METADATA +292 -0
- factpulse-2.0.37.dist-info/RECORD +134 -0
- factpulse-2.0.37.dist-info/top_level.txt +2 -0
- factpulse_helpers/__init__.py +96 -0
- factpulse_helpers/client.py +1887 -0
- factpulse_helpers/exceptions.py +253 -0
- factpulse/api/processing_endpoints_unifis_api.py +0 -592
- factpulse/api/signature_lectronique_api.py +0 -1358
- factpulse/models/body_lister_services_structure_api_v1_chorus_pro_structures_id_structure_cpp_services_get.py +0 -102
- factpulse/models/body_rechercher_factures_destinataire_api_v1_chorus_pro_factures_rechercher_destinataire_post.py +0 -104
- factpulse/models/body_recycler_facture_api_v1_chorus_pro_factures_recycler_post.py +0 -104
- factpulse/models/body_telecharger_groupe_factures_api_v1_chorus_pro_factures_telecharger_groupe_post.py +0 -104
- factpulse/models/body_traiter_facture_recue_api_v1_chorus_pro_factures_traiter_facture_recue_post.py +0 -104
- factpulse/models/body_valideur_consulter_facture_api_v1_chorus_pro_factures_valideur_consulter_post.py +0 -104
- factpulse/models/body_valideur_traiter_facture_api_v1_chorus_pro_factures_valideur_traiter_post.py +0 -104
- factpulse/models/facture_enrichie_info_input.py +0 -123
- factpulse/models/montanthttotal.py +0 -139
- factpulse/models/montanttva.py +0 -139
- factpulse-1.0.9.dist-info/METADATA +0 -182
- factpulse-1.0.9.dist-info/RECORD +0 -131
- factpulse-1.0.9.dist-info/top_level.txt +0 -1
- {factpulse-1.0.9.dist-info → factpulse-2.0.37.dist-info}/WHEEL +0 -0
- {factpulse-1.0.9.dist-info → factpulse-2.0.37.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from factpulse.models.chorus_pro_credentials import ChorusProCredentials
|
|
23
|
-
from factpulse.models.utilisateur import Utilisateur
|
|
24
|
-
from typing import Optional, Set
|
|
25
|
-
from typing_extensions import Self
|
|
26
|
-
|
|
27
|
-
class BodyValideurConsulterFactureApiV1ChorusProFacturesValideurConsulterPost(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
BodyValideurConsulterFactureApiV1ChorusProFacturesValideurConsulterPost
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
payload: Dict[str, Any]
|
|
32
|
-
user_info: Utilisateur
|
|
33
|
-
credentials: Optional[ChorusProCredentials] = None
|
|
34
|
-
__properties: ClassVar[List[str]] = ["payload", "user_info", "credentials"]
|
|
35
|
-
|
|
36
|
-
model_config = ConfigDict(
|
|
37
|
-
populate_by_name=True,
|
|
38
|
-
validate_assignment=True,
|
|
39
|
-
protected_namespaces=(),
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def to_str(self) -> str:
|
|
44
|
-
"""Returns the string representation of the model using alias"""
|
|
45
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
-
|
|
47
|
-
def to_json(self) -> str:
|
|
48
|
-
"""Returns the JSON representation of the model using alias"""
|
|
49
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
-
return json.dumps(self.to_dict())
|
|
51
|
-
|
|
52
|
-
@classmethod
|
|
53
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
-
"""Create an instance of BodyValideurConsulterFactureApiV1ChorusProFacturesValideurConsulterPost from a JSON string"""
|
|
55
|
-
return cls.from_dict(json.loads(json_str))
|
|
56
|
-
|
|
57
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
-
"""Return the dictionary representation of the model using alias.
|
|
59
|
-
|
|
60
|
-
This has the following differences from calling pydantic's
|
|
61
|
-
`self.model_dump(by_alias=True)`:
|
|
62
|
-
|
|
63
|
-
* `None` is only added to the output dict for nullable fields that
|
|
64
|
-
were set at model initialization. Other fields with value `None`
|
|
65
|
-
are ignored.
|
|
66
|
-
"""
|
|
67
|
-
excluded_fields: Set[str] = set([
|
|
68
|
-
])
|
|
69
|
-
|
|
70
|
-
_dict = self.model_dump(
|
|
71
|
-
by_alias=True,
|
|
72
|
-
exclude=excluded_fields,
|
|
73
|
-
exclude_none=True,
|
|
74
|
-
)
|
|
75
|
-
# override the default output from pydantic by calling `to_dict()` of user_info
|
|
76
|
-
if self.user_info:
|
|
77
|
-
_dict['user_info'] = self.user_info.to_dict()
|
|
78
|
-
# override the default output from pydantic by calling `to_dict()` of credentials
|
|
79
|
-
if self.credentials:
|
|
80
|
-
_dict['credentials'] = self.credentials.to_dict()
|
|
81
|
-
# set to None if credentials (nullable) is None
|
|
82
|
-
# and model_fields_set contains the field
|
|
83
|
-
if self.credentials is None and "credentials" in self.model_fields_set:
|
|
84
|
-
_dict['credentials'] = None
|
|
85
|
-
|
|
86
|
-
return _dict
|
|
87
|
-
|
|
88
|
-
@classmethod
|
|
89
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
90
|
-
"""Create an instance of BodyValideurConsulterFactureApiV1ChorusProFacturesValideurConsulterPost from a dict"""
|
|
91
|
-
if obj is None:
|
|
92
|
-
return None
|
|
93
|
-
|
|
94
|
-
if not isinstance(obj, dict):
|
|
95
|
-
return cls.model_validate(obj)
|
|
96
|
-
|
|
97
|
-
_obj = cls.model_validate({
|
|
98
|
-
"payload": obj.get("payload"),
|
|
99
|
-
"user_info": Utilisateur.from_dict(obj["user_info"]) if obj.get("user_info") is not None else None,
|
|
100
|
-
"credentials": ChorusProCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None
|
|
101
|
-
})
|
|
102
|
-
return _obj
|
|
103
|
-
|
|
104
|
-
|
factpulse/models/body_valideur_traiter_facture_api_v1_chorus_pro_factures_valideur_traiter_post.py
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from factpulse.models.chorus_pro_credentials import ChorusProCredentials
|
|
23
|
-
from factpulse.models.utilisateur import Utilisateur
|
|
24
|
-
from typing import Optional, Set
|
|
25
|
-
from typing_extensions import Self
|
|
26
|
-
|
|
27
|
-
class BodyValideurTraiterFactureApiV1ChorusProFacturesValideurTraiterPost(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
BodyValideurTraiterFactureApiV1ChorusProFacturesValideurTraiterPost
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
payload: Dict[str, Any]
|
|
32
|
-
user_info: Utilisateur
|
|
33
|
-
credentials: Optional[ChorusProCredentials] = None
|
|
34
|
-
__properties: ClassVar[List[str]] = ["payload", "user_info", "credentials"]
|
|
35
|
-
|
|
36
|
-
model_config = ConfigDict(
|
|
37
|
-
populate_by_name=True,
|
|
38
|
-
validate_assignment=True,
|
|
39
|
-
protected_namespaces=(),
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def to_str(self) -> str:
|
|
44
|
-
"""Returns the string representation of the model using alias"""
|
|
45
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
-
|
|
47
|
-
def to_json(self) -> str:
|
|
48
|
-
"""Returns the JSON representation of the model using alias"""
|
|
49
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
-
return json.dumps(self.to_dict())
|
|
51
|
-
|
|
52
|
-
@classmethod
|
|
53
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
-
"""Create an instance of BodyValideurTraiterFactureApiV1ChorusProFacturesValideurTraiterPost from a JSON string"""
|
|
55
|
-
return cls.from_dict(json.loads(json_str))
|
|
56
|
-
|
|
57
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
-
"""Return the dictionary representation of the model using alias.
|
|
59
|
-
|
|
60
|
-
This has the following differences from calling pydantic's
|
|
61
|
-
`self.model_dump(by_alias=True)`:
|
|
62
|
-
|
|
63
|
-
* `None` is only added to the output dict for nullable fields that
|
|
64
|
-
were set at model initialization. Other fields with value `None`
|
|
65
|
-
are ignored.
|
|
66
|
-
"""
|
|
67
|
-
excluded_fields: Set[str] = set([
|
|
68
|
-
])
|
|
69
|
-
|
|
70
|
-
_dict = self.model_dump(
|
|
71
|
-
by_alias=True,
|
|
72
|
-
exclude=excluded_fields,
|
|
73
|
-
exclude_none=True,
|
|
74
|
-
)
|
|
75
|
-
# override the default output from pydantic by calling `to_dict()` of user_info
|
|
76
|
-
if self.user_info:
|
|
77
|
-
_dict['user_info'] = self.user_info.to_dict()
|
|
78
|
-
# override the default output from pydantic by calling `to_dict()` of credentials
|
|
79
|
-
if self.credentials:
|
|
80
|
-
_dict['credentials'] = self.credentials.to_dict()
|
|
81
|
-
# set to None if credentials (nullable) is None
|
|
82
|
-
# and model_fields_set contains the field
|
|
83
|
-
if self.credentials is None and "credentials" in self.model_fields_set:
|
|
84
|
-
_dict['credentials'] = None
|
|
85
|
-
|
|
86
|
-
return _dict
|
|
87
|
-
|
|
88
|
-
@classmethod
|
|
89
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
90
|
-
"""Create an instance of BodyValideurTraiterFactureApiV1ChorusProFacturesValideurTraiterPost from a dict"""
|
|
91
|
-
if obj is None:
|
|
92
|
-
return None
|
|
93
|
-
|
|
94
|
-
if not isinstance(obj, dict):
|
|
95
|
-
return cls.model_validate(obj)
|
|
96
|
-
|
|
97
|
-
_obj = cls.model_validate({
|
|
98
|
-
"payload": obj.get("payload"),
|
|
99
|
-
"user_info": Utilisateur.from_dict(obj["user_info"]) if obj.get("user_info") is not None else None,
|
|
100
|
-
"credentials": ChorusProCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None
|
|
101
|
-
})
|
|
102
|
-
return _obj
|
|
103
|
-
|
|
104
|
-
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
import pprint
|
|
17
|
-
import re # noqa: F401
|
|
18
|
-
import json
|
|
19
|
-
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from factpulse.models.montant_ht_total import MontantHtTotal
|
|
23
|
-
from factpulse.models.montant_ttc_total import MontantTtcTotal
|
|
24
|
-
from factpulse.models.montant_tva import MontantTva
|
|
25
|
-
from typing import Optional, Set
|
|
26
|
-
from typing_extensions import Self
|
|
27
|
-
|
|
28
|
-
class FactureEnrichieInfoInput(BaseModel):
|
|
29
|
-
"""
|
|
30
|
-
Informations sur la facture enrichie.
|
|
31
|
-
""" # noqa: E501
|
|
32
|
-
numero_facture: StrictStr
|
|
33
|
-
id_emetteur: Optional[StrictInt] = None
|
|
34
|
-
id_destinataire: Optional[StrictInt] = None
|
|
35
|
-
nom_emetteur: StrictStr
|
|
36
|
-
nom_destinataire: StrictStr
|
|
37
|
-
montant_ht_total: MontantHtTotal
|
|
38
|
-
montant_tva: MontantTva
|
|
39
|
-
montant_ttc_total: MontantTtcTotal
|
|
40
|
-
__properties: ClassVar[List[str]] = ["numero_facture", "id_emetteur", "id_destinataire", "nom_emetteur", "nom_destinataire", "montant_ht_total", "montant_tva", "montant_ttc_total"]
|
|
41
|
-
|
|
42
|
-
model_config = ConfigDict(
|
|
43
|
-
populate_by_name=True,
|
|
44
|
-
validate_assignment=True,
|
|
45
|
-
protected_namespaces=(),
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def to_str(self) -> str:
|
|
50
|
-
"""Returns the string representation of the model using alias"""
|
|
51
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
-
|
|
53
|
-
def to_json(self) -> str:
|
|
54
|
-
"""Returns the JSON representation of the model using alias"""
|
|
55
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
-
return json.dumps(self.to_dict())
|
|
57
|
-
|
|
58
|
-
@classmethod
|
|
59
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
-
"""Create an instance of FactureEnrichieInfoInput from a JSON string"""
|
|
61
|
-
return cls.from_dict(json.loads(json_str))
|
|
62
|
-
|
|
63
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
-
"""Return the dictionary representation of the model using alias.
|
|
65
|
-
|
|
66
|
-
This has the following differences from calling pydantic's
|
|
67
|
-
`self.model_dump(by_alias=True)`:
|
|
68
|
-
|
|
69
|
-
* `None` is only added to the output dict for nullable fields that
|
|
70
|
-
were set at model initialization. Other fields with value `None`
|
|
71
|
-
are ignored.
|
|
72
|
-
"""
|
|
73
|
-
excluded_fields: Set[str] = set([
|
|
74
|
-
])
|
|
75
|
-
|
|
76
|
-
_dict = self.model_dump(
|
|
77
|
-
by_alias=True,
|
|
78
|
-
exclude=excluded_fields,
|
|
79
|
-
exclude_none=True,
|
|
80
|
-
)
|
|
81
|
-
# override the default output from pydantic by calling `to_dict()` of montant_ht_total
|
|
82
|
-
if self.montant_ht_total:
|
|
83
|
-
_dict['montant_ht_total'] = self.montant_ht_total.to_dict()
|
|
84
|
-
# override the default output from pydantic by calling `to_dict()` of montant_tva
|
|
85
|
-
if self.montant_tva:
|
|
86
|
-
_dict['montant_tva'] = self.montant_tva.to_dict()
|
|
87
|
-
# override the default output from pydantic by calling `to_dict()` of montant_ttc_total
|
|
88
|
-
if self.montant_ttc_total:
|
|
89
|
-
_dict['montant_ttc_total'] = self.montant_ttc_total.to_dict()
|
|
90
|
-
# set to None if id_emetteur (nullable) is None
|
|
91
|
-
# and model_fields_set contains the field
|
|
92
|
-
if self.id_emetteur is None and "id_emetteur" in self.model_fields_set:
|
|
93
|
-
_dict['id_emetteur'] = None
|
|
94
|
-
|
|
95
|
-
# set to None if id_destinataire (nullable) is None
|
|
96
|
-
# and model_fields_set contains the field
|
|
97
|
-
if self.id_destinataire is None and "id_destinataire" in self.model_fields_set:
|
|
98
|
-
_dict['id_destinataire'] = None
|
|
99
|
-
|
|
100
|
-
return _dict
|
|
101
|
-
|
|
102
|
-
@classmethod
|
|
103
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
104
|
-
"""Create an instance of FactureEnrichieInfoInput from a dict"""
|
|
105
|
-
if obj is None:
|
|
106
|
-
return None
|
|
107
|
-
|
|
108
|
-
if not isinstance(obj, dict):
|
|
109
|
-
return cls.model_validate(obj)
|
|
110
|
-
|
|
111
|
-
_obj = cls.model_validate({
|
|
112
|
-
"numero_facture": obj.get("numero_facture"),
|
|
113
|
-
"id_emetteur": obj.get("id_emetteur"),
|
|
114
|
-
"id_destinataire": obj.get("id_destinataire"),
|
|
115
|
-
"nom_emetteur": obj.get("nom_emetteur"),
|
|
116
|
-
"nom_destinataire": obj.get("nom_destinataire"),
|
|
117
|
-
"montant_ht_total": MontantHtTotal.from_dict(obj["montant_ht_total"]) if obj.get("montant_ht_total") is not None else None,
|
|
118
|
-
"montant_tva": MontantTva.from_dict(obj["montant_tva"]) if obj.get("montant_tva") is not None else None,
|
|
119
|
-
"montant_ttc_total": MontantTtcTotal.from_dict(obj["montant_ttc_total"]) if obj.get("montant_ttc_total") is not None else None
|
|
120
|
-
})
|
|
121
|
-
return _obj
|
|
122
|
-
|
|
123
|
-
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
from inspect import getfullargspec
|
|
17
|
-
import json
|
|
18
|
-
import pprint
|
|
19
|
-
import re # noqa: F401
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
21
|
-
from typing import Optional, Union
|
|
22
|
-
from typing_extensions import Annotated
|
|
23
|
-
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
24
|
-
from typing_extensions import Literal, Self
|
|
25
|
-
from pydantic import Field
|
|
26
|
-
|
|
27
|
-
MONTANTHTTOTAL_ANY_OF_SCHEMAS = ["float", "str"]
|
|
28
|
-
|
|
29
|
-
class Montanthttotal(BaseModel):
|
|
30
|
-
"""
|
|
31
|
-
Montant total HT.
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
# data type: float
|
|
35
|
-
anyof_schema_1_validator: Optional[Union[Annotated[float, Field(strict=True, ge=0.0)], Annotated[int, Field(strict=True, ge=0)]]] = None
|
|
36
|
-
# data type: str
|
|
37
|
-
anyof_schema_2_validator: Optional[Annotated[str, Field(strict=True)]] = None
|
|
38
|
-
if TYPE_CHECKING:
|
|
39
|
-
actual_instance: Optional[Union[float, str]] = None
|
|
40
|
-
else:
|
|
41
|
-
actual_instance: Any = None
|
|
42
|
-
any_of_schemas: Set[str] = { "float", "str" }
|
|
43
|
-
|
|
44
|
-
model_config = {
|
|
45
|
-
"validate_assignment": True,
|
|
46
|
-
"protected_namespaces": (),
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
def __init__(self, *args, **kwargs) -> None:
|
|
50
|
-
if args:
|
|
51
|
-
if len(args) > 1:
|
|
52
|
-
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
53
|
-
if kwargs:
|
|
54
|
-
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
55
|
-
super().__init__(actual_instance=args[0])
|
|
56
|
-
else:
|
|
57
|
-
super().__init__(**kwargs)
|
|
58
|
-
|
|
59
|
-
@field_validator('actual_instance')
|
|
60
|
-
def actual_instance_must_validate_anyof(cls, v):
|
|
61
|
-
instance = Montanthttotal.model_construct()
|
|
62
|
-
error_messages = []
|
|
63
|
-
# validate data type: float
|
|
64
|
-
try:
|
|
65
|
-
instance.anyof_schema_1_validator = v
|
|
66
|
-
return v
|
|
67
|
-
except (ValidationError, ValueError) as e:
|
|
68
|
-
error_messages.append(str(e))
|
|
69
|
-
# validate data type: str
|
|
70
|
-
try:
|
|
71
|
-
instance.anyof_schema_2_validator = v
|
|
72
|
-
return v
|
|
73
|
-
except (ValidationError, ValueError) as e:
|
|
74
|
-
error_messages.append(str(e))
|
|
75
|
-
if error_messages:
|
|
76
|
-
# no match
|
|
77
|
-
raise ValueError("No match found when setting the actual_instance in Montanthttotal with anyOf schemas: float, str. Details: " + ", ".join(error_messages))
|
|
78
|
-
else:
|
|
79
|
-
return v
|
|
80
|
-
|
|
81
|
-
@classmethod
|
|
82
|
-
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
|
83
|
-
return cls.from_json(json.dumps(obj))
|
|
84
|
-
|
|
85
|
-
@classmethod
|
|
86
|
-
def from_json(cls, json_str: str) -> Self:
|
|
87
|
-
"""Returns the object represented by the json string"""
|
|
88
|
-
instance = cls.model_construct()
|
|
89
|
-
error_messages = []
|
|
90
|
-
# deserialize data into float
|
|
91
|
-
try:
|
|
92
|
-
# validation
|
|
93
|
-
instance.anyof_schema_1_validator = json.loads(json_str)
|
|
94
|
-
# assign value to actual_instance
|
|
95
|
-
instance.actual_instance = instance.anyof_schema_1_validator
|
|
96
|
-
return instance
|
|
97
|
-
except (ValidationError, ValueError) as e:
|
|
98
|
-
error_messages.append(str(e))
|
|
99
|
-
# deserialize data into str
|
|
100
|
-
try:
|
|
101
|
-
# validation
|
|
102
|
-
instance.anyof_schema_2_validator = json.loads(json_str)
|
|
103
|
-
# assign value to actual_instance
|
|
104
|
-
instance.actual_instance = instance.anyof_schema_2_validator
|
|
105
|
-
return instance
|
|
106
|
-
except (ValidationError, ValueError) as e:
|
|
107
|
-
error_messages.append(str(e))
|
|
108
|
-
|
|
109
|
-
if error_messages:
|
|
110
|
-
# no match
|
|
111
|
-
raise ValueError("No match found when deserializing the JSON string into Montanthttotal with anyOf schemas: float, str. Details: " + ", ".join(error_messages))
|
|
112
|
-
else:
|
|
113
|
-
return instance
|
|
114
|
-
|
|
115
|
-
def to_json(self) -> str:
|
|
116
|
-
"""Returns the JSON representation of the actual instance"""
|
|
117
|
-
if self.actual_instance is None:
|
|
118
|
-
return "null"
|
|
119
|
-
|
|
120
|
-
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
121
|
-
return self.actual_instance.to_json()
|
|
122
|
-
else:
|
|
123
|
-
return json.dumps(self.actual_instance)
|
|
124
|
-
|
|
125
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], float, str]]:
|
|
126
|
-
"""Returns the dict representation of the actual instance"""
|
|
127
|
-
if self.actual_instance is None:
|
|
128
|
-
return None
|
|
129
|
-
|
|
130
|
-
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
131
|
-
return self.actual_instance.to_dict()
|
|
132
|
-
else:
|
|
133
|
-
return self.actual_instance
|
|
134
|
-
|
|
135
|
-
def to_str(self) -> str:
|
|
136
|
-
"""Returns the string representation of the actual instance"""
|
|
137
|
-
return pprint.pformat(self.model_dump())
|
|
138
|
-
|
|
139
|
-
|
factpulse/models/montanttva.py
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
-
|
|
8
|
-
The version of the OpenAPI document: 1.0.0
|
|
9
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
-
|
|
11
|
-
Do not edit the class manually.
|
|
12
|
-
""" # noqa: E501
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
from inspect import getfullargspec
|
|
17
|
-
import json
|
|
18
|
-
import pprint
|
|
19
|
-
import re # noqa: F401
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
21
|
-
from typing import Optional, Union
|
|
22
|
-
from typing_extensions import Annotated
|
|
23
|
-
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
24
|
-
from typing_extensions import Literal, Self
|
|
25
|
-
from pydantic import Field
|
|
26
|
-
|
|
27
|
-
MONTANTTVA_ANY_OF_SCHEMAS = ["float", "str"]
|
|
28
|
-
|
|
29
|
-
class Montanttva(BaseModel):
|
|
30
|
-
"""
|
|
31
|
-
Montant de la TVA pour cette ligne.
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
# data type: float
|
|
35
|
-
anyof_schema_1_validator: Optional[Union[Annotated[float, Field(strict=True, ge=0.0)], Annotated[int, Field(strict=True, ge=0)]]] = None
|
|
36
|
-
# data type: str
|
|
37
|
-
anyof_schema_2_validator: Optional[Annotated[str, Field(strict=True)]] = None
|
|
38
|
-
if TYPE_CHECKING:
|
|
39
|
-
actual_instance: Optional[Union[float, str]] = None
|
|
40
|
-
else:
|
|
41
|
-
actual_instance: Any = None
|
|
42
|
-
any_of_schemas: Set[str] = { "float", "str" }
|
|
43
|
-
|
|
44
|
-
model_config = {
|
|
45
|
-
"validate_assignment": True,
|
|
46
|
-
"protected_namespaces": (),
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
def __init__(self, *args, **kwargs) -> None:
|
|
50
|
-
if args:
|
|
51
|
-
if len(args) > 1:
|
|
52
|
-
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
53
|
-
if kwargs:
|
|
54
|
-
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
55
|
-
super().__init__(actual_instance=args[0])
|
|
56
|
-
else:
|
|
57
|
-
super().__init__(**kwargs)
|
|
58
|
-
|
|
59
|
-
@field_validator('actual_instance')
|
|
60
|
-
def actual_instance_must_validate_anyof(cls, v):
|
|
61
|
-
instance = Montanttva.model_construct()
|
|
62
|
-
error_messages = []
|
|
63
|
-
# validate data type: float
|
|
64
|
-
try:
|
|
65
|
-
instance.anyof_schema_1_validator = v
|
|
66
|
-
return v
|
|
67
|
-
except (ValidationError, ValueError) as e:
|
|
68
|
-
error_messages.append(str(e))
|
|
69
|
-
# validate data type: str
|
|
70
|
-
try:
|
|
71
|
-
instance.anyof_schema_2_validator = v
|
|
72
|
-
return v
|
|
73
|
-
except (ValidationError, ValueError) as e:
|
|
74
|
-
error_messages.append(str(e))
|
|
75
|
-
if error_messages:
|
|
76
|
-
# no match
|
|
77
|
-
raise ValueError("No match found when setting the actual_instance in Montanttva with anyOf schemas: float, str. Details: " + ", ".join(error_messages))
|
|
78
|
-
else:
|
|
79
|
-
return v
|
|
80
|
-
|
|
81
|
-
@classmethod
|
|
82
|
-
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
|
83
|
-
return cls.from_json(json.dumps(obj))
|
|
84
|
-
|
|
85
|
-
@classmethod
|
|
86
|
-
def from_json(cls, json_str: str) -> Self:
|
|
87
|
-
"""Returns the object represented by the json string"""
|
|
88
|
-
instance = cls.model_construct()
|
|
89
|
-
error_messages = []
|
|
90
|
-
# deserialize data into float
|
|
91
|
-
try:
|
|
92
|
-
# validation
|
|
93
|
-
instance.anyof_schema_1_validator = json.loads(json_str)
|
|
94
|
-
# assign value to actual_instance
|
|
95
|
-
instance.actual_instance = instance.anyof_schema_1_validator
|
|
96
|
-
return instance
|
|
97
|
-
except (ValidationError, ValueError) as e:
|
|
98
|
-
error_messages.append(str(e))
|
|
99
|
-
# deserialize data into str
|
|
100
|
-
try:
|
|
101
|
-
# validation
|
|
102
|
-
instance.anyof_schema_2_validator = json.loads(json_str)
|
|
103
|
-
# assign value to actual_instance
|
|
104
|
-
instance.actual_instance = instance.anyof_schema_2_validator
|
|
105
|
-
return instance
|
|
106
|
-
except (ValidationError, ValueError) as e:
|
|
107
|
-
error_messages.append(str(e))
|
|
108
|
-
|
|
109
|
-
if error_messages:
|
|
110
|
-
# no match
|
|
111
|
-
raise ValueError("No match found when deserializing the JSON string into Montanttva with anyOf schemas: float, str. Details: " + ", ".join(error_messages))
|
|
112
|
-
else:
|
|
113
|
-
return instance
|
|
114
|
-
|
|
115
|
-
def to_json(self) -> str:
|
|
116
|
-
"""Returns the JSON representation of the actual instance"""
|
|
117
|
-
if self.actual_instance is None:
|
|
118
|
-
return "null"
|
|
119
|
-
|
|
120
|
-
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
121
|
-
return self.actual_instance.to_json()
|
|
122
|
-
else:
|
|
123
|
-
return json.dumps(self.actual_instance)
|
|
124
|
-
|
|
125
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], float, str]]:
|
|
126
|
-
"""Returns the dict representation of the actual instance"""
|
|
127
|
-
if self.actual_instance is None:
|
|
128
|
-
return None
|
|
129
|
-
|
|
130
|
-
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
131
|
-
return self.actual_instance.to_dict()
|
|
132
|
-
else:
|
|
133
|
-
return self.actual_instance
|
|
134
|
-
|
|
135
|
-
def to_str(self) -> str:
|
|
136
|
-
"""Returns the string representation of the actual instance"""
|
|
137
|
-
return pprint.pformat(self.model_dump())
|
|
138
|
-
|
|
139
|
-
|