factpulse 2.0.35 → 2.0.36

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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -3
  3. data/Gemfile.lock +1 -1
  4. data/docs/BoundingBoxSchema.md +30 -0
  5. data/docs/CadreDeFacturation.md +2 -0
  6. data/docs/ChampVerifieSchema.md +34 -0
  7. data/docs/DimensionPageSchema.md +20 -0
  8. data/docs/DirectionFlux.md +15 -0
  9. data/docs/FluxResume.md +32 -0
  10. data/docs/LigneDeTVA.md +5 -1
  11. data/docs/NatureOperation.md +15 -0
  12. data/docs/NoteObligatoireSchema.md +30 -0
  13. data/docs/PDPCredentials.md +26 -0
  14. data/docs/ProfilFlux.md +15 -0
  15. data/docs/ReponseHealthcheckAFNOR.md +22 -0
  16. data/docs/ReponseRechercheFlux.md +24 -0
  17. data/docs/ReponseSoumissionFlux.md +30 -0
  18. data/docs/ReponseVerificationSucces.md +36 -0
  19. data/docs/RequeteRechercheFlux.md +34 -0
  20. data/docs/RequeteSoumissionFlux.md +28 -0
  21. data/docs/StatutAcquittement.md +15 -0
  22. data/docs/StatutChampAPI.md +15 -0
  23. data/docs/SyntaxeFlux.md +15 -0
  24. data/docs/TraitementFactureApi.md +2 -2
  25. data/docs/TypeFlux.md +15 -0
  26. data/docs/VrificationPDFXMLApi.md +435 -0
  27. data/lib/factpulse/api/traitement_facture_api.rb +4 -4
  28. data/lib/factpulse/api/vrification_pdfxml_api.rb +430 -0
  29. data/lib/factpulse/helpers/client.rb +2 -1
  30. data/lib/factpulse/models/bounding_box_schema.rb +332 -0
  31. data/lib/factpulse/models/cadre_de_facturation.rb +12 -2
  32. data/lib/factpulse/models/champ_verifie_schema.rb +334 -0
  33. data/lib/factpulse/models/dimension_page_schema.rb +193 -0
  34. data/lib/factpulse/models/direction_flux.rb +40 -0
  35. data/lib/factpulse/models/flux_resume.rb +251 -0
  36. data/lib/factpulse/models/ligne_de_tva.rb +26 -6
  37. data/lib/factpulse/models/nature_operation.rb +66 -0
  38. data/lib/factpulse/models/note_obligatoire_schema.rb +265 -0
  39. data/lib/factpulse/models/pdp_credentials.rb +257 -0
  40. data/lib/factpulse/models/profil_flux.rb +41 -0
  41. data/lib/factpulse/models/reponse_healthcheck_afnor.rb +220 -0
  42. data/lib/factpulse/models/reponse_recherche_flux.rb +249 -0
  43. data/lib/factpulse/models/reponse_soumission_flux.rb +294 -0
  44. data/lib/factpulse/models/reponse_verification_succes.rb +343 -0
  45. data/lib/factpulse/models/requete_recherche_flux.rb +306 -0
  46. data/lib/factpulse/models/requete_soumission_flux.rb +238 -0
  47. data/lib/factpulse/models/statut_acquittement.rb +41 -0
  48. data/lib/factpulse/models/statut_champ_api.rb +43 -0
  49. data/lib/factpulse/models/syntaxe_flux.rb +43 -0
  50. data/lib/factpulse/models/type_flux.rb +43 -0
  51. data/lib/factpulse/version.rb +1 -1
  52. data/lib/factpulse.rb +20 -0
  53. metadata +42 -2
