alula-ruby 1.5.0 → 1.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ceb68711713b164848aa6b194152c6f41e102de57412f04555fcc19961820bbf
4
- data.tar.gz: 98f3e2bfff91c8d80af2d4df652bdd0a42cc87be09800369bc122941dcac6bdd
3
+ metadata.gz: 4ba30ce4a88b334fd10633b735f401d59b041cfdf2298a1298b5136e283d4b1d
4
+ data.tar.gz: '09475f21199c2182b86e3a775b88ed1df2f6617566bb2e980cd0d109d6536630'
5
5
  SHA512:
6
- metadata.gz: 91c47f517294638509cd4c7511c63b55ae098ffd1c86143dbc9c4af678dfef09004c739cfbdb12572d4210e6e4df2311440b8b305af41515d2b199f5f794b80e
7
- data.tar.gz: a89654f421f310e3bc721512431d8e5958567ab8a926c93e9b04ef21f3b2bb1c0b5369537f62db3de43ef11eeff03ba2a839224f67bc3946509ff3ef08fba512
6
+ metadata.gz: 7266449db3159f70c5a4d77ae25ae59355b7d4dc5e34d8cae838b10292b51c592da29ef192bd363b230f8a65d34195b30d1bfe617db3c25e6595a36f0d133e5b
7
+ data.tar.gz: eca19d6a1412ba2b51c4e4ba6514b47fd05fff1445b8fd3f6a9868eca43d0148d3c5498fd076eeb8230adbd4cbe5a31922eff061466c068f8eab5602e4245b6b
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.6
1
+ 3.3.0
data/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:3.0.6-alpine
1
+ FROM ruby:3.3.0-alpine
2
2
 
3
3
  RUN gem install bundler
4
4
 
data/VERSION.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  | Version | Date | Description |
4
4
  | ------- | --------- | --------------------------------------------------------------------------- |
5
+ | v1.7.0 | 2024-06-13 | Add DELETE, PATCH/POST, unregister capabilities for cameras |
6
+ | v1.6.0 | 2024-01-26 | Add user language attribute |
5
7
  | v1.5.0 | 2024-01-09 | Add more known errors that use a different format |
6
8
  | v1.4.0 | 2024-01-04 | Add more known errors that use a different format, bugfix for `NotImplementedError` raising |
7
9
  | v1.3.0 | 2023-11-20 | Update NotImplemented error's message to include a JSONized hash, add more known errors that use a different format |
@@ -73,6 +73,7 @@ services:
73
73
  IPDAPI_WS_WORK_VIGILANCE_CANCEL_BATCH_WINDOW_MSEC: ${IPDAPI_WS_WORK_VIGILANCE_CANCEL_BATCH_WINDOW_MSEC:-10000}
74
74
  IPDAPI_WS_WORK_VIGILANCE_CANCEL_TERMINATE_DELAY_MSEC: ${IPDAPI_WS_WORK_VIGILANCE_CANCEL_TERMINATE_DELAY_MSEC:-500}
75
75
  IPDAPI_WS_WORK_VIGILANCE_TERMINATE_DELAY_MSEC: ${IPDAPI_WS_WORK_VIGILANCE_TERMINATE_DELAY_MSEC:-500}
76
+ LOG_LEVEL: warn
76
77
  MARIADB_ADDRESS: mariadb
77
78
  MARIADB_PASS: ""
78
79
  MARIADB_USER: root
@@ -82,13 +83,14 @@ services:
82
83
  MONGODB_USER: ipd
83
84
  RMQ_EPHEMERAL_ADDRESS: amqp://rmq-ephemeral
84
85
  RMQ_PERSISTENT_ADDRESS: amqp://rmq-persistent
86
+ REDIS_ADDRESS: redis-ipdapi
85
87
  healthcheck:
86
- interval: 15s
87
- retries: 5
88
+ interval: 5s
89
+ retries: 10
88
90
  start_period: 30s
89
- test: curl -s http://localhost/public/v1/healthcheck/default || exit -1
90
- timeout: 15s
91
- image: 6z1wlx5zf1.execute-api.us-east-1.amazonaws.com/alula/ipdapi:latest-master
91
+ test: apk add curl && curl -s http://localhost/public/v1/healthcheck/default || exit -1
92
+ timeout: 10s
93
+ image: 613707345027.dkr.ecr.us-east-1.amazonaws.com/api/ipdapi:staging
92
94
  networks:
93
95
  mesh_net:
94
96
  profiles:
@@ -101,23 +103,24 @@ services:
101
103
  ports:
102
104
  - "8080:80"
103
105
  mariadb:
106
+ hostname: mariadb
107
+ image: mariadb:10.3
104
108
  command:
105
109
  - --wait_timeout=28800
106
110
  - --max_connections=2048
107
111
  environment:
108
- MYSQL_ALLOW_EMPTY_PASSWORD: "true"
109
- healthcheck:
110
- interval: 15s
111
- retries: 5
112
- test: [CMD, mysqladmin, ping, -h, localhost]
113
- timeout: 15s
114
- image: mariadb:10.3
115
- networks:
116
- mesh_net:
112
+ MYSQL_ALLOW_EMPTY_PASSWORD: 'true'
117
113
  volumes:
118
114
  - mariadb_data:/var/lib/mysql
119
115
  - ./utils/mariadb/init:/docker-entrypoint-initdb.d
120
116
  - ./utils/mariadb/conf:/etc/mysql/conf.d
117
+ healthcheck:
118
+ test: mysql -D mysql --silent --execute "SELECT 1;"
119
+ interval: 30s
120
+ timeout: 10s
121
+ retries: 5
122
+ networks:
123
+ mesh_net:
121
124
  mongodb:
122
125
  command: --replSet api0 --bind_ip_all
123
126
  environment:
@@ -154,6 +157,19 @@ services:
154
157
  image: rabbitmq:management
155
158
  networks:
156
159
  mesh_net:
160
+ redis-ipdapi:
161
+ container_name: redis-ipdapi
162
+ image: redis:6.0.9-alpine
163
+ healthcheck:
164
+ test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
165
+ interval: 1s
166
+ timeout: 5s
167
+ retries: 30
168
+ networks:
169
+ mesh_net:
170
+ ports:
171
+ - 6379:6379
172
+ restart: always
157
173
  version: "3.9"
158
174
  volumes:
159
175
  dcp-mongo:
@@ -4,4 +4,4 @@ echo "INIT $(date +%s)" > /var/run/alula/ipdapi-status
4
4
  cat scripts/npm | grep -v npm | bash
5
5
  node app/migrations.js --create --up
6
6
  echo "READY $(date +%s)" >> /var/run/alula/ipdapi-status
7
- npm start
7
+ exec node app/main.js
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alula
4
+ class VideoUnregisterProc < Alula::RpcResource
5
+ class Response < Alula::RpcResponse
6
+ end
7
+
8
+ def self.call(device_id:)
9
+ payload = {
10
+ deviceId: device_id
11
+ }
12
+
13
+ request(
14
+ http_method: :post,
15
+ path: '/rpc/v1/video/unregister',
16
+ payload: payload,
17
+ handler: Response
18
+ )
19
+ end
20
+ end
21
+ end
@@ -141,6 +141,13 @@ module Alula
141
141
  filterable: false,
142
142
  creatable_by: [],
143
143
  patchable_by: %i[system station dealer technician user sub_user]
144
+
145
+ field :language,
146
+ type: :string,
147
+ sortable: false,
148
+ filterable: false,
149
+ creatable_by: %i[system station dealer technician user sub_user],
150
+ patchable_by: %i[system station dealer technician user sub_user]
144
151
 
145
152
  field :def_mod,
146
153
  type: :string,
@@ -32,6 +32,11 @@ module Alula
32
32
 
33
33
  api_name :video
34
34
 
35
+ # Instance method
36
+ def resource_url(id = nil)
37
+ "/#{self.class.api_name}/v1/#{self.class.resource_name}/#{id}"
38
+ end
39
+
35
40
  def construct_from(json_object)
36
41
  @raw_data = json_object.dup
37
42
  @values = json_object
@@ -2,15 +2,88 @@ module Alula
2
2
  module Video
3
3
  class Device < Alula::Video::BaseResource
4
4
  extend Alula::ApiOperations::Request
5
+ extend Alula::ApiOperations::Save
6
+ extend Alula::ApiOperations::Delete
5
7
 
