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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2031e0ca807aa7da08a97ea70b81c99b2854a63fd59d54611076fe4e66cd15ea
4
- data.tar.gz: 8d3782d64e52f9ef8c8682e415005e2a920cbb3a1c8dbf2ea9fff40017d0f257
3
+ metadata.gz: b80881eb5442f4ea7a7e8e3279696a4cbf289b6d51ecdaaeb377fe882fccc2c6
4
+ data.tar.gz: 1657c4b389ebd50a6971bd92b920d0643112e1d1f56c28a67db2616e4c4124bc
5
5
  SHA512:
6
- metadata.gz: 9bb59dc003bd0d33d55cb70a8f8964a7e9f2a737e596cf953a146f76698f7bad78a730628f1d112bb55af27486786a436e87be5b82bef08319f3dd3b545381fb
7
- data.tar.gz: f8dbc2a2f30e6ae03d8833b09b3809196590293747b8164d51cf00f9fb6a5091359b23794f7de10d1959dce1abb8e08fd58d0ad11d19a56c92d81502407ea611
6
+ metadata.gz: '0285c18efabcc0bf982642829c77d4a18253e8329c41814ebd355133cd376827fb5bc5a4fa008db256fb269adb54719d76485fb33ad551bdc4920de7fc74ac36'
7
+ data.tar.gz: bf52662c76e2805d7d41b165b2b59f770938bceae9fd72315ed3fedfb84a4b2312145fb430aea3955cfb08cd65f8968c3541b2a78d1147ac94d02c8fc42f0507
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-miradore (3.3.9)
4
+ ruby-miradore (3.3.13)
5
5
  activesupport (~> 6.1)
6
6
  builder (~> 3.1)
7
7
  crack (~> 0.4)
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://rzilient.online.miradore.com/API/Device?auth=&filters=(InvDevice.SerialNumber%20eq%20C76TLUEMHG7F)&select=*,*
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?auth=1_8,Yo-TV8QyCiBUF&filters=&select=*,InvDevice.*
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?auth=&filters=&select=*,*
5
+ uri: https://rzilient.online.miradore.com/API/Device/?auth=&filters=&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?auth=&filters=&select=*,InvDevice.*
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?auth=&filters=(InvDevice.SerialNumber%20eq%20SRE)&select=*,*
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?auth=&filters=&select=*,InvDevice.*,InvOS.*,InvStorage.*,Security.*,Location.*,Enrollment.*,User.*
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?auth=&filters=(InvDevice.SerialNumber%20eq%2087DB6H2)&select=*,*
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?auth=1_8,Yo-TV8QyCiBUF&filters=(InvDevice.SerialNumber%20eq%2087DB6H2)&select=*,*
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/Organization?auth=&filters=&select=*,*
5
+ uri: https://rzilient.online.miradore.com/API/Organization/?auth=&filters=&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?auth=&filters=(ID%20eq%202)&select=*,*
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?auth=&filters=(InvDevice.SerialNumber%20eq%20K8N0CV07315233B)&select=*,*
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: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://rzilient.online.miradore.com/API/User?auth=&filters=&select=*,ID
5
+ uri: https://rzilient.online.miradore.com/API/User/?auth=&filters=&select=*,ID
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: |
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ruby
4
4
  module Miradore
5
- VERSION = "3.3.9"
5
+ VERSION = "3.3.13"
6
6
  end
7
7
  end
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
- # It won't use instance private method anymore. In order to keep consistency between Request and Device,User,Organization
65
- # all call will happen the same way, creating a new instance.
66
- # class << self
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[version] % args.merge(
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.9
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-09 00:00:00.000000000 Z
11
+ date: 2021-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport