factpulse 3.0.33 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acc461cec6e349339999ef2bcefdc9167ffeacb88ff0f9c22e64e0183a182b42
4
- data.tar.gz: b5f252d6a21c3bef0a029a6a11e4e35b9b3aa2cf44155e2fd5c4399174322385
3
+ metadata.gz: eae78264ee3b2ac1f57aeb4e067dece096c2ecde9d822a9727029be8fcbae24e
4
+ data.tar.gz: '07545528aead7e76703579aec585a5290281880ad24ce449aab9818cae17b39b'
5
5
  SHA512:
6
- metadata.gz: d6f8183133fd3fcefe861fae183ad462c008f236dc4b0f9563797e88f30063c3137bf628ddbef2d261ffca7bed7e904c92f6b133d4ab3a08aa40e29907e07775
7
- data.tar.gz: 02b6af0e6c841d0379db6b72d7bf4f1f648662f82934d9670a0f6ae3d2f07c785bdee2a13118643bf354aa96aa68037acfa02300b772a79d4e10a67cead31221
6
+ metadata.gz: c04efc02125978efa3eb6d7c00a4008ed55e4b649826195e50d86b67a6cd0521a65ad4314e2502df70cd8409af029f572ca2dd1c7a2772f7f9ad5d87df351366
7
+ data.tar.gz: 9c2cce5e0b386d5d66a419f5644732f1f6f0118bff230e3d862b11b70cdd237498311df45a9142201770199f50b3bf2dcc316e0f7d4b03d0def3e43b535176da
data/CHANGELOG.md CHANGED
@@ -7,14 +7,11 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [3.0.33] - 2026-01-17
11
-
12
- ### Added
13
- - Support API cycle de vie CDAR
10
+ ## [3.0.34] - 2026-01-17
14
11
 
15
12
  ### Fixed
16
- - Soumission AFNOR dans le flux complet
13
+ - Gestion des erreurs métier (`result.status === "ERROR"`) dans tous les SDK - corrige l'erreur "No content" lors d'échecs de validation
17
14
 
18
15
 
