factpulse 3.0.32 → 3.0.34

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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -16
  3. data/Gemfile.lock +1 -1
  4. data/docs/ActionCodeInfo.md +22 -0
  5. data/docs/ActionCodesResponse.md +22 -0
  6. data/docs/BodySubmitCdarApiV1CdarSubmitPost.md +20 -0
  7. data/docs/BodySubmitCdarXmlApiV1CdarSubmitXmlPost.md +20 -0
  8. data/docs/CDARCycleDeVieApi.md +489 -0
  9. data/docs/ChorusProCredentials.md +8 -8
  10. data/docs/ChorusProDestination.md +1 -1
  11. data/docs/CreateCDARRequest.md +52 -0
  12. data/docs/Encaisseamount.md +15 -0
  13. data/docs/Encaisseamount1.md +15 -0
  14. data/docs/FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md +24 -0
  15. data/docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md +26 -0
  16. data/docs/GenerateCDARResponse.md +26 -0
  17. data/docs/GetChorusProIdRequest.md +1 -1
  18. data/docs/GetInvoiceRequest.md +1 -1
  19. data/docs/GetStructureRequest.md +1 -1
  20. data/docs/ReasonCodeInfo.md +22 -0
  21. data/docs/ReasonCodesResponse.md +22 -0
  22. data/docs/RecipientInput.md +26 -0
  23. data/docs/SearchStructureRequest.md +1 -1
  24. data/docs/StatusCodeInfo.md +22 -0
  25. data/docs/StatusCodesResponse.md +22 -0
  26. data/docs/SubmitCDARRequest.md +54 -0
  27. data/docs/SubmitCDARResponse.md +24 -0
  28. data/docs/SubmitCDARXMLRequest.md +22 -0
  29. data/docs/SubmitInvoiceRequest.md +1 -1
  30. data/docs/ValidateCDARRequest.md +32 -0
  31. data/docs/ValidateCDARResponse.md +22 -0
  32. data/lib/factpulse/api/cdar_cycle_de_vie_api.rb +491 -0
  33. data/lib/factpulse/helpers/client.rb +17 -1
  34. data/lib/factpulse/models/action_code_info.rb +220 -0
  35. data/lib/factpulse/models/action_codes_response.rb +207 -0
  36. data/lib/factpulse/models/body_submit_cdar_api_v1_cdar_submit_post.rb +174 -0
  37. data/lib/factpulse/models/body_submit_cdar_xml_api_v1_cdar_submit_xml_post.rb +174 -0
  38. data/lib/factpulse/models/chorus_pro_credentials.rb +26 -94
  39. data/lib/factpulse/models/chorus_pro_destination.rb +1 -1
  40. data/lib/factpulse/models/create_cdar_request.rb +414 -0
  41. data/lib/factpulse/models/encaisseamount.rb +104 -0
  42. data/lib/factpulse/models/encaisseamount1.rb +103 -0
  43. data/lib/factpulse/models/facture_electronique_rest_api_schemas_cdar_validation_error_response.rb +215 -0
  44. data/lib/factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.rb +259 -0
  45. data/lib/factpulse/models/generate_cdar_response.rb +273 -0
  46. data/lib/factpulse/models/get_chorus_pro_id_request.rb +1 -1
  47. data/lib/factpulse/models/get_invoice_request.rb +1 -1
  48. data/lib/factpulse/models/get_structure_request.rb +1 -1
  49. data/lib/factpulse/models/reason_code_info.rb +220 -0
  50. data/lib/factpulse/models/reason_codes_response.rb +207 -0
  51. data/lib/factpulse/models/recipient_input.rb +191 -0
  52. data/lib/factpulse/models/search_structure_request.rb +1 -1
  53. data/lib/factpulse/models/status_code_info.rb +220 -0
  54. data/lib/factpulse/models/status_codes_response.rb +207 -0
  55. data/lib/factpulse/models/submit_cdar_request.rb +426 -0
  56. data/lib/factpulse/models/submit_cdar_response.rb +213 -0
  57. data/lib/factpulse/models/submit_cdarxml_request.rb +188 -0
  58. data/lib/factpulse/models/submit_invoice_request.rb +1 -1
  59. data/lib/factpulse/models/validate_cdar_request.rb +219 -0
  60. data/lib/factpulse/models/{facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb → validate_cdar_response.rb} +47 -48
  61. data/lib/factpulse/version.rb +1 -1
  62. data/lib/factpulse.rb +21 -1
  63. metadata +44 -4
  64. data/docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md +0 -26
