factpulse 1.0.8 → 1.0.13

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ce0f1f2fe92c3fa54367c5becea06a2cc0f8a2235e14fdea09a8eb59fe3a336
4
- data.tar.gz: 61180b0780bd01888e992885050450d294a5bedbf6ed7487ac18bcc59598a2ce
3
+ metadata.gz: c74c060877b8d7806cc6792dd3d111190ce5360599692c841d069328c0a6e9b3
4
+ data.tar.gz: 284d0c9b4f310e0f5109d558539e54b8c1b9cdd06ea2926444e76292a9e8a294
5
5
  SHA512:
6
- metadata.gz: 2b2513e2925b6a89191bdc6918c1ab3cd453eb9a672646f244a0688f425e9053efbd2b28187f8593c8a3586b31ab5ee4764112684b031955cfc7d10aee426036
7
- data.tar.gz: 6c08603a0b953b86c18e2d9402bb4f93fa3fcafdc8e696c24fc94e8a4cd69dbc789f342f814770380320413682a5b25b62ee62c27365099c1b148e1a35cd2436
6
+ metadata.gz: a7eea264f2ee1c0c68a6cdfe30ff8c486cdff76789e1406459f356a08037dafe54a9f345dedd968b3bdc6be0b1d9625cdab0001ded1396927f513fb6a705be85
7
+ data.tar.gz: 5f35e61645a67ce1ccd3443fa05cb09e97bba4f420bbe92d6004eb17dc689a40d22b26247563004ea8290580418ffc6d0b8529abdba57aeaa05d7483347c0097
data/CHANGELOG.md CHANGED
@@ -7,7 +7,7 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [1.0.8] - 2025-11-13
10
+ ## [1.0.13] - 2025-11-13
11
11
 
12
12
  ### Added
13
13
  - Version initiale du SDK ruby
@@ -24,5 +24,5 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
24
24
  - Guide d'authentification JWT
25
25
  - Configuration avancée (timeout, proxy, debug)
26
26
 