19
- [Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v3.0.33...HEAD
20
- [3.0.33]: https://github.com/factpulse/sdk-ruby/releases/tag/v3.0.33
16
+ [Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v3.0.34...HEAD
17
+ [3.0.34]: https://github.com/factpulse/sdk-ruby/releases/tag/v3.0.34
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- factpulse (3.0.33)
4
+ factpulse (3.0.34)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -0,0 +1,24 @@
1
+ # FactPulse::FactureElectroniqueRestApiSchemasCdarValidationErrorResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **field** | **String** | Champ concerné | |
8
+ | **message** | **String** | Message d'erreur | |
9
+ | **rule** | **String** | | [optional] |
10
+ | **severity** | **String** | Sévérité (error/warning) | [optional][default to 'error'] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'factpulse'
16
+
17
+ instance = FactPulse::FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.new(
18
+ field: null,
19
+ message: null,
20
+ rule: null,
21
+ severity: null
22
+ )
23
+ ```
24
+
@@ -5,8 +5,8 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **valid** | **Boolean** | Résultat de validation | |
8
- | **errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | Liste des erreurs | [optional] |
9
- | **warnings** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | Liste des avertissements | [optional] |
8
+ | **errors** | [**Array<FactureElectroniqueRestApiSchemasCdarValidationErrorResponse>**](FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md) | Liste des erreurs | [optional] |
9
+ | **warnings** | [**Array<FactureElectroniqueRestApiSchemasCdarValidationErrorResponse>**](FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md) | Liste des avertissements | [optional] |
10
10
 
11
11
  ## Example
12
12
 
@@ -4,10 +4,7 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **field** | **String** | Champ concerné | |
8
- | **message** | **String** | Message d'erreur | |
9
- | **rule** | **String** | | [optional] |
10
- | **severity** | **String** | Sévérité (error/warning) | [optional][default to 'error'] |
7
+ | **detail** | **Array<String>** | List of detected validation errors. | |
11
8
 
12
9
  ## Example
13
10
 
@@ -15,10 +12,7 @@
15
12
  require 'factpulse'
16
13
 
17
14
  instance = FactPulse::ValidationErrorResponse.new(
18
- field: null,
19
- message: null,
20
- rule: null,
21
- severity: null
15
+ detail: null
22
16
  )
23
17
  ```
24
18
 
@@ -297,6 +297,22 @@ module FactPulse
297
297
 
298
298
  if sync && data['taskId']
299
299
  result = poll_task(data['taskId'], timeout: timeout)
300
+
301
+ # Check for business error (task succeeded but business result is ERROR)
302
+ if result['status'] == 'ERROR'
303
+ error_msg = result['errorMessage'] || 'Business error'
304
+ errors = (result['details'] || []).map do |d|
305
+ ValidationErrorDetail.new(
306
+ d['level'] || 'ERROR',
307
+ d['item'] || '',
308
+ d['reason'] || '',
309
+ d['source'],
310
+ d['code']
311
+ )
312
+ end
313
+ raise FactPulseValidationError.new(error_msg, errors)
314
+ end
315
+
300
316
  if result['content_b64']
301
317
  return Base64.decode64(result['content_b64'])
302
318
  elsif result['content_xml']
@@ -14,15 +14,26 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module FactPulse
17
- # Response for validation errors.
18
- class FactureElectroniqueRestApiSchemasValidationValidationErrorResponse < ApiModelBase
19
- # List of detected validation errors.
20
- attr_accessor :detail
17
+ # Erreur de validation.
18
+ class FactureElectroniqueRestApiSchemasCdarValidationErrorResponse < ApiModelBase
19
+ # Champ concerné
20
+ attr_accessor :field
21
+
22
+ # Message d'erreur
23
+ attr_accessor :message
24
+
25
+ attr_accessor :rule
26
+
27
+ # Sévérité (error/warning)
28
+ attr_accessor :severity
21
29
 
22
30
  # Attribute mapping from ruby-style variable name to JSON key.
23
31
  def self.attribute_map
24
32
  {
25
- :'detail' => :'detail'
33
+ :'field' => :'field',
34
+ :'message' => :'message',
35
+ :'rule' => :'rule',
36
+ :'severity' => :'severity'
26
37
  }
27
38
  end
28
39
 
@@ -39,13 +50,17 @@ module FactPulse
39
50
  # Attribute type mapping.
40
51
  def self.openapi_types
41
52
  {
42
- :'detail' => :'Array<String>'
53
+ :'field' => :'String',
54
+ :'message' => :'String',
55
+ :'rule' => :'String',
56
+ :'severity' => :'String'
43
57
  }
44
58
  end
45
59
 
46
60
  # List of attributes with nullable: true
47
61
  def self.openapi_nullable
48
62
  Set.new([
63
+ :'rule',
49
64
  ])
50
65
  end
51
66
 
@@ -53,24 +68,38 @@ module FactPulse
53
68
  # @param [Hash] attributes Model attributes in the form of hash
54
69
  def initialize(attributes = {})
55
70
  if (!attributes.is_a?(Hash))
56
- fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::FactureElectroniqueRestApiSchemasValidationValidationErrorResponse` initialize method"
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::FactureElectroniqueRestApiSchemasCdarValidationErrorResponse` initialize method"
57
72
  end
58
73
 
59
74
  # check to see if the attribute exists and convert string to symbol for hash key
60
75
  acceptable_attribute_map = self.class.acceptable_attribute_map
61
76
  attributes = attributes.each_with_object({}) { |(k, v), h|
62
77
  if (!acceptable_attribute_map.key?(k.to_sym))
63
- fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::FactureElectroniqueRestApiSchemasValidationValidationErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::FactureElectroniqueRestApiSchemasCdarValidationErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
79
  end
65
80
  h[k.to_sym] = v
66
81
  }
67
82
 
68
- if attributes.key?(:'detail')
69
- if (value = attributes[:'detail']).is_a?(Array)
70
- self.detail = value
71
- end
83
+ if attributes.key?(:'field')
84
+ self.field = attributes[:'field']
85
+ else
86
+ self.field = nil
87
+ end
88
+
89
+ if attributes.key?(:'message')
90
+ self.message = attributes[:'message']
72
91
  else
73
- self.detail = nil
92
+ self.message = nil
93
+ end
94
+
95
+ if attributes.key?(:'rule')
96
+ self.rule = attributes[:'rule']
97
+ end
98
+
99
+ if attributes.key?(:'severity')
100
+ self.severity = attributes[:'severity']
101
+ else
102
+ self.severity = 'error'
74
103
  end
75
104
  end
76
105
 
@@ -79,8 +108,12 @@ module FactPulse
79
108
  def list_invalid_properties
80
109
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
110
  invalid_properties = Array.new
82
- if @detail.nil?
83
- invalid_properties.push('invalid value for "detail", detail cannot be nil.')
111
+ if @field.nil?
112
+ invalid_properties.push('invalid value for "field", field cannot be nil.')
113
+ end
114
+
115
+ if @message.nil?
116
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
84
117
  end
85
118
 
86
119
  invalid_properties
@@ -90,18 +123,29 @@ module FactPulse
90
123
  # @return true if the model is valid
91
124
  def valid?
92
125
  warn '[DEPRECATED] the `valid?` method is obsolete'
93
- return false if @detail.nil?
126
+ return false if @field.nil?
127
+ return false if @message.nil?
94
128
  true
95
129
  end
96
130
 
97
131
  # Custom attribute writer method with validation
98
- # @param [Object] detail Value to be assigned
99
- def detail=(detail)
100
- if detail.nil?
101
- fail ArgumentError, 'detail cannot be nil'
132
+ # @param [Object] field Value to be assigned
133
+ def field=(field)
134
+ if field.nil?
135
+ fail ArgumentError, 'field cannot be nil'
136
+ end
137
+
138
+ @field = field
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] message Value to be assigned
143
+ def message=(message)
144
+ if message.nil?
145
+ fail ArgumentError, 'message cannot be nil'
102
146
  end
103
147
 
104
- @detail = detail
148
+ @message = message
105
149
  end
106
150
 
107
151
  # Checks equality by comparing each attribute.
@@ -109,7 +153,10 @@ module FactPulse
109
153
  def ==(o)
110
154
  return true if self.equal?(o)
111
155
  self.class == o.class &&
112
- detail == o.detail
156
+ field == o.field &&
157
+ message == o.message &&
158
+ rule == o.rule &&
159
+ severity == o.severity
113
160
  end
114
161
 
115
162
  # @see the `==` method
@@ -121,7 +168,7 @@ module FactPulse
121
168
  # Calculates hash code according to all attributes.
122
169
  # @return [Integer] Hash code
123
170
  def hash
124
- [detail].hash
171
+ [field, message, rule, severity].hash
125
172
  end
126
173
 
127
174
  # Builds the object from hash
@@ -48,8 +48,8 @@ module FactPulse
48
48
  def self.openapi_types
49
49
  {
50
50
  :'valid' => :'Boolean',
51
- :'errors' => :'Array<ValidationErrorResponse>',
52
- :'warnings' => :'Array<ValidationErrorResponse>'
51
+ :'errors' => :'Array<FactureElectroniqueRestApiSchemasCdarValidationErrorResponse>',
52
+ :'warnings' => :'Array<FactureElectroniqueRestApiSchemasCdarValidationErrorResponse>'
53
53
  }
54
54
  end
55
55
 
@@ -14,26 +14,15 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module FactPulse
17
- # Erreur de validation.
17
+ # Response for validation errors.
18
18
  class ValidationErrorResponse < ApiModelBase
19
- # Champ concerné
20
- attr_accessor :field
21
-
22
- # Message d'erreur
23
- attr_accessor :message
24
-
25
- attr_accessor :rule
26
-
27
- # Sévérité (error/warning)
28
- attr_accessor :severity
19
+ # List of detected validation errors.
20
+ attr_accessor :detail
29
21
 
30
22
  # Attribute mapping from ruby-style variable name to JSON key.
31
23
  def self.attribute_map
32
24
  {
33
- :'field' => :'field',
34
- :'message' => :'message',
35
- :'rule' => :'rule',
36
- :'severity' => :'severity'
25
+ :'detail' => :'detail'
37
26
  }
38
27
  end
39
28
 
@@ -50,17 +39,13 @@ module FactPulse
50
39
  # Attribute type mapping.
51
40
  def self.openapi_types
52
41
  {
53
- :'field' => :'String',
54
- :'message' => :'String',
55
- :'rule' => :'String',
56
- :'severity' => :'String'
42
+ :'detail' => :'Array<String>'
57
43
  }
58
44
  end
59
45
 
60
46
  # List of attributes with nullable: true
61
47
  def self.openapi_nullable
62
48
  Set.new([
63
- :'rule',
64
49
  ])
65
50
  end
66
51
 
@@ -80,26 +65,12 @@ module FactPulse
80
65
  h[k.to_sym] = v
81
66
  }
