lws 7.1.1 → 7.2.1
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/bin/lwsconsole +4 -6
- data/lib/lws.rb +20 -12
- data/lib/lws/apps/auth.rb +3 -3
- data/lib/lws/apps/corporate_website.rb +3 -3
- data/lib/lws/apps/digital_signage.rb +94 -15
- data/lib/lws/apps/generic.rb +14 -8
- data/lib/lws/apps/maps.rb +3 -3
- data/lib/lws/apps/presence.rb +89 -9
- data/lib/lws/apps/resource.rb +3 -3
- data/lib/lws/apps/ticket.rb +3 -3
- data/lib/lws/config.rb +35 -16
- data/lib/lws/errors.rb +3 -3
- data/lib/lws/middleware.rb +3 -3
- data/lib/lws/middleware/http_logger.rb +3 -3
- data/lib/lws/middleware/json_logger.rb +3 -3
- data/lib/lws/middleware/json_parser.rb +3 -3
- data/lib/lws/middleware/request_headers.rb +3 -3
- data/lib/lws/stubbing.rb +3 -3
- data/lib/lws/version.rb +4 -4
- data/test/api_token_middleware_test.rb +3 -3
- data/test/auth_test.rb +3 -3
- data/test/caching_test.rb +3 -3
- data/test/corporate_website_test.rb +8 -8
- data/test/digital_signage_test.rb +11 -12
- data/test/generic_test.rb +5 -5
- data/test/http_caching_test.rb +80 -0
- data/test/json_parser_test.rb +3 -3
- data/test/logger_test.rb +3 -3
- data/test/maps_test.rb +6 -6
- data/test/presence_test.rb +27 -4
- data/test/resource_test.rb +6 -6
- data/test/setup_test.rb +17 -4
- data/test/stubbing_test.rb +3 -3
- data/test/support/with_env.rb +3 -3
- data/test/test_helper.rb +9 -5
- data/test/ticket_test.rb +5 -5
- metadata +37 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6deffc4e78a47854d29873d8fc9a28362613690de1c942ae8eed2c5e83e937ca
|
4
|
+
data.tar.gz: a1986c2225a9f172a12cacc6a37d00a19458cbe396212a3281cb74c7901db850
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e8856e550c55c227c1671a42573f60044a7bee2e16be6a4f35f5e954cd2b37289a8ee4eee225894d5073e82cb37ee0111bd29c464ccad8c36b3872a0698eacf
|
7
|
+
data.tar.gz: c3e1c5f33253614acf54842796ccb4c9b3b532b4f172d22c7f5f0456056425c15f785a8df29db2af5eb80828bcd76ae3bf7131d74cff967702ad350b40f78656
|
data/bin/lwsconsole
CHANGED
@@ -87,13 +87,11 @@ begin
|
|
87
87
|
if @options[:cfg_file]
|
88
88
|
cfg_file = @options[:cfg_file]
|
89
89
|
raise "config file does not exist: #{cfg_file}" unless File.exist? cfg_file
|
90
|
-
config.load_config_file(cfg_file)
|
90
|
+
config.load_config_file(cfg_file, @options[:environment])
|
91
91
|
else
|
92
|
-
config.load_config_file(GLOBAL_CONFIG_FILE)
|
93
|
-
config.load_config_file(USER_CONFIG_FILE)
|
92
|
+
config.load_config_file(GLOBAL_CONFIG_FILE, @options[:environment])
|
93
|
+
config.load_config_file(USER_CONFIG_FILE, @options[:environment])
|
94
94
|
end
|
95
|
-
|
96
|
-
config.environment = @options[:environment] if @options[:environment]
|
97
95
|
end
|
98
96
|
if @options[:app]
|
99
97
|
@app_module = LWS.app_module(@options[:app].downcase)
|
@@ -158,7 +156,7 @@ if LWS.config.http_debug
|
|
158
156
|
end
|
159
157
|
end
|
160
158
|
debug_outputs << "JSON" if LWS.config.json_debug
|
161
|
-
|
159
|
+
if debug_outputs.present?
|
162
160
|
puts "- Debug output: #{debug_outputs.join(', ')}"
|
163
161
|
end
|
164
162
|
puts
|
data/lib/lws.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
#
|
2
|
-
# Copyright © 2016 LeftClick B.V.
|
2
|
+
# Copyright © 2016–2020 LeftClick B.V.
|
3
3
|
#
|
4
4
|
# This software is property of LeftClick B.V. and cannot be redistributed
|
5
5
|
# and/or modified without permission. The software or any of its parts
|
6
6
|
# cannot be used for any other purposes than the LeftClick services and
|
7
7
|
# only during a valid license subscription. For more information, please
|
8
|
-
# contact LeftClick B.V. at:
|
9
|
-
# Netherlands, info@leftclick.eu, +
|
8
|
+
# contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
|
9
|
+
# Netherlands, info@leftclick.eu, +3185-4444-004.
|
10
10
|
|
11
11
|
|
12
12
|
require "faraday_middleware"
|
13
|
+
require "faraday/http_cache"
|
13
14
|
require "hashie"
|
14
15
|
require "multi_json"
|
15
16
|
require "spyke"
|
@@ -43,7 +44,7 @@ module LWS
|
|
43
44
|
# @return [Config] the API configuration for the web services
|
44
45
|
mattr_reader :config
|
45
46
|
|
46
|
-
# @return [Stubbing] the stubbing setup for the web
|
47
|
+
# @return [Stubbing] the stubbing setup for the web services
|
47
48
|
mattr_reader :stubbing
|
48
49
|
|
49
50
|
# Sets up the application API libraries using the provided
|
@@ -73,11 +74,15 @@ module LWS
|
|
73
74
|
#
|
74
75
|
# @yieldparam [Config] config an API configuration object that can be
|
75
76
|
# configured
|
76
|
-
# @raise [LWS::Errors::ConfigError] if the API token is not configured/found
|
77
|
+
# @raise [LWS::Errors::ConfigError] if the API token is not configured/found afterwards
|
77
78
|
# @return [LWS] the module itself
|
78
79
|
def self.setup(&block)
|
79
80
|
@@config = Config.new
|
80
|
-
|
81
|
+
|
82
|
+
# Override the environment if needed
|
83
|
+
if ENV["LC_LWS_ENV"].present?
|
84
|
+
@@config.environment = ENV["LC_LWS_ENV"].to_sym
|
85
|
+
end
|
81
86
|
|
82
87
|
# Override the API token if needed (and no custom API token middleware
|
83
88
|
# is used)
|
@@ -85,10 +90,7 @@ module LWS
|
|
85
90
|
@@config.api_token = ENV["LC_LWS_API_TOKEN"]
|
86
91
|
end
|
87
92
|
|
88
|
-
|
89
|
-
if ENV["LC_LWS_ENV"].present?
|
90
|
-
@@config.environment = ENV["LC_LWS_ENV"].to_sym
|
91
|
-
end
|
93
|
+
yield @@config
|
92
94
|
|
93
95
|
if config.api_token.blank? and config.api_token_middleware.blank?
|
94
96
|
raise LWS::Errors::ConfigError,
|
@@ -107,14 +109,20 @@ module LWS
|
|
107
109
|
# Sets up the Faraday API object with the current LWS configuration for
|
108
110
|
# the given API URL.
|
109
111
|
#
|
110
|
-
# @param api_url The endpoint URL of the API
|
111
|
-
# @return [Faraday] A Faraday connection that makes requests to the API
|
112
|
+
# @param api_url [String] The endpoint URL of the API
|
113
|
+
# @return [Faraday::Connection] A Faraday connection that makes requests to the API
|
112
114
|
def self.setup_api(api_url)
|
113
115
|
api = Faraday.new(url: api_url) do |c|
|
114
116
|
# Request
|
115
117
|
if config.caching_object
|
116
118
|
c.use FaradayMiddleware::Caching, config.caching_object
|
117
119
|
end
|
120
|
+
if config.http_caching
|
121
|
+
logger = config.http_debug ? config.logger : nil
|
122
|
+
c.use Faraday::HttpCache, store: config.http_caching_object,
|
123
|
+
logger: logger,
|
124
|
+
shared_cache: false
|
125
|
+
end
|
118
126
|
c.use RequestHeaders, config.api_token
|
119
127
|
c.use config.api_token_middleware if config.api_token_middleware.present?
|
120
128
|
c.request :json
|
data/lib/lws/apps/auth.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
#
|
2
|
-
# Copyright © 2016 LeftClick B.V.
|
2
|
+
# Copyright © 2016–2020 LeftClick B.V.
|
3
3
|
#
|
4
4
|
# This software is property of LeftClick B.V. and cannot be redistributed
|
5
5
|
# and/or modified without permission. The software or any of its parts
|
6
6
|
# cannot be used for any other purposes than the LeftClick services and
|
7
7
|
# only during a valid license subscription. For more information, please
|
8
|
-
# contact LeftClick B.V. at:
|
9
|
-
# Netherlands, info@leftclick.eu, +
|
8
|
+
# contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
|
9
|
+
# Netherlands, info@leftclick.eu, +3185-4444-004.
|
10
10
|
|
11
11
|
|
12
12
|
# = The auth app module
|
@@ -1,12 +1,12 @@
|
|
1
1
|
#
|
2
|
-
# Copyright © 2016 LeftClick B.V.
|
2
|
+
# Copyright © 2016–2020 LeftClick B.V.
|
3
3
|
#
|
4
4
|
# This software is property of LeftClick B.V. and cannot be redistributed
|
5
5
|
# and/or modified without permission. The software or any of its parts
|
6
6
|
# cannot be used for any other purposes than the LeftClick services and
|
7
7
|
# only during a valid license subscription. For more information, please
|
8
|
-
# contact LeftClick B.V. at:
|
9
|
-
# Netherlands, info@leftclick.eu, +
|
8
|
+
# contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
|
9
|
+
# Netherlands, info@leftclick.eu, +3185-4444-004.
|
10
10
|
|
11
11
|
|
12
12
|
# = The corporate website app module
|
@@ -1,12 +1,12 @@
|
|
1
1
|
#
|
2
|
-
# Copyright ©
|
2
|
+
# Copyright © 2016–2020 LeftClick B.V.
|
3
3
|
#
|
4
4
|
# This software is property of LeftClick B.V. and cannot be redistributed
|
5
5
|
# and/or modified without permission. The software or any of its parts
|
6
6
|
# cannot be used for any other purposes than the LeftClick services and
|
7
7
|
# only during a valid license subscription. For more information, please
|
8
|
-
# contact LeftClick B.V. at:
|
9
|
-
# Netherlands, info@leftclick.eu, +
|
8
|
+
# contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
|
9
|
+
# Netherlands, info@leftclick.eu, +3185-4444-004.
|
10
10
|
|
11
11
|
|
12
12
|
# = The digital_signage app module
|
@@ -497,6 +497,11 @@ module LWS::DigitalSignage
|
|
497
497
|
class Layout < LWS::Generic::Model
|
498
498
|
use_api LWS::DigitalSignage.api
|
499
499
|
|
500
|
+
# @!attribute category_ids
|
501
|
+
# @return [Array<Integer>] the IDs of the categories assoicated with
|
502
|
+
# the layout
|
503
|
+
attribute :category_ids
|
504
|
+
|
500
505
|
# @!attribute categories
|
501
506
|
# @return [Array<Layout::Category>] the categories associated with
|
502
507
|
# the layout
|
@@ -504,13 +509,19 @@ module LWS::DigitalSignage
|
|
504
509
|
has_many :categories, class_name: "LWS::DigitalSignage::Layout::Category",
|
505
510
|
uri: "layout/:layout_id/categories(/:id)"
|
506
511
|
|
507
|
-
# @!attribute
|
508
|
-
# @return [LWS::Auth::Company] the company the layout
|
509
|
-
belongs_to :
|
512
|
+
# @!attribute company_owner
|
513
|
+
# @return [LWS::Auth::Company] the company that owns the layout
|
514
|
+
belongs_to :company_owner, class_name: "LWS::Auth::Company",
|
515
|
+
foreign_key: :company_owner_id,
|
516
|
+
uri: "companies/:id"
|
510
517
|
|
511
|
-
# @!attribute
|
512
|
-
# @return [Integer] the ID of the company the layout
|
513
|
-
attribute :
|
518
|
+
# @!attribute company_owner_id
|
519
|
+
# @return [Integer] the ID of the company that owns the layout
|
520
|
+
attribute :company_owner_id
|
521
|
+
|
522
|
+
# @!attribute company_shared_ids
|
523
|
+
# @return [Array<Integer>] the IDs of the company the layout is shared with
|
524
|
+
attribute :company_shared_ids
|
514
525
|
|
515
526
|
# @!attribute default_duration
|
516
527
|
# @return [5..3600] the default duration of a slide created from the layout
|
@@ -520,6 +531,14 @@ module LWS::DigitalSignage
|
|
520
531
|
# @return [String, nil] the description of the layout
|
521
532
|
attribute :description
|
522
533
|
|
534
|
+
# @!attribute description_html
|
535
|
+
# @return [String, nil] an HTML version of the description of the layout
|
536
|
+
attribute :description_html
|
537
|
+
|
538
|
+
# @!attribute duration_kind
|
539
|
+
# @return ["variable", "fixed", "kind"] the duration kind of the layout
|
540
|
+
attribute :duration_kind
|
541
|
+
|
523
542
|
# @!attribute favorite
|
524
543
|
# @return [Boolean] whether the layout is a favorite for the current account
|
525
544
|
attribute :favorite
|
@@ -547,11 +566,25 @@ module LWS::DigitalSignage
|
|
547
566
|
# @return [Boolean] whether the layout has priority over others
|
548
567
|
attribute :priority
|
549
568
|
|
569
|
+
# @!attribute public
|
570
|
+
# @return [Boolean] whether the layout is public (i.e. shared with all
|
571
|
+
# companies)
|
572
|
+
attribute :public
|
573
|
+
|
574
|
+
# @!attribute rotation
|
575
|
+
# @return ["landscape", "portrait"] the rotation (orientation) of the
|
576
|
+
# layout
|
577
|
+
attribute :rotation
|
578
|
+
|
550
579
|
# @!attribute slides
|
551
580
|
# @return [Array<Slide>] the slides using the layout
|
552
581
|
has_many :slides, class_name: "LWS::DigitalSignage::Slide",
|
553
582
|
uri: "layouts/:layout_id/slides(/:id)"
|
554
583
|
|
584
|
+
# @!attribute thumbnail_url
|
585
|
+
# @return [String, nil] the URL of the thumbnail of the layout
|
586
|
+
attribute :thumbnail_url
|
587
|
+
|
555
588
|
# @!attribute trans
|
556
589
|
# @return ["cut", "fadein", "zoomin", "slidein"] the transition of the
|
557
590
|
# entire layout
|
@@ -728,6 +761,19 @@ module LWS::DigitalSignage
|
|
728
761
|
use_api LWS::DigitalSignage.api
|
729
762
|
uri "layout/:layout_id/versions(/:id)"
|
730
763
|
|
764
|
+
# @!attribute archive_storage_id
|
765
|
+
# @return [String, nil] sthe storage ID of the archive/layout pack of the
|
766
|
+
# layout version
|
767
|
+
attribute :archive_storage_id
|
768
|
+
|
769
|
+
# @!attribute archive_url
|
770
|
+
# @note
|
771
|
+
# To be able retrieve this, the token needs to be passed via +X-Token+
|
772
|
+
# in the HTTP request headers!
|
773
|
+
# @return [String, nil] the URL of the archive/layout pack of the layout
|
774
|
+
# version (if accessible)
|
775
|
+
attribute :archive_url
|
776
|
+
|
731
777
|
# @!attribute elements
|
732
778
|
# @return [Array<Layout::Element>] the elements contained in the layout
|
733
779
|
# version
|
@@ -801,9 +847,9 @@ module LWS::DigitalSignage
|
|
801
847
|
# @return [Integer] the ID of the configuration of the player
|
802
848
|
attribute :configuration_id
|
803
849
|
|
804
|
-
# @!attribute
|
850
|
+
# @!attribute feedback
|
805
851
|
# @return [Hash{String=>String}] a mapping of player feedback key/values
|
806
|
-
attribute :
|
852
|
+
attribute :feedback
|
807
853
|
|
808
854
|
# @!attribute [r] health_percentage
|
809
855
|
# @return [Fixnum] the health of the player (percentage)
|
@@ -834,13 +880,17 @@ module LWS::DigitalSignage
|
|
834
880
|
# @return [Integer] the ID of the model of the player
|
835
881
|
attribute :model_id
|
836
882
|
|
883
|
+
# @!attribute name
|
884
|
+
# @return [String] the name of the player
|
885
|
+
attribute :name
|
886
|
+
|
837
887
|
# @!attribute notifications
|
838
888
|
# @return [Array<Player::Notification>] the notifications for the player
|
839
889
|
has_many :notifications, class_name: "LWS::DigitalSignage::Player::Notification"
|
840
890
|
|
841
|
-
# @!attribute
|
891
|
+
# @!attribute operation_hours [r]
|
842
892
|
# @return [String, nil] the number of hours the player has been operational
|
843
|
-
attribute :
|
893
|
+
attribute :operation_hours
|
844
894
|
|
845
895
|
# @!attribute operational_since [r]
|
846
896
|
# @return [String, nil] the date/time when the player became operational
|
@@ -855,6 +905,10 @@ module LWS::DigitalSignage
|
|
855
905
|
# @return [Array<Player::Component::Part>] the parts of the player
|
856
906
|
has_many :parts, class_name: "LWS::DigitalSignage::Player::Component::Part"
|
857
907
|
|
908
|
+
# @!attribute recent_os
|
909
|
+
# @return [Boolean] whether the OS of the player is recent
|
910
|
+
attribute :recent_os
|
911
|
+
|
858
912
|
# @!attribute registration_locked
|
859
913
|
# @return [Boolean] whether registarion is locked for the player
|
860
914
|
attribute :registration_locked
|
@@ -891,9 +945,14 @@ module LWS::DigitalSignage
|
|
891
945
|
attribute :status
|
892
946
|
|
893
947
|
# @!attribute status_reason [r]
|
894
|
-
# @return [
|
948
|
+
# @return ["unknown", "hardware_failure", "outdated_os", "good", "connection_inactive_short",
|
949
|
+
# "connection_inactive_long"] the reason for the current player status
|
895
950
|
attribute :status_reason
|
896
951
|
|
952
|
+
# @!attribute status_updated_at [r]
|
953
|
+
# @return [String] the date/time the status was last updated
|
954
|
+
attribute :status_updated_at
|
955
|
+
|
897
956
|
# @!attribute tags
|
898
957
|
# @return [Array<Player::Tag>] the tags of the player
|
899
958
|
has_many :tags, class_name: "LWS::DigitalSignage::Player::Tag"
|
@@ -1685,6 +1744,10 @@ module LWS::DigitalSignage
|
|
1685
1744
|
# scheduled on
|
1686
1745
|
has_many :channel_groups, class_name: "LWS::DigitalSignage::Channel::Group"
|
1687
1746
|
|
1747
|
+
# @!attribute comments
|
1748
|
+
# @return [String, nil] the comments/remarks for the slide
|
1749
|
+
attribute :comments
|
1750
|
+
|
1688
1751
|
# @!attribute company
|
1689
1752
|
# @return [LWS::Auth::Company] the company the slide belongs to
|
1690
1753
|
belongs_to :company, class_name: "LWS::Auth::Company"
|
@@ -1693,6 +1756,19 @@ module LWS::DigitalSignage
|
|
1693
1756
|
# @return [Integer] the ID of the company the slide belongs to
|
1694
1757
|
attribute :company_id
|
1695
1758
|
|
1759
|
+
# @!attribute duration
|
1760
|
+
# @return [Integer, nil] the duration of the slide (for fixed or content-bound durations
|
1761
|
+
# in the layout)
|
1762
|
+
attribute :duration
|
1763
|
+
|
1764
|
+
# @!attribute edit_account_ids
|
1765
|
+
# @return [Array<Integer>] the IDs of the accounts that can edit the slide
|
1766
|
+
attribute :edit_account_ids
|
1767
|
+
|
1768
|
+
# @!attribute editable_by_me
|
1769
|
+
# @return [Boolean] whether the authenticated user can edit the slide
|
1770
|
+
attribute :editable_by_me
|
1771
|
+
|
1696
1772
|
# @!attribute layout
|
1697
1773
|
# @return [LWS::Layout] the layout the slide uses
|
1698
1774
|
belongs_to :layout
|
@@ -1711,13 +1787,16 @@ module LWS::DigitalSignage
|
|
1711
1787
|
|
1712
1788
|
# @!attribute schedules
|
1713
1789
|
# @return [Array<Schedule>] the slide schedules that apply for the slide
|
1714
|
-
# FIXME: Missing endpoint in LWS
|
1715
1790
|
has_many :schedules, class_name: "LWS::DigitalSignage::Slide::Schedule"
|
1716
1791
|
|
1717
1792
|
# @!attribute status [r]
|
1718
1793
|
# @return ["initializing", "waiting_content", "available", "error"]
|
1719
1794
|
# the status of the slide
|
1720
1795
|
attribute :status
|
1796
|
+
|
1797
|
+
# @!attribute thumbnail_url
|
1798
|
+
# @return [String, nil] the URL of the thumbnail of the slide
|
1799
|
+
attribute :thumbnail_url
|
1721
1800
|
end
|
1722
1801
|
|
1723
1802
|
# = The slide schedule class
|
data/lib/lws/apps/generic.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
#
|
2
|
-
# Copyright © 2016 LeftClick B.V.
|
2
|
+
# Copyright © 2016–2020 LeftClick B.V.
|
3
3
|
#
|
4
4
|
# This software is property of LeftClick B.V. and cannot be redistributed
|
5
5
|
# and/or modified without permission. The software or any of its parts
|
6
6
|
# cannot be used for any other purposes than the LeftClick services and
|
7
7
|
# only during a valid license subscription. For more information, please
|
8
|
-
# contact LeftClick B.V. at:
|
9
|
-
# Netherlands, info@leftclick.eu, +
|
8
|
+
# contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
|
9
|
+
# Netherlands, info@leftclick.eu, +3185-4444-004.
|
10
10
|
|
11
11
|
|
12
12
|
# = The generic app module
|
@@ -79,8 +79,10 @@ module LWS::Generic
|
|
79
79
|
# Sets the Faraday API object used for this class. This will used by
|
80
80
|
# Spyke.
|
81
81
|
#
|
82
|
-
# @param api
|
83
|
-
#
|
82
|
+
# @param [Faraday::Connection] api A Faraday connection that makes
|
83
|
+
# requests to the API
|
84
|
+
# @return [Faraday::Connection] The Faraday connection that makes requests
|
85
|
+
# to the API
|
84
86
|
def self.use_api(api)
|
85
87
|
self.connection = api
|
86
88
|
self.include_root_in_json self.name.split("::").last.underscore.to_sym
|
@@ -155,7 +157,11 @@ module LWS::Generic
|
|
155
157
|
# @return [Object, nil] the digged up value or +nil+
|
156
158
|
def dig(*attrs)
|
157
159
|
attr = attrs.shift
|
158
|
-
value =
|
160
|
+
value = begin
|
161
|
+
send(attr)
|
162
|
+
rescue NoMethodError
|
163
|
+
nil
|
164
|
+
end
|
159
165
|
return nil if value.nil?
|
160
166
|
return value if attrs.empty?
|
161
167
|
raise TypeError, "#{value.class} does not have #dig method" unless value.respond_to? :dig
|
@@ -191,7 +197,7 @@ module LWS::Generic
|
|
191
197
|
|
192
198
|
# = The storage class
|
193
199
|
#
|
194
|
-
# This class can be used to upload files for this app module.
|
200
|
+
# This class can be used to download and upload files for this app module.
|
195
201
|
class Storage
|
196
202
|
# @!visibility private
|
197
203
|
def self.use_api(api)
|
@@ -262,7 +268,7 @@ module LWS::Generic
|
|
262
268
|
checksum = Digest::MD5.base64digest(data)
|
263
269
|
body = { blob: { filename: filename,
|
264
270
|
content_type: content_type,
|
265
|
-
byte_size: data.
|
271
|
+
byte_size: data.bytesize,
|
266
272
|
checksum: checksum } }
|
267
273
|
res = @as_connection.post do |req|
|
268
274
|
req.url "rails/active_storage/direct_uploads"
|
data/lib/lws/apps/maps.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
#
|
2
|
-
# Copyright © 2016 LeftClick B.V.
|
2
|
+
# Copyright © 2016–2020 LeftClick B.V.
|
3
3
|
#
|
4
4
|
# This software is property of LeftClick B.V. and cannot be redistributed
|
5
5
|
# and/or modified without permission. The software or any of its parts
|
6
6
|
# cannot be used for any other purposes than the LeftClick services and
|
7
7
|
# only during a valid license subscription. For more information, please
|
8
|
-
# contact LeftClick B.V. at:
|
9
|
-
# Netherlands, info@leftclick.eu, +
|
8
|
+
# contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
|
9
|
+
# Netherlands, info@leftclick.eu, +3185-4444-004.
|
10
10
|
|
11
11
|
|
12
12
|
# = The maps app module
|
data/lib/lws/apps/presence.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
#
|
2
|
-
# Copyright © 2016 LeftClick B.V.
|
2
|
+
# Copyright © 2016–2020 LeftClick B.V.
|
3
3
|
#
|
4
4
|
# This software is property of LeftClick B.V. and cannot be redistributed
|
5
5
|
# and/or modified without permission. The software or any of its parts
|
6
6
|
# cannot be used for any other purposes than the LeftClick services and
|
7
7
|
# only during a valid license subscription. For more information, please
|
8
|
-
# contact LeftClick B.V. at:
|
9
|
-
# Netherlands, info@leftclick.eu, +
|
8
|
+
# contact LeftClick B.V. at: Schootense Dreef 20A, 5708 HZ Helmond, The
|
9
|
+
# Netherlands, info@leftclick.eu, +3185-4444-004.
|
10
10
|
|
11
11
|
|
12
12
|
# = The presence app module
|
@@ -43,10 +43,6 @@ module LWS::Presence
|
|
43
43
|
class Appointment < LWS::Generic::Model
|
44
44
|
use_api LWS::Presence.api
|
45
45
|
|
46
|
-
# @!attribute title
|
47
|
-
# @return [String] the title of the appointment
|
48
|
-
attribute :title
|
49
|
-
|
50
46
|
# @!attribute datetime_end
|
51
47
|
# @return [String] the timestamp of the end of the appointment
|
52
48
|
attribute :datetime_end
|
@@ -72,22 +68,66 @@ module LWS::Presence
|
|
72
68
|
attribute :location_id
|
73
69
|
|
74
70
|
# @!attribute organiser
|
75
|
-
# @return [Person] the
|
71
|
+
# @return [Person] the organiser of the appointment
|
76
72
|
belongs_to :organiser, class_name: "LWS::Presence::Person"
|
77
73
|
|
78
74
|
# @!attribute organiser_id
|
79
|
-
# @return [Fixnum] the ID of the
|
75
|
+
# @return [Fixnum] the ID of the organiser of the appointment
|
80
76
|
attribute :organiser_id
|
81
77
|
|
82
78
|
# @!attribute people
|
83
79
|
# @return [Array<Person>] the people associated with the appointment
|
84
80
|
has_many :people
|
85
81
|
|
82
|
+
# @!attribute title
|
83
|
+
# @return [String] the title of the appointment
|
84
|
+
attribute :title
|
85
|
+
|
86
86
|
# @!attribute uuid
|
87
87
|
# @return [String] the UUID of the location
|
88
88
|
attribute :uuid
|
89
89
|
end
|
90
90
|
|
91
|
+
# = The journal (entry) class
|
92
|
+
#
|
93
|
+
# @note
|
94
|
+
# This class is only used within the context of the {Location} class.
|
95
|
+
class Journal < LWS::Generic::Model
|
96
|
+
use_api LWS::Presence.api
|
97
|
+
|
98
|
+
# @!attribute check_in
|
99
|
+
# @return [String] the timestamp of the check-in of this journal (entry)
|
100
|
+
attribute :check_in
|
101
|
+
|
102
|
+
# @!attribute check_out
|
103
|
+
# @return [String, nil] the timestamp of the check out of this journal (entry)
|
104
|
+
attribute :check_out
|
105
|
+
|
106
|
+
# @!attribute company
|
107
|
+
# @return [LWS::Auth::Company] the company the journal (entry) belongs to
|
108
|
+
belongs_to :company, class_name: "LWS::Auth::Company"
|
109
|
+
|
110
|
+
# @!attribute company_id
|
111
|
+
# @return [Integer] the ID of the company the journal (entry) belongs to
|
112
|
+
attribute :company_id
|
113
|
+
|
114
|
+
# @!attribute location
|
115
|
+
# @return [Location] the location the journal (entry) belongs to
|
116
|
+
belongs_to :location
|
117
|
+
|
118
|
+
# @!attribute location_id
|
119
|
+
# @return [Integer] the ID of the location the journal (entry) belongs to
|
120
|
+
attribute :location_id
|
121
|
+
|
122
|
+
# @!attribute person
|
123
|
+
# @return [Person] the person the journal (entry) belongs to
|
124
|
+
belongs_to :person
|
125
|
+
|
126
|
+
# @!attribute person_id
|
127
|
+
# @return [Integer] the ID of the person the journal (entry) belongs to
|
128
|
+
attribute :person_id
|
129
|
+
end
|
130
|
+
|
91
131
|
# = The location class
|
92
132
|
class Location < LWS::Generic::Model
|
93
133
|
use_api LWS::Presence.api
|
@@ -176,6 +216,10 @@ module LWS::Presence
|
|
176
216
|
# @return [String, nil] the URL of the image of the location
|
177
217
|
attribute :image_url
|
178
218
|
|
219
|
+
# @!attribute journals
|
220
|
+
# @return [Array<Journal>] the journal (entries) associated with the location
|
221
|
+
has_many :journals, class: "LWS::Presence::Journal"
|
222
|
+
|
179
223
|
# @!attribute lat
|
180
224
|
# @return [Float] the latitude of the location
|
181
225
|
attribute :lat
|
@@ -395,6 +439,10 @@ module LWS::Presence
|
|
395
439
|
class Person < LWS::Generic::Model
|
396
440
|
use_api LWS::Presence.api
|
397
441
|
|
442
|
+
# @!attribute address
|
443
|
+
# @return [String, nil] the address of the person
|
444
|
+
attribute :address
|
445
|
+
|
398
446
|
# @!attribute appointments
|
399
447
|
# @return [Array<Appointment>] the appointments involving the person
|
400
448
|
has_many :appointments
|
@@ -410,6 +458,18 @@ module LWS::Presence
|
|
410
458
|
# @return [String, nil] the URL of the avatar of the person
|
411
459
|
attribute :avatar_url
|
412
460
|
|
461
|
+
# @!attribute birthdate
|
462
|
+
# @return [String, nil] the birthdate of the person
|
463
|
+
attribute :birthdate
|
464
|
+
|
465
|
+
# @!attribute city
|
466
|
+
# @return [String, nil] the city of the person
|
467
|
+
attribute :city
|
468
|
+
|
469
|
+
# @!attribute country
|
470
|
+
# @return [String, nil] the country of the person
|
471
|
+
attribute :country
|
472
|
+
|
413
473
|
# @!attribute company
|
414
474
|
# @return [LWS::Auth::Company] the company the person belongs to
|
415
475
|
belongs_to :company, class_name: "LWS::Auth::Company"
|
@@ -551,12 +611,24 @@ module LWS::Presence
|
|
551
611
|
# @return ["public", "private"] if a person should be protected by not
|
552
612
|
# showing critical information
|
553
613
|
attribute :visibility
|
614
|
+
|
615
|
+
# @!attribute zip_code
|
616
|
+
# @return [String, nil] the zip code of the person
|
617
|
+
attribute :zip_code
|
554
618
|
end
|
555
619
|
|
556
620
|
# = The reader class
|
557
621
|
class Reader < LWS::Generic::Model
|
558
622
|
use_api LWS::Presence.api
|
559
623
|
|
624
|
+
# @!attribute company
|
625
|
+
# @return [LWS::Auth::Company] the company the reader belongs to
|
626
|
+
belongs_to :company, class_name: "LWS::Auth::Company"
|
627
|
+
|
628
|
+
# @!attribute company_id
|
629
|
+
# @return [Integer] the ID of the company the reader belongs to
|
630
|
+
attribute :company_id
|
631
|
+
|
560
632
|
# @!attribute gateway
|
561
633
|
# @return [Integer] the (32-bit) LCIO gateway ID of the reader
|
562
634
|
attribute :gateway
|
@@ -569,9 +641,17 @@ module LWS::Presence
|
|
569
641
|
# @return [Integer] the ID of the location of the reader
|
570
642
|
attribute :location_id
|
571
643
|
|
644
|
+
# @!attribute name
|
645
|
+
# @return [String] the name of the reader
|
646
|
+
attribute :name
|
647
|
+
|
572
648
|
# @!attribute node
|
573
649
|
# @return [Integer] the (8-bit) LCIO gateway node number of the reader
|
574
650
|
attribute :node
|
651
|
+
|
652
|
+
# @!attribute serial_number
|
653
|
+
# @return [String] the serial number of the reader
|
654
|
+
attribute :serial_number
|
575
655
|
end
|
576
656
|
|
577
657
|
# (see Generic::Storage)
|