6
- field :account_id, type: :string
7
- field :active, type: :boolean
8
- field :brand, type: :string
9
- field :hardware_id, type: :string
10
- field :manufacturer, type: :string
11
- field :name, type: :string
12
- field :serial_number, type: :string
13
- field :verification_code, type: :string
8
+ field :account_id,
9
+ type: :string,
10
+ patchable_by: %i[system station dealer user],
11
+ creatable_by: %i[system station dealer user]
12
+
13
+ field :active,
14
+ type: :boolean,
15
+ patchable_by: %i[system station dealer user],
16
+ creatable_by: %i[system station dealer user]
17
+
18
+ field :brand,
19
+ type: :string,
20
+ patchable_by: %i[system station dealer user],
21
+ creatable_by: %i[system station dealer user]
22
+
23
+ field :hardware_id,
24
+ type: :string,
25
+ patchable_by: %i[system station dealer user],
26
+ creatable_by: %i[system station dealer user]
27
+
28
+ field :manufacturer,
29
+ type: :string,
30
+ patchable_by: %i[system station dealer user],
31
+ creatable_by: %i[system station dealer user]
32
+
33
+ field :name,
34
+ type: :string,
35
+ patchable_by: %i[system station dealer user],
36
+ creatable_by: %i[system station dealer user]
37
+
38
+ field :serial_number,
39
+ type: :string,
40
+ patchable_by: %i[system station dealer user],
41
+ creatable_by: %i[system station dealer user]
42
+
43
+ field :verification_code,
44
+ type: :string,
45
+ patchable_by: %i[system station dealer user],
46
+ creatable_by: %i[system station dealer user]
47
+
48
+ field :timezone,
49
+ type: :string,
50
+ patchable_by: %i[system station dealer user],
51
+ creatable_by: %i[system station dealer user]
52
+
53
+ field :timezone_id,
54
+ type: :string,
55
+ patchable_by: %i[system station dealer user],
56
+ creatable_by: %i[system station dealer user]
57
+
58
+ field :daylight_saving,
59
+ type: :number,
60
+ patchable_by: %i[system station dealer user],
61
+ creatable_by: %i[system station dealer user]
62
+
63
+ field :time_format,
64
+ type: :number,
65
+ patchable_by: %i[system station dealer user],
66
+ creatable_by: %i[system station dealer user]
67
+
68
+ field :customer_id,
69
+ type: :string,
70
+ patchable_by: %i[system station dealer user],
71
+ creatable_by: %i[system station dealer user]
72
+
73
+ field :online,
74
+ type: :object,
75
+ patchable_by: %i[system station dealer user],
76
+ creatable_by: %i[system station dealer user]
77
+
78
+ field :settings,
79
+ type: :object,
80
+ patchable_by: %i[system station dealer user],
81
+ creatable_by: %i[system station dealer user]
82
+
83
+ field :model,
84
+ type: :string,
85
+ patchable_by: %i[system station dealer user],
86
+ creatable_by: %i[system station dealer user]
14
87
 
15
88
  def is_jsw?
16
89
  manufacturer == 'jsw'
data/lib/alula/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alula
4
- VERSION = '1.5.0'
4
+ VERSION = '1.7.0'
5
5
  end
data/lib/alula.rb CHANGED
@@ -94,6 +94,7 @@ require_relative 'alula/procedures/user_plansvideo_price_get'
94
94
  require_relative 'alula/procedures/user_get_locked_proc'
95
95
  require_relative 'alula/procedures/user_unlock_proc'
96
96
  require_relative 'alula/procedures/user_password_reset_proc'
97
+ require_relative 'alula/procedures/video_unregister_proc'
97
98
 
98
99
  module Alula
99
100
  #
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: 1.5.0
4
+ version: 1.7.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: 2024-01-09 00:00:00.000000000 Z
11
+ date: 2024-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -240,6 +240,7 @@ files:
240
240
  - lib/alula/procedures/user_transfer_reject.rb
241
241
  - lib/alula/procedures/user_transfer_request.rb
242
242
  - lib/alula/procedures/user_unlock_proc.rb
243
+ - lib/alula/procedures/video_unregister_proc.rb
243
244
  - lib/alula/query_interface.rb
244
245
  - lib/alula/rate_limit.rb
245
246
  - lib/alula/relationship_attributes.rb