82
67
 
83
- if attributes.key?(:'field')
84
- self.field = attributes[:'field']
85
- else
86
- self.field = nil
87
- end
88
-
89
- if attributes.key?(:'message')
90
- self.message = attributes[:'message']
91
- else
92
- self.message = nil
93
- end
94
-
95
- if attributes.key?(:'rule')
96
- self.rule = attributes[:'rule']
97
- end
98
-
99
- if attributes.key?(:'severity')
100
- self.severity = attributes[:'severity']
68
+ if attributes.key?(:'detail')
69
+ if (value = attributes[:'detail']).is_a?(Array)
70
+ self.detail = value
71
+ end
101
72
  else
102
- self.severity = 'error'
73
+ self.detail = nil
103
74
  end
104
75
  end
105
76
 
@@ -108,12 +79,8 @@ module FactPulse
108
79
  def list_invalid_properties
109
80
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
110
81
  invalid_properties = Array.new
111
- if @field.nil?
112
- invalid_properties.push('invalid value for "field", field cannot be nil.')
113
- end
114
-
115
- if @message.nil?
116
- invalid_properties.push('invalid value for "message", message cannot be nil.')
82
+ if @detail.nil?
83
+ invalid_properties.push('invalid value for "detail", detail cannot be nil.')
117
84
  end
