activitysmith 1.7.0 → 1.9.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/README.md +113 -18
- data/generated/activitysmith_openapi/api/app_icon_badges_api.rb +90 -0
- data/generated/activitysmith_openapi/api/live_activities_api.rb +10 -10
- data/generated/activitysmith_openapi/models/app_icon_badge_count_update_request.rb +260 -0
- data/generated/activitysmith_openapi/models/app_icon_badge_count_update_response.rb +331 -0
- data/generated/activitysmith_openapi/models/content_state_end.rb +1 -1
- data/generated/activitysmith_openapi/models/content_state_start.rb +1 -1
- data/generated/activitysmith_openapi/models/content_state_update.rb +1 -1
- data/generated/activitysmith_openapi/models/live_activity_action.rb +3 -5
- data/generated/activitysmith_openapi/models/live_activity_end_request.rb +14 -4
- data/generated/activitysmith_openapi/models/live_activity_start_request.rb +11 -1
- data/generated/activitysmith_openapi/models/live_activity_stream_delete_request.rb +11 -1
- data/generated/activitysmith_openapi/models/live_activity_stream_request.rb +11 -1
- data/generated/activitysmith_openapi/models/live_activity_update_request.rb +14 -4
- data/generated/activitysmith_openapi/models/push_notification_action.rb +2 -4
- data/generated/activitysmith_openapi/models/push_notification_request.rb +2 -4
- data/generated/activitysmith_openapi/models/stream_content_state.rb +1 -1
- data/generated/activitysmith_openapi/version.rb +1 -1
- data/generated/activitysmith_openapi.rb +3 -0
- data/lib/activitysmith/client.rb +15 -1
- data/lib/activitysmith/version.rb +1 -1
- metadata +5 -2
|
@@ -68,7 +68,7 @@ module OpenapiClient
|
|
|
68
68
|
:'media' => :'String',
|
|
69
69
|
:'redirection' => :'String',
|
|
70
70
|
:'actions' => :'Array<PushNotificationAction>',
|
|
71
|
-
:'payload' => :'
|
|
71
|
+
:'payload' => :'Object',
|
|
72
72
|
:'badge' => :'Integer',
|
|
73
73
|
:'sound' => :'String',
|
|
74
74
|
:'target' => :'ChannelTarget'
|
|
@@ -125,9 +125,7 @@ module OpenapiClient
|
|
|
125
125
|
end
|
|
126
126
|
|
|
127
127
|
if attributes.key?(:'payload')
|
|
128
|
-
|
|
129
|
-
self.payload = value
|
|
130
|
-
end
|
|
128
|
+
self.payload = attributes[:'payload']
|
|
131
129
|
end
|
|
132
130
|
|
|
133
131
|
if attributes.key?(:'badge')
|
|
@@ -47,7 +47,7 @@ module OpenapiClient
|
|
|
47
47
|
# Required on the first PUT or whenever the stream cannot infer the current activity type.
|
|
48
48
|
attr_accessor :type
|
|
49
49
|
|
|
50
|
-
# Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints
|
|
50
|
+
# Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
|
|
51
51
|
attr_accessor :color
|
|
52
52
|
|
|
53
53
|
# Optional. Overrides color for the current step. Only applies to segmented_progress.
|
|
@@ -20,6 +20,8 @@ require 'activitysmith_openapi/configuration'
|
|
|
20
20
|
require 'activitysmith_openapi/models/activity_metric'
|
|
21
21
|
require 'activitysmith_openapi/models/activity_metric_value'
|
|
22
22
|
require 'activitysmith_openapi/models/alert_payload'
|
|
23
|
+
require 'activitysmith_openapi/models/app_icon_badge_count_update_request'
|
|
24
|
+
require 'activitysmith_openapi/models/app_icon_badge_count_update_response'
|
|
23
25
|
require 'activitysmith_openapi/models/bad_request_error'
|
|
24
26
|
require 'activitysmith_openapi/models/channel_target'
|
|
25
27
|
require 'activitysmith_openapi/models/content_state_end'
|
|
@@ -59,6 +61,7 @@ require 'activitysmith_openapi/models/send_push_notification429_response'
|
|
|
59
61
|
require 'activitysmith_openapi/models/stream_content_state'
|
|
60
62
|
|
|
61
63
|
# APIs
|
|
64
|
+
require 'activitysmith_openapi/api/app_icon_badges_api'
|
|
62
65
|
require 'activitysmith_openapi/api/live_activities_api'
|
|
63
66
|
require 'activitysmith_openapi/api/metrics_api'
|
|
64
67
|
require 'activitysmith_openapi/api/push_notifications_api'
|
data/lib/activitysmith/client.rb
CHANGED
|
@@ -19,6 +19,14 @@ module ActivitySmith
|
|
|
19
19
|
@notifications = Notifications.new(OpenapiClient::PushNotificationsApi.new(api_client))
|
|
20
20
|
@live_activities = LiveActivities.new(OpenapiClient::LiveActivitiesApi.new(api_client))
|
|
21
21
|
@metrics = Metrics.new(OpenapiClient::MetricsApi.new(api_client))
|
|
22
|
+
@app_icon_badges = OpenapiClient::AppIconBadgesApi.new(api_client)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def badge_count(value, channels: nil)
|
|
26
|
+
request = { badge: value }
|
|
27
|
+
normalized_channels = normalize_channels(channels)
|
|
28
|
+
request[:target] = { channels: normalized_channels } unless normalized_channels.empty?
|
|
29
|
+
@app_icon_badges.update_app_icon_badge_count(request)
|
|
22
30
|
end
|
|
23
31
|
|
|
24
32
|
private
|
|
@@ -44,7 +52,8 @@ module ActivitySmith
|
|
|
44
52
|
"OpenapiClient::ApiClient",
|
|
45
53
|
"OpenapiClient::PushNotificationsApi",
|
|
46
54
|
"OpenapiClient::LiveActivitiesApi",
|
|
47
|
-
"OpenapiClient::MetricsApi"
|
|
55
|
+
"OpenapiClient::MetricsApi",
|
|
56
|
+
"OpenapiClient::AppIconBadgesApi"
|
|
48
57
|
].reject { |name| constant_defined?(name) }
|
|
49
58
|
|
|
50
59
|
missing.empty?
|
|
@@ -56,5 +65,10 @@ module ActivitySmith
|
|
|
56
65
|
rescue NameError
|
|
57
66
|
false
|
|
58
67
|
end
|
|
68
|
+
|
|
69
|
+
def normalize_channels(channels)
|
|
70
|
+
values = channels.is_a?(String) ? channels.split(",") : Array(channels)
|
|
71
|
+
values.map { |channel| channel.to_s.strip }.reject(&:empty?)
|
|
72
|
+
end
|
|
59
73
|
end
|
|
60
74
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activitysmith
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ActivitySmith
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-07-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|
|
@@ -76,6 +76,7 @@ files:
|
|
|
76
76
|
- LICENSE
|
|
77
77
|
- README.md
|
|
78
78
|
- generated/activitysmith_openapi.rb
|
|
79
|
+
- generated/activitysmith_openapi/api/app_icon_badges_api.rb
|
|
79
80
|
- generated/activitysmith_openapi/api/live_activities_api.rb
|
|
80
81
|
- generated/activitysmith_openapi/api/metrics_api.rb
|
|
81
82
|
- generated/activitysmith_openapi/api/push_notifications_api.rb
|
|
@@ -85,6 +86,8 @@ files:
|
|
|
85
86
|
- generated/activitysmith_openapi/models/activity_metric.rb
|
|
86
87
|
- generated/activitysmith_openapi/models/activity_metric_value.rb
|
|
87
88
|
- generated/activitysmith_openapi/models/alert_payload.rb
|
|
89
|
+
- generated/activitysmith_openapi/models/app_icon_badge_count_update_request.rb
|
|
90
|
+
- generated/activitysmith_openapi/models/app_icon_badge_count_update_response.rb
|
|
88
91
|
- generated/activitysmith_openapi/models/bad_request_error.rb
|
|
89
92
|
- generated/activitysmith_openapi/models/channel_target.rb
|
|
90
93
|
- generated/activitysmith_openapi/models/content_state_end.rb
|