@@ -0,0 +1,343 @@
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\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```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\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **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
+ # Réponse de vérification réussie avec données unifiées.
18
+ class ReponseVerificationSucces < ApiModelBase
19
+ # True si aucun écart critique
20
+ attr_accessor :est_conforme
21
+
22
+ # Score de conformité (0-100%)
23
+ attr_accessor :score_conformite
24
+
25
+ # Nombre de champs vérifiés
26
+ attr_accessor :champs_verifies
27
+
28
+ # Nombre de champs conformes
29
+ attr_accessor :champs_conformes
30
+
31
+ # True si le PDF contient du XML Factur-X
32
+ attr_accessor :est_facturx
33
+
34
+ attr_accessor :profil_facturx
35
+
36
+ # Liste des champs vérifiés avec valeurs, statuts et coordonnées PDF
37
+ attr_accessor :champs
38
+
39
+ # Notes obligatoires (PMT, PMD, AAB) avec localisation PDF
40
+ attr_accessor :notes_obligatoires
41
+
42
+ # Dimensions de chaque page du PDF (largeur, hauteur)
43
+ attr_accessor :dimensions_pages
44
+
45
+ # Avertissements non bloquants
46
+ attr_accessor :avertissements
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'est_conforme' => :'est_conforme',
52
+ :'score_conformite' => :'score_conformite',
53
+ :'champs_verifies' => :'champs_verifies',
54
+ :'champs_conformes' => :'champs_conformes',
55
+ :'est_facturx' => :'est_facturx',
56
+ :'profil_facturx' => :'profil_facturx',
57
+ :'champs' => :'champs',
58
+ :'notes_obligatoires' => :'notes_obligatoires',
59
+ :'dimensions_pages' => :'dimensions_pages',
60
+ :'avertissements' => :'avertissements'
61
+ }
62
+ end
63
+
64
+ # Returns attribute mapping this model knows about
65
+ def self.acceptable_attribute_map
66
+ attribute_map
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ acceptable_attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'est_conforme' => :'Boolean',
78
+ :'score_conformite' => :'Float',
79
+ :'champs_verifies' => :'Integer',
80
+ :'champs_conformes' => :'Integer',
81
+ :'est_facturx' => :'Boolean',
82
+ :'profil_facturx' => :'String',
83
+ :'champs' => :'Array<ChampVerifieSchema>',
84
+ :'notes_obligatoires' => :'Array<NoteObligatoireSchema>',
85
+ :'dimensions_pages' => :'Array<DimensionPageSchema>',
86
+ :'avertissements' => :'Array<String>'
87
+ }
88
+ end
89
+
90
+ # List of attributes with nullable: true
91
+ def self.openapi_nullable
92
+ Set.new([
93
+ :'profil_facturx',
94
+ ])
95
+ end
96
+
97
+ # Initializes the object
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ def initialize(attributes = {})
100
+ if (!attributes.is_a?(Hash))
101
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::ReponseVerificationSucces` initialize method"
102
+ end
103
+
104
+ # check to see if the attribute exists and convert string to symbol for hash key
105
+ acceptable_attribute_map = self.class.acceptable_attribute_map
106
+ attributes = attributes.each_with_object({}) { |(k, v), h|
107
+ if (!acceptable_attribute_map.key?(k.to_sym))
108
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::ReponseVerificationSucces`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
109
+ end
110
+ h[k.to_sym] = v
111
+ }
112
+
113
+ if attributes.key?(:'est_conforme')
114
+ self.est_conforme = attributes[:'est_conforme']
115
+ else
116
+ self.est_conforme = nil
117
+ end
118
+
119
+ if attributes.key?(:'score_conformite')
120
+ self.score_conformite = attributes[:'score_conformite']
121
+ else
122
+ self.score_conformite = nil
123
+ end
124
+
125
+ if attributes.key?(:'champs_verifies')
126
+ self.champs_verifies = attributes[:'champs_verifies']
127
+ else
128
+ self.champs_verifies = 0
129
+ end
130
+
131
+ if attributes.key?(:'champs_conformes')
132
+ self.champs_conformes = attributes[:'champs_conformes']
133
+ else
134
+ self.champs_conformes = 0
135
+ end
136
+
137
+ if attributes.key?(:'est_facturx')
138
+ self.est_facturx = attributes[:'est_facturx']
139
+ else
140
+ self.est_facturx = false
141
+ end
142
+
143
+ if attributes.key?(:'profil_facturx')
144
+ self.profil_facturx = attributes[:'profil_facturx']
145
+ end
146
+
147
+ if attributes.key?(:'champs')
148
+ if (value = attributes[:'champs']).is_a?(Array)
149
+ self.champs = value
150
+ end
151
+ end
152
+
153
+ if attributes.key?(:'notes_obligatoires')
154
+ if (value = attributes[:'notes_obligatoires']).is_a?(Array)
155
+ self.notes_obligatoires = value
156
+ end
157
+ end
158
+
159
+ if attributes.key?(:'dimensions_pages')
160
+ if (value = attributes[:'dimensions_pages']).is_a?(Array)
161
+ self.dimensions_pages = value
162
+ end
163
+ end
164
+
165
+ if attributes.key?(:'avertissements')
166
+ if (value = attributes[:'avertissements']).is_a?(Array)
167
+ self.avertissements = value
168
+ end
169
+ end
170
+ end
171
+
172
+ # Show invalid properties with the reasons. Usually used together with valid?
173
+ # @return Array for valid properties with the reasons
174
+ def list_invalid_properties
175
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
176
+ invalid_properties = Array.new
177
+ if @est_conforme.nil?
178
+ invalid_properties.push('invalid value for "est_conforme", est_conforme cannot be nil.')
179
+ end
180
+
181
+ if @score_conformite.nil?
182
+ invalid_properties.push('invalid value for "score_conformite", score_conformite cannot be nil.')
183
+ end
184
+
185
+ if @score_conformite > 100.0
186
+ invalid_properties.push('invalid value for "score_conformite", must be smaller than or equal to 100.0.')
187
+ end
188
+
189
+ if @score_conformite < 0.0
190
+ invalid_properties.push('invalid value for "score_conformite", must be greater than or equal to 0.0.')
191
+ end
192
+
193
+ if !@champs_verifies.nil? && @champs_verifies < 0
194
+ invalid_properties.push('invalid value for "champs_verifies", must be greater than or equal to 0.')
195
+ end
196
+
197
+ if !@champs_conformes.nil? && @champs_conformes < 0
198
+ invalid_properties.push('invalid value for "champs_conformes", must be greater than or equal to 0.')
199
+ end
200
+
201
+ invalid_properties
202
+ end
203
+
204
+ # Check to see if the all the properties in the model are valid
205
+ # @return true if the model is valid
206
+ def valid?
207
+ warn '[DEPRECATED] the `valid?` method is obsolete'
208
+ return false if @est_conforme.nil?
209
+ return false if @score_conformite.nil?
210
+ return false if @score_conformite > 100.0
211
+ return false if @score_conformite < 0.0
212
+ return false if !@champs_verifies.nil? && @champs_verifies < 0
213
+ return false if !@champs_conformes.nil? && @champs_conformes < 0
214
+ true
215
+ end
216
+
217
+ # Custom attribute writer method with validation
218
+ # @param [Object] est_conforme Value to be assigned
219
+ def est_conforme=(est_conforme)
220
+ if est_conforme.nil?
221
+ fail ArgumentError, 'est_conforme cannot be nil'
222
+ end
223
+
224
+ @est_conforme = est_conforme
225
+ end
226
+
227
+ # Custom attribute writer method with validation
228
+ # @param [Object] score_conformite Value to be assigned
229
+ def score_conformite=(score_conformite)
230
+ if score_conformite.nil?
231
+ fail ArgumentError, 'score_conformite cannot be nil'
232
+ end
233
+
234
+ if score_conformite > 100.0
235
+ fail ArgumentError, 'invalid value for "score_conformite", must be smaller than or equal to 100.0.'
236
+ end
237
+
238
+ if score_conformite < 0.0
239
+ fail ArgumentError, 'invalid value for "score_conformite", must be greater than or equal to 0.0.'
240
+ end
241
+
242
+ @score_conformite = score_conformite
243
+ end
244
+
245
+ # Custom attribute writer method with validation
246
+ # @param [Object] champs_verifies Value to be assigned
247
+ def champs_verifies=(champs_verifies)
248
+ if champs_verifies.nil?
249
+ fail ArgumentError, 'champs_verifies cannot be nil'
250
+ end
251
+
252
+ if champs_verifies < 0
253
+ fail ArgumentError, 'invalid value for "champs_verifies", must be greater than or equal to 0.'
254
+ end
255
+
256
+ @champs_verifies = champs_verifies
257
+ end
258
+
259
+ # Custom attribute writer method with validation
260
+ # @param [Object] champs_conformes Value to be assigned
261
+ def champs_conformes=(champs_conformes)
262
+ if champs_conformes.nil?
263
+ fail ArgumentError, 'champs_conformes cannot be nil'
264
+ end
265
+
266
+ if champs_conformes < 0
267
+ fail ArgumentError, 'invalid value for "champs_conformes", must be greater than or equal to 0.'
268
+ end
269
+
270
+ @champs_conformes = champs_conformes
271
+ end
272
+
273
+ # Checks equality by comparing each attribute.
274
+ # @param [Object] Object to be compared
275
+ def ==(o)
276
+ return true if self.equal?(o)
277
+ self.class == o.class &&
278
+ est_conforme == o.est_conforme &&
279
+ score_conformite == o.score_conformite &&
280
+ champs_verifies == o.champs_verifies &&
281
+ champs_conformes == o.champs_conformes &&
282
+ est_facturx == o.est_facturx &&
283
+ profil_facturx == o.profil_facturx &&
284
+ champs == o.champs &&
285
+ notes_obligatoires == o.notes_obligatoires &&
286
+ dimensions_pages == o.dimensions_pages &&
287
+ avertissements == o.avertissements
288
+ end
289
+
290
+ # @see the `==` method
291
+ # @param [Object] Object to be compared
292
+ def eql?(o)
293
+ self == o
294
+ end
295
+
296
+ # Calculates hash code according to all attributes.
297
+ # @return [Integer] Hash code
298
+ def hash
299
+ [est_conforme, score_conformite, champs_verifies, champs_conformes, est_facturx, profil_facturx, champs, notes_obligatoires, dimensions_pages, avertissements].hash
300
+ end
301
+
302
+ # Builds the object from hash
303
+ # @param [Hash] attributes Model attributes in the form of hash
304
+ # @return [Object] Returns the model itself
305
+ def self.build_from_hash(attributes)
306
+ return nil unless attributes.is_a?(Hash)
307
+ attributes = attributes.transform_keys(&:to_sym)
308
+ transformed_hash = {}
309
+ openapi_types.each_pair do |key, type|
310
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
311
+ transformed_hash["#{key}"] = nil
312
+ elsif type =~ /\AArray<(.*)>/i
313
+ # check to ensure the input is an array given that the attribute
314
+ # is documented as an array but the input is not
315
+ if attributes[attribute_map[key]].is_a?(Array)
316
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
317
+ end
318
+ elsif !attributes[attribute_map[key]].nil?
319
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
320
+ end
321
+ end
322
+ new(transformed_hash)
323
+ end
324
+
325
+ # Returns the object in the form of hash
326
+ # @return [Hash] Returns the object in the form of hash
327
+ def to_hash
328
+ hash = {}
329
+ self.class.attribute_map.each_pair do |attr, param|
330
+ value = self.send(attr)
331
+ if value.nil?
332
+ is_nullable = self.class.openapi_nullable.include?(attr)
333
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
334
+ end
335
+
336
+ hash[param] = _to_hash(value)
337
+ end
338
+ hash
339
+ end
340
+
341
+ end
342
+
343
+ end
@@ -0,0 +1,306 @@
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\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```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\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **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
+ # Requête pour rechercher des flux soumis
18
+ class RequeteRechercheFlux < ApiModelBase
19
+ attr_accessor :date_maj_apres
20
+
21
+ attr_accessor :date_maj_avant
22
+
23
+ attr_accessor :type_flux
24
+
25
+ attr_accessor :direction_flux
26
+
27
+ attr_accessor :tracking_id
28
+
29
+ attr_accessor :flow_id
30
+
31
+ attr_accessor :statut_acquittement
32
+
33
+ # Décalage pour la pagination
34
+ attr_accessor :offset
35
+
36
+ # Nombre maximum de résultats (max 100)
37
+ attr_accessor :limit
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'date_maj_apres' => :'date_maj_apres',
65
+ :'date_maj_avant' => :'date_maj_avant',
66
+ :'type_flux' => :'type_flux',
67
+ :'direction_flux' => :'direction_flux',
68
+ :'tracking_id' => :'tracking_id',
69
+ :'flow_id' => :'flow_id',
70
+ :'statut_acquittement' => :'statut_acquittement',
71
+ :'offset' => :'offset',
72
+ :'limit' => :'limit'
73
+ }
74
+ end
75
+
76
+ # Returns attribute mapping this model knows about
77
+ def self.acceptable_attribute_map
78
+ attribute_map
79
+ end
80
+
81
+ # Returns all the JSON keys this model knows about
82
+ def self.acceptable_attributes
83
+ acceptable_attribute_map.values
84
+ end
85
+
86
+ # Attribute type mapping.
87
+ def self.openapi_types
88
+ {
89
+ :'date_maj_apres' => :'Time',
90
+ :'date_maj_avant' => :'Time',
91
+ :'type_flux' => :'Array<TypeFlux>',
92
+ :'direction_flux' => :'Array<DirectionFlux>',
93
+ :'tracking_id' => :'String',
94
+ :'flow_id' => :'String',
95
+ :'statut_acquittement' => :'StatutAcquittement',
96
+ :'offset' => :'Integer',
97
+ :'limit' => :'Integer'
98
+ }
99
+ end
100
+
101
+ # List of attributes with nullable: true
102
+ def self.openapi_nullable
103
+ Set.new([
104
+ :'date_maj_apres',
105
+ :'date_maj_avant',
106
+ :'type_flux',
107
+ :'direction_flux',
108
+ :'tracking_id',
109
+ :'flow_id',
110
+ :'statut_acquittement',
111
+ ])
112
+ end
113
+
114
+ # Initializes the object
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ def initialize(attributes = {})
117
+ if (!attributes.is_a?(Hash))
118
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::RequeteRechercheFlux` initialize method"
119
+ end
120
+
121
+ # check to see if the attribute exists and convert string to symbol for hash key
122
+ acceptable_attribute_map = self.class.acceptable_attribute_map
123
+ attributes = attributes.each_with_object({}) { |(k, v), h|
124
+ if (!acceptable_attribute_map.key?(k.to_sym))
125
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::RequeteRechercheFlux`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
126
+ end
127
+ h[k.to_sym] = v
128
+ }
129
+
130
+ if attributes.key?(:'date_maj_apres')
131
+ self.date_maj_apres = attributes[:'date_maj_apres']
132
+ end
133
+
134
+ if attributes.key?(:'date_maj_avant')
135
+ self.date_maj_avant = attributes[:'date_maj_avant']
136
+ end
137
+
138
+ if attributes.key?(:'type_flux')
139
+ if (value = attributes[:'type_flux']).is_a?(Array)
140
+ self.type_flux = value
141
+ end
142
+ end
143
+
144
+ if attributes.key?(:'direction_flux')
145
+ if (value = attributes[:'direction_flux']).is_a?(Array)
146
+ self.direction_flux = value
147
+ end
148
+ end
149
+
150
+ if attributes.key?(:'tracking_id')
151
+ self.tracking_id = attributes[:'tracking_id']
152
+ end
153
+
154
+ if attributes.key?(:'flow_id')
155
+ self.flow_id = attributes[:'flow_id']
156
+ end
157
+
158
+ if attributes.key?(:'statut_acquittement')
159
+ self.statut_acquittement = attributes[:'statut_acquittement']
160
+ end
161
+
162
+ if attributes.key?(:'offset')
163
+ self.offset = attributes[:'offset']
164
+ else
165
+ self.offset = 0
166
+ end
167
+
168
+ if attributes.key?(:'limit')
169
+ self.limit = attributes[:'limit']
170
+ else
171
+ self.limit = 25
172
+ end
173
+ end
174
+
175
+ # Show invalid properties with the reasons. Usually used together with valid?
176
+ # @return Array for valid properties with the reasons
177
+ def list_invalid_properties
178
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
179
+ invalid_properties = Array.new
180
+ if !@offset.nil? && @offset < 0
181
+ invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.')
182
+ end
183
+
184
+ if !@limit.nil? && @limit > 100
185
+ invalid_properties.push('invalid value for "limit", must be smaller than or equal to 100.')
186
+ end
187
+
188
+ if !@limit.nil? && @limit < 1
189
+ invalid_properties.push('invalid value for "limit", must be greater than or equal to 1.')
190
+ end
191
+
192
+ invalid_properties
193
+ end
194
+
195
+ # Check to see if the all the properties in the model are valid
196
+ # @return true if the model is valid
197
+ def valid?
198
+ warn '[DEPRECATED] the `valid?` method is obsolete'
199
+ return false if !@offset.nil? && @offset < 0
200
+ return false if !@limit.nil? && @limit > 100
201
+ return false if !@limit.nil? && @limit < 1
202
+ true
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] offset Value to be assigned
207
+ def offset=(offset)
208
+ if offset.nil?
209
+ fail ArgumentError, 'offset cannot be nil'
210
+ end
211
+
212
+ if offset < 0
213
+ fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.'
214
+ end
215
+
216
+ @offset = offset
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] limit Value to be assigned
221
+ def limit=(limit)
222
+ if limit.nil?
223
+ fail ArgumentError, 'limit cannot be nil'
224
+ end
225
+
226
+ if limit > 100
227
+ fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 100.'
228
+ end
229
+
230
+ if limit < 1
231
+ fail ArgumentError, 'invalid value for "limit", must be greater than or equal to 1.'
232
+ end
233
+
234
+ @limit = limit
235
+ end
236
+
237
+ # Checks equality by comparing each attribute.
238
+ # @param [Object] Object to be compared
239
+ def ==(o)
240
+ return true if self.equal?(o)
241
+ self.class == o.class &&
242
+ date_maj_apres == o.date_maj_apres &&
243
+ date_maj_avant == o.date_maj_avant &&
244
+ type_flux == o.type_flux &&
245
+ direction_flux == o.direction_flux &&
246
+ tracking_id == o.tracking_id &&
247
+ flow_id == o.flow_id &&
248
+ statut_acquittement == o.statut_acquittement &&
249
+ offset == o.offset &&
250
+ limit == o.limit
251
+ end
252
+
253
+ # @see the `==` method
254
+ # @param [Object] Object to be compared
255
+ def eql?(o)
256
+ self == o
257
+ end
258
+
259
+ # Calculates hash code according to all attributes.
260
+ # @return [Integer] Hash code
261
+ def hash
262
+ [date_maj_apres, date_maj_avant, type_flux, direction_flux, tracking_id, flow_id, statut_acquittement, offset, limit].hash
263
+ end
264
+
265
+ # Builds the object from hash
266
+ # @param [Hash] attributes Model attributes in the form of hash
267
+ # @return [Object] Returns the model itself
268
+ def self.build_from_hash(attributes)
269
+ return nil unless attributes.is_a?(Hash)
270
+ attributes = attributes.transform_keys(&:to_sym)
271
+ transformed_hash = {}
272
+ openapi_types.each_pair do |key, type|
273
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
274
+ transformed_hash["#{key}"] = nil
275
+ elsif type =~ /\AArray<(.*)>/i
276
+ # check to ensure the input is an array given that the attribute
277
+ # is documented as an array but the input is not
278
+ if attributes[attribute_map[key]].is_a?(Array)
279
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
280
+ end
281
+ elsif !attributes[attribute_map[key]].nil?
282
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
283
+ end
284
+ end
285
+ new(transformed_hash)
286
+ end
287
+
288
+ # Returns the object in the form of hash
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_hash
291
+ hash = {}
292
+ self.class.attribute_map.each_pair do |attr, param|
293
+ value = self.send(attr)
294
+ if value.nil?
295
+ is_nullable = self.class.openapi_nullable.include?(attr)
296
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
297
+ end
298
+
299
+ hash[param] = _to_hash(value)
300
+ end
301
+ hash
302
+ end
303
+
304
+ end
305
+
306
+ end