@@ -0,0 +1,174 @@
1
+ =begin
2
+ #FactPulse REST API
3
+
4
+ # REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: contact@factpulse.fr
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ class BodySubmitCdarXmlApiV1CdarSubmitXmlPost < ApiModelBase
18
+ attr_accessor :request
19
+
20
+ attr_accessor :pdp_credentials
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'request' => :'request',
26
+ :'pdp_credentials' => :'pdp_credentials'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'request' => :'SubmitCDARXMLRequest',
44
+ :'pdp_credentials' => :'PDPCredentials'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ :'pdp_credentials'
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::BodySubmitCdarXmlApiV1CdarSubmitXmlPost` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::BodySubmitCdarXmlApiV1CdarSubmitXmlPost`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'request')
72
+ self.request = attributes[:'request']
73
+ else
74
+ self.request = nil
75
+ end
76
+
77
+ if attributes.key?(:'pdp_credentials')
78
+ self.pdp_credentials = attributes[:'pdp_credentials']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ invalid_properties = Array.new
87
+ if @request.nil?
88
+ invalid_properties.push('invalid value for "request", request cannot be nil.')
89
+ end
90
+
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ warn '[DEPRECATED] the `valid?` method is obsolete'
98
+ return false if @request.nil?
99
+ true
100
+ end
101
+
102
+ # Custom attribute writer method with validation
103
+ # @param [Object] request Value to be assigned
104
+ def request=(request)
105
+ if request.nil?
106
+ fail ArgumentError, 'request cannot be nil'
107
+ end
108
+
109
+ @request = request
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ request == o.request &&
118
+ pdp_credentials == o.pdp_credentials
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [request, pdp_credentials].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ attributes = attributes.transform_keys(&:to_sym)
139
+ transformed_hash = {}
140
+ openapi_types.each_pair do |key, type|
141
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = nil
143
+ elsif type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[attribute_map[key]].is_a?(Array)
147
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
148
+ end
149
+ elsif !attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
151
+ end
152
+ end
153
+ new(transformed_hash)
154
+ end
155
+
156
+ # Returns the object in the form of hash
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_hash
159
+ hash = {}
160
+ self.class.attribute_map.each_pair do |attr, param|
161
+ value = self.send(attr)
162
+ if value.nil?
163
+ is_nullable = self.class.openapi_nullable.include?(attr)
164
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
165
+ end
166
+
167
+ hash[param] = _to_hash(value)
168
+ end
169
+ hash
170
+ end
171
+
172
+ end
173
+
174
+ end
@@ -14,31 +14,27 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module FactPulse
17
- # Chorus Pro credentials for Zero-Trust mode. **Zero-Trust Mode**: Credentials are passed in each request and are NEVER stored. **Security**: - Credentials are never persisted in the database - They are used only for the duration of the request - Secure transmission via HTTPS **Use cases**: - High-security environments (banks, administrations) - Strict GDPR compliance - Tests with temporary credentials - Users who don't want to store their credentials
17
+ # Optional Chorus Pro credentials. **MODE 1 - JWT retrieval (recommended):** Do not provide this `credentials` field in the payload. Credentials will be automatically retrieved via client_uid from JWT (0-trust). **MODE 2 - Credentials in payload:** Provide all required fields below. Useful for tests or third-party integrations.
18
18
  class ChorusProCredentials < ApiModelBase
19
- # PISTE Client ID (government API portal)
20
19
  attr_accessor :piste_client_id
21
20
 
