ruby-miradore 3.3.9 → 3.3.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/fixtures/vcr_cassettes/Get__Mobile_Device.yml +1 -1
- data/fixtures/vcr_cassettes/InvDevice.yml +1 -1
- data/fixtures/vcr_cassettes/all_criteria.yml +1 -1
- data/fixtures/vcr_cassettes/auth_not_found.yml +1 -1
- data/fixtures/vcr_cassettes/error_by_serial_number.yml +1 -1
- data/fixtures/vcr_cassettes/full_list_and_details.yml +1 -1
- data/fixtures/vcr_cassettes/get_computer_device_to_update.yml +1 -1
- data/fixtures/vcr_cassettes/get_computer_device_to_update_2.yml +1 -1
- data/fixtures/vcr_cassettes/get_location.yml +1 -1
- data/fixtures/vcr_cassettes/get_user_from_miradore.yml +1 -1
- data/fixtures/vcr_cassettes/search_by_serial_number.yml +1 -1
- data/fixtures/vcr_cassettes/user_alredy_exist_in_miradore.yml +1 -1
- data/lib/ruby/miradore/version.rb +1 -1
- data/lib/ruby/miradore.rb +10 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b80881eb5442f4ea7a7e8e3279696a4cbf289b6d51ecdaaeb377fe882fccc2c6
|
4
|
+
data.tar.gz: 1657c4b389ebd50a6971bd92b920d0643112e1d1f56c28a67db2616e4c4124bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0285c18efabcc0bf982642829c77d4a18253e8329c41814ebd355133cd376827fb5bc5a4fa008db256fb269adb54719d76485fb33ad551bdc4920de7fc74ac36'
|
7
|
+
data.tar.gz: bf52662c76e2805d7d41b165b2b59f770938bceae9fd72315ed3fedfb84a4b2312145fb430aea3955cfb08cd65f8968c3541b2a78d1147ac94d02c8fc42f0507
|
data/Gemfile.lock
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://rzilient.online.miradore.com/API/Device
|
5
|
+
uri: https://rzilient.online.miradore.com/API/Device/?auth=&filters=(InvDevice.SerialNumber%20eq%20C76TLUEMHG7F)&select=*,*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://test634.online.miradore.com/API/Device
|
5
|
+
uri: https://test634.online.miradore.com/API/Device/?auth=1_8,Yo-TV8QyCiBUF&filters=&select=*,InvDevice.*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://rzilient.online.miradore.com/API/Device
|
5
|
+
uri: https://rzilient.online.miradore.com/API/Device/?auth=&filters=&select=*,InvDevice.*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://rzilient.online.miradore.com/API/Device
|
5
|
+
uri: https://rzilient.online.miradore.com/API/Device/?auth=&filters=(InvDevice.SerialNumber%20eq%20SRE)&select=*,*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://rzilient.online.miradore.com/API/Device
|
5
|
+
uri: https://rzilient.online.miradore.com/API/Device/?auth=&filters=&select=*,InvDevice.*,InvOS.*,InvStorage.*,Security.*,Location.*,Enrollment.*,User.*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://test634.online.miradore.com/API/Device
|
5
|
+
uri: https://test634.online.miradore.com/API/Device/?auth=&filters=(InvDevice.SerialNumber%20eq%2087DB6H2)&select=*,*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://test634.online.miradore.com/API/Device
|
5
|
+
uri: https://test634.online.miradore.com/API/Device/?auth=1_8,Yo-TV8QyCiBUF&filters=(InvDevice.SerialNumber%20eq%2087DB6H2)&select=*,*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://rzilient.online.miradore.com/API/User
|
5
|
+
uri: https://rzilient.online.miradore.com/API/User/?auth=&filters=(ID%20eq%202)&select=*,*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://rzilient.online.miradore.com/API/Device
|
5
|
+
uri: https://rzilient.online.miradore.com/API/Device/?auth=&filters=(InvDevice.SerialNumber%20eq%20K8N0CV07315233B)&select=*,*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
data/lib/ruby/miradore.rb
CHANGED
@@ -13,7 +13,7 @@ module Ruby
|
|
13
13
|
|
14
14
|
def self.url
|
15
15
|
{
|
16
|
-
item_v1: "https://%<subdomain>s.online.miradore.com/API/%<item>s?auth=%<auth>s&select=*,%<attribute>s&filters=%<filter>s",
|
16
|
+
item_v1: "https://%<subdomain>s.online.miradore.com/API/%<item>s/%<id>s?auth=%<auth>s&select=*,%<attribute>s&filters=%<filter>s",
|
17
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",
|
18
18
|
v2: "https://%<subdomain>s.online.miradore.com/API/v2/Device/%<id>s/%<method>s"
|
19
19
|
}
|
@@ -61,16 +61,17 @@ module Ruby
|
|
61
61
|
@json
|
62
62
|
end
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
|
64
|
+
def api_version
|
65
|
+
superclass == Object ? :request_v1 : :item_v1
|
66
|
+
end
|
67
67
|
|
68
68
|
private
|
69
69
|
|
70
70
|
def http_method_v1(**args)
|
71
|
-
url = Miradore.url[
|
71
|
+
url = Miradore.url[api_version] % args.merge(
|
72
72
|
subdomain: @subdomain || args[:subdomain],
|
73
73
|
auth: args.fetch(:auth, @auth),
|
74
|
+
id: args.fetch(:id, nil),
|
74
75
|
item: self.class.to_s.split("::").last,
|
75
76
|
attribute: args.fetch(:attribute, "*"),
|
76
77
|
filter: args.fetch(:filter, nil)
|
@@ -90,10 +91,6 @@ module Ruby
|
|
90
91
|
{ error: "#{self.class.to_s.split("::").last}(s) not found", status: :not_found }
|
91
92
|
end
|
92
93
|
|
93
|
-
def version
|
94
|
-
superclass == Object ? :request_v1 : :item_v1
|
95
|
-
end
|
96
|
-
|
97
94
|
end
|
98
95
|
|
99
96
|
class Device < Request
|
@@ -138,6 +135,10 @@ module Ruby
|
|
138
135
|
http_method(args.merge(method: :put, action: __method__))
|
139
136
|
end
|
140
137
|
|
138
|
+
def activate(**args)
|
139
|
+
http_method(args.merge(method: :post, action: __method__))
|
140
|
+
end
|
141
|
+
|
141
142
|
def device_serial_number
|
142
143
|
invdevice.serial_number || invdevice.hardware_serial_number
|
143
144
|
end
|
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: 3.3.
|
4
|
+
version: 3.3.13
|
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: 2021-11-
|
11
|
+
date: 2021-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|