27
- [Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v1.0.8...HEAD
28
- [1.0.8]: https://github.com/factpulse/sdk-ruby/releases/tag/v1.0.8
27
+ [Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v1.0.13...HEAD
28
+ [1.0.13]: https://github.com/factpulse/sdk-ruby/releases/tag/v1.0.13
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- factpulse (1.0.8)
4
+ factpulse (1.0.13)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
data/docs/ChorusProApi.md CHANGED
@@ -734,7 +734,7 @@ FactPulse.configure do |config|
734
734
  end
735
735
 
736
736
  api_instance = FactPulse::ChorusProApi.new
737
- soumettre_facture_request = FactPulse::SoumettreFactureRequest.new({numero_facture: 'numero_facture_example', date_facture: 'date_facture_example', id_structure_cpp: 37, montant_ht_total: 'montant_ht_total_example', montant_tva: 'montant_tva_example', montant_ttc_total: 'montant_ttc_total_example'}) # SoumettreFactureRequest |
737
+ soumettre_facture_request = FactPulse::SoumettreFactureRequest.new({numero_facture: 'numero_facture_example', date_facture: 'date_facture_example', id_structure_cpp: 37, montant_ht_total: FactPulse::MontantHtTotal1.new, montant_tva: FactPulse::MontantTva1.new, montant_ttc_total: FactPulse::MontantTtcTotal1.new}) # SoumettreFactureRequest |
738
738
 
739
739
  begin
740
740
  # Soumettre une facture à Chorus Pro
@@ -0,0 +1,15 @@
1
+ # FactPulse::MontantHtTotal1
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'factpulse'
12
+
13
+ instance = FactPulse::MontantHtTotal1.new()
14
+ ```
15
+
@@ -0,0 +1,15 @@
1
+ # FactPulse::MontantTtcTotal1
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'factpulse'
12
+
13
+ instance = FactPulse::MontantTtcTotal1.new()
14
+ ```
15
+
@@ -0,0 +1,15 @@
1
+ # FactPulse::MontantTva1
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'factpulse'
12
+
13
+ instance = FactPulse::MontantTva1.new()
14
+ ```
15
+
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **profil_facturx** | **String** | Profil Factur-X à utiliser | [optional][default to 'EN16931'] |
7
+ | **profil_facturx** | [**ProfilAPI**](ProfilAPI.md) | Profil Factur-X à utiliser | [optional] |
8
8
  | **auto_enrichir** | **Boolean** | Auto-enrichir les données (APIs Entreprises, Chorus Pro, etc.) | [optional][default to true] |
9
9
  | **valider** | **Boolean** | Valider le XML Factur-X avec Schematron | [optional][default to true] |
10
10
  | **verifier_parametres_destination** | **Boolean** | Vérifier les paramètres requis par la destination (ex: code_service pour Chorus) | [optional][default to true] |
@@ -11,9 +11,9 @@
11
11
  | **id_structure_cpp** | **Integer** | ID Chorus Pro de la structure destinataire | |
12
12
  | **code_service** | **String** | | [optional] |
13
13
  | **numero_engagement** | **String** | | [optional] |
14
- | **montant_ht_total** | **String** | Montant HT total | |
15
- | **montant_tva** | **String** | Montant TVA | |
16
- | **montant_ttc_total** | **String** | Montant TTC total | |
14
+ | **montant_ht_total** | [**MontantHtTotal1**](MontantHtTotal1.md) | | |
15
+ | **montant_tva** | [**MontantTva1**](MontantTva1.md) | | |
16
+ | **montant_ttc_total** | [**MontantTtcTotal1**](MontantTtcTotal1.md) | | |
17
17
  | **piece_jointe_principale_id** | **Integer** | | [optional] |
18
18
  | **piece_jointe_principale_designation** | **String** | | [optional] |
19
19
  | **commentaire** | **String** | | [optional] |
data/docs/StatutTache.md CHANGED
@@ -6,7 +6,7 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **id_tache** | **String** | | |
8
8
  | **statut** | **String** | | |
9
- | **resultat** | [**AnyOf**](AnyOf.md) | | [optional] |
9
+ | **resultat** | **Hash<String, Object>** | | [optional] |
10
10
 
11
11
  ## Example
12
12
 
@@ -0,0 +1,104 @@
1
+ =begin
2
+ #API REST FactPulse
3
+
4
+ # 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/
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.18.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Montant HT total
18
+ module MontantHtTotal1
19
+ class << self
20
+ # List of class defined in anyOf (OpenAPI v3)
21
+ def openapi_any_of
22
+ [
23
+ :'Float',
24
+ :'String'
25
+ ]
26
+ end
27
+
28
+ # Builds the object
29
+ # @param [Mixed] Data to be matched against the list of anyOf items
30
+ # @return [Object] Returns the model or the data itself
31
+ def build(data)
32
+ # Go through the list of anyOf items and attempt to identify the appropriate one.
33
+ # Note:
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_any_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ return find_and_cast_into_type(klass, data)
42
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
43
+ end
44
+ end
45
+
46
+ openapi_any_of.include?(:AnyType) ? data : nil
47
+ end
48
+
49
+ private
50
+
51
+ SchemaMismatchError = Class.new(StandardError)
52
+
53
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
54
+ def find_and_cast_into_type(klass, data)
55
+ return if data.nil?
56
+
57
+ case klass.to_s
58
+ when 'Boolean'
59
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
60
+ when 'Float'
61
+ return data if data.instance_of?(Float)
62
+ when 'Integer'
63
+ return data if data.instance_of?(Integer)
64
+ when 'Time'
65
+ return Time.parse(data)
66
+ when 'Date'
67
+ return Date.iso8601(data)
68
+ when 'String'
69
+ return data if data.instance_of?(String)
70
+ when 'Object' # "type: object"
71
+ return data if data.instance_of?(Hash)
72
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
73
+ if data.instance_of?(Array)
74
+ sub_type = Regexp.last_match[:sub_type]
75
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
76
+ end
77
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
78
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
79
+ sub_type = Regexp.last_match[:sub_type]
80
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
81
+ end
82
+ else # model
83
+ const = FactPulse.const_get(klass)
84
+ if const
85
+ if const.respond_to?(:openapi_any_of) # nested anyOf model
86
+ model = const.build(data)
87
+ return model if model
88
+ else
89
+ # raise if data contains keys that are not known to the model
90
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
91
+ model = const.build_from_hash(data)
92
+ return model if model
93
+ end
94
+ end
95
+ end
96
+
97
+ raise # if no match by now, raise
98
+ rescue
99
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
100
+ end
101
+ end
102
+ end
103
+
104
+ end
@@ -0,0 +1,104 @@
1
+ =begin
2
+ #API REST FactPulse
3
+
4
+ # 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/
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.18.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Montant TTC total
18
+ module MontantTtcTotal1
19
+ class << self
20
+ # List of class defined in anyOf (OpenAPI v3)
21
+ def openapi_any_of
22
+ [
23
+ :'Float',
24
+ :'String'
25
+ ]
26
+ end
27
+
28
+ # Builds the object
29
+ # @param [Mixed] Data to be matched against the list of anyOf items
30
+ # @return [Object] Returns the model or the data itself
31
+ def build(data)
32
+ # Go through the list of anyOf items and attempt to identify the appropriate one.
33
+ # Note:
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_any_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ return find_and_cast_into_type(klass, data)
42
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
43
+ end
44
+ end
45
+
46
+ openapi_any_of.include?(:AnyType) ? data : nil
47
+ end
48
+
49
+ private
50
+
51
+ SchemaMismatchError = Class.new(StandardError)
52
+
53
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
54
+ def find_and_cast_into_type(klass, data)
55
+ return if data.nil?
56
+
57
+ case klass.to_s
58
+ when 'Boolean'
59
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
60
+ when 'Float'
61
+ return data if data.instance_of?(Float)
62
+ when 'Integer'
63
+ return data if data.instance_of?(Integer)
64
+ when 'Time'
65
+ return Time.parse(data)
66
+ when 'Date'
67
+ return Date.iso8601(data)
68
+ when 'String'
69
+ return data if data.instance_of?(String)
70
+ when 'Object' # "type: object"
71
+ return data if data.instance_of?(Hash)
72
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
73
+ if data.instance_of?(Array)
74
+ sub_type = Regexp.last_match[:sub_type]
75
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
76
+ end
77
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
78
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
79
+ sub_type = Regexp.last_match[:sub_type]
80
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
81
+ end
82
+ else # model
83
+ const = FactPulse.const_get(klass)
84
+ if const
85
+ if const.respond_to?(:openapi_any_of) # nested anyOf model
86
+ model = const.build(data)
87
+ return model if model
88
+ else
89
+ # raise if data contains keys that are not known to the model
90
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
91
+ model = const.build_from_hash(data)
92
+ return model if model
93
+ end
94
+ end
95
+ end
96
+
97
+ raise # if no match by now, raise
98
+ rescue
99
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
100
+ end
101
+ end
102
+ end
103
+
104
+ end
@@ -0,0 +1,104 @@
1
+ =begin
2
+ #API REST FactPulse
3
+
4
+ # 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/
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.18.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Montant TVA
18
+ module MontantTva1
19
+ class << self
20
+ # List of class defined in anyOf (OpenAPI v3)
21
+ def openapi_any_of
22
+ [
23
+ :'Float',
24
+ :'String'
25
+ ]
26
+ end
27
+
28
+ # Builds the object
29
+ # @param [Mixed] Data to be matched against the list of anyOf items
30
+ # @return [Object] Returns the model or the data itself
31
+ def build(data)
32
+ # Go through the list of anyOf items and attempt to identify the appropriate one.
33
+ # Note:
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_any_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ return find_and_cast_into_type(klass, data)
42
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
43
+ end
44
+ end
45
+
46
+ openapi_any_of.include?(:AnyType) ? data : nil
47
+ end
48
+
49
+ private
50
+
51
+ SchemaMismatchError = Class.new(StandardError)
52
+
53
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
54
+ def find_and_cast_into_type(klass, data)
55
+ return if data.nil?
56
+
57
+ case klass.to_s
58
+ when 'Boolean'
59
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
60
+ when 'Float'
61
+ return data if data.instance_of?(Float)
62
+ when 'Integer'
63
+ return data if data.instance_of?(Integer)
64
+ when 'Time'
65
+ return Time.parse(data)
66
+ when 'Date'
67
+ return Date.iso8601(data)
68
+ when 'String'
69
+ return data if data.instance_of?(String)
70
+ when 'Object' # "type: object"
71
+ return data if data.instance_of?(Hash)
72
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
73
+ if data.instance_of?(Array)
74
+ sub_type = Regexp.last_match[:sub_type]
75
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
76
+ end
77
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
78
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
79
+ sub_type = Regexp.last_match[:sub_type]
80
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
81
+ end
82
+ else # model
83
+ const = FactPulse.const_get(klass)
84
+ if const
85
+ if const.respond_to?(:openapi_any_of) # nested anyOf model
86
+ model = const.build(data)
87
+ return model if model
88
+ else
89
+ # raise if data contains keys that are not known to the model
90
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
91
+ model = const.build_from_hash(data)
92
+ return model if model
93
+ end
94
+ end
95
+ end
96
+
97
+ raise # if no match by now, raise
98
+ rescue
99
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
100
+ end
101
+ end
102
+ end
103
+
104
+ end
@@ -73,7 +73,7 @@ module FactPulse
73
73
  # Attribute type mapping.
74
74
  def self.openapi_types
75
75
  {
76
- :'profil_facturx' => :'String',
76
+ :'profil_facturx' => :'ProfilAPI',
77
77
  :'auto_enrichir' => :'Boolean',
78
78
  :'valider' => :'Boolean',
79
79
  :'verifier_parametres_destination' => :'Boolean'
@@ -104,8 +104,6 @@ module FactPulse
104
104
 
105
105
  if attributes.key?(:'profil_facturx')
106
106
  self.profil_facturx = attributes[:'profil_facturx']
107
- else
108
- self.profil_facturx = 'EN16931'
109
107
  end
110
108
 
111
109
  if attributes.key?(:'auto_enrichir')
@@ -139,21 +137,9 @@ module FactPulse
139
137
  # @return true if the model is valid
140
138
  def valid?
141
139
  warn '[DEPRECATED] the `valid?` method is obsolete'
142
- profil_facturx_validator = EnumAttributeValidator.new('String', ["MINIMUM", "BASIC", "EN16931", "EXTENDED"])
143
- return false unless profil_facturx_validator.valid?(@profil_facturx)
144
140
  true
145
141
  end
146
142
 
147
- # Custom attribute writer method checking allowed values (enum).
148
- # @param [Object] profil_facturx Object to be assigned
149
- def profil_facturx=(profil_facturx)
150
- validator = EnumAttributeValidator.new('String', ["MINIMUM", "BASIC", "EN16931", "EXTENDED"])
151
- unless validator.valid?(profil_facturx)
152
- fail ArgumentError, "invalid value for \"profil_facturx\", must be one of #{validator.allowable_values}."
153
- end
154
- @profil_facturx = profil_facturx
155
- end
156
-
157
143
  # Checks equality by comparing each attribute.
158
144
  # @param [Object] Object to be compared
159
145
  def ==(o)
@@ -33,13 +33,10 @@ module FactPulse
33
33
 
34
34
  attr_accessor :numero_engagement
35
35
 
36
- # Montant HT total
37
36
  attr_accessor :montant_ht_total
38
37
 
39
- # Montant TVA
40
38
  attr_accessor :montant_tva
41
39
 
42
- # Montant TTC total
43
40
  attr_accessor :montant_ttc_total
44
41
 
45
42
  attr_accessor :piece_jointe_principale_id
@@ -93,9 +90,9 @@ module FactPulse
93
90
  :'id_structure_cpp' => :'Integer',
94
91
  :'code_service' => :'String',
95
92
  :'numero_engagement' => :'String',
96
- :'montant_ht_total' => :'String',
97
- :'montant_tva' => :'String',
98
- :'montant_ttc_total' => :'String',
93
+ :'montant_ht_total' => :'MontantHtTotal1',
94
+ :'montant_tva' => :'MontantTva1',
95
+ :'montant_ttc_total' => :'MontantTtcTotal1',
99
96
  :'piece_jointe_principale_id' => :'Integer',
100
97
  :'piece_jointe_principale_designation' => :'String',
101
98
  :'commentaire' => :'String',
@@ -46,7 +46,7 @@ module FactPulse
46
46
  {
47
47
  :'id_tache' => :'String',
48
48
  :'statut' => :'String',
49
- :'resultat' => :'AnyOf'
49
+ :'resultat' => :'Hash<String, Object>'
50
50
  }
51
51
  end
52
52
 
@@ -86,7 +86,9 @@ module FactPulse
86
86
  end
87
87
 
88
88
  if attributes.key?(:'resultat')
89
- self.resultat = attributes[:'resultat']
89
+ if (value = attributes[:'resultat']).is_a?(Hash)
90
+ self.resultat = value
91
+ end
90
92
  end
91
93
  end
92
94
 
@@ -11,5 +11,5 @@ Generator version: 7.18.0-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module FactPulse
14
- VERSION = '1.0.8'
14
+ VERSION = '1.0.13'
15
15
  end
data/lib/factpulse.rb CHANGED
@@ -67,11 +67,14 @@ require 'factpulse/models/ligne_de_tva'
67
67
  require 'factpulse/models/mode_depot'
68
68
  require 'factpulse/models/mode_paiement'
69
69
  require 'factpulse/models/montant_ht_total'
70
+ require 'factpulse/models/montant_ht_total1'
70
71
  require 'factpulse/models/montant_total'
71
72
  require 'factpulse/models/montant_total_acompte'
72
73
  require 'factpulse/models/montant_total_montant_remise_globale_ttc'
73
74
  require 'factpulse/models/montant_ttc_total'
75
+ require 'factpulse/models/montant_ttc_total1'
74
76
  require 'factpulse/models/montant_tva'
77
+ require 'factpulse/models/montant_tva1'
75
78
  require 'factpulse/models/montantapayer'
76
79
  require 'factpulse/models/montantbaseht'
77
80
  require 'factpulse/models/montanthttotal'
@@ -132,9 +135,7 @@ require 'factpulse/api/afnorpdppa_api'
132
135
  require 'factpulse/api/afnorpdppa_directory_service_api'
133
136
  require 'factpulse/api/afnorpdppa_flow_service_api'
134
137
  require 'factpulse/api/chorus_pro_api'
135
- require 'factpulse/api/processing_endpoints_unifis_api'
136
138
  require 'factpulse/api/sant_api'
137
- require 'factpulse/api/signature_lectronique_api'
138
139
  require 'factpulse/api/traitement_facture_api'
139
140
  require 'factpulse/api/utilisateur_api'
140
141
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factpulse
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
@@ -167,11 +167,14 @@ files:
167
167
  - docs/ModeDepot.md
168
168
  - docs/ModePaiement.md
169
169
  - docs/MontantHtTotal.md
170
+ - docs/MontantHtTotal1.md
170
171
  - docs/MontantTotal.md
171
172
  - docs/MontantTotalAcompte.md
172
173
  - docs/MontantTotalMontantRemiseGlobaleTtc.md
173
174
  - docs/MontantTtcTotal.md
175
+ - docs/MontantTtcTotal1.md
174
176
  - docs/MontantTva.md
177
+ - docs/MontantTva1.md
175
178
  - docs/Montantapayer.md
176
179
  - docs/Montantbaseht.md
177
180
  - docs/Montanthttotal.md
@@ -187,7 +190,6 @@ files:
187
190
  - docs/ParametresSignature.md
188
191
  - docs/ParametresStructure.md
189
192
  - docs/PieceJointeComplementaire.md
190
- - docs/ProcessingEndpointsUnifisApi.md
191
193
  - docs/ProfilAPI.md
192
194
  - docs/ProfilFlux.md
193
195
  - docs/Quantite.md
@@ -211,7 +213,6 @@ files:
211
213
  - docs/SchemeID.md
212
214
  - docs/ServiceStructure.md
213
215
  - docs/SignatureInfo.md
214
- - docs/SignatureLectroniqueApi.md
215
216
  - docs/SoumettreFactureCompleteRequest.md
216
217
  - docs/SoumettreFactureCompleteResponse.md
217
218
  - docs/SoumettreFactureRequest.md
@@ -238,9 +239,7 @@ files:
238
239
  - lib/factpulse/api/afnorpdppa_directory_service_api.rb
239
240
  - lib/factpulse/api/afnorpdppa_flow_service_api.rb
240
241
  - lib/factpulse/api/chorus_pro_api.rb
241
- - lib/factpulse/api/processing_endpoints_unifis_api.rb
242
242
  - lib/factpulse/api/sant_api.rb
243
- - lib/factpulse/api/signature_lectronique_api.rb
244
243
  - lib/factpulse/api/traitement_facture_api.rb
245
244
  - lib/factpulse/api/utilisateur_api.rb
246
245
  - lib/factpulse/api_client.rb
@@ -296,11 +295,14 @@ files:
296
295
  - lib/factpulse/models/mode_depot.rb
297
296
  - lib/factpulse/models/mode_paiement.rb
298
297
  - lib/factpulse/models/montant_ht_total.rb
298
+ - lib/factpulse/models/montant_ht_total1.rb
299
299
  - lib/factpulse/models/montant_total.rb
300
300
  - lib/factpulse/models/montant_total_acompte.rb
301
301
  - lib/factpulse/models/montant_total_montant_remise_globale_ttc.rb
302
302
  - lib/factpulse/models/montant_ttc_total.rb
303
+ - lib/factpulse/models/montant_ttc_total1.rb
303
304
  - lib/factpulse/models/montant_tva.rb
305
+ - lib/factpulse/models/montant_tva1.rb
304
306
  - lib/factpulse/models/montantapayer.rb
305
307
  - lib/factpulse/models/montantbaseht.rb
306
308
  - lib/factpulse/models/montanthttotal.rb