openc3 5.9.1 → 5.10.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of openc3 might be problematic. Click here for more details.

Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/lib/openc3/accessors/binary_accessor.rb +5 -2
  4. data/lib/openc3/api/limits_api.rb +3 -3
  5. data/lib/openc3/microservices/decom_microservice.rb +5 -1
  6. data/lib/openc3/microservices/trigger_group_microservice.rb +6 -2
  7. data/lib/openc3/models/interface_model.rb +2 -0
  8. data/lib/openc3/models/microservice_status_model.rb +1 -1
  9. data/lib/openc3/models/plugin_model.rb +2 -0
  10. data/lib/openc3/models/target_model.rb +2 -0
  11. data/lib/openc3/models/tool_model.rb +2 -0
  12. data/lib/openc3/models/widget_model.rb +2 -0
  13. data/lib/openc3/packets/packet.rb +7 -13
  14. data/lib/openc3/packets/structure.rb +2 -2
  15. data/lib/openc3/packets/structure_item.rb +7 -27
  16. data/lib/openc3/script/api_shared.rb +45 -48
  17. data/lib/openc3/script/web_socket_api.rb +2 -2
  18. data/lib/openc3/system/target.rb +3 -3
  19. data/lib/openc3/top_level.rb +1 -1
  20. data/lib/openc3/topics/command_decom_topic.rb +0 -4
  21. data/lib/openc3/topics/telemetry_decom_topic.rb +0 -4
  22. data/lib/openc3/topics/telemetry_reduced_topics.rb +1 -13
  23. data/lib/openc3/topics/topic.rb +0 -8
  24. data/lib/openc3/utilities/authentication.rb +0 -1
  25. data/lib/openc3/utilities/aws_bucket.rb +44 -38
  26. data/lib/openc3/utilities/store_autoload.rb +5 -5
  27. data/lib/openc3/version.rb +5 -5
  28. data/templates/tool_angular/package.json +17 -17
  29. data/templates/tool_angular/yarn.lock +1798 -998
  30. data/templates/tool_react/package.json +20 -20
  31. data/templates/tool_react/yarn.lock +754 -700
  32. data/templates/tool_svelte/package.json +21 -21
  33. data/templates/tool_svelte/yarn.lock +622 -478
  34. data/templates/tool_vue/package.json +7 -7
  35. data/templates/tool_vue/yarn.lock +152 -118
  36. data/templates/widget/package.json +8 -8
  37. data/templates/widget/yarn.lock +157 -66
  38. metadata +2 -2
@@ -24,10 +24,6 @@ require 'openc3/topics/topic'
24
24
 
25
25
  module OpenC3
26
26
  class CommandDecomTopic < Topic
27
- def self.topics(scope:)
28
- super(scope, 'DECOMCMD')
29
- end
30
-
31
27
  def self.write_packet(packet, scope:)
32
28
  topic = "#{scope}__DECOMCMD__{#{packet.target_name}}__#{packet.packet_name}"
