onfido 3.1.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e49647b89683e1a972dd4aa7fc52fe3b83a2ef5b91015b703f2f1825163aefdf
4
- data.tar.gz: c2c0fc5cfef81086c92b90765ab0156b4d401bde312566350edfe8dd52d90a87
3
+ metadata.gz: 8b1b0a9b1f5e69e278fc7001f2cbbce7c86dbf87857592f0d484f995a30060e7
4
+ data.tar.gz: 558baf4a305a2834ccbe70e70b9170d22bcb5078fa95137b473362913a7512b4
5
5
  SHA512:
6
- metadata.gz: 7ad579443fe7bb71ea26ebf39c622959f386bbae04a6450fb5d6617026e68a691c67a6ddb9928f97a4610161c246ac596a8ca8b226df907836a1ab6293e058b5
7
- data.tar.gz: 667e52f85d7afb8d775c66db9ccfb6f121feb80510628784863ce576321f66cc19014f850397696598ad116d04171db1f465baf218cb99801a3ddf9cdfcff329
6
+ metadata.gz: 1f27173db1bf62e097539f20aac439d28b313d430756e44fee5ab981cc5c540cd1e8292546716db9e43946712361d3434ab20e2388349e2988f89a958f9c235e
7
+ data.tar.gz: c9edc6a9e9ad038140954efca57e884fa46139e27922ffddfe2be8f1a74aa66afbfd224a6d93bd5cda3d9372facffcdd5cc8c0c7f5ad28dcb60d155292ed099c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## v3.2.0 18th July 2024
4
+
5
+ - Release based on Onfido OpenAPI spec version [v3.2.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v3.2.0):
6
+ - [CAT-1289] Document report's properties: Add middle name
7
+ - chore(qes): add documents endpoint
8
+ - [CAT-1297] Webhook Event: remove uuid format from object.id
9
+ - fix(qes): fix download document http method
10
+ - Add started_at_iso8601 field in webhook event
11
+ - add jpeg file type for documents
12
+ - Fix error handling documentation in README file
13
+
14
+ ## v3.1.0 5th July 2024
15
+
16
+ - Release based on Onfido OpenAPI spec version [v3.1.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v3.1.0):
17
+ - Add missing fields in document report's properties
18
+
3
19
  ## v3.0.0 24th June 2024
4
20
 
