epp-xml 0.10.1 → 0.10.2

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
  SHA1:
3
- metadata.gz: a6e014f16dd7adb1748dd3015f6355ac4518b7ef
4
- data.tar.gz: c7e957b18dd5760bda52a325473a06d38aee0ebb
3
+ metadata.gz: 71439758babfc5817c54111fd3f46b81350351f7
4
+ data.tar.gz: dd77cba20e69cac8cf5ab4220284887fd90f5f94
5
5
  SHA512:
6
- metadata.gz: 828c3c112bc24d0af011a499beab2e7525cd79a5f347110741f3accf0b90b4a5da4697a1a00da7e20a55207a8c5e776f3d780b77453d0f28abf9782e179bc5b1
7
- data.tar.gz: 486e13682b3b075e73dc02117d98e637a109ba23b763f10fe3e74b3e015878a10e2ea0f9d0ae89f2f2d9c6484f4fcc477c95aec35292eed73c5fa618ee961b2c
6
+ metadata.gz: 9429d7b4ecba375a7e183c0d8295596224c64e66c0e71740735ccc82828a95ac0c98159493e642759c83341dcc1ef928868e80fab199872521ca8256bf45e290
7
+ data.tar.gz: c08021763ed497ebd1c8b9463c5ebfd27dee990aad5840054474d5ec9255888cc54214ff249166a22f15b931b8711bc087bd729a211adf8172d2f17118ae702f
@@ -4,27 +4,27 @@ class EppXml
4
4
  class Contact
5
5
  include ClientTransactionId
6
6
 
7
- def create(xml_params = {})
8
- build('create', xml_params)
7
+ def create(xml_params = {}, custom_params = {})
8
+ build('create', xml_params, custom_params)
9
9
  end
10
10
 
11
- def check(xml_params = {})
12
- build('check', xml_params)
11
+ def check(xml_params = {}, custom_params = {})
12
+ build('check', xml_params, custom_params)
13
13
  end
14
14
 
15
- def info(xml_params = {})
16
- build('info', xml_params)
15
+ def info(xml_params = {}, custom_params = {})
16
+ build('info', xml_params, custom_params)
17
17
  end
18
18
 
19
- def delete(xml_params = {})
20
- build('delete', xml_params)
19
+ def delete(xml_params = {}, custom_params = {})
20
+ build('delete', xml_params, custom_params)
21
21
  end
22
22
 
23
- def update(xml_params = {})
24
- build('update', xml_params)
23
+ def update(xml_params = {}, custom_params = {})
24
+ build('update', xml_params, custom_params)
25
25
  end
26
26
 
27
- def transfer(xml_params = {}, op = 'query')
27
+ def transfer(xml_params = {}, op = 'query', custom_params = {})
28
28
  xml = Builder::XmlMarkup.new
29
29
 
30
30
  xml.instruct!(:xml, standalone: 'no')
@@ -35,6 +35,8 @@ class EppXml
35
35
  EppXml.generate_xml_from_hash(xml_params, xml, 'contact:')
36
36
  end
37
37
  end
38
+
39
+ EppXml.custom_ext(xml, custom_params)
38
40
  xml.clTRID(clTRID)
39
41
  end
40
42
  end
@@ -42,7 +44,7 @@ class EppXml
42
44
 
43
45
  private
44
46
 
45
- def build(command, xml_params)
47
+ def build(command, xml_params, custom_params)
46
48
  xml = Builder::XmlMarkup.new
47
49
 
48
50
  xml.instruct!(:xml, standalone: 'no')
@@ -53,6 +55,8 @@ class EppXml
53
55
  EppXml.generate_xml_from_hash(xml_params, xml, 'contact:')
54
56
  end
55
57
  end
58
+
59
+ EppXml.custom_ext(xml, custom_params)
56
60
  xml.clTRID(clTRID)
57
61
  end
58
62
  end
@@ -4,23 +4,23 @@ class EppXml
4
4
  class Domain
5
5
  include ClientTransactionId
6
6
 
7
- def info(xml_params = {})
8
- build('info', xml_params)
7
+ def info(xml_params = {}, custom_params = {})
8
+ build('info', xml_params, custom_params)
9
9
  end
10
10
 
11
- def check(xml_params = {})
12
- build('check', xml_params)
11
+ def check(xml_params = {}, custom_params = {})
12
+ build('check', xml_params, custom_params)
13
13
  end
14
14
 
15
- def delete(xml_params = {})
16
- build('delete', xml_params)
15
+ def delete(xml_params = {}, custom_params = {})
16
+ build('delete', xml_params, custom_params)
17
17
  end
18
18
 
19
- def renew(xml_params = {})
20
- build('renew', xml_params)
19
+ def renew(xml_params = {}, custom_params = {})
20
+ build('renew', xml_params, custom_params)
21
21
  end
22
22
 
23
- def create(xml_params = {}, dnssec_params = {})
23
+ def create(xml_params = {}, dnssec_params = {}, custom_params = {})
24
24
  xml = Builder::XmlMarkup.new
25
25
 
26
26
  xml.instruct!(:xml, standalone: 'no')
@@ -31,17 +31,24 @@ class EppXml
31
31
  EppXml.generate_xml_from_hash(xml_params, xml, 'domain:')
32
32
  end
33
33
  end
34
+
34
35
  xml.extension do
