alula-ruby 2.28.0 → 2.29.0
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 +4 -4
- data/VERSION.md +1 -0
- data/alula-docker-compose.yml +3 -0
- data/lib/alula/meta.rb +61 -7
- data/lib/alula/resources/user_impersonation.rb +27 -0
- data/lib/alula/version.rb +1 -1
- data/lib/alula.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1bc4313af51d05bbfa6b052d37686a460790479c7c6088ee572a1a5a29b74447
|
|
4
|
+
data.tar.gz: f44486c2d746b6480a629fd4df9a419e7d4ab087d4b240f35a14f4e142071126
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 345ca2b0194f93b3e452c3511c7dcfca88bbc105865f5081e246c7d1f71dc61ea5ced3fdd66c17a345fde329664a51501c563ad0be18c32f4cf706ef5d31a4df
|
|
7
|
+
data.tar.gz: 633a12588520c9a78a3eb6bc949a5639fae5dd485e097239b1590fe570de48b2619d7e51c3666ec036d9f4f6b5564f63245f3c550860194c90ca69bbea1a13a8
|
data/VERSION.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
| Version | Date | Description |
|
|
4
4
|
| ------- | ------------| --------------------------------------------------------------------------- |
|
|
5
|
+
| v2.29.0 | 2025-12-01 | Adds User Impersonation Requests and new Meta |
|
|
5
6
|
| v2.28.0 | 2025-11-19 | Add product_sku Device property |
|
|
6
7
|
| v2.27.1 | 2025-11-14 | Add ONVIF feature support for CONNECT-FLX-DUAL and CONNECT-FLX-DUAL-Z devices |
|
|
7
8
|
| v2.27.0 | 2025-10-02 | Add nfc_get_branding proc to get dealer branding from tag id |
|
data/alula-docker-compose.yml
CHANGED
|
@@ -70,6 +70,9 @@ services:
|
|
|
70
70
|
IPDAPI_RL_DEFAULT_MAX_HITS: ${IPDAPI_RL_DEFAULT_MAX_HITS:-10000}
|
|
71
71
|
IPDAPI_RL_LOGIN_MAX_HITS: ${IPDAPI_RL_LOGIN_MAX_HITS:-1000}
|
|
72
72
|
IPDAPI_TRUST_PROXY: loopback
|
|
73
|
+
IPDAPI_M2M_API_BASE_URL: https://app.m2mservices.com/
|
|
74
|
+
IPDAPI_M2M_API_USERNAME: user
|
|
75
|
+
IPDAPI_M2M_API_PASSWORD: pass
|
|
73
76
|
IPDAPI_WS_WORK_EVENTS_ENABLED: true
|
|
74
77
|
IPDAPI_WS_WORK_VIGILANCE_BATCH_WINDOW_MSEC: ${IPDAPI_WS_WORK_VIGILANCE_BATCH_WINDOW_MSEC:-5000}
|
|
75
78
|
IPDAPI_WS_WORK_VIGILANCE_CANCEL_BATCH_WINDOW_MSEC: ${IPDAPI_WS_WORK_VIGILANCE_CANCEL_BATCH_WINDOW_MSEC:-10000}
|
data/lib/alula/meta.rb
CHANGED
|
@@ -1,16 +1,70 @@
|
|
|
1
1
|
module Alula
|
|
2
2
|
class Meta
|
|
3
|
-
attr_reader :page, :total, :number, :size
|
|
3
|
+
attr_reader :page, :total, :number, :size, :custom_attributes
|
|
4
4
|
|
|
5
5
|
def initialize(meta)
|
|
6
|
-
|
|
6
|
+
meta_hash = coerce_to_hash(meta)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
page_data = extract_page(meta_hash)
|
|
9
|
+
build_pagination(page_data)
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
@custom_attributes = build_custom_attributes(meta_hash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def [](key)
|
|
15
|
+
custom_attributes[normalize_key(key)]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def fetch(key, *args, &block)
|
|
19
|
+
custom_attributes.fetch(normalize_key(key), *args, &block)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def method_missing(method_name, *args, &block)
|
|
23
|
+
return custom_attributes[method_name] if custom_attributes.key?(method_name)
|
|
24
|
+
|
|
25
|
+
super
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def respond_to_missing?(method_name, include_private = false)
|
|
29
|
+
custom_attributes.key?(method_name) || super
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
private
|
|
33
|
+
|
|
34
|
+
def coerce_to_hash(meta)
|
|
35
|
+
return {} unless meta.respond_to?(:each_pair)
|
|
36
|
+
|
|
37
|
+
meta.each_pair.each_with_object({}) do |(key, value), result|
|
|
38
|
+
result[key.to_s] = value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def extract_page(meta_hash)
|
|
43
|
+
meta_hash.delete('page') || meta_hash.delete(:page)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def build_pagination(page_data)
|
|
47
|
+
if page_data
|
|
48
|
+
@page = Alula::Pagination.new(page_data)
|
|
49
|
+
@total = @page.total
|
|
50
|
+
@number = @page.number
|
|
51
|
+
@size = @page.size
|
|
52
|
+
else
|
|
53
|
+
@page = nil
|
|
54
|
+
@total = nil
|
|
55
|
+
@number = nil
|
|
56
|
+
@size = nil
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def build_custom_attributes(meta_hash)
|
|
61
|
+
meta_hash.each_with_object({}) do |(key, value), attributes|
|
|
62
|
+
attributes[normalize_key(key)] = value
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def normalize_key(key)
|
|
67
|
+
Util.underscore(key.to_s).to_sym
|
|
14
68
|
end
|
|
15
69
|
end
|
|
16
70
|
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module Alula
|
|
2
|
+
class UserImpersonation < Alula::RestResource
|
|
3
|
+
extend Alula::ResourceAttributes
|
|
4
|
+
extend Alula::ApiOperations::Request
|
|
5
|
+
extend Alula::ApiOperations::Save
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
resource_path 'users/impersonation'
|
|
9
|
+
type 'users-impersonation'
|
|
10
|
+
|
|
11
|
+
# Resource Fields
|
|
12
|
+
# Not all params are presented here at the moment
|
|
13
|
+
field :id,
|
|
14
|
+
type: :string,
|
|
15
|
+
sortable: false,
|
|
16
|
+
filterable: false,
|
|
17
|
+
creatable_by: [],
|
|
18
|
+
patchable_by: []
|
|
19
|
+
|
|
20
|
+
field :status,
|
|
21
|
+
type: :string,
|
|
22
|
+
sortable: false,
|
|
23
|
+
filterable: false,
|
|
24
|
+
creatable_by: [],
|
|
25
|
+
patchable_by: %i[dealer]
|
|
26
|
+
end
|
|
27
|
+
end
|
data/lib/alula/version.rb
CHANGED
data/lib/alula.rb
CHANGED
|
@@ -121,6 +121,7 @@ require_relative 'alula/resources/self'
|
|
|
121
121
|
require_relative 'alula/resources/user'
|
|
122
122
|
require_relative 'alula/resources/user_phone'
|
|
123
123
|
require_relative 'alula/resources/user_address'
|
|
124
|
+
require_relative 'alula/resources/user_impersonation'
|
|
124
125
|
require_relative 'alula/resources/user_pushtoken'
|
|
125
126
|
require_relative 'alula/resources/user_preferences'
|
|
126
127
|
require_relative 'alula/resources/user_videoprofile'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: alula-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.29.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Titus Johnson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-12-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: httparty
|
|
@@ -355,6 +355,7 @@ files:
|
|
|
355
355
|
- lib/alula/resources/token_exchange.rb
|
|
356
356
|
- lib/alula/resources/user.rb
|
|
357
357
|
- lib/alula/resources/user_address.rb
|
|
358
|
+
- lib/alula/resources/user_impersonation.rb
|
|
358
359
|
- lib/alula/resources/user_phone.rb
|
|
359
360
|
- lib/alula/resources/user_preferences.rb
|
|
360
361
|
- lib/alula/resources/user_pushtoken.rb
|