5
21
  - Library has been rebuilt from scratch and automatically generated on [Onfido OpenAPI Spec](https://github.com/onfido/onfido-openapi-spec) (release [v3.0.0](https://github.com/onfido/onfido-openapi-spec/releases/tag/v3.0.0))
data/README.md CHANGED
@@ -14,7 +14,7 @@ This version uses Onfido API v3.6. Refer to our [API versioning guide](https://d
14
14
  ### Installation
15
15
 
16
16
  ```ruby
17
- gem onfido, '~> 3.1.0'
17
+ gem onfido, '~> 3.3.0'
18
18
  ```
19
19
 
20
20
  Configure with your API token, region and optional timeout (default value is 30):
@@ -46,20 +46,20 @@ Documentation and code examples can be found at https://documentation.onfido.com
46
46
 
47
47
  ## Error Handling
48
48
 
49
- All errors are wrapped by `ApiError` coming from [FaradayExpection](https://www.rubydoc.info/github/lostisland/faraday/Faraday/ClientError):
49
+ All errors are wrapped by `ApiError` coming from [FaradayException](https://www.rubydoc.info/github/lostisland/faraday/Faraday/ClientError):
50
50
 
51
51
  - `Connection timed out` is raised in case of `Faraday::TimeoutError`
52
52
  - `Connection failed` is raised in case of `Faraday::ConnectionFailed`
53
53
 
54
- All errors provide the `response_code`, `response_body`, `json_body`, `type` and `fields` of the error.
54
+ All errors provide the `code`, `response_headers`, and `response_body` of the error.
55
55
 
56
56
  ```ruby
57
57
  def create_applicant
58
58
  onfido_api.create_applicant(params)
59
- rescue Faraday::ConnectionFailed => e
60
- e.type # => 'validation_error'
61
- e.fields # => { "email": { "messages": ["invalid format"] } }
62
- e.response_code # => '422'
59
+ rescue Onfido::ApiError => e
60
+ e.message # => 'Unprocessable entity'
61
+ e.response_body # => { error: { type: "validation_error", message: "", fields: { "email": [ "invalid format" ] } } }
62
+ e.code # => '422'
63
63
  end
64
64
  ```
65
65
 
@@ -1321,6 +1321,77 @@ module Onfido
1321
1321
  return data, status_code, headers
1322
1322
  end
1323
1323
 
1324
+ # Retrieves the signed document or application form
1325
+ # Retrieves the signed document or application form depending on the file_id provided.
1326
+ # @param workflow_run_id [String] The unique identifier of the Workflow Run for which you want to retrieve the signed document.
1327
+ # @param file_id [String] The unique identifier of the file which you want to retrieve.
1328
+ # @param [Hash] opts the optional parameters
1329
+ # @return [File]
1330
+ def download_qes_document(workflow_run_id, file_id, opts = {})
1331
+ data, _status_code, _headers = download_qes_document_with_http_info(workflow_run_id, file_id, opts)
1332
+ data
1333
+ end
1334
+
1335
+ # Retrieves the signed document or application form
1336
+ # Retrieves the signed document or application form depending on the file_id provided.
1337
+ # @param workflow_run_id [String] The unique identifier of the Workflow Run for which you want to retrieve the signed document.
1338
+ # @param file_id [String] The unique identifier of the file which you want to retrieve.
1339
+ # @param [Hash] opts the optional parameters
1340
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
1341
+ def download_qes_document_with_http_info(workflow_run_id, file_id, opts = {})
1342
+ if @api_client.config.debugging
1343
+ @api_client.config.logger.debug 'Calling API: DefaultApi.download_qes_document ...'
1344
+ end
1345
+ # verify the required parameter 'workflow_run_id' is set
1346
+ if @api_client.config.client_side_validation && workflow_run_id.nil?
1347
+ fail ArgumentError, "Missing the required parameter 'workflow_run_id' when calling DefaultApi.download_qes_document"
1348
+ end
1349
+ # verify the required parameter 'file_id' is set
1350
+ if @api_client.config.client_side_validation && file_id.nil?
1351
+ fail ArgumentError, "Missing the required parameter 'file_id' when calling DefaultApi.download_qes_document"
1352
+ end
1353
+ # resource path
1354
+ local_var_path = '/qualified_electronic_signature/documents'
1355
+
1356
+ # query parameters
1357
+ query_params = opts[:query_params] || {}
1358
+ query_params[:'workflow_run_id'] = workflow_run_id
1359
+ query_params[:'file_id'] = file_id
1360
+
1361
+ # header parameters
1362
+ header_params = opts[:header_params] || {}
1363
+ # HTTP header 'Accept' (if needed)
1364
+ header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json'])
1365
+
1366
+ # form parameters
1367
+ form_params = opts[:form_params] || {}
1368
+
1369
+ # http body (model)
1370
+ post_body = opts[:debug_body]
1371
+
1372
+ # return_type
1373
+ return_type = opts[:debug_return_type] || 'File'
1374
+
1375
+ # auth_names
1376
+ auth_names = opts[:debug_auth_names] || ['Token']
1377
+
1378
+ new_options = opts.merge(
1379
+ :operation => :"DefaultApi.download_qes_document",
1380
+ :header_params => header_params,
1381
+ :query_params => query_params,
1382
+ :form_params => form_params,
1383
+ :body => post_body,
1384
+ :auth_names => auth_names,
1385
+ :return_type => return_type
1386
+ )
1387
+
1388
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1389
+ if @api_client.config.debugging
1390
+ @api_client.config.logger.debug "API called: DefaultApi#download_qes_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1391
+ end
1392
+ return data, status_code, headers
1393
+ end
1394
+
1324
1395
  # Retrieve Workflow Run Evidence Summary File
1325
1396
  # Retrieves the signed evidence file for the designated Workflow Run
1326
1397
  # @param workflow_run_id [String] Workflow Run ID
@@ -4030,7 +4101,7 @@ module Onfido
4030
4101
  if @api_client.config.client_side_validation && file.nil?
4031
4102
  fail ArgumentError, "Missing the required parameter 'file' when calling DefaultApi.upload_document"
4032
4103
  end
4033
- allowable_values = ["jpg", "png", "pdf", "unknown_default_open_api"]
4104
+ allowable_values = ["jpg", "jpeg", "png", "pdf", "unknown_default_open_api"]
4034
4105
  if @api_client.config.client_side_validation && opts[:'file_type'] && !allowable_values.include?(opts[:'file_type'])
4035
4106
  fail ArgumentError, "invalid value for \"file_type\", must be one of #{allowable_values}"
4036
4107
  end
@@ -34,7 +34,7 @@ module Onfido
34
34
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
35
35
  def initialize(config = Configuration.default)
36
36
  @config = config
37
- @user_agent = "onfido-ruby/3.1.0"
37
+ @user_agent = "onfido-ruby/3.3.0"
38
38
  @default_headers = {
39
39
  'Content-Type' => 'application/json',
40
40
  'User-Agent' => @user_agent
@@ -201,7 +201,7 @@ module Onfido
201
201
  # @return true if the model is valid
202
202
  def valid?
203
203
  warn '[DEPRECATED] the `valid?` method is obsolete'
204
- file_type_validator = EnumAttributeValidator.new('String', ["jpg", "png", "pdf", "unknown_default_open_api"])
204
+ file_type_validator = EnumAttributeValidator.new('String', ["jpg", "jpeg", "png", "pdf", "unknown_default_open_api"])
205
205
  return false unless file_type_validator.valid?(@file_type)
206
206
  side_validator = EnumAttributeValidator.new('String', ["front", "back", "unknown_default_open_api"])
207
207
  return false unless side_validator.valid?(@side)
@@ -212,7 +212,7 @@ module Onfido
212
212
  # Custom attribute writer method checking allowed values (enum).
213
213
  # @param [Object] file_type Object to be assigned
214
214
  def file_type=(file_type)
215
- validator = EnumAttributeValidator.new('String', ["jpg", "png", "pdf", "unknown_default_open_api"])
215
+ validator = EnumAttributeValidator.new('String', ["jpg", "jpeg", "png", "pdf", "unknown_default_open_api"])
216
216
  unless validator.valid?(file_type)
217
217
  fail ArgumentError, "invalid value for \"file_type\", must be one of #{validator.allowable_values}."
218
218
  end
@@ -27,12 +27,14 @@ module Onfido
27
27
 
28
28
  attr_accessor :first_name
29
29
 
30
+ attr_accessor :middle_name
31
+
32
+ attr_accessor :last_name
33
+
30
34
  attr_accessor :gender
31
35
 
32
36
  attr_accessor :issuing_country
33
37
 
34
- attr_accessor :last_name
35
-
36
38
  attr_accessor :nationality
37
39
 
38
40
  attr_accessor :issuing_state
@@ -134,9 +136,10 @@ module Onfido
134
136
  :'document_numbers' => :'document_numbers',
135
137
  :'document_type' => :'document_type',
136
138
  :'first_name' => :'first_name',
139
+ :'middle_name' => :'middle_name',
140
+ :'last_name' => :'last_name',
137
141
  :'gender' => :'gender',
138
142
  :'issuing_country' => :'issuing_country',
139
- :'last_name' => :'last_name',
140
143
  :'nationality' => :'nationality',
141
144
  :'issuing_state' => :'issuing_state',
142
145
  :'issuing_date' => :'issuing_date',
@@ -189,9 +192,10 @@ module Onfido
189
192
  :'document_numbers' => :'Array<DocumentPropertiesDocumentNumbersInner>',
190
193
  :'document_type' => :'String',
191
194
  :'first_name' => :'String',
195
+ :'middle_name' => :'String',
196
+ :'last_name' => :'String',
192
197
  :'gender' => :'String',
193
198
  :'issuing_country' => :'String',
194
- :'last_name' => :'String',
195
199
  :'nationality' => :'String',
196
200
  :'issuing_state' => :'String',
197
201
  :'issuing_date' => :'Date',
@@ -277,6 +281,14 @@ module Onfido
277
281
  self.first_name = attributes[:'first_name']
278
282
  end
279
283
 
284
+ if attributes.key?(:'middle_name')
285
+ self.middle_name = attributes[:'middle_name']
286
+ end
287
+
288
+ if attributes.key?(:'last_name')
289
+ self.last_name = attributes[:'last_name']
290
+ end
291
+
280
292
  if attributes.key?(:'gender')
281
293
  self.gender = attributes[:'gender']
282
294
  end
@@ -285,10 +297,6 @@ module Onfido
285
297
  self.issuing_country = attributes[:'issuing_country']
286
298
  end
287
299
 
288
- if attributes.key?(:'last_name')
289
- self.last_name = attributes[:'last_name']
290
- end
291
-
292
300
  if attributes.key?(:'nationality')
293
301
  self.nationality = attributes[:'nationality']
294
302
  end
@@ -494,9 +502,10 @@ module Onfido
494
502
  document_numbers == o.document_numbers &&
495
503
  document_type == o.document_type &&
496
504
  first_name == o.first_name &&
505
+ middle_name == o.middle_name &&
506
+ last_name == o.last_name &&
497
507
  gender == o.gender &&
498
508
  issuing_country == o.issuing_country &&
499
- last_name == o.last_name &&
500
509
  nationality == o.nationality &&
501
510
  issuing_state == o.issuing_state &&
502
511
  issuing_date == o.issuing_date &&
@@ -543,7 +552,7 @@ module Onfido
543
552
  # Calculates hash code according to all attributes.
544
553
  # @return [Integer] Hash code
545
554
  def hash
546
- [date_of_birth, date_of_expiry, personal_number, document_numbers, document_type, first_name, gender, issuing_country, last_name, nationality, issuing_state, issuing_date, categorisation, mrz_line1, mrz_line2, mrz_line3, address, place_of_birth, spouse_name, widow_name, alias_name, issuing_authority, remarks, civil_state, expatriation, father_name, mother_name, religion, type_of_permit, version_number, document_subtype, profession, security_document_number, tax_number, nist_identity_evidence_strength, has_issuance_confirmation, real_id_compliance, security_tier, address_lines, barcode, nfc, driving_licence_information, document_classification, extracted_data].hash
555
+ [date_of_birth, date_of_expiry, personal_number, document_numbers, document_type, first_name, middle_name, last_name, gender, issuing_country, nationality, issuing_state, issuing_date, categorisation, mrz_line1, mrz_line2, mrz_line3, address, place_of_birth, spouse_name, widow_name, alias_name, issuing_authority, remarks, civil_state, expatriation, father_name, mother_name, religion, type_of_permit, version_number, document_subtype, profession, security_document_number, tax_number, nist_identity_evidence_strength, has_issuance_confirmation, real_id_compliance, security_tier, address_lines, barcode, nfc, driving_licence_information, document_classification, extracted_data].hash
547
556
  end
548
557
 
549
558
  # Builds the object from hash
@@ -133,7 +133,7 @@ module Onfido
133
133
  # @return true if the model is valid
134
134
  def valid?
135
135
  warn '[DEPRECATED] the `valid?` method is obsolete'
136
- file_type_validator = EnumAttributeValidator.new('String', ["jpg", "png", "pdf", "unknown_default_open_api"])
136
+ file_type_validator = EnumAttributeValidator.new('String', ["jpg", "jpeg", "png", "pdf", "unknown_default_open_api"])
137
137
  return false unless file_type_validator.valid?(@file_type)
138
138
  side_validator = EnumAttributeValidator.new('String', ["front", "back", "unknown_default_open_api"])
139
139
  return false unless side_validator.valid?(@side)
@@ -143,7 +143,7 @@ module Onfido
143
143
  # Custom attribute writer method checking allowed values (enum).
144
144
  # @param [Object] file_type Object to be assigned
145
145
  def file_type=(file_type)
146
- validator = EnumAttributeValidator.new('String', ["jpg", "png", "pdf", "unknown_default_open_api"])
146
+ validator = EnumAttributeValidator.new('String', ["jpg", "jpeg", "png", "pdf", "unknown_default_open_api"])
147
147
  unless validator.valid?(file_type)
148
148
  fail ArgumentError, "invalid value for \"file_type\", must be one of #{validator.allowable_values}."
149
149
  end
@@ -27,12 +27,14 @@ module Onfido
27
27
 
28
28
  attr_accessor :first_name
29
29
 
30
+ attr_accessor :middle_name
31
+
32
+ attr_accessor :last_name
33
+
30
34
  attr_accessor :gender
31
35
 
32
36
  attr_accessor :issuing_country
33
37
 
34
- attr_accessor :last_name
35
-
36
38
  attr_accessor :nationality
37
39
 
38
40
  attr_accessor :issuing_state
@@ -151,9 +153,10 @@ module Onfido
151
153
  :'document_numbers' => :'document_numbers',
152
154
  :'document_type' => :'document_type',
153
155
  :'first_name' => :'first_name',
156
+ :'middle_name' => :'middle_name',
157
+ :'last_name' => :'last_name',
154
158
  :'gender' => :'gender',
155
159
  :'issuing_country' => :'issuing_country',
156
- :'last_name' => :'last_name',
157
160
  :'nationality' => :'nationality',
158
161
  :'issuing_state' => :'issuing_state',
159
162
  :'issuing_date' => :'issuing_date',
@@ -212,9 +215,10 @@ module Onfido
212
215
  :'document_numbers' => :'Array<DocumentPropertiesDocumentNumbersInner>',
213
216
  :'document_type' => :'String',
214
217
  :'first_name' => :'String',
218
+ :'middle_name' => :'String',
219
+ :'last_name' => :'String',
215
220
  :'gender' => :'String',
216
221
  :'issuing_country' => :'String',
217
- :'last_name' => :'String',
218
222
  :'nationality' => :'String',
219
223
  :'issuing_state' => :'String',
220
224
  :'issuing_date' => :'Date',
@@ -313,6 +317,14 @@ module Onfido
313
317
  self.first_name = attributes[:'first_name']
314
318
  end
315
319
 
320
+ if attributes.key?(:'middle_name')
321
+ self.middle_name = attributes[:'middle_name']
322
+ end
323
+
324
+ if attributes.key?(:'last_name')
325
+ self.last_name = attributes[:'last_name']
326
+ end
327
+
316
328
  if attributes.key?(:'gender')
317
329
  self.gender = attributes[:'gender']
318
330
  end
@@ -321,10 +333,6 @@ module Onfido
321
333
  self.issuing_country = attributes[:'issuing_country']
322
334
  end
323
335
 
324
- if attributes.key?(:'last_name')
325
- self.last_name = attributes[:'last_name']
326
- end
327
-
328
336
  if attributes.key?(:'nationality')
329
337
  self.nationality = attributes[:'nationality']
330
338
  end
@@ -556,9 +564,10 @@ module Onfido
556
564
  document_numbers == o.document_numbers &&
557
565
  document_type == o.document_type &&
558
566
  first_name == o.first_name &&
567
+ middle_name == o.middle_name &&
568
+ last_name == o.last_name &&
559
569
  gender == o.gender &&
560
570
  issuing_country == o.issuing_country &&
561
- last_name == o.last_name &&
562
571
  nationality == o.nationality &&
563
572
  issuing_state == o.issuing_state &&
564
573
  issuing_date == o.issuing_date &&
@@ -611,7 +620,7 @@ module Onfido
611
620
  # Calculates hash code according to all attributes.
612
621
  # @return [Integer] Hash code
613
622
  def hash
614
- [date_of_birth, date_of_expiry, personal_number, document_numbers, document_type, first_name, gender, issuing_country, last_name, nationality, issuing_state, issuing_date, categorisation, mrz_line1, mrz_line2, mrz_line3, address, place_of_birth, spouse_name, widow_name, alias_name, issuing_authority, remarks, civil_state, expatriation, father_name, mother_name, religion, type_of_permit, version_number, document_subtype, profession, security_document_number, tax_number, nist_identity_evidence_strength, has_issuance_confirmation, real_id_compliance, security_tier, address_lines, barcode, nfc, driving_licence_information, document_classification, extracted_data, drivers_licence, restricted_licence, raw_licence_category, raw_vehicle_classes, vehicle_class_details, passenger_vehicle].hash
623
+ [date_of_birth, date_of_expiry, personal_number, document_numbers, document_type, first_name, middle_name, last_name, gender, issuing_country, nationality, issuing_state, issuing_date, categorisation, mrz_line1, mrz_line2, mrz_line3, address, place_of_birth, spouse_name, widow_name, alias_name, issuing_authority, remarks, civil_state, expatriation, father_name, mother_name, religion, type_of_permit, version_number, document_subtype, profession, security_document_number, tax_number, nist_identity_evidence_strength, has_issuance_confirmation, real_id_compliance, security_tier, address_lines, barcode, nfc, driving_licence_information, document_classification, extracted_data, drivers_licence, restricted_licence, raw_licence_category, raw_vehicle_classes, vehicle_class_details, passenger_vehicle].hash
615
624
  end
616
625
 
617
626
  # Builds the object from hash
@@ -22,6 +22,9 @@ module Onfido
22
22
  # The current state of the object, if available.
23
23
  attr_accessor :status
24
24
 
25
+ # The date and time when the operation was started, if available.
26
+ attr_accessor :started_at_iso8601
27
+
25
28
  # The date and time when the operation was completed, if available.
26
29
  attr_accessor :completed_at_iso8601
27
30
 
@@ -33,6 +36,7 @@ module Onfido
33
36
  {
34
37
  :'id' => :'id',
35
38
  :'status' => :'status',
39
+ :'started_at_iso8601' => :'started_at_iso8601',
36
40
  :'completed_at_iso8601' => :'completed_at_iso8601',
37
41
  :'href' => :'href'
38
42
  }
@@ -48,6 +52,7 @@ module Onfido
48
52
  {
49
53
  :'id' => :'String',
50
54
  :'status' => :'String',
55
+ :'started_at_iso8601' => :'Time',
51
56
  :'completed_at_iso8601' => :'Time',
52
57
  :'href' => :'String'
53
58
  }
@@ -84,6 +89,10 @@ module Onfido
84
89
  self.status = attributes[:'status']
85
90
  end
86
91
 
92
+ if attributes.key?(:'started_at_iso8601')
93
+ self.started_at_iso8601 = attributes[:'started_at_iso8601']
94
+ end
95
+
87
96
  if attributes.key?(:'completed_at_iso8601')
88
97
  self.completed_at_iso8601 = attributes[:'completed_at_iso8601']
89
98
  end
@@ -127,6 +136,7 @@ module Onfido
127
136
  self.class == o.class &&
128
137
  id == o.id &&
129
138
  status == o.status &&
139
+ started_at_iso8601 == o.started_at_iso8601 &&
130
140
  completed_at_iso8601 == o.completed_at_iso8601 &&
131
141
  href == o.href
132
142
  end
@@ -140,7 +150,7 @@ module Onfido
140
150
  # Calculates hash code according to all attributes.
141
151
  # @return [Integer] Hash code
142
152
  def hash
143
- [id, status, completed_at_iso8601, href].hash
153
+ [id, status, started_at_iso8601, completed_at_iso8601, href].hash
144
154
  end
145
155
 
146
156
  # Builds the object from hash
@@ -24,6 +24,9 @@ module Onfido
24
24
  # Tags or labels assigned to the workflow run.
25
25
  attr_accessor :tags
26
26
 
27
+ # Customer-provided user identifier.
28
+ attr_accessor :customer_user_id
29
+
27
30
  attr_accessor :link
28
31
 
29
32
  # The date and time when the Workflow Run was created.
@@ -52,6 +55,9 @@ module Onfido
52
55
 
53
56
  attr_accessor :error
54
57
 
58
+ # Client token to use when loading this workflow run in the Onfido SDK.
59
+ attr_accessor :sdk_token
60
+
55
61
  class EnumAttributeValidator
56
62
  attr_reader :datatype
57
63
  attr_reader :allowable_values
@@ -80,6 +86,7 @@ module Onfido
80
86
  :'applicant_id' => :'applicant_id',
81
87
  :'workflow_id' => :'workflow_id',
82
88
  :'tags' => :'tags',
89
+ :'customer_user_id' => :'customer_user_id',
83
90
  :'link' => :'link',
84
91
  :'created_at' => :'created_at',
85
92
  :'updated_at' => :'updated_at',
@@ -89,7 +96,8 @@ module Onfido
89
96
  :'status' => :'status',
90
97
  :'output' => :'output',
91
98
  :'reasons' => :'reasons',
92
- :'error' => :'error'
99
+ :'error' => :'error',
100
+ :'sdk_token' => :'sdk_token'
93
101
  }
94
102
  end
95
103
 
@@ -104,6 +112,7 @@ module Onfido
104
112
  :'applicant_id' => :'String',
105
113
  :'workflow_id' => :'String',
106
114
  :'tags' => :'Array<String>',
115
+ :'customer_user_id' => :'String',
107
116
  :'link' => :'WorkflowRunSharedLink',
108
117
  :'created_at' => :'Time',
109
118
  :'updated_at' => :'Time',
@@ -113,7 +122,8 @@ module Onfido
113
122
  :'status' => :'String',
114
123
  :'output' => :'Object',
115
124
  :'reasons' => :'Array<String>',
116
- :'error' => :'WorkflowRunResponseError'
125
+ :'error' => :'WorkflowRunResponseError',
126
+ :'sdk_token' => :'String'
117
127
  }
118
128
  end
119
129
 
@@ -121,6 +131,7 @@ module Onfido
121
131
  def self.openapi_nullable
122
132
  Set.new([
123
133
  :'tags',
134
+ :'sdk_token'
124
135
  ])
125
136
  end
126
137
 
@@ -165,6 +176,10 @@ module Onfido
165
176
  end
166
177
  end
167
178
 
179
+ if attributes.key?(:'customer_user_id')
180
+ self.customer_user_id = attributes[:'customer_user_id']
181
+ end
182
+
168
183
  if attributes.key?(:'link')
169
184
  self.link = attributes[:'link']
170
185
  end
@@ -208,6 +223,10 @@ module Onfido
208
223
  if attributes.key?(:'error')
209
224
  self.error = attributes[:'error']
210
225
  end
226
+
227
+ if attributes.key?(:'sdk_token')
228
+ self.sdk_token = attributes[:'sdk_token']
229
+ end
211
230
  end
212
231
 
213
232
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -227,6 +246,10 @@ module Onfido
227
246
  invalid_properties.push('invalid value for "tags", number of items must be less than or equal to 30.')
228
247
  end
229
248
 
249
+ if !@customer_user_id.nil? && @customer_user_id.to_s.length > 256
250
+ invalid_properties.push('invalid value for "customer_user_id", the character length must be smaller than or equal to 256.')
251
+ end
252
+
230
253
  if @id.nil?
231
254
  invalid_properties.push('invalid value for "id", id cannot be nil.')
232
255
  end
@@ -241,6 +264,7 @@ module Onfido
241
264
  return false if @applicant_id.nil?
242
265
  return false if @workflow_id.nil?
243
266
  return false if !@tags.nil? && @tags.length > 30
267
+ return false if !@customer_user_id.nil? && @customer_user_id.to_s.length > 256
244
268
  return false if @id.nil?
245
269
  status_validator = EnumAttributeValidator.new('String', ["awaiting_input", "processing", "abandoned", "error", "approved", "review", "declined", "unknown_default_open_api"])
246
270
  return false unless status_validator.valid?(@status)
@@ -257,6 +281,20 @@ module Onfido
257
281
  @tags = tags
258
282
  end
259
283
 
284
+ # Custom attribute writer method with validation
285
+ # @param [Object] customer_user_id Value to be assigned
286
+ def customer_user_id=(customer_user_id)
287
+ if customer_user_id.nil?
288
+ fail ArgumentError, 'customer_user_id cannot be nil'
289
+ end
290
+
291
+ if customer_user_id.to_s.length > 256
292
+ fail ArgumentError, 'invalid value for "customer_user_id", the character length must be smaller than or equal to 256.'
293
+ end
294
+
295
+ @customer_user_id = customer_user_id
296
+ end
297
+
260
298
  # Custom attribute writer method checking allowed values (enum).
261
299
  # @param [Object] status Object to be assigned
262
300
  def status=(status)
@@ -275,6 +313,7 @@ module Onfido
275
313
  applicant_id == o.applicant_id &&
276
314
  workflow_id == o.workflow_id &&
277
315
  tags == o.tags &&
316
+ customer_user_id == o.customer_user_id &&
278
317
  link == o.link &&
279
318
  created_at == o.created_at &&
280
319
  updated_at == o.updated_at &&
@@ -284,7 +323,8 @@ module Onfido
284
323
  status == o.status &&
285
324
  output == o.output &&
286
325
  reasons == o.reasons &&
287
- error == o.error
326
+ error == o.error &&
327
+ sdk_token == o.sdk_token
288
328
  end
289
329
 
290
330
  # @see the `==` method
@@ -296,7 +336,7 @@ module Onfido
296
336
  # Calculates hash code according to all attributes.
297
337
  # @return [Integer] Hash code
298
338
  def hash
299
- [applicant_id, workflow_id, tags, link, created_at, updated_at, id, workflow_version_id, dashboard_url, status, output, reasons, error].hash
339
+ [applicant_id, workflow_id, tags, customer_user_id, link, created_at, updated_at, id, workflow_version_id, dashboard_url, status, output, reasons, error, sdk_token].hash
300
340
  end
301
341
 
302
342
  # Builds the object from hash
@@ -24,6 +24,9 @@ module Onfido
24
24
  # Tags or labels assigned to the workflow run.
25
25
  attr_accessor :tags
26
26
 
27
+ # Customer-provided user identifier.
28
+ attr_accessor :customer_user_id
29
+
27
30
  attr_accessor :link
28
31
 
29
32
  # The date and time when the Workflow Run was created.
@@ -41,6 +44,7 @@ module Onfido
41
44
  :'applicant_id' => :'applicant_id',
42
45
  :'workflow_id' => :'workflow_id',
43
46
  :'tags' => :'tags',
47
+ :'customer_user_id' => :'customer_user_id',
44
48
  :'link' => :'link',
45
49
  :'created_at' => :'created_at',
46
50
  :'updated_at' => :'updated_at',
@@ -59,6 +63,7 @@ module Onfido
59
63
  :'applicant_id' => :'String',
60
64
  :'workflow_id' => :'String',
61
65
  :'tags' => :'Array<String>',
66
+ :'customer_user_id' => :'String',
62
67
  :'link' => :'WorkflowRunSharedLink',
63
68
  :'created_at' => :'Time',
64
69
  :'updated_at' => :'Time',
@@ -114,6 +119,10 @@ module Onfido
114
119
  end
115
120
  end
116
121
 
122
+ if attributes.key?(:'customer_user_id')
123
+ self.customer_user_id = attributes[:'customer_user_id']
124
+ end
125
+
117
126
  if attributes.key?(:'link')
118
127
  self.link = attributes[:'link']
119
128
  end
@@ -150,6 +159,10 @@ module Onfido
150
159
  invalid_properties.push('invalid value for "tags", number of items must be less than or equal to 30.')
151
160
  end
152
161
 
162
+ if !@customer_user_id.nil? && @customer_user_id.to_s.length > 256
163
+ invalid_properties.push('invalid value for "customer_user_id", the character length must be smaller than or equal to 256.')
164
+ end
165
+
153
166
  invalid_properties
154
167
  end
155
168
 
@@ -160,6 +173,7 @@ module Onfido
160
173
  return false if @applicant_id.nil?
161
174
  return false if @workflow_id.nil?
162
175
  return false if !@tags.nil? && @tags.length > 30
176
+ return false if !@customer_user_id.nil? && @customer_user_id.to_s.length > 256
163
177
  true
164
178
  end
165
179
 
@@ -173,6 +187,20 @@ module Onfido
173
187
  @tags = tags
174
188
  end
175
189
 
190
+ # Custom attribute writer method with validation
191
+ # @param [Object] customer_user_id Value to be assigned
192
+ def customer_user_id=(customer_user_id)
193
+ if customer_user_id.nil?
194
+ fail ArgumentError, 'customer_user_id cannot be nil'
195
+ end
196
+
197
+ if customer_user_id.to_s.length > 256
198
+ fail ArgumentError, 'invalid value for "customer_user_id", the character length must be smaller than or equal to 256.'
199
+ end
200
+
201
+ @customer_user_id = customer_user_id
202
+ end
203
+
176
204
  # Checks equality by comparing each attribute.
177
205
  # @param [Object] Object to be compared
178
206
  def ==(o)
@@ -181,6 +209,7 @@ module Onfido
181
209
  applicant_id == o.applicant_id &&
182
210
  workflow_id == o.workflow_id &&
183
211
  tags == o.tags &&
212
+ customer_user_id == o.customer_user_id &&
184
213
  link == o.link &&
185
214
  created_at == o.created_at &&
186
215
  updated_at == o.updated_at &&
@@ -196,7 +225,7 @@ module Onfido
196
225
  # Calculates hash code according to all attributes.
197
226
  # @return [Integer] Hash code
198
227
  def hash
199
- [applicant_id, workflow_id, tags, link, created_at, updated_at, custom_data].hash
228
+ [applicant_id, workflow_id, tags, customer_user_id, link, created_at, updated_at, custom_data].hash
200
229
  end
201
230
 
202
231
  # Builds the object from hash
@@ -35,6 +35,9 @@ module Onfido
35
35
 
36
36
  attr_accessor :error
37
37
 
38
+ # Client token to use when loading this workflow run in the Onfido SDK.
39
+ attr_accessor :sdk_token
40
+
38
41
  class EnumAttributeValidator
39
42
  attr_reader :datatype
40
43
  attr_reader :allowable_values
@@ -66,7 +69,8 @@ module Onfido
66
69
  :'status' => :'status',
67
70
  :'output' => :'output',
68
71
  :'reasons' => :'reasons',
69
- :'error' => :'error'
72
+ :'error' => :'error',
73
+ :'sdk_token' => :'sdk_token'
70
74
  }
71
75
  end
72
76
 
@@ -84,13 +88,15 @@ module Onfido
84
88
  :'status' => :'String',
85
89
  :'output' => :'Object',
86
90
  :'reasons' => :'Array<String>',
87
- :'error' => :'WorkflowRunResponseError'
91
+ :'error' => :'WorkflowRunResponseError',
92
+ :'sdk_token' => :'String'
88
93
  }
89
94
  end
90
95
 
91
96
  # List of attributes with nullable: true
92
97
  def self.openapi_nullable
93
98
  Set.new([
99
+ :'sdk_token'
94
100
  ])
95
101
  end
96
102
 
@@ -140,6 +146,10 @@ module Onfido
140
146
  if attributes.key?(:'error')
141
147
  self.error = attributes[:'error']
142
148
  end
149
+
150
+ if attributes.key?(:'sdk_token')
151
+ self.sdk_token = attributes[:'sdk_token']
152
+ end
143
153
  end
144
154
 
145
155
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -185,7 +195,8 @@ module Onfido
185
195
  status == o.status &&
186
196
  output == o.output &&
187
197
  reasons == o.reasons &&
188
- error == o.error
198
+ error == o.error &&
199
+ sdk_token == o.sdk_token
189
200
  end
190
201
 
191
202
  # @see the `==` method
@@ -197,7 +208,7 @@ module Onfido
197
208
  # Calculates hash code according to all attributes.
198
209
  # @return [Integer] Hash code
199
210
  def hash
200
- [id, workflow_version_id, dashboard_url, status, output, reasons, error].hash
211
+ [id, workflow_version_id, dashboard_url, status, output, reasons, error, sdk_token].hash
201
212
  end
202
213
 
203
214
  # Builds the object from hash
@@ -24,6 +24,9 @@ module Onfido
24
24
  # Tags or labels assigned to the workflow run.
25
25
  attr_accessor :tags
26
26
 
27
+ # Customer-provided user identifier.
28
+ attr_accessor :customer_user_id
29
+
27
30
  attr_accessor :link
28
31
 
29
32
  # The date and time when the Workflow Run was created.
@@ -38,6 +41,7 @@ module Onfido
38
41
  :'applicant_id' => :'applicant_id',
39
42
  :'workflow_id' => :'workflow_id',
40
43
  :'tags' => :'tags',
44
+ :'customer_user_id' => :'customer_user_id',
41
45
  :'link' => :'link',
42
46
  :'created_at' => :'created_at',
43
47
  :'updated_at' => :'updated_at'
@@ -55,6 +59,7 @@ module Onfido
55
59
  :'applicant_id' => :'String',
56
60
  :'workflow_id' => :'String',
57
61
  :'tags' => :'Array<String>',
62
+ :'customer_user_id' => :'String',
58
63
  :'link' => :'WorkflowRunSharedLink',
59
64
  :'created_at' => :'Time',
60
65
  :'updated_at' => :'Time'
@@ -101,6 +106,10 @@ module Onfido
101
106
  end
102
107
  end
103
108
 
109
+ if attributes.key?(:'customer_user_id')
110
+ self.customer_user_id = attributes[:'customer_user_id']
111
+ end
112
+
104
113
  if attributes.key?(:'link')
105
114
  self.link = attributes[:'link']
106
115
  end
@@ -131,6 +140,10 @@ module Onfido
131
140
  invalid_properties.push('invalid value for "tags", number of items must be less than or equal to 30.')
132
141
  end
133
142
 
143
+ if !@customer_user_id.nil? && @customer_user_id.to_s.length > 256
144
+ invalid_properties.push('invalid value for "customer_user_id", the character length must be smaller than or equal to 256.')
145
+ end
146
+
134
147
  invalid_properties
135
148
  end
136
149
 
@@ -141,6 +154,7 @@ module Onfido
141
154
  return false if @applicant_id.nil?
142
155
  return false if @workflow_id.nil?
143
156
  return false if !@tags.nil? && @tags.length > 30
157
+ return false if !@customer_user_id.nil? && @customer_user_id.to_s.length > 256
144
158
  true
145
159
  end
146
160
 
@@ -154,6 +168,20 @@ module Onfido
154
168
  @tags = tags
155
169
  end
156
170
 
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] customer_user_id Value to be assigned
173
+ def customer_user_id=(customer_user_id)
174
+ if customer_user_id.nil?
175
+ fail ArgumentError, 'customer_user_id cannot be nil'
176
+ end
177
+
178
+ if customer_user_id.to_s.length > 256
179
+ fail ArgumentError, 'invalid value for "customer_user_id", the character length must be smaller than or equal to 256.'
180
+ end
181
+
182
+ @customer_user_id = customer_user_id
183
+ end
184
+
157
185
  # Checks equality by comparing each attribute.
