ruby-miradore 4.4.0 → 4.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby/miradore/version.rb +1 -1
- data/lib/ruby/miradore.rb +13 -3
- 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: c854cbb5ab9cac28c6e4fb8c1d913f96531c54eaf0463a5c931d48020c045b40
|
4
|
+
data.tar.gz: 16db5100e8b11468ff2da6edeb797a135a30638882b97cefb33ca18adc815c1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b2e17d1750e09479355f82b4f14ced4c4273d712c6459449b71be3ec6d21482305748f75b6f3000e892cec72ac461e87145e8bf042e09bb36c798caa023d125
|
7
|
+
data.tar.gz: 944315dd81361acb3b6b283434b053a29b45499c3e947e04de03c5ae588c1a8819a6695eb75f1d72396bb11ff339f2d009ad585dbb1c2b8d92b5a69abfa28ec3
|
data/lib/ruby/miradore.rb
CHANGED
@@ -17,6 +17,16 @@ module Ruby
|
|
17
17
|
v2: 'https://%<subdomain>s.online.miradore.com/API/v2/Device/%<id>s/%<method>s'
|
18
18
|
}
|
19
19
|
mattr_accessor :phone_types, default: %w[Android iOS WindowsPhone]
|
20
|
+
mattr_accessor :commands, default: {
|
21
|
+
mobile: {
|
22
|
+
lostmode: {
|
23
|
+
message: 'This device has been reported as lost and its location has been identified, please return before authorities arrive.',
|
24
|
+
phoneNumber: '',
|
25
|
+
footnote: 'Contact Support team to unlock.',
|
26
|
+
enableLocationTracking: true
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
20
30
|
|
21
31
|
# Setup data from initializer
|
22
32
|
def self.setup
|
@@ -89,7 +99,7 @@ module Ruby
|
|
89
99
|
end
|
90
100
|
self.class.new(args.merge(res.values.first&.transform_keys(&:downcase)))
|
91
101
|
rescue StandardError
|
92
|
-
{ error: "#{self.class.to_s.split(
|
102
|
+
{ error: "#{self.class.to_s.split('::').last}(s) not found", status: :not_found }
|
93
103
|
end
|
94
104
|
|
95
105
|
end
|
@@ -109,8 +119,8 @@ module Ruby
|
|
109
119
|
end
|
110
120
|
|
111
121
|
def lostmode(args = {})
|
112
|
-
if args
|
113
|
-
http_method(args.merge(method: :post, id: id, action: __method__))
|
122
|
+
if args.fetch(:enable, false)
|
123
|
+
http_method(args.merge(method: :post, id: id, action: __method__, body: Miradore.commands[:mobile][:lostmode]))
|
114
124
|
else
|
115
125
|
http_method(args.merge(method: :delete, id: id, action: __method__))
|
116
126
|
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: 4.4.
|
4
|
+
version: 4.4.1
|
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: 2023-02-
|
11
|
+
date: 2023-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|