isds 0.1.0 → 0.2.0

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: a5f6c4b4643e4f08410bb292d56afe96a75db717055ec20579dafea9da1dbadd
4
- data.tar.gz: 7658f9a652173800354c7b8b2f5ce5d305d5c2d850237514df18027eccb86fa2
3
+ metadata.gz: 6a549b22ca1e5aef6f07e20818ef5ec3ec4b6054a94ce6a0ef4dd92f59b0392e
4
+ data.tar.gz: 3cfe176c0bb61cc168fff4651f0f71631e15dd9d0216a5bdbff28db00d9e2a90
5
5
  SHA512:
6
- metadata.gz: 8682b7e75cd0e581350ae9c000f43a323e914acb5224a8501f88f706f9d227c99eb51cdfcc958898c8368c9c940c269fd9a4ef0be85a206e5b64088daa20f152
7
- data.tar.gz: 662f41fd534dca323546dbe80e3d20984eac614e160c8193cba1af8bf9b36a8cf92d6c11c26497507cdc48eb748378573f95a6c0cf0df55be8e98ef8d842836d
6
+ metadata.gz: f5e511ae1094d0e454a8dfb7b71aa4190ef2de0026eb0631f6184ca2e10bbf7f24ffb039c8284b7b74a2b8cde7ee718ece719c51d2fa44f4ab67fe583bb71e6c
7
+ data.tar.gz: 02e69bab0a6041ed0ed63fca6c05ea16be5b48952a81115f9b48340091487f2adcd197c6f792902fc7a80f70041464a4fe6e127085ffeb2f48a54ac4458acd3c
data/lib/isds/client.rb CHANGED
@@ -13,7 +13,7 @@ module ISDS
13
13
  def authenticate!
14
14
  configuration.validate!
15
15
  # Perform a simple operation to verify credentials
16
- connection.call(:info, :get_owner_info_from_login)
16
+ connection.call(:access, :get_owner_info_from_login)
17
17
  @authenticated = true
18
18
  rescue ISDS::Error
19
19
  @authenticated = false
@@ -71,7 +71,7 @@ module ISDS
71
71
  # --- Info operations ---
72
72
 
73
73
  def owner_info
74
- connection.call(:info, :get_owner_info_from_login)
74
+ connection.call(:access, :get_owner_info_from_login)
75
75
  end
76
76
 
77
77
  def password_info
@@ -12,7 +12,8 @@ module ISDS
12
12
 
13
13
  def call(service, operation, message = {})
14
14
  client = soap_client_for(service)
15
- response = client.call(operation, message: message)
15
+ pascal_tag = operation.to_s.split('_').map(&:capitalize).join
16
+ response = client.call(operation, message_tag: pascal_tag, message: message)
16
17
  parse_response(response)
17
18
  rescue Savon::SOAPFault => e
18
19
  handle_soap_fault(e)
@@ -49,7 +50,7 @@ module ISDS
49
50
  ssl_verify_mode: configuration.ssl_verify_peer ? :peer : :none,
50
51
  log: configuration.enable_request_logging,
51
52
  pretty_print_xml: configuration.test?,
52
- convert_response_tags_to: ->(tag) { tag.snakecase.to_sym }
53
+ convert_response_tags_to: ->(tag) { Savon::StringUtils.snakecase(tag).to_sym }
53
54
  }
54
55
 
55
56
  options[:ssl_ca_cert_file] = configuration.ssl_ca_file if configuration.ssl_ca_file
data/lib/isds/message.rb CHANGED
@@ -63,23 +63,23 @@ module ISDS
63
63
  end
64
64
 
65
65
  def download_attachment(attachment_id, path = nil)
66
- response = @connection.call(:info, :message_download, { 'isds:dmID' => id })
66
+ response = @connection.call(:operations, :message_download, { 'isds:dmID' => id })
67
67
  extract_attachment(response, attachment_id, path)
68
68
  end
