factpulse 1.0.9__py3-none-any.whl → 3.0.7__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.

Files changed (269) hide show
  1. factpulse/__init__.py +275 -203
  2. factpulse/api/__init__.py +5 -3
  3. factpulse/api/afnorpdppa_api.py +559 -9
  4. factpulse/api/afnorpdppa_directory_service_api.py +4313 -66
  5. factpulse/api/afnorpdppa_flow_service_api.py +23 -23
  6. factpulse/api/chorus_pro_api.py +362 -404
  7. factpulse/api/{signature_lectronique_api.py → document_conversion_api.py} +519 -371
  8. factpulse/api/health_api.py +526 -0
  9. factpulse/api/invoice_processing_api.py +3437 -0
  10. factpulse/api/pdfxml_verification_api.py +1719 -0
  11. factpulse/api/{sant_api.py → user_api.py} +18 -17
  12. factpulse/api_client.py +6 -6
  13. factpulse/configuration.py +6 -4
  14. factpulse/exceptions.py +8 -5
  15. factpulse/models/__init__.py +133 -99
  16. factpulse/models/acknowledgment_status.py +38 -0
  17. factpulse/models/additional_document.py +115 -0
  18. factpulse/models/afnor_credentials.py +106 -0
  19. factpulse/models/afnor_destination.py +127 -0
  20. factpulse/models/afnor_health_check_response.py +91 -0
  21. factpulse/models/afnor_result.py +105 -0
  22. factpulse/models/allowance_charge.py +147 -0
  23. factpulse/models/allowance_reason_code.py +42 -0
  24. factpulse/models/allowance_total_amount.py +145 -0
  25. factpulse/models/amount.py +139 -0
  26. factpulse/models/amount_due.py +139 -0
  27. factpulse/models/api_error.py +104 -0
  28. factpulse/models/async_task_status.py +97 -0
  29. factpulse/models/base_amount.py +145 -0
  30. factpulse/models/bounding_box_schema.py +100 -0
  31. factpulse/models/celery_status.py +40 -0
  32. factpulse/models/certificate_info_response.py +24 -24
  33. factpulse/models/charge_total_amount.py +145 -0
  34. factpulse/models/chorus_pro_destination.py +108 -0
  35. factpulse/models/chorus_pro_result.py +101 -0
  36. factpulse/models/contact.py +113 -0
  37. factpulse/models/convert_error_response.py +105 -0
  38. factpulse/models/convert_pending_input_response.py +114 -0
  39. factpulse/models/convert_resume_request.py +87 -0
  40. factpulse/models/convert_success_response.py +126 -0
  41. factpulse/models/convert_validation_failed_response.py +120 -0
  42. factpulse/models/delivery_party.py +121 -0
  43. factpulse/models/destination.py +27 -27
  44. factpulse/models/document_type_info.py +91 -0
  45. factpulse/models/electronic_address.py +90 -0
  46. factpulse/models/enriched_invoice_info.py +133 -0
  47. factpulse/models/error_level.py +37 -0
  48. factpulse/models/error_source.py +43 -0
  49. factpulse/models/extraction_info.py +93 -0
  50. factpulse/models/factur_x_invoice.py +320 -0
  51. factpulse/models/factur_x_profile.py +39 -0
  52. factpulse/models/factur_xpdf_info.py +91 -0
  53. factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.py +95 -0
  54. factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.py +115 -0
  55. factpulse/models/field_status.py +40 -0
  56. factpulse/models/file_info.py +94 -0
  57. factpulse/models/files_info.py +106 -0
  58. factpulse/models/flow_direction.py +37 -0
  59. factpulse/models/flow_profile.py +38 -0
  60. factpulse/models/flow_summary.py +131 -0
  61. factpulse/models/flow_syntax.py +40 -0
  62. factpulse/models/flow_type.py +40 -0
  63. factpulse/models/generate_certificate_request.py +26 -26
  64. factpulse/models/generate_certificate_response.py +15 -15
  65. factpulse/models/get_chorus_pro_id_request.py +100 -0
  66. factpulse/models/get_chorus_pro_id_response.py +98 -0
  67. factpulse/models/get_invoice_request.py +98 -0
  68. factpulse/models/get_invoice_response.py +142 -0
  69. factpulse/models/get_structure_request.py +100 -0
  70. factpulse/models/get_structure_response.py +142 -0
  71. factpulse/models/global_allowance_amount.py +139 -0
  72. factpulse/models/gross_unit_price.py +145 -0
  73. factpulse/models/http_validation_error.py +2 -2
  74. factpulse/models/incoming_invoice.py +196 -0
  75. factpulse/models/incoming_supplier.py +144 -0
  76. factpulse/models/invoice_format.py +38 -0
  77. factpulse/models/invoice_line.py +354 -0
  78. factpulse/models/invoice_line_allowance_amount.py +145 -0
  79. factpulse/models/invoice_note.py +94 -0
  80. factpulse/models/invoice_references.py +194 -0
  81. factpulse/models/invoice_status.py +96 -0
  82. factpulse/models/invoice_totals.py +177 -0
  83. factpulse/models/invoice_totals_prepayment.py +145 -0
  84. factpulse/models/invoice_type_code.py +51 -0
  85. factpulse/models/invoicing_framework.py +110 -0
  86. factpulse/models/invoicing_framework_code.py +39 -0
  87. factpulse/models/line_net_amount.py +145 -0
  88. factpulse/models/line_total_amount.py +145 -0
  89. factpulse/models/mandatory_note_schema.py +124 -0
  90. factpulse/models/manual_rate.py +139 -0
  91. factpulse/models/manual_vat_rate.py +139 -0
  92. factpulse/models/missing_field.py +107 -0
  93. factpulse/models/operation_nature.py +49 -0
  94. factpulse/models/output_format.py +37 -0
  95. factpulse/models/page_dimensions_schema.py +89 -0
  96. factpulse/models/payee.py +168 -0
  97. factpulse/models/payment_card.py +99 -0
  98. factpulse/models/payment_means.py +41 -0
  99. factpulse/models/pdf_validation_result_api.py +169 -0
  100. factpulse/models/pdp_credentials.py +20 -13
  101. factpulse/models/percentage.py +145 -0
  102. factpulse/models/postal_address.py +134 -0
  103. factpulse/models/price_allowance_amount.py +145 -0
  104. factpulse/models/price_basis_quantity.py +145 -0
  105. factpulse/models/processing_options.py +94 -0
  106. factpulse/models/product_characteristic.py +89 -0
  107. factpulse/models/product_classification.py +101 -0
  108. factpulse/models/quantity.py +139 -0
  109. factpulse/models/recipient.py +167 -0
  110. factpulse/models/rounding_amount.py +145 -0
  111. factpulse/models/scheme_id.py +14 -8
  112. factpulse/models/search_flow_request.py +143 -0
  113. factpulse/models/search_flow_response.py +101 -0
  114. factpulse/models/search_services_response.py +101 -0
  115. factpulse/models/search_structure_request.py +119 -0
  116. factpulse/models/search_structure_response.py +101 -0
  117. factpulse/models/signature_info.py +6 -6
  118. factpulse/models/signature_info_api.py +122 -0
  119. factpulse/models/signature_parameters.py +133 -0
  120. factpulse/models/simplified_invoice_data.py +124 -0
  121. factpulse/models/structure_info.py +14 -14
  122. factpulse/models/structure_parameters.py +91 -0
  123. factpulse/models/structure_service.py +93 -0
  124. factpulse/models/submission_mode.py +38 -0
  125. factpulse/models/submit_complete_invoice_request.py +116 -0
  126. factpulse/models/submit_complete_invoice_response.py +145 -0
  127. factpulse/models/submit_flow_request.py +123 -0
  128. factpulse/models/submit_flow_response.py +109 -0
  129. factpulse/models/submit_gross_amount.py +139 -0
  130. factpulse/models/submit_invoice_request.py +176 -0
  131. factpulse/models/submit_invoice_response.py +103 -0
  132. factpulse/models/submit_net_amount.py +139 -0
  133. factpulse/models/submit_vat_amount.py +139 -0
  134. factpulse/models/supplementary_attachment.py +95 -0
  135. factpulse/models/supplier.py +225 -0
  136. factpulse/models/task_response.py +87 -0
  137. factpulse/models/tax_representative.py +95 -0
  138. factpulse/models/taxable_amount.py +139 -0
  139. factpulse/models/total_gross_amount.py +139 -0
  140. factpulse/models/total_net_amount.py +139 -0
  141. factpulse/models/total_vat_amount.py +139 -0
  142. factpulse/models/unit_net_price.py +139 -0
  143. factpulse/models/unit_of_measure.py +41 -0
  144. factpulse/models/validation_error.py +2 -2
  145. factpulse/models/validation_error_detail.py +107 -0
  146. factpulse/models/validation_error_loc_inner.py +2 -2
  147. factpulse/models/validation_error_response.py +87 -0
  148. factpulse/models/validation_info.py +105 -0
  149. factpulse/models/validation_success_response.py +87 -0
  150. factpulse/models/vat_accounting_code.py +39 -0
  151. factpulse/models/vat_amount.py +139 -0
  152. factpulse/models/vat_category.py +44 -0
  153. factpulse/models/vat_line.py +140 -0
  154. factpulse/models/vat_point_date_code.py +38 -0
  155. factpulse/models/vat_rate.py +145 -0
  156. factpulse/models/verification_success_response.py +135 -0
  157. factpulse/models/verified_field_schema.py +129 -0
  158. factpulse/rest.py +9 -4
  159. factpulse-3.0.7.dist-info/METADATA +292 -0
  160. factpulse-3.0.7.dist-info/RECORD +168 -0
  161. factpulse-3.0.7.dist-info/top_level.txt +2 -0
  162. factpulse_helpers/__init__.py +96 -0
  163. factpulse_helpers/client.py +2111 -0
  164. factpulse_helpers/exceptions.py +253 -0
  165. factpulse/api/processing_endpoints_unifis_api.py +0 -592
  166. factpulse/api/traitement_facture_api.py +0 -3439
  167. factpulse/api/utilisateur_api.py +0 -282
  168. factpulse/models/adresse_electronique.py +0 -90
  169. factpulse/models/adresse_postale.py +0 -120
  170. factpulse/models/body_ajouter_fichier_api_v1_chorus_pro_transverses_ajouter_fichier_post.py +0 -104
  171. factpulse/models/body_completer_facture_api_v1_chorus_pro_factures_completer_post.py +0 -104
  172. factpulse/models/body_lister_services_structure_api_v1_chorus_pro_structures_id_structure_cpp_services_get.py +0 -102
  173. factpulse/models/body_rechercher_factures_destinataire_api_v1_chorus_pro_factures_rechercher_destinataire_post.py +0 -104
  174. factpulse/models/body_rechercher_factures_fournisseur_api_v1_chorus_pro_factures_rechercher_fournisseur_post.py +0 -104
  175. factpulse/models/body_recycler_facture_api_v1_chorus_pro_factures_recycler_post.py +0 -104
  176. factpulse/models/body_telecharger_groupe_factures_api_v1_chorus_pro_factures_telecharger_groupe_post.py +0 -104
  177. factpulse/models/body_traiter_facture_recue_api_v1_chorus_pro_factures_traiter_facture_recue_post.py +0 -104
  178. factpulse/models/body_valideur_consulter_facture_api_v1_chorus_pro_factures_valideur_consulter_post.py +0 -104
  179. factpulse/models/body_valideur_rechercher_factures_api_v1_chorus_pro_factures_valideur_rechercher_post.py +0 -104
  180. factpulse/models/body_valideur_traiter_facture_api_v1_chorus_pro_factures_valideur_traiter_post.py +0 -104
  181. factpulse/models/cadre_de_facturation.py +0 -102
  182. factpulse/models/categorie_tva.py +0 -44
  183. factpulse/models/chorus_pro_credentials.py +0 -95
  184. factpulse/models/code_cadre_facturation.py +0 -39
  185. factpulse/models/code_raison_reduction.py +0 -42
  186. factpulse/models/consulter_facture_request.py +0 -98
  187. factpulse/models/consulter_facture_response.py +0 -142
  188. factpulse/models/consulter_structure_request.py +0 -100
  189. factpulse/models/consulter_structure_response.py +0 -142
  190. factpulse/models/credentials_afnor.py +0 -106
  191. factpulse/models/credentials_chorus_pro.py +0 -115
  192. factpulse/models/destinataire.py +0 -116
  193. factpulse/models/destination_afnor.py +0 -127
  194. factpulse/models/destination_chorus_pro.py +0 -108
  195. factpulse/models/direction_flux.py +0 -37
  196. factpulse/models/donnees_facture_simplifiees.py +0 -124
  197. factpulse/models/facture_enrichie_info_input.py +0 -123
  198. factpulse/models/facture_enrichie_info_output.py +0 -133
  199. factpulse/models/facture_factur_x.py +0 -173
  200. factpulse/models/flux_resume.py +0 -131
  201. factpulse/models/format_sortie.py +0 -37
  202. factpulse/models/fournisseur.py +0 -146
  203. factpulse/models/information_signature_api.py +0 -122
  204. factpulse/models/ligne_de_poste.py +0 -188
  205. factpulse/models/ligne_de_poste_montant_remise_ht.py +0 -145
  206. factpulse/models/ligne_de_poste_montant_total_ligne_ht.py +0 -145
  207. factpulse/models/ligne_de_poste_taux_tva_manuel.py +0 -145
  208. factpulse/models/ligne_de_tva.py +0 -118
  209. factpulse/models/mode_depot.py +0 -38
  210. factpulse/models/mode_paiement.py +0 -41
  211. factpulse/models/montant_ht_total.py +0 -139
  212. factpulse/models/montant_total.py +0 -138
  213. factpulse/models/montant_total_acompte.py +0 -145
  214. factpulse/models/montant_total_montant_remise_globale_ttc.py +0 -145
  215. factpulse/models/montant_ttc_total.py +0 -139
  216. factpulse/models/montant_tva.py +0 -139
  217. factpulse/models/montantapayer.py +0 -139
  218. factpulse/models/montantbaseht.py +0 -139
  219. factpulse/models/montanthttotal.py +0 -139
  220. factpulse/models/montantttctotal.py +0 -139
  221. factpulse/models/montanttva.py +0 -139
  222. factpulse/models/montanttva1.py +0 -139
  223. factpulse/models/montantunitaireht.py +0 -139
  224. factpulse/models/obtenir_id_chorus_pro_request.py +0 -100
  225. factpulse/models/obtenir_id_chorus_pro_response.py +0 -98
  226. factpulse/models/options_processing.py +0 -94
  227. factpulse/models/parametres_signature.py +0 -133
  228. factpulse/models/parametres_structure.py +0 -91
  229. factpulse/models/pdf_factur_x_info.py +0 -91
  230. factpulse/models/piece_jointe_complementaire.py +0 -95
  231. factpulse/models/profil_api.py +0 -39
  232. factpulse/models/profil_flux.py +0 -38
  233. factpulse/models/quantite.py +0 -139
  234. factpulse/models/quota_info.py +0 -95
  235. factpulse/models/rechercher_services_response.py +0 -101
  236. factpulse/models/rechercher_structure_request.py +0 -119
  237. factpulse/models/rechercher_structure_response.py +0 -101
  238. factpulse/models/references.py +0 -124
  239. factpulse/models/reponse_healthcheck_afnor.py +0 -91
  240. factpulse/models/reponse_recherche_flux.py +0 -101
  241. factpulse/models/reponse_soumission_flux.py +0 -109
  242. factpulse/models/reponse_tache.py +0 -87
  243. factpulse/models/reponse_validation_erreur.py +0 -87
  244. factpulse/models/reponse_validation_succes.py +0 -87
  245. factpulse/models/requete_recherche_flux.py +0 -143
  246. factpulse/models/requete_soumission_flux.py +0 -123
  247. factpulse/models/resultat_afnor.py +0 -105
  248. factpulse/models/resultat_chorus_pro.py +0 -101
  249. factpulse/models/resultat_validation_pdfapi.py +0 -169
  250. factpulse/models/service_structure.py +0 -93
  251. factpulse/models/soumettre_facture_complete_request.py +0 -116
  252. factpulse/models/soumettre_facture_complete_response.py +0 -145
  253. factpulse/models/soumettre_facture_request.py +0 -164
  254. factpulse/models/soumettre_facture_response.py +0 -103
  255. factpulse/models/statut_acquittement.py +0 -38
  256. factpulse/models/statut_facture.py +0 -96
  257. factpulse/models/statut_tache.py +0 -99
  258. factpulse/models/syntaxe_flux.py +0 -40
  259. factpulse/models/tauxmanuel.py +0 -139
  260. factpulse/models/type_facture.py +0 -37
  261. factpulse/models/type_flux.py +0 -40
  262. factpulse/models/type_tva.py +0 -39
  263. factpulse/models/unite.py +0 -41
  264. factpulse/models/utilisateur.py +0 -128
  265. factpulse-1.0.9.dist-info/METADATA +0 -182
  266. factpulse-1.0.9.dist-info/RECORD +0 -131
  267. factpulse-1.0.9.dist-info/top_level.txt +0 -1
  268. {factpulse-1.0.9.dist-info → factpulse-3.0.7.dist-info}/WHEEL +0 -0
  269. {factpulse-1.0.9.dist-info → factpulse-3.0.7.dist-info}/licenses/LICENSE +0 -0