158
186
  # @param [Object] Object to be compared
159
187
  def ==(o)
@@ -162,6 +190,7 @@ module Onfido
162
190
  applicant_id == o.applicant_id &&
163
191
  workflow_id == o.workflow_id &&
164
192
  tags == o.tags &&
193
+ customer_user_id == o.customer_user_id &&
165
194
  link == o.link &&
166
195
  created_at == o.created_at &&
167
196
  updated_at == o.updated_at
@@ -176,7 +205,7 @@ module Onfido
176
205
  # Calculates hash code according to all attributes.
177
206
  # @return [Integer] Hash code
178
207
  def hash
179
- [applicant_id, workflow_id, tags, link, created_at, updated_at].hash
208
+ [applicant_id, workflow_id, tags, customer_user_id, link, created_at, updated_at].hash
180
209
  end
181
210
 
182
211
  # Builds the object from hash
@@ -11,5 +11,5 @@ Generator version: 7.6.0
11
11
  =end
12
12
 
13
13
  module Onfido
14
- VERSION = '3.1.0'
14
+ VERSION = '3.3.0'
15
15
  end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../shared_contexts/with_workflow_run'
4
+
5
+ describe Onfido::WorkflowRun do
6
+ include_context 'with applicant'
7
+
8
+ let(:workflow_id) { '8b74614f-9e7f-42fd-852a-5f2bcc852587' }
9
+
10
+ let(:workflow_run_builder) do
11
+ Onfido::WorkflowRunBuilder.new({
12
+ applicant_id: applicant_id,
13
+ workflow_id: workflow_id,
14
+ custom_data: {
15
+ country_of_operation: "GBR",
16
+ document_date_of_expiry: "2022-01-01",
17
+ document_issuing_country: "FRA",
18
+ document_issuing_date: "2022-01-01",
19
+ document_number: "Example string",
20
+ document_to_sign_url: "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
21
+ document_type: "driving_licence",
22
+ }
23
+ })
24
+ end
25
+
26
+ let(:workflow_run) { onfido_api.create_workflow_run(workflow_run_builder) }
27
+ let!(:workflow_run_id) { workflow_run.id }
28
+
29
+ let(:file_id) do
30
+ task = onfido_api.list_tasks(workflow_run_id)[0]
31
+
32
+ output = repeat_request_until_task_output_changes(
33
+ max_retries = 10,
34
+ interval = 3
35
+ ) { onfido_api.find_task(workflow_run_id, task.id) }.output
36
+
37
+ output[:properties][:signed_documents][0][:id]
38
+ end
39
+
40
+ describe 'Workflow run' do
41
+ it 'downloads qes document' do
42
+ file = onfido_api.download_qes_document(workflow_run_id, file_id)
43
+
44
+ expect(file.size).to be > 0
45
+ end
46
+ end
47
+ end
@@ -14,7 +14,7 @@ describe Onfido::Webhook do
14
14
  end
