factpulse 1.0.15 → 2.0.3
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 +4 -4
- data/CHANGELOG.md +3 -3
- data/Gemfile.lock +1 -1
- data/docs/AFNORPDPPADirectoryServiceApi.md +1055 -28
- data/docs/LigneDePoste.md +2 -2
- data/docs/LigneDeTVA.md +2 -2
- data/docs/{Montanttva.md → MontantAPayer.md} +2 -2
- data/docs/{Montanttva1.md → MontantBaseHt.md} +2 -2
- data/docs/{Montantapayer.md → MontantRemiseGlobaleTtc.md} +2 -2
- data/docs/MontantTotal.md +5 -5
- data/docs/{Montanthttotal.md → MontantTotalLigneHt.md} +2 -2
- data/docs/{Montantttctotal.md → MontantUnitaireHt.md} +2 -2
- data/docs/PDPCredentials.md +2 -0
- data/lib/factpulse/api/afnorpdppa_directory_service_api.rb +1011 -27
- data/lib/factpulse/models/ligne_de_poste.rb +2 -2
- data/lib/factpulse/models/ligne_de_tva.rb +2 -2
- data/lib/factpulse/models/{montantapayer.rb → montant_a_payer.rb} +1 -1
- data/lib/factpulse/models/{montantbaseht.rb → montant_base_ht.rb} +1 -1
- data/lib/factpulse/models/montant_ht_total.rb +1 -0
- data/lib/factpulse/models/{montant_total_montant_remise_globale_ttc.rb → montant_remise_globale_ttc.rb} +1 -1
- data/lib/factpulse/models/montant_total.rb +5 -5
- data/lib/factpulse/models/{ligne_de_poste_montant_total_ligne_ht.rb → montant_total_ligne_ht.rb} +1 -1
- data/lib/factpulse/models/montant_ttc_total.rb +1 -0
- data/lib/factpulse/models/montant_tva.rb +1 -0
- data/lib/factpulse/models/montant_tva1.rb +1 -1
- data/lib/factpulse/models/{montantunitaireht.rb → montant_unitaire_ht.rb} +1 -1
- data/lib/factpulse/models/pdp_credentials.rb +11 -1
- data/lib/factpulse/version.rb +1 -1
- data/lib/factpulse.rb +5 -9
- metadata +12 -20
- data/docs/LigneDePosteMontantTotalLigneHt.md +0 -15
- data/docs/MontantTotalMontantRemiseGlobaleTtc.md +0 -15
- data/docs/Montantbaseht.md +0 -15
- data/docs/Montantunitaireht.md +0 -15
- data/lib/factpulse/models/montanthttotal.rb +0 -104
- data/lib/factpulse/models/montantttctotal.rb +0 -104
- data/lib/factpulse/models/montanttva.rb +0 -104
- data/lib/factpulse/models/montanttva1.rb +0 -104
|
@@ -107,9 +107,9 @@ module FactPulse
|
|
|
107
107
|
:'denomination' => :'String',
|
|
108
108
|
:'quantite' => :'Quantite',
|
|
109
109
|
:'unite' => :'Unite',
|
|
110
|
-
:'montant_unitaire_ht' => :'
|
|
110
|
+
:'montant_unitaire_ht' => :'MontantUnitaireHt',
|
|
111
111
|
:'montant_remise_ht' => :'LigneDePosteMontantRemiseHt',
|
|
112
|
-
:'montant_total_ligne_ht' => :'
|
|
112
|
+
:'montant_total_ligne_ht' => :'MontantTotalLigneHt',
|
|
113
113
|
:'taux_tva' => :'String',
|
|
114
114
|
:'taux_tva_manuel' => :'LigneDePosteTauxTvaManuel',
|
|
115
115
|
:'categorie_tva' => :'CategorieTVA',
|
|
@@ -72,8 +72,8 @@ module FactPulse
|
|
|
72
72
|
# Attribute type mapping.
|
|
73
73
|
def self.openapi_types
|
|
74
74
|
{
|
|
75
|
-
:'montant_base_ht' => :'
|
|
76
|
-
:'montant_tva' => :'
|
|
75
|
+
:'montant_base_ht' => :'MontantBaseHt',
|
|
76
|
+
:'montant_tva' => :'MontantTva',
|
|
77
77
|
:'taux' => :'String',
|
|
78
78
|
:'taux_manuel' => :'Tauxmanuel',
|
|
79
79
|
:'categorie' => :'CategorieTVA'
|
|
@@ -56,12 +56,12 @@ module FactPulse
|
|
|
56
56
|
# Attribute type mapping.
|
|
57
57
|
def self.openapi_types
|
|
58
58
|
{
|
|
59
|
-
:'montant_ht_total' => :'
|
|
60
|
-
:'montant_tva' => :'
|
|
61
|
-
:'montant_ttc_total' => :'
|
|
62
|
-
:'montant_a_payer' => :'
|
|
59
|
+
:'montant_ht_total' => :'MontantHtTotal',
|
|
60
|
+
:'montant_tva' => :'MontantTva1',
|
|
61
|
+
:'montant_ttc_total' => :'MontantTtcTotal',
|
|
62
|
+
:'montant_a_payer' => :'MontantAPayer',
|
|
63
63
|
:'acompte' => :'MontantTotalAcompte',
|
|
64
|
-
:'montant_remise_globale_ttc' => :'
|
|
64
|
+
:'montant_remise_globale_ttc' => :'MontantRemiseGlobaleTtc',
|
|
65
65
|
:'motif_remise_globale_ttc' => :'String'
|
|
66
66
|
}
|
|
67
67
|
end
|
data/lib/factpulse/models/{ligne_de_poste_montant_total_ligne_ht.rb → montant_total_ligne_ht.rb}
RENAMED
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module FactPulse
|
|
17
17
|
# Montant total HT de la ligne (quantité × prix unitaire - remise).
|
|
18
|
-
module
|
|
18
|
+
module MontantTotalLigneHt
|
|
19
19
|
class << self
|
|
20
20
|
# List of class defined in anyOf (OpenAPI v3)
|
|
21
21
|
def openapi_any_of
|
|
@@ -19,6 +19,8 @@ module FactPulse
|
|
|
19
19
|
# URL de base du Flow Service AFNOR
|
|
20
20
|
attr_accessor :flow_service_url
|
|
21
21
|
|
|
22
|
+
attr_accessor :directory_service_url
|
|
23
|
+
|
|
22
24
|
# URL du serveur OAuth2
|
|
23
25
|
attr_accessor :token_url
|
|
24
26
|
|
|
@@ -32,6 +34,7 @@ module FactPulse
|
|
|
32
34
|
def self.attribute_map
|
|
33
35
|
{
|
|
34
36
|
:'flow_service_url' => :'flow_service_url',
|
|
37
|
+
:'directory_service_url' => :'directory_service_url',
|
|
35
38
|
:'token_url' => :'token_url',
|
|
36
39
|
:'client_id' => :'client_id',
|
|
37
40
|
:'client_secret' => :'client_secret'
|
|
@@ -52,6 +55,7 @@ module FactPulse
|
|
|
52
55
|
def self.openapi_types
|
|
53
56
|
{
|
|
54
57
|
:'flow_service_url' => :'String',
|
|
58
|
+
:'directory_service_url' => :'String',
|
|
55
59
|
:'token_url' => :'String',
|
|
56
60
|
:'client_id' => :'String',
|
|
57
61
|
:'client_secret' => :'String'
|
|
@@ -61,6 +65,7 @@ module FactPulse
|
|
|
61
65
|
# List of attributes with nullable: true
|
|
62
66
|
def self.openapi_nullable
|
|
63
67
|
Set.new([
|
|
68
|
+
:'directory_service_url',
|
|
64
69
|
])
|
|
65
70
|
end
|
|
66
71
|
|
|
@@ -86,6 +91,10 @@ module FactPulse
|
|
|
86
91
|
self.flow_service_url = nil
|
|
87
92
|
end
|
|
88
93
|
|
|
94
|
+
if attributes.key?(:'directory_service_url')
|
|
95
|
+
self.directory_service_url = attributes[:'directory_service_url']
|
|
96
|
+
end
|
|
97
|
+
|
|
89
98
|
if attributes.key?(:'token_url')
|
|
90
99
|
self.token_url = attributes[:'token_url']
|
|
91
100
|
else
|
|
@@ -186,6 +195,7 @@ module FactPulse
|
|
|
186
195
|
return true if self.equal?(o)
|
|
187
196
|
self.class == o.class &&
|
|
188
197
|
flow_service_url == o.flow_service_url &&
|
|
198
|
+
directory_service_url == o.directory_service_url &&
|
|
189
199
|
token_url == o.token_url &&
|
|
190
200
|
client_id == o.client_id &&
|
|
191
201
|
client_secret == o.client_secret
|
|
@@ -200,7 +210,7 @@ module FactPulse
|
|
|
200
210
|
# Calculates hash code according to all attributes.
|
|
201
211
|
# @return [Integer] Hash code
|
|
202
212
|
def hash
|
|
203
|
-
[flow_service_url, token_url, client_id, client_secret].hash
|
|
213
|
+
[flow_service_url, directory_service_url, token_url, client_id, client_secret].hash
|
|
204
214
|
end
|
|
205
215
|
|
|
206
216
|
# Builds the object from hash
|
data/lib/factpulse/version.rb
CHANGED
data/lib/factpulse.rb
CHANGED
|
@@ -61,27 +61,23 @@ require 'factpulse/models/http_validation_error'
|
|
|
61
61
|
require 'factpulse/models/information_signature_api'
|
|
62
62
|
require 'factpulse/models/ligne_de_poste'
|
|
63
63
|
require 'factpulse/models/ligne_de_poste_montant_remise_ht'
|
|
64
|
-
require 'factpulse/models/ligne_de_poste_montant_total_ligne_ht'
|
|
65
64
|
require 'factpulse/models/ligne_de_poste_taux_tva_manuel'
|
|
66
65
|
require 'factpulse/models/ligne_de_tva'
|
|
67
66
|
require 'factpulse/models/mode_depot'
|
|
68
67
|
require 'factpulse/models/mode_paiement'
|
|
68
|
+
require 'factpulse/models/montant_a_payer'
|
|
69
|
+
require 'factpulse/models/montant_base_ht'
|
|
69
70
|
require 'factpulse/models/montant_ht_total'
|
|
70
71
|
require 'factpulse/models/montant_ht_total1'
|
|
72
|
+
require 'factpulse/models/montant_remise_globale_ttc'
|
|
71
73
|
require 'factpulse/models/montant_total'
|
|
72
74
|
require 'factpulse/models/montant_total_acompte'
|
|
73
|
-
require 'factpulse/models/
|
|
75
|
+
require 'factpulse/models/montant_total_ligne_ht'
|
|
74
76
|
require 'factpulse/models/montant_ttc_total'
|
|
75
77
|
require 'factpulse/models/montant_ttc_total1'
|
|
76
78
|
require 'factpulse/models/montant_tva'
|
|
77
79
|
require 'factpulse/models/montant_tva1'
|
|
78
|
-
require 'factpulse/models/
|
|
79
|
-
require 'factpulse/models/montantbaseht'
|
|
80
|
-
require 'factpulse/models/montanthttotal'
|
|
81
|
-
require 'factpulse/models/montantttctotal'
|
|
82
|
-
require 'factpulse/models/montanttva'
|
|
83
|
-
require 'factpulse/models/montanttva1'
|
|
84
|
-
require 'factpulse/models/montantunitaireht'
|
|
80
|
+
require 'factpulse/models/montant_unitaire_ht'
|
|
85
81
|
require 'factpulse/models/obtenir_id_chorus_pro_request'
|
|
86
82
|
require 'factpulse/models/obtenir_id_chorus_pro_response'
|
|
87
83
|
require 'factpulse/models/options_processing'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: factpulse
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenAPI-Generator
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|
|
@@ -161,27 +161,23 @@ files:
|
|
|
161
161
|
- docs/InformationSignatureAPI.md
|
|
162
162
|
- docs/LigneDePoste.md
|
|
163
163
|
- docs/LigneDePosteMontantRemiseHt.md
|
|
164
|
-
- docs/LigneDePosteMontantTotalLigneHt.md
|
|
165
164
|
- docs/LigneDePosteTauxTvaManuel.md
|
|
166
165
|
- docs/LigneDeTVA.md
|
|
167
166
|
- docs/ModeDepot.md
|
|
168
167
|
- docs/ModePaiement.md
|
|
168
|
+
- docs/MontantAPayer.md
|
|
169
|
+
- docs/MontantBaseHt.md
|
|
169
170
|
- docs/MontantHtTotal.md
|
|
170
171
|
- docs/MontantHtTotal1.md
|
|
172
|
+
- docs/MontantRemiseGlobaleTtc.md
|
|
171
173
|
- docs/MontantTotal.md
|
|
172
174
|
- docs/MontantTotalAcompte.md
|
|
173
|
-
- docs/
|
|
175
|
+
- docs/MontantTotalLigneHt.md
|
|
174
176
|
- docs/MontantTtcTotal.md
|
|
175
177
|
- docs/MontantTtcTotal1.md
|
|
176
178
|
- docs/MontantTva.md
|
|
177
179
|
- docs/MontantTva1.md
|
|
178
|
-
- docs/
|
|
179
|
-
- docs/Montantbaseht.md
|
|
180
|
-
- docs/Montanthttotal.md
|
|
181
|
-
- docs/Montantttctotal.md
|
|
182
|
-
- docs/Montanttva.md
|
|
183
|
-
- docs/Montanttva1.md
|
|
184
|
-
- docs/Montantunitaireht.md
|
|
180
|
+
- docs/MontantUnitaireHt.md
|
|
185
181
|
- docs/ObtenirIdChorusProRequest.md
|
|
186
182
|
- docs/ObtenirIdChorusProResponse.md
|
|
187
183
|
- docs/OptionsProcessing.md
|
|
@@ -289,27 +285,23 @@ files:
|
|
|
289
285
|
- lib/factpulse/models/information_signature_api.rb
|
|
290
286
|
- lib/factpulse/models/ligne_de_poste.rb
|
|
291
287
|
- lib/factpulse/models/ligne_de_poste_montant_remise_ht.rb
|
|
292
|
-
- lib/factpulse/models/ligne_de_poste_montant_total_ligne_ht.rb
|
|
293
288
|
- lib/factpulse/models/ligne_de_poste_taux_tva_manuel.rb
|
|
294
289
|
- lib/factpulse/models/ligne_de_tva.rb
|
|
295
290
|
- lib/factpulse/models/mode_depot.rb
|
|
296
291
|
- lib/factpulse/models/mode_paiement.rb
|
|
292
|
+
- lib/factpulse/models/montant_a_payer.rb
|
|
293
|
+
- lib/factpulse/models/montant_base_ht.rb
|
|
297
294
|
- lib/factpulse/models/montant_ht_total.rb
|
|
298
295
|
- lib/factpulse/models/montant_ht_total1.rb
|
|
296
|
+
- lib/factpulse/models/montant_remise_globale_ttc.rb
|
|
299
297
|
- lib/factpulse/models/montant_total.rb
|
|
300
298
|
- lib/factpulse/models/montant_total_acompte.rb
|
|
301
|
-
- lib/factpulse/models/
|
|
299
|
+
- lib/factpulse/models/montant_total_ligne_ht.rb
|
|
302
300
|
- lib/factpulse/models/montant_ttc_total.rb
|
|
303
301
|
- lib/factpulse/models/montant_ttc_total1.rb
|
|
304
302
|
- lib/factpulse/models/montant_tva.rb
|
|
305
303
|
- lib/factpulse/models/montant_tva1.rb
|
|
306
|
-
- lib/factpulse/models/
|
|
307
|
-
- lib/factpulse/models/montantbaseht.rb
|
|
308
|
-
- lib/factpulse/models/montanthttotal.rb
|
|
309
|
-
- lib/factpulse/models/montantttctotal.rb
|
|
310
|
-
- lib/factpulse/models/montanttva.rb
|
|
311
|
-
- lib/factpulse/models/montanttva1.rb
|
|
312
|
-
- lib/factpulse/models/montantunitaireht.rb
|
|
304
|
+
- lib/factpulse/models/montant_unitaire_ht.rb
|
|
313
305
|
- lib/factpulse/models/obtenir_id_chorus_pro_request.rb
|
|
314
306
|
- lib/factpulse/models/obtenir_id_chorus_pro_response.rb
|
|
315
307
|
- lib/factpulse/models/options_processing.rb
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# FactPulse::LigneDePosteMontantTotalLigneHt
|
|
2
|
-
|
|
3
|
-
## Properties
|
|
4
|
-
|
|
5
|
-
| Name | Type | Description | Notes |
|
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
|
|
8
|
-
## Example
|
|
9
|
-
|
|
10
|
-
```ruby
|
|
11
|
-
require 'factpulse'
|
|
12
|
-
|
|
13
|
-
instance = FactPulse::LigneDePosteMontantTotalLigneHt.new()
|
|
14
|
-
```
|
|
15
|
-
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# FactPulse::MontantTotalMontantRemiseGlobaleTtc
|
|
2
|
-
|
|
3
|
-
## Properties
|
|
4
|
-
|
|
5
|
-
| Name | Type | Description | Notes |
|
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
|
|
8
|
-
## Example
|
|
9
|
-
|
|
10
|
-
```ruby
|
|
11
|
-
require 'factpulse'
|
|
12
|
-
|
|
13
|
-
instance = FactPulse::MontantTotalMontantRemiseGlobaleTtc.new()
|
|
14
|
-
```
|
|
15
|
-
|
data/docs/Montantbaseht.md
DELETED
data/docs/Montantunitaireht.md
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
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 total HT.
|
|
18
|
-
module Montanthttotal
|
|
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
|
|
@@ -1,104 +0,0 @@
|
|
|
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 total TTC.
|
|
18
|
-
module Montantttctotal
|
|
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
|