ruby-miradore 4.0.4 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile.lock +21 -21
- data/lib/ruby/miradore/version.rb +1 -1
- data/lib/ruby/miradore.rb +9 -5
- data/ruby-miradore.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3347ab5a5e973dc09252f6ee02b131b29a5c10fca38d492f9169ef17ba4996cf
|
4
|
+
data.tar.gz: 98bbb4ea6e65661b20fd62f87389c261b60d87d9d81c302b9eba668b356fee16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49d34f37e97582f0edd1f5a412fb3e64265ddbf6ba42007174be7950766d78e386d7659a334f196705424bf41df1c637c0f7484f41a2f1c669ae936b7b18c385
|
7
|
+
data.tar.gz: ee7d628aa657dd2d2c9a4079c8661efa06f0704b2b763843a800747bbf805c516a6f5248385bb74f7b45b309494bfd81855694f96fcef6490178b2e2eadbb1a1
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby-miradore (4.0.
|
4
|
+
ruby-miradore (4.0.0)
|
5
5
|
activesupport (~> 7.0)
|
6
6
|
builder (~> 3.1)
|
7
7
|
crack (~> 0.4)
|
@@ -14,7 +14,7 @@ PATH
|
|
14
14
|
GEM
|
15
15
|
remote: https://rubygems.org/
|
16
16
|
specs:
|
17
|
-
activesupport (7.0.
|
17
|
+
activesupport (7.0.1)
|
18
18
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
19
|
i18n (>= 1.6, < 2)
|
20
20
|
minitest (>= 5.1)
|
@@ -32,7 +32,7 @@ GEM
|
|
32
32
|
httparty (0.20.0)
|
33
33
|
mime-types (~> 3.0)
|
34
34
|
multi_xml (>= 0.5.2)
|
35
|
-
i18n (1.
|
35
|
+
i18n (1.8.11)
|
36
36
|
concurrent-ruby (~> 1.0)
|
37
37
|
mime-types (3.4.1)
|
38
38
|
mime-types-data (~> 3.2015)
|
@@ -40,37 +40,37 @@ GEM
|
|
40
40
|
minitest (5.15.0)
|
41
41
|
multi_xml (0.6.0)
|
42
42
|
parallel (1.21.0)
|
43
|
-
parser (3.1.
|
43
|
+
parser (3.1.0.0)
|
44
44
|
ast (~> 2.4.1)
|
45
45
|
public_suffix (4.0.6)
|
46
|
-
rainbow (3.
|
46
|
+
rainbow (3.0.0)
|
47
47
|
rake (13.0.6)
|
48
|
-
regexp_parser (2.2.
|
48
|
+
regexp_parser (2.2.0)
|
49
49
|
rexml (3.2.5)
|
50
|
-
rspec (3.
|
51
|
-
rspec-core (~> 3.
|
52
|
-
rspec-expectations (~> 3.
|
53
|
-
rspec-mocks (~> 3.
|
54
|
-
rspec-core (3.
|
55
|
-
rspec-support (~> 3.
|
56
|
-
rspec-expectations (3.
|
50
|
+
rspec (3.10.0)
|
51
|
+
rspec-core (~> 3.10.0)
|
52
|
+
rspec-expectations (~> 3.10.0)
|
53
|
+
rspec-mocks (~> 3.10.0)
|
54
|
+
rspec-core (3.10.1)
|
55
|
+
rspec-support (~> 3.10.0)
|
56
|
+
rspec-expectations (3.10.1)
|
57
57
|
diff-lcs (>= 1.2.0, < 2.0)
|
58
|
-
rspec-support (~> 3.
|
59
|
-
rspec-mocks (3.
|
58
|
+
rspec-support (~> 3.10.0)
|
59
|
+
rspec-mocks (3.10.2)
|
60
60
|
diff-lcs (>= 1.2.0, < 2.0)
|
61
|
-
rspec-support (~> 3.
|
62
|
-
rspec-support (3.
|
63
|
-
rubocop (1.
|
61
|
+
rspec-support (~> 3.10.0)
|
62
|
+
rspec-support (3.10.3)
|
63
|
+
rubocop (1.24.1)
|
64
64
|
parallel (~> 1.10)
|
65
|
-
parser (>= 3.
|
65
|
+
parser (>= 3.0.0.0)
|
66
66
|
rainbow (>= 2.2.2, < 4.0)
|
67
67
|
regexp_parser (>= 1.8, < 3.0)
|
68
68
|
rexml
|
69
69
|
rubocop-ast (>= 1.15.1, < 2.0)
|
70
70
|
ruby-progressbar (~> 1.7)
|
71
71
|
unicode-display_width (>= 1.4.0, < 3.0)
|
72
|
-
rubocop-ast (1.
|
73
|
-
parser (>= 3.1.1
|
72
|
+
rubocop-ast (1.15.1)
|
73
|
+
parser (>= 3.0.1.1)
|
74
74
|
ruby-progressbar (1.11.0)
|
75
75
|
tzinfo (2.0.4)
|
76
76
|
concurrent-ruby (~> 1.0)
|
data/lib/ruby/miradore.rb
CHANGED
@@ -8,13 +8,14 @@ require 'json'
|
|
8
8
|
require 'crack/xml'
|
9
9
|
require 'finest/builder'
|
10
10
|
|
11
|
+
|
11
12
|
module Ruby
|
12
13
|
module Miradore
|
13
14
|
|
14
15
|
def self.url
|
15
16
|
{
|
16
|
-
item_v1: 'https://%<subdomain>s.online.miradore.com/API/%<item>s/%<id>s?auth=%<auth>s&select=*,%<attribute>s&filters=%<filter>s
|
17
|
-
request_v1: 'https://%<subdomain>s.online.miradore.com/API/Device?auth=%<auth>s&select=*,Category.*,InvDevice.*,InvStorage.*,InvOS.*,Enrollment.*,Client.*,User.*,Location.*,Security.*,ReportedLocation.*&filters=%<filter>s
|
17
|
+
item_v1: 'https://%<subdomain>s.online.miradore.com/API/%<item>s/%<id>s?auth=%<auth>s&select=*,%<attribute>s&filters=%<filter>s',
|
18
|
+
request_v1: 'https://%<subdomain>s.online.miradore.com/API/Device?auth=%<auth>s&select=*,Category.*,InvDevice.*,InvStorage.*,InvOS.*,Enrollment.*,Client.*,User.*,Location.*,Security.*,ReportedLocation.*&filters=%<filter>s',
|
18
19
|
v2: 'https://%<subdomain>s.online.miradore.com/API/v2/Device/%<id>s/%<method>s'
|
19
20
|
}
|
20
21
|
end
|
@@ -52,7 +53,7 @@ module Ruby
|
|
52
53
|
def call(**args)
|
53
54
|
transform(
|
54
55
|
Crack::XML.parse(
|
55
|
-
http_method_v1(**args.merge(attribute: 'ID')).body
|
56
|
+
http_method_v1(**args.merge( attribute: 'ID')).body
|
56
57
|
)['Content']
|
57
58
|
)
|
58
59
|
end
|
@@ -72,8 +73,7 @@ module Ruby
|
|
72
73
|
id: args.fetch(:id, nil),
|
73
74
|
item: self.class.to_s.split('::').last,
|
74
75
|
attribute: args.fetch(:attribute, '*'),
|
75
|
-
filter: args.fetch(:filter, nil)
|
76
|
-
options: args.fetch(:options, nil)
|
76
|
+
filter: args.fetch(:filter, nil)
|
77
77
|
)
|
78
78
|
self.class.method(args.fetch(:method, :get)).call(url, body: args.fetch(:body, nil)&.to_xml(root: 'Content', skip_types: true))
|
79
79
|
end
|
@@ -138,6 +138,10 @@ module Ruby
|
|
138
138
|
http_method(**args.merge(method: :post, action: __method__))
|
139
139
|
end
|
140
140
|
|
141
|
+
def retire(**args)
|
142
|
+
http_method(**args.merge(method: :delete, id: id, action: nil))
|
143
|
+
end
|
144
|
+
|
141
145
|
def device_serial_number
|
142
146
|
invdevice.serial_number || invdevice.hardware_serial_number
|
143
147
|
end
|
data/ruby-miradore.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = "Miradore MSP Ruby Gem"
|
13
13
|
spec.homepage = "https://github.com/eddygarcas/ruby-miradore"
|
14
14
|
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 3.
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.1.1")
|
16
16
|
|
17
17
|
spec.metadata["allowed_push_host"] = "https://rubygems.org/"
|
18
18
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-miradore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduard Garcia Castelló
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -188,14 +188,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
188
188
|
requirements:
|
189
189
|
- - ">="
|
190
190
|
- !ruby/object:Gem::Version
|
191
|
-
version: 3.
|
191
|
+
version: 3.1.1
|
192
192
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
193
|
requirements:
|
194
194
|
- - ">="
|
195
195
|
- !ruby/object:Gem::Version
|
196
196
|
version: '0'
|
197
197
|
requirements: []
|
198
|
-
rubygems_version: 3.3.
|
198
|
+
rubygems_version: 3.3.7
|
199
199
|
signing_key:
|
200
200
|
specification_version: 4
|
201
201
|
summary: Miradore is a MSP providing an API to get devices information as well s perform
|