15
15
 
16
16
  let(:webhook) { onfido_api.create_webhook(webhook_builder) }
17
- let(:webhook_id) { webhook.id }
17
+ let!(:webhook_id) { webhook.id }
18
18
 
19
19
  it 'creates a webhook' do
20
20
  expect(webhook).to be_an_instance_of Onfido::Webhook
@@ -15,6 +15,8 @@ RSpec.shared_context 'with applicant', shared_context: :metadata do
15
15
  {
16
16
  'first_name' => 'Test',
17
17
  'last_name' => 'Applicant',
18
+ 'email' => "first.last@gmail.com",
19
+ 'phone_number' => "351911111111",
18
20
  'location' => {
19
21
  'ip_address' => '127.0.0.1',
20
22
  'country_of_residence' => 'GBR'
data/spec/spec_helper.rb CHANGED
@@ -86,6 +86,26 @@ def repeat_request_until_status_changes(expected_status, max_retries = 10,
86
86
  instance
87
87
  end
88
88
 
89
+ def repeat_request_until_task_output_changes(max_retries = 10,
90
+ interval = 1, &proc)
91
+ # max_retries --> how many times to retry the request
92
+ # interval --> how many seconds to wait until the next retry
93
+ # proc --> code containing the request
94
+
95
+ instance = proc.call
96
+
97
+ iteration = 0
98
+ while instance.output == nil
99
+ raise "task output did not change in time" if iteration > max_retries
100
+
101
+ iteration += 1
102
+ sleep(interval)
103
+ instance = proc.call
104
+ end
105
+
106
+ instance
107
+ end
108
+
89
109
  def repeat_request_unti_http_code_changes(max_retries = 10,
90
110
  interval = 1, &proc)
91
111
  # max_retries --> how many times to retry the request
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onfido
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-05 00:00:00.000000000 Z
11
+ date: 2024-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -412,6 +412,7 @@ files:
412
412
  - spec/integrations/media/sample_driving_licence.png
413
413
  - spec/integrations/media/sample_photo.png
414
414
  - spec/integrations/motion_capture_spec.rb
415
+ - spec/integrations/qualified_electronic_signature_spec.rb
415
416
  - spec/integrations/report_schema_spec.rb
416
417
  - spec/integrations/report_spec.rb
417
418
  - spec/integrations/sdk_token_spec.rb
@@ -452,30 +453,31 @@ signing_key:
452
453
  specification_version: 4
453
454
  summary: The official Ruby library for integrating with the Onfido API.
454
455
  test_files:
455
- - spec/integrations/address_picker_spec.rb
456
- - spec/integrations/report_schema_spec.rb
457
- - spec/integrations/document_spec.rb
458
- - spec/integrations/extraction_spec.rb
459
- - spec/integrations/report_spec.rb
456
+ - spec/integrations/live_photo_spec.rb
457
+ - spec/integrations/sdk_token_spec.rb
458
+ - spec/integrations/watchlist_monitor_spec.rb
459
+ - spec/integrations/live_video_spec.rb
460
+ - spec/integrations/qualified_electronic_signature_spec.rb
461
+ - spec/integrations/workflow_run_spec.rb
462
+ - spec/integrations/applicant_spec.rb
463
+ - spec/integrations/check_spec.rb
460
464
  - spec/integrations/motion_capture_spec.rb
461
- - spec/integrations/tasks_spec.rb
465
+ - spec/integrations/extraction_spec.rb
462
466
  - spec/integrations/webhook_spec.rb
467
+ - spec/integrations/address_picker_spec.rb
468
+ - spec/integrations/report_schema_spec.rb
463
469
  - spec/integrations/media/sample_photo.png
464
470
  - spec/integrations/media/sample_driving_licence.png
465
- - spec/integrations/check_spec.rb
466
- - spec/integrations/live_video_spec.rb
467
- - spec/integrations/sdk_token_spec.rb
468
- - spec/integrations/live_photo_spec.rb
469
- - spec/integrations/watchlist_monitor_spec.rb
471
+ - spec/integrations/report_spec.rb
472
+ - spec/integrations/tasks_spec.rb
473
+ - spec/integrations/document_spec.rb
470
474
  - spec/integrations/id_photo_spec.rb
471
475
  - spec/integrations/workflow_run_output_spec.rb
472
- - spec/integrations/workflow_run_spec.rb
473
- - spec/integrations/applicant_spec.rb
474
- - spec/shared_contexts/with_onfido.rb
475
476
  - spec/shared_contexts/with_applicant.rb
476
- - spec/shared_contexts/with_workflow_run.rb
477
477
  - spec/shared_contexts/with_document.rb
478
- - spec/shared_contexts/with_check.rb
478
+ - spec/shared_contexts/with_onfido.rb
479
479
  - spec/shared_contexts/with_live_photo.rb
480
+ - spec/shared_contexts/with_check.rb
481
+ - spec/shared_contexts/with_workflow_run.rb
480
482
  - spec/spec_helper.rb
481
483
  - spec/webhook_event_verifier_spec.rb