69
69
 
70
70
  def download_all_attachments(directory)
71
- response = @connection.call(:info, :message_download, { 'isds:dmID' => id })
71
+ response = @connection.call(:operations, :message_download, { 'isds:dmID' => id })
72
72
  extract_all_attachments(response, directory)
73
73
  end
74
74
 
75
75
  def signed_content
76
- response = @connection.call(:info, :signed_message_download, { 'isds:dmID' => id })
76
+ response = @connection.call(:operations, :signed_message_download, { 'isds:dmID' => id })
77
77
  response.dig(:signed_message_download_response, :dm_signature)
78
78
  end
79
79
 
80
80
  class << self
81
81
  def find(message_id, connection:)
82
- response = connection.call(:info, :message_download, { 'isds:dmID' => message_id })
82
+ response = connection.call(:operations, :message_download, { 'isds:dmID' => message_id })
83
83
  from_response(response, connection: connection)
84
84
  end
85
85
 
data/lib/isds/search.rb CHANGED
@@ -13,6 +13,8 @@ module ISDS
13
13
  criteria = build_search_criteria(query, **options)
14
14
  response = connection.call(:search, :find_data_box, criteria)
15
15
  parse_search_response(response)
16
+ rescue PermissionDeniedError
17
+ []
16
18
  end
17
19
 
18
20
  def self.by_name(name, connection:, exact: false)
data/lib/isds/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ISDS
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
data/lib/isds.rb CHANGED
@@ -21,24 +21,32 @@ module ISDS
21
21
  ENDPOINTS = {
22
22
  production: {
23
23
  base_url: 'https://ws1.mojedatovaschranka.cz/',
24
- ws_url: 'https://ws1.mojedatovaschranka.cz/soap',
25
- ws2_url: 'https://ws1.mojedatovaschranka.cz/vdz_ws/'
24
+ operations: 'https://ws1.mojedatovaschranka.cz/DS/dz',
25
+ info: 'https://ws1.mojedatovaschranka.cz/DS/dx',
26
+ search: 'https://ws1.mojedatovaschranka.cz/DS/df',
27
+ access: 'https://ws1.mojedatovaschranka.cz/DS/DsManage',
28
+ supplementary: 'https://ws1.mojedatovaschranka.cz/DS/dx',
29
+ large_messages: 'https://ws1.mojedatovaschranka.cz/DS/dz'
26
30
  },
27
31
  test: {
28
- base_url: 'https://www.czebox.cz/',
29
- ws_url: 'https://www.czebox.cz/soap',
30
- ws2_url: 'https://www.czebox.cz/vdz_ws/',
32
+ base_url: 'https://ws1.czebox.cz/',
33
+ operations: 'https://ws1.czebox.cz/DS/dz',
34
+ info: 'https://ws1.czebox.cz/DS/dx',
35
+ search: 'https://ws1.czebox.cz/DS/df',
36
+ access: 'https://ws1.czebox.cz/DS/DsManage',
37
+ supplementary: 'https://ws1.czebox.cz/DS/dx',
38
+ large_messages: 'https://ws1.czebox.cz/DS/dz',
31
39
  wsdl_base: 'https://www.czebox.cz/static/wsdl/v20/'
32
40
  }
33
41
  }.freeze
34
42
 
35
43
  SERVICE_ENDPOINT_MAP = {
36
- operations: :ws_url,
37
- info: :ws_url,
38
- search: :ws_url,
39
- access: :ws_url,
40
- supplementary: :ws_url,
41
- large_messages: :ws2_url
44
+ operations: :operations,
45
+ info: :info,
46
+ search: :search,
47
+ access: :access,
48
+ supplementary: :supplementary,
49
+ large_messages: :large_messages
42
50
  }.freeze
43
51
 
44
52
  class << self
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Segfault Labs
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-02-02 00:00:00.000000000 Z
10
+ date: 2026-02-03 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: nokogiri