trycourier 6.4.4 → 6.6.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/CHANGELOG.md +20 -0
- data/README.md +1 -1
- data/lib/courier/models/digest_day_of_week.rb +21 -0
- data/lib/courier/models/digest_frequency.rb +21 -0
- data/lib/courier/models/email_footer.rb +114 -7
- data/lib/courier/models/journey_conditions_field.rb +11 -1
- data/lib/courier/models/journey_node.rb +17 -2
- data/lib/courier/models/topic_digest_category.rb +71 -0
- data/lib/courier/models/topic_digest_release_request.rb +35 -0
- data/lib/courier/models/topic_digest_request.rb +63 -0
- data/lib/courier/models/topic_digest_response.rb +66 -0
- data/lib/courier/models/topic_digest_schedule_request.rb +93 -0
- data/lib/courier/models/topic_digest_schedule_response.rb +103 -0
- data/lib/courier/models/users/preference_update_or_create_topic_params.rb +13 -1
- data/lib/courier/models/users/token_add_single_params.rb +13 -5
- data/lib/courier/models/users/token_update_params.rb +30 -4
- data/lib/courier/models/users/topic_preference.rb +12 -1
- data/lib/courier/models/users/user_token.rb +13 -5
- data/lib/courier/models/workspace_preference_topic_create_request.rb +15 -1
- data/lib/courier/models/workspace_preference_topic_get_response.rb +9 -1
- data/lib/courier/models/workspace_preference_topic_replace_request.rb +15 -1
- data/lib/courier/models/workspace_preferences/topic_delete_digest_params.rb +28 -0
- data/lib/courier/models/workspace_preferences/topic_release_digest_params.rb +28 -0
- data/lib/courier/models.rb +16 -0
- data/lib/courier/resources/digests/schedules.rb +1 -1
- data/lib/courier/resources/users/tokens.rb +1 -1
- data/lib/courier/resources/workspace_preferences/topics.rb +77 -4
- data/lib/courier/resources/workspace_preferences.rb +0 -2
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +10 -0
- data/rbi/courier/models/digest_day_of_week.rbi +25 -0
- data/rbi/courier/models/digest_frequency.rbi +25 -0
- data/rbi/courier/models/email_footer.rbi +229 -7
- data/rbi/courier/models/journey_node.rbi +12 -1
- data/rbi/courier/models/topic_digest_category.rbi +116 -0
- data/rbi/courier/models/topic_digest_release_request.rbi +51 -0
- data/rbi/courier/models/topic_digest_request.rbi +95 -0
- data/rbi/courier/models/topic_digest_response.rbi +98 -0
- data/rbi/courier/models/topic_digest_schedule_request.rbi +141 -0
- data/rbi/courier/models/topic_digest_schedule_response.rbi +159 -0
- data/rbi/courier/models/users/preference_update_or_create_topic_params.rbi +16 -0
- data/rbi/courier/models/users/token_add_single_params.rbi +18 -6
- data/rbi/courier/models/users/token_update_params.rbi +59 -7
- data/rbi/courier/models/users/topic_preference.rbi +17 -0
- data/rbi/courier/models/users/user_token.rbi +18 -6
- data/rbi/courier/models/workspace_preference_topic_create_request.rbi +25 -0
- data/rbi/courier/models/workspace_preference_topic_get_response.rbi +13 -0
- data/rbi/courier/models/workspace_preference_topic_replace_request.rbi +25 -0
- data/rbi/courier/models/workspace_preferences/topic_delete_digest_params.rbi +48 -0
- data/rbi/courier/models/workspace_preferences/topic_release_digest_params.rbi +48 -0
- data/rbi/courier/models.rbi +16 -0
- data/rbi/courier/resources/digests/schedules.rbi +5 -2
- data/rbi/courier/resources/users/tokens.rbi +6 -2
- data/rbi/courier/resources/workspace_preferences/topics.rbi +72 -2
- data/rbi/courier/resources/workspace_preferences.rbi +0 -2
- data/sig/courier/models/digest_day_of_week.rbs +26 -0
- data/sig/courier/models/digest_frequency.rbs +19 -0
- data/sig/courier/models/email_footer.rbs +107 -5
- data/sig/courier/models/topic_digest_category.rbs +57 -0
- data/sig/courier/models/topic_digest_release_request.rbs +17 -0
- data/sig/courier/models/topic_digest_request.rbs +48 -0
- data/sig/courier/models/topic_digest_response.rbs +58 -0
- data/sig/courier/models/topic_digest_schedule_request.rbs +80 -0
- data/sig/courier/models/topic_digest_schedule_response.rbs +96 -0
- data/sig/courier/models/users/preference_update_or_create_topic_params.rbs +5 -0
- data/sig/courier/models/users/token_update_params.rbs +27 -4
- data/sig/courier/models/users/topic_preference.rbs +7 -0
- data/sig/courier/models/workspace_preference_topic_create_request.rbs +5 -0
- data/sig/courier/models/workspace_preference_topic_get_response.rbs +5 -0
- data/sig/courier/models/workspace_preference_topic_replace_request.rbs +5 -0
- data/sig/courier/models/workspace_preferences/topic_delete_digest_params.rbs +30 -0
- data/sig/courier/models/workspace_preferences/topic_release_digest_params.rbs +34 -0
- data/sig/courier/models.rbs +16 -0
- data/sig/courier/resources/workspace_preferences/topics.rbs +16 -0
- metadata +32 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 72f51e60173a98ce2cc1e4b6d3c0613e82f18de751e7ea855ed2418808cac4d9
|
|
4
|
+
data.tar.gz: 5a10110fea4a9c3b8c5acaf39d169a902c7a8566e4ddfb49933eaed3600c0924
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7940121c65ecbb1ef483b5f8594cdde2a3b08f1c93d22c04ebbd829b2989030e6d3bc43359b98196fc749a4c21fe8d54cb2a3355f37e057996da472e807751eb
|
|
7
|
+
data.tar.gz: 569ff793ab8fa5d18202278cd38630cb6556c391f3097e2931c938afb87e2a6c163c4b061bab684dc4a18d668843d0b36a7ebbb5b11699976483d49e466d5370
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [6.6.0](https://github.com/trycourier/courier-ruby/compare/v6.5.0...v6.6.0) (2026-09-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **api:** digest configuration, per-recipient schedules, and release ([#154](https://github.com/trycourier/courier-ruby/issues/154)) ([abaf9f2](https://github.com/trycourier/courier-ruby/commit/abaf9f215ae6c9e6aaeb36e7313c9300da23b39b))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Documentation
|
|
12
|
+
|
|
13
|
+
* **api:** group the topic digest endpoints under Digests, and match the docs voice ([#155](https://github.com/trycourier/courier-ruby/issues/155)) ([cb00e91](https://github.com/trycourier/courier-ruby/commit/cb00e91773b41f312db5c627ee500080da48b051))
|
|
14
|
+
* **api:** stop teaching an aud_ prefix that Courier does not issue ([#152](https://github.com/trycourier/courier-ruby/issues/152)) ([1bd0f05](https://github.com/trycourier/courier-ruby/commit/1bd0f05a5e3db1e593c04046a7b20e9bdd1f64bf))
|
|
15
|
+
|
|
16
|
+
## [6.5.0](https://github.com/trycourier/courier-ruby/compare/v6.4.4...v6.5.0) (2026-09-04)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **api:** document the expiry_date contract and allow boolean patch values ([#148](https://github.com/trycourier/courier-ruby/issues/148)) ([191cec0](https://github.com/trycourier/courier-ruby/commit/191cec0ef235a855add991f9b935c1d90e0239f8))
|
|
22
|
+
|
|
3
23
|
## [6.4.4](https://github.com/trycourier/courier-ruby/compare/v6.4.3...v6.4.4) (2026-09-03)
|
|
4
24
|
|
|
5
25
|
|
data/README.md
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# A day of the week. Accepted case-insensitively, returned lowercase.
|
|
6
|
+
module DigestDayOfWeek
|
|
7
|
+
extend Courier::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
SUNDAY = :sunday
|
|
10
|
+
MONDAY = :monday
|
|
11
|
+
TUESDAY = :tuesday
|
|
12
|
+
WEDNESDAY = :wednesday
|
|
13
|
+
THURSDAY = :thursday
|
|
14
|
+
FRIDAY = :friday
|
|
15
|
+
SATURDAY = :saturday
|
|
16
|
+
|
|
17
|
+
# @!method self.values
|
|
18
|
+
# @return [Array<Symbol>]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# How often a digest is delivered. `instant` delivers immediately without
|
|
6
|
+
# batching, and is the one value that takes no `time`.
|
|
7
|
+
module DigestFrequency
|
|
8
|
+
extend Courier::Internal::Type::Enum
|
|
9
|
+
|
|
10
|
+
INSTANT = :instant
|
|
11
|
+
DAILY = :daily
|
|
12
|
+
WEEKDAYS = :weekdays
|
|
13
|
+
WEEKLY = :weekly
|
|
14
|
+
CUSTOM_DAYS = :custom_days
|
|
15
|
+
MONTHLY = :monthly
|
|
16
|
+
|
|
17
|
+
# @!method self.values
|
|
18
|
+
# @return [Array<Symbol>]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -3,19 +3,126 @@
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Models
|
|
5
5
|
class EmailFooter < Courier::Internal::Type::BaseModel
|
|
6
|
-
# @!attribute content
|
|
7
|
-
#
|
|
8
|
-
# @return [String, nil]
|
|
9
|
-
optional :content, String, nil?: true
|
|
10
|
-
|
|
11
6
|
# @!attribute inherit_default
|
|
12
7
|
#
|
|
13
8
|
# @return [Boolean, nil]
|
|
14
9
|
optional :inherit_default, Courier::Internal::Type::Boolean, api_name: :inheritDefault, nil?: true
|
|
15
10
|
|
|
16
|
-
# @!
|
|
17
|
-
#
|
|
11
|
+
# @!attribute markdown
|
|
12
|
+
# The footer body, as markdown. This is the field the API returns and accepts; it
|
|
13
|
+
# is omitted entirely when no footer body is set. Sending null is accepted and
|
|
14
|
+
# treated as no footer body.
|
|
15
|
+
#
|
|
16
|
+
# @return [String, nil]
|
|
17
|
+
optional :markdown, String, nil?: true
|
|
18
|
+
|
|
19
|
+
# @!attribute social
|
|
20
|
+
# Social links rendered in the email footer.
|
|
21
|
+
#
|
|
22
|
+
# @return [Courier::Models::EmailFooter::Social, nil]
|
|
23
|
+
optional :social, -> { Courier::EmailFooter::Social }, nil?: true
|
|
24
|
+
|
|
25
|
+
# @!method initialize(inherit_default: nil, markdown: nil, social: nil)
|
|
26
|
+
# Some parameter documentations has been truncated, see
|
|
27
|
+
# {Courier::Models::EmailFooter} for more details.
|
|
28
|
+
#
|
|
18
29
|
# @param inherit_default [Boolean, nil]
|
|
30
|
+
#
|
|
31
|
+
# @param markdown [String, nil] The footer body, as markdown. This is the field the API returns and accepts; it
|
|
32
|
+
#
|
|
33
|
+
# @param social [Courier::Models::EmailFooter::Social, nil] Social links rendered in the email footer.
|
|
34
|
+
|
|
35
|
+
# @see Courier::Models::EmailFooter#social
|
|
36
|
+
class Social < Courier::Internal::Type::BaseModel
|
|
37
|
+
# @!attribute facebook
|
|
38
|
+
#
|
|
39
|
+
# @return [Courier::Models::EmailFooter::Social::Facebook, nil]
|
|
40
|
+
optional :facebook, -> { Courier::EmailFooter::Social::Facebook }, nil?: true
|
|
41
|
+
|
|
42
|
+
# @!attribute instagram
|
|
43
|
+
#
|
|
44
|
+
# @return [Courier::Models::EmailFooter::Social::Instagram, nil]
|
|
45
|
+
optional :instagram, -> { Courier::EmailFooter::Social::Instagram }, nil?: true
|
|
46
|
+
|
|
47
|
+
# @!attribute linkedin
|
|
48
|
+
#
|
|
49
|
+
# @return [Courier::Models::EmailFooter::Social::Linkedin, nil]
|
|
50
|
+
optional :linkedin, -> { Courier::EmailFooter::Social::Linkedin }, nil?: true
|
|
51
|
+
|
|
52
|
+
# @!attribute medium
|
|
53
|
+
#
|
|
54
|
+
# @return [Courier::Models::EmailFooter::Social::Medium, nil]
|
|
55
|
+
optional :medium, -> { Courier::EmailFooter::Social::Medium }, nil?: true
|
|
56
|
+
|
|
57
|
+
# @!attribute twitter
|
|
58
|
+
#
|
|
59
|
+
# @return [Courier::Models::EmailFooter::Social::Twitter, nil]
|
|
60
|
+
optional :twitter, -> { Courier::EmailFooter::Social::Twitter }, nil?: true
|
|
61
|
+
|
|
62
|
+
# @!method initialize(facebook: nil, instagram: nil, linkedin: nil, medium: nil, twitter: nil)
|
|
63
|
+
# Social links rendered in the email footer.
|
|
64
|
+
#
|
|
65
|
+
# @param facebook [Courier::Models::EmailFooter::Social::Facebook, nil]
|
|
66
|
+
# @param instagram [Courier::Models::EmailFooter::Social::Instagram, nil]
|
|
67
|
+
# @param linkedin [Courier::Models::EmailFooter::Social::Linkedin, nil]
|
|
68
|
+
# @param medium [Courier::Models::EmailFooter::Social::Medium, nil]
|
|
69
|
+
# @param twitter [Courier::Models::EmailFooter::Social::Twitter, nil]
|
|
70
|
+
|
|
71
|
+
# @see Courier::Models::EmailFooter::Social#facebook
|
|
72
|
+
class Facebook < Courier::Internal::Type::BaseModel
|
|
73
|
+
# @!attribute url
|
|
74
|
+
#
|
|
75
|
+
# @return [String, nil]
|
|
76
|
+
optional :url, String, nil?: true
|
|
77
|
+
|
|
78
|
+
# @!method initialize(url: nil)
|
|
79
|
+
# @param url [String, nil]
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# @see Courier::Models::EmailFooter::Social#instagram
|
|
83
|
+
class Instagram < Courier::Internal::Type::BaseModel
|
|
84
|
+
# @!attribute url
|
|
85
|
+
#
|
|
86
|
+
# @return [String, nil]
|
|
87
|
+
optional :url, String, nil?: true
|
|
88
|
+
|
|
89
|
+
# @!method initialize(url: nil)
|
|
90
|
+
# @param url [String, nil]
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# @see Courier::Models::EmailFooter::Social#linkedin
|
|
94
|
+
class Linkedin < Courier::Internal::Type::BaseModel
|
|
95
|
+
# @!attribute url
|
|
96
|
+
#
|
|
97
|
+
# @return [String, nil]
|
|
98
|
+
optional :url, String, nil?: true
|
|
99
|
+
|
|
100
|
+
# @!method initialize(url: nil)
|
|
101
|
+
# @param url [String, nil]
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# @see Courier::Models::EmailFooter::Social#medium
|
|
105
|
+
class Medium < Courier::Internal::Type::BaseModel
|
|
106
|
+
# @!attribute url
|
|
107
|
+
#
|
|
108
|
+
# @return [String, nil]
|
|
109
|
+
optional :url, String, nil?: true
|
|
110
|
+
|
|
111
|
+
# @!method initialize(url: nil)
|
|
112
|
+
# @param url [String, nil]
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# @see Courier::Models::EmailFooter::Social#twitter
|
|
116
|
+
class Twitter < Courier::Internal::Type::BaseModel
|
|
117
|
+
# @!attribute url
|
|
118
|
+
#
|
|
119
|
+
# @return [String, nil]
|
|
120
|
+
optional :url, String, nil?: true
|
|
121
|
+
|
|
122
|
+
# @!method initialize(url: nil)
|
|
123
|
+
# @param url [String, nil]
|
|
124
|
+
end
|
|
125
|
+
end
|
|
19
126
|
end
|
|
20
127
|
end
|
|
21
128
|
end
|
|
@@ -12,10 +12,20 @@ module Courier
|
|
|
12
12
|
# - Binary form (3 elements): `[path, operator, value]` where `operator`
|
|
13
13
|
# is one of `is equal`, `is not equal`, `contains`, `does not contain`,
|
|
14
14
|
# `starts with`, `ends with`, `greater than`, `greater than or equal`,
|
|
15
|
-
# `less than`, `less than or equal`.
|
|
15
|
+
# `less than`, `less than or equal`, `was`, `was not`.
|
|
16
16
|
#
|
|
17
17
|
# Example: `["user.tier", "is equal", "gold"]`.
|
|
18
18
|
#
|
|
19
|
+
# `was` / `was not` compare a `send_status.<nodeId>` path (referencing
|
|
20
|
+
# an earlier send node's node id) against one of `SENT`, `DELIVERED`,
|
|
21
|
+
# `OPENED`, `CLICKED`, `UNDELIVERABLE`. The first four are cumulative
|
|
22
|
+
# and ordered `SENT < DELIVERED < OPENED < CLICKED`, so `was DELIVERED`
|
|
23
|
+
# is true once the message has reached DELIVERED, OPENED, or CLICKED.
|
|
24
|
+
# `UNDELIVERABLE` is an exact match only and is never part of that
|
|
25
|
+
# ordering, in either direction.
|
|
26
|
+
# Example:
|
|
27
|
+
# `["send_status.P9Z3VCRJG647M7QNJZR3548HW741", "was", "DELIVERED"]`.
|
|
28
|
+
#
|
|
19
29
|
# - Unary form (2 elements): `[path, operator]` where `operator` is
|
|
20
30
|
# one of `exists`, `does not exist`.
|
|
21
31
|
#
|
|
@@ -47,7 +47,11 @@ module Courier
|
|
|
47
47
|
# Collect events arriving at the node into a single batch and fire one downstream step with the aggregated payload. The first event into a batch owns the run; later contributing events terminate at the batch step. The batch releases when any of `max_items` is reached, a quiet window of `wait_period` elapses, or the `max_wait_period` ceiling hits.
|
|
48
48
|
variant -> { Courier::JourneyNode::JourneyBatchNode }
|
|
49
49
|
|
|
50
|
-
# Add the current event to a digest keyed by the given subscription topic. The digest accumulates events and releases them on the schedule configured for the topic.
|
|
50
|
+
# Add the current event to a digest keyed by the given subscription topic. The digest accumulates events and releases them on the schedule configured for the topic, using the notification template configured on that topic. This node's `type` value is `add-to-digest`.
|
|
51
|
+
#
|
|
52
|
+
# **The topic must have a template configured.** If the topic has no template when the first event reaches this node, the journey run fails immediately: the run is marked `ERROR`, no digest instance is created, and the journey does not continue past this node. Configure the topic's template before using the topic in a journey.
|
|
53
|
+
#
|
|
54
|
+
# If the journey run is scoped to a tenant, digests are kept separate per tenant: two runs for the same user under different tenants accumulate and release as separate digests, even on the same topic.
|
|
51
55
|
variant -> { Courier::JourneyNode::JourneyAddToDigestNode }
|
|
52
56
|
|
|
53
57
|
# Terminate the journey run.
|
|
@@ -240,7 +244,18 @@ module Courier
|
|
|
240
244
|
#
|
|
241
245
|
# Add the current event to a digest keyed by the given subscription topic. The
|
|
242
246
|
# digest accumulates events and releases them on the schedule configured for the
|
|
243
|
-
# topic.
|
|
247
|
+
# topic, using the notification template configured on that topic. This node's
|
|
248
|
+
# `type` value is `add-to-digest`.
|
|
249
|
+
#
|
|
250
|
+
# **The topic must have a template configured.** If the topic has no template when
|
|
251
|
+
# the first event reaches this node, the journey run fails immediately: the run is
|
|
252
|
+
# marked `ERROR`, no digest instance is created, and the journey does not continue
|
|
253
|
+
# past this node. Configure the topic's template before using the topic in a
|
|
254
|
+
# journey.
|
|
255
|
+
#
|
|
256
|
+
# If the journey run is scoped to a tenant, digests are kept separate per tenant:
|
|
257
|
+
# two runs for the same user under different tenants accumulate and release as
|
|
258
|
+
# separate digests, even on the same topic.
|
|
244
259
|
#
|
|
245
260
|
# @param subscription_topic_id [String] The subscription topic that owns the digest the event is added to.
|
|
246
261
|
#
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class TopicDigestCategory < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute category_key
|
|
7
|
+
# The key that identifies the category within the digest.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :category_key, String
|
|
11
|
+
|
|
12
|
+
# @!attribute limit
|
|
13
|
+
# How many collected events are carried into the rendered digest. Defaults to 10.
|
|
14
|
+
#
|
|
15
|
+
# Events beyond the limit are discarded, not held back for the next digest: the
|
|
16
|
+
# release consumes everything collected so far and only `limit` of them appear.
|
|
17
|
+
# `retain` decides which ones those are.
|
|
18
|
+
#
|
|
19
|
+
# @return [Integer, nil]
|
|
20
|
+
optional :limit, Integer
|
|
21
|
+
|
|
22
|
+
# @!attribute retain
|
|
23
|
+
# Which collected events survive the `limit`. `FIRST` and `LOWEST` keep the
|
|
24
|
+
# earliest or smallest; `LAST` and `HIGHEST` keep the latest or largest. Accepted
|
|
25
|
+
# case-insensitively, returned uppercase.
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, Courier::Models::TopicDigestCategory::Retain, nil]
|
|
28
|
+
optional :retain, enum: -> { Courier::TopicDigestCategory::Retain }
|
|
29
|
+
|
|
30
|
+
# @!attribute sort_key
|
|
31
|
+
# The data key used to rank events. Required when `retain` is `HIGHEST` or
|
|
32
|
+
# `LOWEST`.
|
|
33
|
+
#
|
|
34
|
+
# @return [String, nil]
|
|
35
|
+
optional :sort_key, String
|
|
36
|
+
|
|
37
|
+
# @!method initialize(category_key:, limit: nil, retain: nil, sort_key: nil)
|
|
38
|
+
# Some parameter documentations has been truncated, see
|
|
39
|
+
# {Courier::Models::TopicDigestCategory} for more details.
|
|
40
|
+
#
|
|
41
|
+
# How events collected under a category key are retained when a digest holds more
|
|
42
|
+
# than it will render.
|
|
43
|
+
#
|
|
44
|
+
# @param category_key [String] The key that identifies the category within the digest.
|
|
45
|
+
#
|
|
46
|
+
# @param limit [Integer] How many collected events are carried into the rendered digest. Defaults to 10.
|
|
47
|
+
#
|
|
48
|
+
# @param retain [Symbol, Courier::Models::TopicDigestCategory::Retain] Which collected events survive the `limit`. `FIRST` and `LOWEST` keep the earlie
|
|
49
|
+
#
|
|
50
|
+
# @param sort_key [String] The data key used to rank events. Required when `retain` is `HIGHEST` or `LOWEST
|
|
51
|
+
|
|
52
|
+
# Which collected events survive the `limit`. `FIRST` and `LOWEST` keep the
|
|
53
|
+
# earliest or smallest; `LAST` and `HIGHEST` keep the latest or largest. Accepted
|
|
54
|
+
# case-insensitively, returned uppercase.
|
|
55
|
+
#
|
|
56
|
+
# @see Courier::Models::TopicDigestCategory#retain
|
|
57
|
+
module Retain
|
|
58
|
+
extend Courier::Internal::Type::Enum
|
|
59
|
+
|
|
60
|
+
FIRST = :FIRST
|
|
61
|
+
LAST = :LAST
|
|
62
|
+
HIGHEST = :HIGHEST
|
|
63
|
+
LOWEST = :LOWEST
|
|
64
|
+
NONE = :NONE
|
|
65
|
+
|
|
66
|
+
# @!method self.values
|
|
67
|
+
# @return [Array<Symbol>]
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class TopicDigestReleaseRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute user_id
|
|
7
|
+
# The recipient whose digest to release. Required: there is no "release everyone
|
|
8
|
+
# on this topic" form, because a whole-schedule flush already has its own endpoint
|
|
9
|
+
# and a body-shaped difference between one recipient and all of them is too easy
|
|
10
|
+
# to get wrong.
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :user_id, String
|
|
14
|
+
|
|
15
|
+
# @!attribute tenant_id
|
|
16
|
+
# The recipient's tenant, when they were sent to as part of one -- the same value
|
|
17
|
+
# returned as `tenant_id` on a digest instance and sent as
|
|
18
|
+
# `message.context.tenant_id`. It is part of the held digest's key, so a tenanted
|
|
19
|
+
# recipient cannot be found without it. Omit for an ordinary recipient.
|
|
20
|
+
#
|
|
21
|
+
# @return [String, nil]
|
|
22
|
+
optional :tenant_id, String
|
|
23
|
+
|
|
24
|
+
# @!method initialize(user_id:, tenant_id: nil)
|
|
25
|
+
# Some parameter documentations has been truncated, see
|
|
26
|
+
# {Courier::Models::TopicDigestReleaseRequest} for more details.
|
|
27
|
+
#
|
|
28
|
+
# Which recipient's held digest to release.
|
|
29
|
+
#
|
|
30
|
+
# @param user_id [String] The recipient whose digest to release. Required: there is no "release everyone o
|
|
31
|
+
#
|
|
32
|
+
# @param tenant_id [String] The recipient's tenant, when they were sent to as part of one -- the same value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class TopicDigestRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute schedules
|
|
7
|
+
# The cadences this digest delivers on. At least one is required: a digest with no
|
|
8
|
+
# schedule collects events into an instance that can never fire. Omitting the key
|
|
9
|
+
# on a replace leaves stored schedules untouched; sending `[]` is a `400`.
|
|
10
|
+
#
|
|
11
|
+
# @return [Array<Courier::Models::TopicDigestScheduleRequest>]
|
|
12
|
+
required :schedules, -> { Courier::Internal::Type::ArrayOf[Courier::TopicDigestScheduleRequest] }
|
|
13
|
+
|
|
14
|
+
# @!attribute template_id
|
|
15
|
+
# The notification template that renders the digest. A digest with no template
|
|
16
|
+
# collects nothing, so this is required.
|
|
17
|
+
#
|
|
18
|
+
# @return [String]
|
|
19
|
+
required :template_id, String
|
|
20
|
+
|
|
21
|
+
# @!attribute audience_id
|
|
22
|
+
# Optional audience the digest is scoped to.
|
|
23
|
+
#
|
|
24
|
+
# @return [String, nil]
|
|
25
|
+
optional :audience_id, String
|
|
26
|
+
|
|
27
|
+
# @!attribute categories
|
|
28
|
+
# Retention rules per category key. Defaults to a single `digest` category
|
|
29
|
+
# retaining `FIRST`.
|
|
30
|
+
#
|
|
31
|
+
# @return [Array<Courier::Models::TopicDigestCategory>, nil]
|
|
32
|
+
optional :categories, -> { Courier::Internal::Type::ArrayOf[Courier::TopicDigestCategory] }
|
|
33
|
+
|
|
34
|
+
# @!attribute trigger_empty
|
|
35
|
+
# Whether to deliver the digest even when nothing was collected.
|
|
36
|
+
#
|
|
37
|
+
# @return [Boolean, nil]
|
|
38
|
+
optional :trigger_empty, Courier::Internal::Type::Boolean
|
|
39
|
+
|
|
40
|
+
# @!method initialize(schedules:, template_id:, audience_id: nil, categories: nil, trigger_empty: nil)
|
|
41
|
+
# Some parameter documentations has been truncated, see
|
|
42
|
+
# {Courier::Models::TopicDigestRequest} for more details.
|
|
43
|
+
#
|
|
44
|
+
# A topic's digest configuration: the template that renders it, the cadences it
|
|
45
|
+
# delivers on, and how collected events are retained.
|
|
46
|
+
#
|
|
47
|
+
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
48
|
+
# template and removes its schedules. There is no `enabled` flag, and
|
|
49
|
+
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
50
|
+
# merely off.
|
|
51
|
+
#
|
|
52
|
+
# @param schedules [Array<Courier::Models::TopicDigestScheduleRequest>] The cadences this digest delivers on. At least one is required: a digest with no
|
|
53
|
+
#
|
|
54
|
+
# @param template_id [String] The notification template that renders the digest. A digest with no template col
|
|
55
|
+
#
|
|
56
|
+
# @param audience_id [String] Optional audience the digest is scoped to.
|
|
57
|
+
#
|
|
58
|
+
# @param categories [Array<Courier::Models::TopicDigestCategory>] Retention rules per category key. Defaults to a single `digest` category retaini
|
|
59
|
+
#
|
|
60
|
+
# @param trigger_empty [Boolean] Whether to deliver the digest even when nothing was collected.
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class TopicDigestResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute categories
|
|
7
|
+
# Retention rules per category key.
|
|
8
|
+
#
|
|
9
|
+
# @return [Array<Courier::Models::TopicDigestCategory>]
|
|
10
|
+
required :categories, -> { Courier::Internal::Type::ArrayOf[Courier::TopicDigestCategory] }
|
|
11
|
+
|
|
12
|
+
# @!attribute schedules
|
|
13
|
+
# The digest's delivery cadences, each with its server-assigned `schedule_id`.
|
|
14
|
+
#
|
|
15
|
+
# @return [Array<Courier::Models::TopicDigestScheduleResponse>]
|
|
16
|
+
required :schedules, -> { Courier::Internal::Type::ArrayOf[Courier::TopicDigestScheduleResponse] }
|
|
17
|
+
|
|
18
|
+
# @!attribute template_id
|
|
19
|
+
# The notification template that renders the digest.
|
|
20
|
+
#
|
|
21
|
+
# @return [String]
|
|
22
|
+
required :template_id, String
|
|
23
|
+
|
|
24
|
+
# @!attribute audience_id
|
|
25
|
+
# The audience the digest is scoped to, when set.
|
|
26
|
+
#
|
|
27
|
+
# @return [String, nil]
|
|
28
|
+
optional :audience_id, String
|
|
29
|
+
|
|
30
|
+
# @!attribute created
|
|
31
|
+
# ISO-8601 timestamp of when the digest was configured.
|
|
32
|
+
#
|
|
33
|
+
# @return [String, nil]
|
|
34
|
+
optional :created, String
|
|
35
|
+
|
|
36
|
+
# @!attribute trigger_empty
|
|
37
|
+
# Whether the digest is delivered even when nothing was collected.
|
|
38
|
+
#
|
|
39
|
+
# @return [Boolean, nil]
|
|
40
|
+
optional :trigger_empty, Courier::Internal::Type::Boolean
|
|
41
|
+
|
|
42
|
+
# @!attribute updated
|
|
43
|
+
# ISO-8601 timestamp of the last update.
|
|
44
|
+
#
|
|
45
|
+
# @return [String, nil]
|
|
46
|
+
optional :updated, String
|
|
47
|
+
|
|
48
|
+
# @!method initialize(categories:, schedules:, template_id:, audience_id: nil, created: nil, trigger_empty: nil, updated: nil)
|
|
49
|
+
# A topic's digest configuration.
|
|
50
|
+
#
|
|
51
|
+
# @param categories [Array<Courier::Models::TopicDigestCategory>] Retention rules per category key.
|
|
52
|
+
#
|
|
53
|
+
# @param schedules [Array<Courier::Models::TopicDigestScheduleResponse>] The digest's delivery cadences, each with its server-assigned `schedule_id`.
|
|
54
|
+
#
|
|
55
|
+
# @param template_id [String] The notification template that renders the digest.
|
|
56
|
+
#
|
|
57
|
+
# @param audience_id [String] The audience the digest is scoped to, when set.
|
|
58
|
+
#
|
|
59
|
+
# @param created [String] ISO-8601 timestamp of when the digest was configured.
|
|
60
|
+
#
|
|
61
|
+
# @param trigger_empty [Boolean] Whether the digest is delivered even when nothing was collected.
|
|
62
|
+
#
|
|
63
|
+
# @param updated [String] ISO-8601 timestamp of the last update.
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class TopicDigestScheduleRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute frequency
|
|
7
|
+
# How often a digest is delivered. `instant` delivers immediately without
|
|
8
|
+
# batching, and is the one value that takes no `time`.
|
|
9
|
+
#
|
|
10
|
+
# @return [Symbol, Courier::Models::DigestFrequency]
|
|
11
|
+
required :frequency, enum: -> { Courier::DigestFrequency }
|
|
12
|
+
|
|
13
|
+
# @!attribute day_of_month
|
|
14
|
+
# Required when `frequency` is `monthly`.
|
|
15
|
+
#
|
|
16
|
+
# @return [Integer, nil]
|
|
17
|
+
optional :day_of_month, Integer
|
|
18
|
+
|
|
19
|
+
# @!attribute day_of_week
|
|
20
|
+
# Required when `frequency` is `weekly`.
|
|
21
|
+
#
|
|
22
|
+
# @return [Symbol, Courier::Models::DigestDayOfWeek, nil]
|
|
23
|
+
optional :day_of_week, enum: -> { Courier::DigestDayOfWeek }
|
|
24
|
+
|
|
25
|
+
# @!attribute days_of_week
|
|
26
|
+
# Required when `frequency` is `custom_days`.
|
|
27
|
+
#
|
|
28
|
+
# @return [Array<Symbol, Courier::Models::DigestDayOfWeek>, nil]
|
|
29
|
+
optional :days_of_week, -> { Courier::Internal::Type::ArrayOf[enum: Courier::DigestDayOfWeek] }
|
|
30
|
+
|
|
31
|
+
# @!attribute disabled
|
|
32
|
+
# Whether the schedule is disabled.
|
|
33
|
+
#
|
|
34
|
+
# @return [Boolean, nil]
|
|
35
|
+
optional :disabled, Courier::Internal::Type::Boolean
|
|
36
|
+
|
|
37
|
+
# @!attribute is_default
|
|
38
|
+
# The schedule recipients are placed on when they have not chosen one. Set this
|
|
39
|
+
# explicitly rather than relying on array position.
|
|
40
|
+
#
|
|
41
|
+
# @return [Boolean, nil]
|
|
42
|
+
optional :is_default, Courier::Internal::Type::Boolean
|
|
43
|
+
|
|
44
|
+
# @!attribute schedule_id
|
|
45
|
+
# Identifier of an existing schedule to update. Omit when creating a new one.
|
|
46
|
+
#
|
|
47
|
+
# @return [String, nil]
|
|
48
|
+
optional :schedule_id, String
|
|
49
|
+
|
|
50
|
+
# @!attribute time
|
|
51
|
+
# 24-hour local delivery time, `HH:MM`. Required for every frequency except
|
|
52
|
+
# `instant`.
|
|
53
|
+
#
|
|
54
|
+
# @return [String, nil]
|
|
55
|
+
optional :time, String
|
|
56
|
+
|
|
57
|
+
# @!attribute timezone
|
|
58
|
+
# IANA timezone the `time` and day fields are expressed in, e.g.
|
|
59
|
+
# `America/New_York`. Absent means UTC. Delivery follows the same local wall-clock
|
|
60
|
+
# across daylight-saving changes.
|
|
61
|
+
#
|
|
62
|
+
# @return [String, nil]
|
|
63
|
+
optional :timezone, String
|
|
64
|
+
|
|
65
|
+
# @!method initialize(frequency:, day_of_month: nil, day_of_week: nil, days_of_week: nil, disabled: nil, is_default: nil, schedule_id: nil, time: nil, timezone: nil)
|
|
66
|
+
# Some parameter documentations has been truncated, see
|
|
67
|
+
# {Courier::Models::TopicDigestScheduleRequest} for more details.
|
|
68
|
+
#
|
|
69
|
+
# One delivery cadence for a topic's digest. Supply `schedule_id` to update an
|
|
70
|
+
# existing schedule in place; omit it and one is assigned and returned. The
|
|
71
|
+
# `schedules` array is a full replacement, so a stored schedule absent from it is
|
|
72
|
+
# deleted along with its delivery rule.
|
|
73
|
+
#
|
|
74
|
+
# @param frequency [Symbol, Courier::Models::DigestFrequency] How often a digest is delivered. `instant` delivers immediately without batching
|
|
75
|
+
#
|
|
76
|
+
# @param day_of_month [Integer] Required when `frequency` is `monthly`.
|
|
77
|
+
#
|
|
78
|
+
# @param day_of_week [Symbol, Courier::Models::DigestDayOfWeek] Required when `frequency` is `weekly`.
|
|
79
|
+
#
|
|
80
|
+
# @param days_of_week [Array<Symbol, Courier::Models::DigestDayOfWeek>] Required when `frequency` is `custom_days`.
|
|
81
|
+
#
|
|
82
|
+
# @param disabled [Boolean] Whether the schedule is disabled.
|
|
83
|
+
#
|
|
84
|
+
# @param is_default [Boolean] The schedule recipients are placed on when they have not chosen one. Set this ex
|
|
85
|
+
#
|
|
86
|
+
# @param schedule_id [String] Identifier of an existing schedule to update. Omit when creating a new one.
|
|
87
|
+
#
|
|
88
|
+
# @param time [String] 24-hour local delivery time, `HH:MM`. Required for every frequency except `insta
|
|
89
|
+
#
|
|
90
|
+
# @param timezone [String] IANA timezone the `time` and day fields are expressed in, e.g. `America/New_York
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|