22
- # PISTE Client Secret
23
21
  attr_accessor :piste_client_secret
24
22
 
25
- # Chorus Pro login
26
- attr_accessor :chorus_pro_login
23
+ attr_accessor :chorus_login
27
24
 
28
- # Chorus Pro password
29
- attr_accessor :chorus_pro_password
25
+ attr_accessor :chorus_password
30
26
 
31
- # Use sandbox environment (true) or production (false)
32
- attr_accessor :sandbox
27
+ # [MODE 2] Use sandbox mode (default: True)
28
+ attr_accessor :sandbox_mode
33
29
 
34
30
  # Attribute mapping from ruby-style variable name to JSON key.
35
31
  def self.attribute_map
36
32
  {
37
33
  :'piste_client_id' => :'pisteClientId',
38
34
  :'piste_client_secret' => :'pisteClientSecret',
39
- :'chorus_pro_login' => :'chorusProLogin',
40
- :'chorus_pro_password' => :'chorusProPassword',
41
- :'sandbox' => :'sandbox'
35
+ :'chorus_login' => :'chorusLogin',
36
+ :'chorus_password' => :'chorusPassword',
37
+ :'sandbox_mode' => :'sandboxMode'
42
38
  }
43
39
  end
44
40
 
@@ -57,15 +53,19 @@ module FactPulse
57
53
  {
58
54
  :'piste_client_id' => :'String',
59
55
  :'piste_client_secret' => :'String',
60
- :'chorus_pro_login' => :'String',
61
- :'chorus_pro_password' => :'String',
62
- :'sandbox' => :'Boolean'
56
+ :'chorus_login' => :'String',
57
+ :'chorus_password' => :'String',
58
+ :'sandbox_mode' => :'Boolean'
63
59
  }
64
60
  end
65
61
 
66
62
  # List of attributes with nullable: true
67
63
  def self.openapi_nullable
68
64
  Set.new([
65
+ :'piste_client_id',
66
+ :'piste_client_secret',
67
+ :'chorus_login',
68
+ :'chorus_password',
69
69
  ])
70
70
  end
71
71
 
@@ -87,32 +87,24 @@ module FactPulse
87
87
 
88
88
  if attributes.key?(:'piste_client_id')
89
89
  self.piste_client_id = attributes[:'piste_client_id']
90
- else
91
- self.piste_client_id = nil
92
90
  end
93
91
 
94
92
  if attributes.key?(:'piste_client_secret')
95
93
  self.piste_client_secret = attributes[:'piste_client_secret']
96
- else
97
- self.piste_client_secret = nil
98
94
  end
99
95
 
100
- if attributes.key?(:'chorus_pro_login')
101
- self.chorus_pro_login = attributes[:'chorus_pro_login']
102
- else
103
- self.chorus_pro_login = nil
96
+ if attributes.key?(:'chorus_login')
97
+ self.chorus_login = attributes[:'chorus_login']
104
98
  end
105
99
 
106
- if attributes.key?(:'chorus_pro_password')
107
- self.chorus_pro_password = attributes[:'chorus_pro_password']
108
- else
109
- self.chorus_pro_password = nil
100
+ if attributes.key?(:'chorus_password')
101
+ self.chorus_password = attributes[:'chorus_password']
110
102
  end
111
103
 
112
- if attributes.key?(:'sandbox')
113
- self.sandbox = attributes[:'sandbox']
104
+ if attributes.key?(:'sandbox_mode')
105
+ self.sandbox_mode = attributes[:'sandbox_mode']
114
106
  else
115
- self.sandbox = true
107
+ self.sandbox_mode = true
116
108
  end
117
109
  end
118
110
 
@@ -121,22 +113,6 @@ module FactPulse
121
113
  def list_invalid_properties
122
114
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
123
115
  invalid_properties = Array.new