118
85
 
119
86
  invalid_properties
@@ -123,29 +90,18 @@ module FactPulse
123
90
  # @return true if the model is valid
124
91
  def valid?
125
92
  warn '[DEPRECATED] the `valid?` method is obsolete'
126
- return false if @field.nil?
127
- return false if @message.nil?
93
+ return false if @detail.nil?
128
94
  true
129
95
  end
130
96
 
131
97
  # Custom attribute writer method with validation
132
- # @param [Object] field Value to be assigned
133
- def field=(field)
134
- if field.nil?
135
- fail ArgumentError, 'field cannot be nil'
136
- end
137
-
138
- @field = field
139
- end
140
-
141
- # Custom attribute writer method with validation
142
- # @param [Object] message Value to be assigned
143
- def message=(message)
144
- if message.nil?
145
- fail ArgumentError, 'message cannot be nil'
98
+ # @param [Object] detail Value to be assigned
99
+ def detail=(detail)
100
+ if detail.nil?
101
+ fail ArgumentError, 'detail cannot be nil'
146
102
  end
147
103
 
148
- @message = message
104
+ @detail = detail
149
105
  end
150
106
 
151
107
  # Checks equality by comparing each attribute.
@@ -153,10 +109,7 @@ module FactPulse
153
109
  def ==(o)
154
110
  return true if self.equal?(o)
155
111
  self.class == o.class &&
156
- field == o.field &&
157
- message == o.message &&
158
- rule == o.rule &&
159
- severity == o.severity
112
+ detail == o.detail
160
113
  end
161
114
 
162
115
  # @see the `==` method
@@ -168,7 +121,7 @@ module FactPulse
168
121
  # Calculates hash code according to all attributes.
169
122
  # @return [Integer] Hash code
170
123
  def hash
171
- [field, message, rule, severity].hash
124
+ [detail].hash
172
125
  end
173
126
 
174
127
  # Builds the object from hash
@@ -11,5 +11,5 @@ Generator version: 7.19.0-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module FactPulse
14
- VERSION = '3.0.33'
14
+ VERSION = '3.0.34'
15
15
  end
data/lib/factpulse.rb CHANGED
@@ -165,9 +165,9 @@ require 'factpulse/models/error_source'
165
165
  require 'factpulse/models/extraction_info'
166
166
  require 'factpulse/models/factur_x_invoice'
167
167
  require 'factpulse/models/factur_xpdf_info'
168
+ require 'factpulse/models/facture_electronique_rest_api_schemas_cdar_validation_error_response'
168
169
  require 'factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials'
169
170
  require 'factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code'
170
- require 'factpulse/models/facture_electronique_rest_api_schemas_validation_validation_error_response'
171
171
  require 'factpulse/models/field_status'
172
172
  require 'factpulse/models/file_info'
173
173
  require 'factpulse/models/files_info'
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: 3.0.33
4
+ version: 3.0.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
@@ -271,9 +271,9 @@ files:
271
271
  - docs/ExtractionInfo.md
272
272
  - docs/FacturXInvoice.md
273
273
  - docs/FacturXPDFInfo.md
274
+ - docs/FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md
274
275
  - docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md
275
276
  - docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md
276
- - docs/FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md
277
277
  - docs/FieldStatus.md
278
278
  - docs/FileInfo.md
279
279
  - docs/FilesInfo.md
@@ -590,9 +590,9 @@ files:
590
590
  - lib/factpulse/models/extraction_info.rb
591
591
  - lib/factpulse/models/factur_x_invoice.rb
592
592
  - lib/factpulse/models/factur_xpdf_info.rb
593
+ - lib/factpulse/models/facture_electronique_rest_api_schemas_cdar_validation_error_response.rb
593
594
  - lib/factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.rb
594
595
  - lib/factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb
595
- - lib/factpulse/models/facture_electronique_rest_api_schemas_validation_validation_error_response.rb
596
596
  - lib/factpulse/models/field_status.rb
597
597
  - lib/factpulse/models/file_info.rb
598
598
  - lib/factpulse/models/files_info.rb
@@ -1,18 +0,0 @@
1
- # FactPulse::FactureElectroniqueRestApiSchemasValidationValidationErrorResponse
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **detail** | **Array&lt;String&gt;** | List of detected validation errors. | |
8
-
9
- ## Example
10
-
11
- ```ruby
12
- require 'factpulse'
13
-
14
- instance = FactPulse::FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.new(
15
- detail: null
16
- )
17
- ```
18
-