@@ -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, Field, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from factpulse.models.pdp_credentials import PDPCredentials
23
- from factpulse.models.profil_flux import ProfilFlux
24
- from factpulse.models.syntaxe_flux import SyntaxeFlux
25
- from typing import Optional, Set
26
- from typing_extensions import Self
27
-
28
- class RequeteSoumissionFlux(BaseModel):
29
- """
30
- Requête pour soumettre une facture à une PDP/PA via AFNOR
31
- """ # noqa: E501
32
- nom_flux: StrictStr = Field(description="Nom du flux (ex: 'Facture 2025-001')")
33
- syntaxe_flux: Optional[SyntaxeFlux] = Field(default=None, description="Syntaxe du flux (CII pour Factur-X)")
34
- profil_flux: Optional[ProfilFlux] = None
35
- tracking_id: Optional[StrictStr] = None
36
- request_id: Optional[StrictStr] = None
37
- pdp_credentials: Optional[PDPCredentials] = None
38
- __properties: ClassVar[List[str]] = ["nom_flux", "syntaxe_flux", "profil_flux", "tracking_id", "request_id", "pdp_credentials"]
39
-
40
- model_config = ConfigDict(
41
- populate_by_name=True,
42
- validate_assignment=True,
43
- protected_namespaces=(),
44
- )
45
-
46
-
47
- def to_str(self) -> str:
48
- """Returns the string representation of the model using alias"""
49
- return pprint.pformat(self.model_dump(by_alias=True))
50
-
51
- def to_json(self) -> str:
52
- """Returns the JSON representation of the model using alias"""
53
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
- return json.dumps(self.to_dict())
55
-
56
- @classmethod
57
- def from_json(cls, json_str: str) -> Optional[Self]:
58
- """Create an instance of RequeteSoumissionFlux from a JSON string"""
59
- return cls.from_dict(json.loads(json_str))
60
-
61
- def to_dict(self) -> Dict[str, Any]:
62
- """Return the dictionary representation of the model using alias.
63
-
64
- This has the following differences from calling pydantic's
65
- `self.model_dump(by_alias=True)`:
66
-
67
- * `None` is only added to the output dict for nullable fields that
68
- were set at model initialization. Other fields with value `None`
69
- are ignored.
70
- """
71
- excluded_fields: Set[str] = set([
72
- ])
73
-
74
- _dict = self.model_dump(
75
- by_alias=True,
76
- exclude=excluded_fields,
77
- exclude_none=True,
78
- )
79
- # override the default output from pydantic by calling `to_dict()` of pdp_credentials
80
- if self.pdp_credentials:
81
- _dict['pdp_credentials'] = self.pdp_credentials.to_dict()
82
- # set to None if profil_flux (nullable) is None
83
- # and model_fields_set contains the field
84
- if self.profil_flux is None and "profil_flux" in self.model_fields_set:
85
- _dict['profil_flux'] = None
86
-
87
- # set to None if tracking_id (nullable) is None
88
- # and model_fields_set contains the field
89
- if self.tracking_id is None and "tracking_id" in self.model_fields_set:
90
- _dict['tracking_id'] = None
91
-
92
- # set to None if request_id (nullable) is None
93
- # and model_fields_set contains the field
94
- if self.request_id is None and "request_id" in self.model_fields_set:
95
- _dict['request_id'] = None
96
-
97
- # set to None if pdp_credentials (nullable) is None
98
- # and model_fields_set contains the field
99
- if self.pdp_credentials is None and "pdp_credentials" in self.model_fields_set:
100
- _dict['pdp_credentials'] = None
101
-
102
- return _dict
103
-
104
- @classmethod
105
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
106
- """Create an instance of RequeteSoumissionFlux from a dict"""
107
- if obj is None:
108
- return None
109
-
110
- if not isinstance(obj, dict):
111
- return cls.model_validate(obj)
112
-
113
- _obj = cls.model_validate({
114
- "nom_flux": obj.get("nom_flux"),
115
- "syntaxe_flux": obj.get("syntaxe_flux"),
116
- "profil_flux": obj.get("profil_flux"),
117
- "tracking_id": obj.get("tracking_id"),
118
- "request_id": obj.get("request_id"),
119
- "pdp_credentials": PDPCredentials.from_dict(obj["pdp_credentials"]) if obj.get("pdp_credentials") is not None else None
120
- })
121
- return _obj
122
-
123
-
@@ -1,105 +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, Field, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
-
25
- class ResultatAFNOR(BaseModel):
26
- """
27
- Résultat de la soumission à AFNOR PDP.
28
- """ # noqa: E501
29
- flow_id: StrictStr = Field(description="Identifiant du flux soumis")
30
- tracking_id: Optional[StrictStr] = None
31
- sha256: StrictStr = Field(description="Hash SHA-256 du fichier soumis")
32
- flow_syntax: StrictStr = Field(description="Syntaxe du flux")
33
- flow_profile: Optional[StrictStr] = None
34
- __properties: ClassVar[List[str]] = ["flow_id", "tracking_id", "sha256", "flow_syntax", "flow_profile"]
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 ResultatAFNOR 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
- # set to None if tracking_id (nullable) is None
76
- # and model_fields_set contains the field
77
- if self.tracking_id is None and "tracking_id" in self.model_fields_set:
78
- _dict['tracking_id'] = None
79
-
80
- # set to None if flow_profile (nullable) is None
81
- # and model_fields_set contains the field
82
- if self.flow_profile is None and "flow_profile" in self.model_fields_set:
83
- _dict['flow_profile'] = None
84
-
85
- return _dict
86
-
87
- @classmethod
88
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
- """Create an instance of ResultatAFNOR from a dict"""
90
- if obj is None:
91
- return None
92
-
93
- if not isinstance(obj, dict):
94
- return cls.model_validate(obj)
95
-
96
- _obj = cls.model_validate({
97
- "flow_id": obj.get("flow_id"),
98
- "tracking_id": obj.get("tracking_id"),
99
- "sha256": obj.get("sha256"),
100
- "flow_syntax": obj.get("flow_syntax"),
101
- "flow_profile": obj.get("flow_profile")
102
- })
103
- return _obj
104
-
105
-
@@ -1,101 +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, Field, StrictInt, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
-
25
- class ResultatChorusPro(BaseModel):
26
- """
27
- Résultat de la soumission à Chorus Pro.
28
- """ # noqa: E501
29
- identifiant_facture_cpp: StrictInt = Field(description="ID Chorus Pro de la facture soumise")
30
- numero_flux_depot: Optional[StrictStr] = None
31
- piece_jointe_id: Optional[StrictInt] = None
32
- __properties: ClassVar[List[str]] = ["identifiant_facture_cpp", "numero_flux_depot", "piece_jointe_id"]
33
-
34
- model_config = ConfigDict(
35
- populate_by_name=True,
36
- validate_assignment=True,
37
- protected_namespaces=(),
38
- )
39
-
40
-
41
- def to_str(self) -> str:
42
- """Returns the string representation of the model using alias"""
43
- return pprint.pformat(self.model_dump(by_alias=True))
44
-
45
- def to_json(self) -> str:
46
- """Returns the JSON representation of the model using alias"""
47
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
- return json.dumps(self.to_dict())
49
-
50
- @classmethod
51
- def from_json(cls, json_str: str) -> Optional[Self]:
52
- """Create an instance of ResultatChorusPro from a JSON string"""
53
- return cls.from_dict(json.loads(json_str))
54
-
55
- def to_dict(self) -> Dict[str, Any]:
56
- """Return the dictionary representation of the model using alias.
57
-
58
- This has the following differences from calling pydantic's
59
- `self.model_dump(by_alias=True)`:
60
-
61
- * `None` is only added to the output dict for nullable fields that
62
- were set at model initialization. Other fields with value `None`
63
- are ignored.
64
- """
65
- excluded_fields: Set[str] = set([
66
- ])
67
-
68
- _dict = self.model_dump(
69
- by_alias=True,
70
- exclude=excluded_fields,
71
- exclude_none=True,
72
- )
73
- # set to None if numero_flux_depot (nullable) is None
74
- # and model_fields_set contains the field
75
- if self.numero_flux_depot is None and "numero_flux_depot" in self.model_fields_set:
76
- _dict['numero_flux_depot'] = None
77
-
78
- # set to None if piece_jointe_id (nullable) is None
79
- # and model_fields_set contains the field
80
- if self.piece_jointe_id is None and "piece_jointe_id" in self.model_fields_set:
81
- _dict['piece_jointe_id'] = None
82
-
83
- return _dict
84
-
85
- @classmethod
86
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
- """Create an instance of ResultatChorusPro from a dict"""
88
- if obj is None:
89
- return None
90
-
91
- if not isinstance(obj, dict):
92
- return cls.model_validate(obj)
93
-
94
- _obj = cls.model_validate({
95
- "identifiant_facture_cpp": obj.get("identifiant_facture_cpp"),
96
- "numero_flux_depot": obj.get("numero_flux_depot"),
97
- "piece_jointe_id": obj.get("piece_jointe_id")
98
- })
99
- return _obj
100
-
101
-
@@ -1,169 +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, Field, StrictBool, StrictInt, StrictStr
21
- from typing import Any, ClassVar, Dict, List, Optional
22
- from factpulse.models.information_signature_api import InformationSignatureAPI
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
-
26
- class ResultatValidationPDFAPI(BaseModel):
27
- """
28
- Résultat complet de la validation d'un PDF Factur-X.
29
- """ # noqa: E501
30
- est_conforme: StrictBool = Field(description="True si le PDF est conforme à tous les critères (XML, PDF/A, XMP)")
31
- xml_present: StrictBool = Field(description="True si un XML Factur-X est embarqué dans le PDF")
32
- xml_conforme: StrictBool = Field(description="True si le XML Factur-X est conforme aux règles Schematron")
33
- profil_detecte: Optional[StrictStr] = None
34
- erreurs_xml: Optional[List[StrictStr]] = Field(default=None, description="Liste des erreurs de validation XML")
35
- pdfa_conforme: StrictBool = Field(description="True si le PDF est conforme PDF/A")
36
- version_pdfa: Optional[StrictStr] = None
37
- methode_validation_pdfa: Optional[StrictStr] = Field(default='metadata', description="Méthode utilisée pour la validation PDF/A (metadata ou verapdf)")
38
- regles_validees: Optional[StrictInt] = None
39
- regles_echouees: Optional[StrictInt] = None
40
- erreurs_pdfa: Optional[List[StrictStr]] = Field(default=None, description="Liste des erreurs de conformité PDF/A")
41
- avertissements_pdfa: Optional[List[StrictStr]] = Field(default=None, description="Liste des avertissements PDF/A")
42
- xmp_present: StrictBool = Field(description="True si des métadonnées XMP sont présentes")
43
- xmp_conforme_facturx: StrictBool = Field(description="True si les métadonnées XMP contiennent des informations Factur-X")
44
- profil_xmp: Optional[StrictStr] = None
45
- version_xmp: Optional[StrictStr] = None
46
- erreurs_xmp: Optional[List[StrictStr]] = Field(default=None, description="Liste des erreurs de métadonnées XMP")
47
- metadonnees_xmp: Optional[Dict[str, Any]] = Field(default=None, description="Métadonnées XMP extraites du PDF")
48
- est_signe: StrictBool = Field(description="True si le PDF contient au moins une signature")
49
- nombre_signatures: Optional[StrictInt] = Field(default=0, description="Nombre de signatures électroniques trouvées")
50
- signatures: Optional[List[InformationSignatureAPI]] = Field(default=None, description="Liste des signatures trouvées avec leurs informations")
51
- erreurs_signatures: Optional[List[StrictStr]] = Field(default=None, description="Liste des erreurs lors de l'analyse des signatures")
52
- message_resume: StrictStr = Field(description="Message résumant le résultat de la validation")
53
- __properties: ClassVar[List[str]] = ["est_conforme", "xml_present", "xml_conforme", "profil_detecte", "erreurs_xml", "pdfa_conforme", "version_pdfa", "methode_validation_pdfa", "regles_validees", "regles_echouees", "erreurs_pdfa", "avertissements_pdfa", "xmp_present", "xmp_conforme_facturx", "profil_xmp", "version_xmp", "erreurs_xmp", "metadonnees_xmp", "est_signe", "nombre_signatures", "signatures", "erreurs_signatures", "message_resume"]
54
-
55
- model_config = ConfigDict(
56
- populate_by_name=True,
57
- validate_assignment=True,
58
- protected_namespaces=(),
59
- )
60
-
61
-
62
- def to_str(self) -> str:
63
- """Returns the string representation of the model using alias"""
64
- return pprint.pformat(self.model_dump(by_alias=True))
65
-
66
- def to_json(self) -> str:
67
- """Returns the JSON representation of the model using alias"""
68
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
69
- return json.dumps(self.to_dict())
70
-
71
- @classmethod
72
- def from_json(cls, json_str: str) -> Optional[Self]:
73
- """Create an instance of ResultatValidationPDFAPI from a JSON string"""
74
- return cls.from_dict(json.loads(json_str))
75
-
76
- def to_dict(self) -> Dict[str, Any]:
77
- """Return the dictionary representation of the model using alias.
78
-
79
- This has the following differences from calling pydantic's
80
- `self.model_dump(by_alias=True)`:
81
-
82
- * `None` is only added to the output dict for nullable fields that
83
- were set at model initialization. Other fields with value `None`
84
- are ignored.
85
- """
86
- excluded_fields: Set[str] = set([
87
- ])
88
-
89
- _dict = self.model_dump(
90
- by_alias=True,
91
- exclude=excluded_fields,
92
- exclude_none=True,
93
- )
94
- # override the default output from pydantic by calling `to_dict()` of each item in signatures (list)
95
- _items = []
96
- if self.signatures:
97
- for _item_signatures in self.signatures:
98
- if _item_signatures:
99
- _items.append(_item_signatures.to_dict())
100
- _dict['signatures'] = _items
101
- # set to None if profil_detecte (nullable) is None
102
- # and model_fields_set contains the field
103
- if self.profil_detecte is None and "profil_detecte" in self.model_fields_set:
104
- _dict['profil_detecte'] = None
105
-
106
- # set to None if version_pdfa (nullable) is None
107
- # and model_fields_set contains the field
108
- if self.version_pdfa is None and "version_pdfa" in self.model_fields_set:
109
- _dict['version_pdfa'] = None
110
-
111
- # set to None if regles_validees (nullable) is None
112
- # and model_fields_set contains the field
113
- if self.regles_validees is None and "regles_validees" in self.model_fields_set:
114
- _dict['regles_validees'] = None
115
-
116
- # set to None if regles_echouees (nullable) is None
117
- # and model_fields_set contains the field
118
- if self.regles_echouees is None and "regles_echouees" in self.model_fields_set:
119
- _dict['regles_echouees'] = None
120
-
121
- # set to None if profil_xmp (nullable) is None
122
- # and model_fields_set contains the field
123
- if self.profil_xmp is None and "profil_xmp" in self.model_fields_set:
124
- _dict['profil_xmp'] = None
125
-
126
- # set to None if version_xmp (nullable) is None
127
- # and model_fields_set contains the field
128
- if self.version_xmp is None and "version_xmp" in self.model_fields_set:
129
- _dict['version_xmp'] = None
130
-
131
- return _dict
132
-
133
- @classmethod
134
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
135
- """Create an instance of ResultatValidationPDFAPI from a dict"""
136
- if obj is None:
137
- return None
138
-
139
- if not isinstance(obj, dict):
140
- return cls.model_validate(obj)
141
-
142
- _obj = cls.model_validate({
143
- "est_conforme": obj.get("est_conforme"),
144
- "xml_present": obj.get("xml_present"),
145
- "xml_conforme": obj.get("xml_conforme"),
146
- "profil_detecte": obj.get("profil_detecte"),
147
- "erreurs_xml": obj.get("erreurs_xml"),
148
- "pdfa_conforme": obj.get("pdfa_conforme"),
149
- "version_pdfa": obj.get("version_pdfa"),
150
- "methode_validation_pdfa": obj.get("methode_validation_pdfa") if obj.get("methode_validation_pdfa") is not None else 'metadata',
151
- "regles_validees": obj.get("regles_validees"),
152
- "regles_echouees": obj.get("regles_echouees"),
153
- "erreurs_pdfa": obj.get("erreurs_pdfa"),
154
- "avertissements_pdfa": obj.get("avertissements_pdfa"),
155
- "xmp_present": obj.get("xmp_present"),
156
- "xmp_conforme_facturx": obj.get("xmp_conforme_facturx"),
157
- "profil_xmp": obj.get("profil_xmp"),
158
- "version_xmp": obj.get("version_xmp"),
159
- "erreurs_xmp": obj.get("erreurs_xmp"),
160
- "metadonnees_xmp": obj.get("metadonnees_xmp"),
161
- "est_signe": obj.get("est_signe"),
162
- "nombre_signatures": obj.get("nombre_signatures") if obj.get("nombre_signatures") is not None else 0,
163
- "signatures": [InformationSignatureAPI.from_dict(_item) for _item in obj["signatures"]] if obj.get("signatures") is not None else None,
164
- "erreurs_signatures": obj.get("erreurs_signatures"),
165
- "message_resume": obj.get("message_resume")
166
- })
167
- return _obj
168
-
169
-
@@ -1,93 +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, Field, StrictBool, StrictInt, StrictStr
21
- from typing import Any, ClassVar, Dict, List
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
-
25
- class ServiceStructure(BaseModel):
26
- """
27
- Service d'une structure.
28
- """ # noqa: E501
29
- id_service: StrictInt = Field(description="ID du service")
30
- code_service: StrictStr = Field(description="Code du service")
31
- libelle_service: StrictStr = Field(description="Libellé du service")
32
- est_actif: StrictBool = Field(description="Service actif")
33
- __properties: ClassVar[List[str]] = ["id_service", "code_service", "libelle_service", "est_actif"]
34
-
35
- model_config = ConfigDict(
36
- populate_by_name=True,
37
- validate_assignment=True,
38
- protected_namespaces=(),
39
- )
40
-
41
-
42
- def to_str(self) -> str:
43
- """Returns the string representation of the model using alias"""
44
- return pprint.pformat(self.model_dump(by_alias=True))
45
-
46
- def to_json(self) -> str:
47
- """Returns the JSON representation of the model using alias"""
48
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
- return json.dumps(self.to_dict())
50
-
51
- @classmethod
52
- def from_json(cls, json_str: str) -> Optional[Self]:
53
- """Create an instance of ServiceStructure from a JSON string"""
54
- return cls.from_dict(json.loads(json_str))
55
-
56
- def to_dict(self) -> Dict[str, Any]:
57
- """Return the dictionary representation of the model using alias.
58
-
59
- This has the following differences from calling pydantic's
60
- `self.model_dump(by_alias=True)`:
61
-
62
- * `None` is only added to the output dict for nullable fields that
63
- were set at model initialization. Other fields with value `None`
64
- are ignored.
65
- """
66
- excluded_fields: Set[str] = set([
67
- ])
68
-
69
- _dict = self.model_dump(
70
- by_alias=True,
71
- exclude=excluded_fields,
72
- exclude_none=True,
73
- )
74
- return _dict
75
-
76
- @classmethod
77
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
- """Create an instance of ServiceStructure from a dict"""
79
- if obj is None:
80
- return None
81
-
82
- if not isinstance(obj, dict):
83
- return cls.model_validate(obj)
84
-
85
- _obj = cls.model_validate({
86
- "id_service": obj.get("id_service"),
87
- "code_service": obj.get("code_service"),
88
- "libelle_service": obj.get("libelle_service"),
89
- "est_actif": obj.get("est_actif")
90
- })
91
- return _obj
92
-
93
-