124
- if @piste_client_id.nil?
125
- invalid_properties.push('invalid value for "piste_client_id", piste_client_id cannot be nil.')
126
- end
127
-
128
- if @piste_client_secret.nil?
129
- invalid_properties.push('invalid value for "piste_client_secret", piste_client_secret cannot be nil.')
130
- end
131
-
132
- if @chorus_pro_login.nil?
133
- invalid_properties.push('invalid value for "chorus_pro_login", chorus_pro_login cannot be nil.')
134
- end
135
-
136
- if @chorus_pro_password.nil?
137
- invalid_properties.push('invalid value for "chorus_pro_password", chorus_pro_password cannot be nil.')
138
- end
139
-
140
116
  invalid_properties
141
117
  end
142
118
 
@@ -144,53 +120,9 @@ module FactPulse
144
120
  # @return true if the model is valid
145
121
  def valid?
146
122
  warn '[DEPRECATED] the `valid?` method is obsolete'
147
- return false if @piste_client_id.nil?
148
- return false if @piste_client_secret.nil?
149
- return false if @chorus_pro_login.nil?
150
- return false if @chorus_pro_password.nil?
151
123
  true
152
124
  end
153
125
 
154
- # Custom attribute writer method with validation
155
- # @param [Object] piste_client_id Value to be assigned
156
- def piste_client_id=(piste_client_id)
157
- if piste_client_id.nil?
158
- fail ArgumentError, 'piste_client_id cannot be nil'
159
- end
160
-
161
- @piste_client_id = piste_client_id
162
- end
163
-
164
- # Custom attribute writer method with validation
165
- # @param [Object] piste_client_secret Value to be assigned
166
- def piste_client_secret=(piste_client_secret)
167
- if piste_client_secret.nil?
168
- fail ArgumentError, 'piste_client_secret cannot be nil'
169
- end
170
-
171
- @piste_client_secret = piste_client_secret
172
- end
173
-
174
- # Custom attribute writer method with validation
175
- # @param [Object] chorus_pro_login Value to be assigned
176
- def chorus_pro_login=(chorus_pro_login)
177
- if chorus_pro_login.nil?
178
- fail ArgumentError, 'chorus_pro_login cannot be nil'
179
- end
180
-
181
- @chorus_pro_login = chorus_pro_login
182
- end
183
-
184
- # Custom attribute writer method with validation
185
- # @param [Object] chorus_pro_password Value to be assigned
186
- def chorus_pro_password=(chorus_pro_password)
187
- if chorus_pro_password.nil?
188
- fail ArgumentError, 'chorus_pro_password cannot be nil'
189
- end
190
-
191
- @chorus_pro_password = chorus_pro_password
192
- end
193
-
194
126
  # Checks equality by comparing each attribute.
195
127
  # @param [Object] Object to be compared
196
128
  def ==(o)
@@ -198,9 +130,9 @@ module FactPulse
198
130
  self.class == o.class &&
199
131
  piste_client_id == o.piste_client_id &&
200
132
  piste_client_secret == o.piste_client_secret &&
201
- chorus_pro_login == o.chorus_pro_login &&
202
- chorus_pro_password == o.chorus_pro_password &&
203
- sandbox == o.sandbox
133
+ chorus_login == o.chorus_login &&
134
+ chorus_password == o.chorus_password &&
135
+ sandbox_mode == o.sandbox_mode
204
136
  end
205
137
 
206
138
  # @see the `==` method
@@ -212,7 +144,7 @@ module FactPulse
212
144
  # Calculates hash code according to all attributes.
213
145
  # @return [Integer] Hash code
214
146
  def hash
215
- [piste_client_id, piste_client_secret, chorus_pro_login, chorus_pro_password, sandbox].hash
147
+ [piste_client_id, piste_client_secret, chorus_login, chorus_password, sandbox_mode].hash
216
148
  end
217
149
 
218
150
  # Builds the object from hash
@@ -64,7 +64,7 @@ module FactPulse
64
64
  def self.openapi_types
65
65
  {
66
66
  :'type' => :'String',
67
- :'credentials' => :'FactureElectroniqueRestApiSchemasProcessingChorusProCredentials'
67
+ :'credentials' => :'ChorusProCredentials'
68
68
  }
69
69
  end
70
70