33
29
  msg_hash = { time: packet.packet_time.to_nsec_from_epoch,
@@ -25,10 +25,6 @@ require 'openc3/utilities/open_telemetry'
25
25
 
26
26
  module OpenC3
27
27
  class TelemetryDecomTopic < Topic
28
- def self.topics(scope:)
29
- super(scope, 'DECOM')
30
- end
31
-
32
28
  def self.write_packet(packet, id: nil, scope:)
33
29
  OpenC3.in_span("write_packet") do
34
30
  # Need to build a JSON hash of the decommutated data
@@ -17,7 +17,7 @@
17
17
  # All changes Copyright 2022, OpenC3, Inc.
18
18
  # All Rights Reserved
19
19
  #
20
- # This file may also be used under the terms of a commercial license
20
+ # This file may also be used under the terms of a commercial license
21
21
  # if purchased from OpenC3, Inc.
22
22
 
23
23
  require 'openc3/topics/topic'
@@ -25,10 +25,6 @@ require 'openc3/utilities/open_telemetry'
25
25
 
26
26
  module OpenC3
27
27
  class TelemetryReducedMinuteTopic < Topic
28
- def self.topics(scope:)
29
- super(scope, 'REDUCED_MINUTE')
30
- end
31
-
32
28
  def self.write(target_name:, packet_name:, stored:, time:, data:, id: nil, scope:)
33
29
  OpenC3.in_span("write") do
34
30
  # Write to stream
@@ -47,10 +43,6 @@ module OpenC3
47
43
  end
48
44
 
49
45
  class TelemetryReducedHourTopic < Topic
50
- def self.topics(scope:)
51
- super(scope, 'REDUCED_HOUR')
52
- end
53
-
54
46
  def self.write(target_name:, packet_name:, stored:, time:, data:, id: nil, scope:)
55
47
  OpenC3.in_span("write") do
56
48
  # Write to stream
@@ -69,10 +61,6 @@ module OpenC3
69
61
  end
70
62
 
71
63
  class TelemetryReducedDayTopic < Topic
72
- def self.topics(scope:)
73
- super(scope, 'REDUCED_DAY')
74
- end
75
-
76
64
  def self.write(target_name:, packet_name:, stored:, time:, data:, id: nil, scope:)
77
65
  OpenC3.in_span("write") do
78
66
  # Write to stream
@@ -33,14 +33,6 @@ module OpenC3
33
33
  topics.each { |topic| EphemeralStore.xtrim(topic, maxlen) }
34
34
  end
35
35
 
36
- def self.topics(scope, key)
37
- EphemeralStore
38
- .scan_each(match: "#{scope}__#{key}__*", type: 'stream', count: 100)
39
- .to_a # Change the enumerator into an array
40
- .uniq # Scan can return duplicates so ensure unique
41
- .sort # Sort not entirely necessary but nice
42
- end
43
-
44
36
  def self.get_cnt(topic)
45
37
  _, packet = EphemeralStore.get_newest_message(topic)
46
38
  packet ? packet["received_count"].to_i : 0
@@ -98,7 +98,6 @@ module OpenC3
98
98
  rescue OpenC3AuthenticationError
99
99
  return nil
100
100
  end
101
- return nil
102
101
  end
103
102
 
104
103
  private
@@ -42,45 +42,47 @@ module OpenC3
42
42
  end
43
43
 
44
44
  def ensure_public(bucket)
45
- policy = <<~EOL
46
- {
47
- "Version": "2012-10-17",
48
- "Statement": [
49
- {
50
- "Action": [
51
- "s3:GetBucketLocation",
52
- "s3:ListBucket"
53
- ],
54
- "Effect": "Allow",
55
- "Principal": {
56
- "AWS": [
57
- "*"
58
- ]
59
- },
60
- "Resource": [
61
- "arn:aws:s3:::#{bucket}"
62
- ],
63
- "Sid": ""
64
- },
65
- {
66
- "Action": [
67
- "s3:GetObject"
68
- ],
69
- "Effect": "Allow",
70
- "Principal": {
71
- "AWS": [
72
- "*"
73
- ]
45
+ unless ENV['OPENC3_NO_BUCKET_POLICY']
46
+ policy = <<~EOL
47
+ {
48
+ "Version": "2012-10-17",
49
+ "Statement": [
50
+ {
51
+ "Action": [
52
+ "s3:GetBucketLocation",
53
+ "s3:ListBucket"
54
+ ],
55
+ "Effect": "Allow",
56
+ "Principal": {
57
+ "AWS": [
58
+ "*"
59
+ ]
60
+ },
61
+ "Resource": [
62
+ "arn:aws:s3:::#{bucket}"
63
+ ],
64
+ "Sid": ""
74
65
  },
75
- "Resource": [
76
- "arn:aws:s3:::#{bucket}/*"
77
- ],
78
- "Sid": ""
79
- }
80
- ]
81
- }
82
- EOL
83
- @client.put_bucket_policy({ bucket: bucket, policy: policy })
66
+ {
67
+ "Action": [
68
+ "s3:GetObject"
69
+ ],
70
+ "Effect": "Allow",
71
+ "Principal": {
72
+ "AWS": [
73
+ "*"
74
+ ]
75
+ },
76
+ "Resource": [
77
+ "arn:aws:s3:::#{bucket}/*"
78
+ ],
79
+ "Sid": ""
80
+ }
81
+ ]
82
+ }
83
+ EOL
84
+ @client.put_bucket_policy({ bucket: bucket, policy: policy })
85
+ end
84
86
  end
85
87
 
86
88
  def exist?(bucket)
@@ -213,10 +215,14 @@ module OpenC3
213
215
 
214
216
  def delete_object(bucket:, key:)
215
217
  @client.delete_object(bucket: bucket, key: key)
218
+ rescue Exception
219
+ Logger.error("Error deleting object bucket: #{bucket}, key: #{key}")
216
220
  end
217
221
 
218
222
  def delete_objects(bucket:, keys:)
219
223
  @client.delete_objects(bucket: bucket, delete: { objects: keys.map {|key| { key: key } } })
224
+ rescue Exception
225
+ Logger.error("Error deleting objects bucket: #{bucket}, keys: #{keys}")
220
226
  end
221
227
 
222
228
  def presigned_request(bucket:, key:, method:, internal: true)
@@ -196,12 +196,12 @@ module OpenC3
196
196
  # store.trim_topic('MANGO__TOPIC', 1000, approximate: 'true', limit: 0)
197
197
  #
198
198
  # @param topic [String] the stream key
199
- # @param minid [Integer] mid id length of entries to trim
199
+ # @param minid [Integer] Id to throw away data up to
200
200
  # @param approximate [Boolean] whether to add `~` modifier of maxlen or not
201
- # @param limit [Boolean] whether to add `~` modifier of maxlen or not
201
+ # @param limit [Boolean] number of items to return from the call
202
202
  #
203
203
  # @return [Integer] the number of entries actually deleted
204
- def trim_topic(topic, minid, approximate = 'true', limit: 0)
204
+ def trim_topic(topic, minid, approximate = true, limit: 0)
205
205
  @redis_pool.with do |redis|
206
206
  return redis.xtrim_minid(topic, minid, approximate: approximate, limit: limit)
207
207
  end
@@ -218,8 +218,8 @@ module OpenC3
218
218
  end
219
219
 
220
220
  class Redis
221
- def xtrim_minid(key, minid, approximate: 'true', limit: nil)
222
- args = [:xtrim, key, :MINID, (approximate ? '~' : nil), minid].compact
221
+ def xtrim_minid(key, minid, approximate: true, limit: nil)
222
+ args = [:xtrim, key, :MINID, (approximate ? '~' : '='), minid]
223
223
  args.concat([:LIMIT, limit]) if limit
224
224
  send_command(args)
225
225
  end
@@ -1,14 +1,14 @@
1
1
  # encoding: ascii-8bit
2
2
 
3
- OPENC3_VERSION = '5.9.1'
3
+ OPENC3_VERSION = '5.10.1'
4
4
  module OpenC3
5
5
  module Version
6
6
  MAJOR = '5'
7
- MINOR = '9'
7
+ MINOR = '10'
8
8
  PATCH = '1'
9
9
  OTHER = ''
10
- BUILD = 'e60c6e1f7e80f87eae7bc623986940da5449d6ad'
10
+ BUILD = 'b248056bc6fa7af79757e21f3b79601118eec0e5'
11
11
  end
12
- VERSION = '5.9.1'
13
- GEM_VERSION = '5.9.1'
12
+ VERSION = '5.10.1'
13
+ GEM_VERSION = '5.10.1'
14
14
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%= tool_name %>",
3
- "version": "5.9.1",
3
+ "version": "5.10.1",
4
4
  "scripts": {
5
5
  "ng": "ng",
6
6
  "start": "ng serve",
@@ -12,30 +12,30 @@
12
12
  },
13
13
  "private": true,
14
14
  "dependencies": {
15
- "@angular/animations": "^16.1.3",
16
- "@angular/cdk": "^16.1.3",
17
- "@angular/common": "^16.1.3",
18
- "@angular/compiler": "^16.1.3",
19
- "@angular/core": "^16.1.3",
20
- "@angular/forms": "^16.1.3",
21
- "@angular/material": "16.1.3",
22
- "@angular/platform-browser": "^16.1.3",
23
- "@angular/platform-browser-dynamic": "^16.1.3",
24
- "@angular/router": "^16.1.3",
25
- "@openc3/tool-common": "5.9.1",
15
+ "@openc3/tool-common": "5.10.1",
16
+ "@angular/animations": "^16.2.0",
17
+ "@angular/cdk": "^16.2.0",
18
+ "@angular/common": "^16.2.0",
19
+ "@angular/compiler": "^16.2.0",
20
+ "@angular/core": "^16.2.0",
21
+ "@angular/forms": "^16.2.0",
22
+ "@angular/material": "16.2.0",
23
+ "@angular/platform-browser": "^16.2.0",
24
+ "@angular/platform-browser-dynamic": "^16.2.0",
25
+ "@angular/router": "^16.2.0",
26
26
  "rxjs": "~7.8.0",
27
27
  "single-spa": ">=5.9.5",
28
28
  "single-spa-angular": "^8.1.0",
29
- "tslib": "^2.6.0",
29
+ "tslib": "^2.6.1",
30
30
  "zone.js": "~0.13.1"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@angular-builders/custom-webpack": "16.0.0",
34
- "@angular-devkit/build-angular": "^16.0.5",
35
- "@angular/cli": "~16.1.3",
36
- "@angular/compiler-cli": "^16.0.0",
34
+ "@angular-devkit/build-angular": "^16.2.0",
35
+ "@angular/cli": "~16.2.0",
36
+ "@angular/compiler-cli": "^16.2.0",
37
37
  "@types/jasmine": "~4.3.0",
38
- "jasmine-core": "~5.0.1",
38
+ "jasmine-core": "~5.1.0",
39
39
  "karma": "~6.4.0",
40
40
  "karma-chrome-launcher": "~3.2.0",
41
41
  "karma-coverage": "~2.2.0",