35
36
  xml.tag!('secDNS:create', 'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1') do
36
37
  EppXml.generate_xml_from_hash(dnssec_params, xml, 'secDNS:')
37
- end
38
- end if dnssec_params != false
38
+ end if dnssec_params.any?
39
+
40
+ xml.tag!('eis:extdata',
41
+ 'xmlns:eis' => 'urn:ee:eis:xml:epp:eis-1.0') do
42
+ EppXml.generate_xml_from_hash(custom_params, xml, 'eis:')
43
+ end if custom_params.any?
44
+ end if dnssec_params.any? || custom_params.any?
45
+
39
46
  xml.clTRID(clTRID)
40
47
  end
41
48
  end
42
49
  end
43
50
 
44
- def update(xml_params = {}, dnssec_params = false)
51
+ def update(xml_params = {}, dnssec_params = {}, custom_params = {})
45
52
  xml = Builder::XmlMarkup.new
46
53
 
47
54
  xml.instruct!(:xml, standalone: 'no')
@@ -57,13 +64,19 @@ class EppXml
57
64
  xml.tag!('secDNS:create', 'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1') do
58
65
  EppXml.generate_xml_from_hash(dnssec_params, xml, 'secDNS:')
59
66
  end
60
- end if dnssec_params != false
67
+
68
+ xml.tag!('eis:extdata',
69
+ 'xmlns:eis' => 'urn:ee:eis:xml:epp:eis-1.0') do
70
+ EppXml.generate_xml_from_hash(custom_params, xml, 'eis:')
71
+ end if custom_params.any?
72
+ end if dnssec_params.any? || custom_params.any?
73
+
61
74
  xml.clTRID(clTRID)
62
75
  end
63
76
  end
64
77
  end
65
78
 
66
- def transfer(xml_params = {}, op = 'query')
79
+ def transfer(xml_params = {}, op = 'query', custom_params = {})
67
80
  xml = Builder::XmlMarkup.new
68
81
 
69
82
  xml.instruct!(:xml, standalone: 'no')
@@ -74,6 +87,8 @@ class EppXml
74
87
  EppXml.generate_xml_from_hash(xml_params, xml, 'domain:')
75
88
  end
76
89
  end
90
+
91
+ EppXml.custom_ext(xml, custom_params)
77
92
  xml.clTRID(clTRID)
78
93
  end
79
94
  end
@@ -81,7 +96,7 @@ class EppXml
81
96
 
82
97
  private
83
98
 
84
- def build(command, xml_params)
99
+ def build(command, xml_params, custom_params)
85
100
  xml = Builder::XmlMarkup.new
86
101
 
87
102
  xml.instruct!(:xml, standalone: 'no')
@@ -92,6 +107,8 @@ class EppXml
92
107
  EppXml.generate_xml_from_hash(xml_params, xml, 'domain:')
93
108
  end
94
109
  end
110
+
111
+ EppXml.custom_ext(xml, custom_params)
95
112
  xml.clTRID(clTRID)
96
113
  end
97
114
  end
@@ -4,7 +4,7 @@ class EppXml
4
4
  class Keyrelay
5
5
  include ClientTransactionId
6
6
 
7
- def keyrelay(xml_params = {})
7
+ def keyrelay(xml_params = {}, custom_params = {})
8
8
  xml = Builder::XmlMarkup.new
9
9
 
10
10
  xml.instruct!(:xml, standalone: 'no')
@@ -32,6 +32,12 @@ class EppXml
32
32
  end if xml_params[:expiry]
33
33
 
34
34
  end
35
+
36
+ xml.tag!('eis:extdata',
37
+ 'xmlns:eis' => 'urn:ee:eis:xml:epp:eis-1.0') do
38
+ EppXml.generate_xml_from_hash(custom_params, xml, 'eis:')
39
+ end if custom_params.any?
40
+
35
41
  xml.tag!('ext:clTRID', clTRID)
36
42
  end
37
43
  end
@@ -38,7 +38,7 @@ class EppXml
38
38
  end
39
39
  end
40
40
 
41
- def poll(xml_params = {})
41
+ def poll(xml_params = {}, custom_params = {})
42
42
  defaults = {
43
43
  poll: { value: '', attrs: { op: 'req' } }
44
44
  }
@@ -51,6 +51,8 @@ class EppXml
51
51
  xml.epp('xmlns' => 'urn:ietf:params:xml:ns:epp-1.0') do
52
52
  xml.command do
53
53
  EppXml.generate_xml_from_hash(xml_params, xml)
54
+
55
+ EppXml.custom_ext(xml, custom_params)
54
56
  xml.clTRID(clTRID)
55
57
  end
56
58
  end
data/lib/epp-xml.rb CHANGED
@@ -54,5 +54,14 @@ class EppXml
54
54
  end
55
55
  end
56
56
  end
57
+
58
+ def custom_ext(xml, custom_params)
59
+ xml.extension do
60
+ xml.tag!('eis:extdata',
61
+ 'xmlns:eis' => 'urn:ee:eis:xml:epp:eis-1.0') do
62
+ EppXml.generate_xml_from_hash(custom_params, xml, 'eis:')
63
+ end if custom_params.any?
64
+ end if custom_params.any?
65
+ end
57
66
  end
58
67
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epp-xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - GiTLAB LTD