trycourier 6.6.0 → 6.8.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 +19 -0
- data/README.md +1 -1
- data/lib/courier/models/create_journey_request.rb +16 -1
- data/lib/courier/models/elemental_action_node.rb +31 -3
- data/lib/courier/models/journey_response.rb +14 -1
- data/lib/courier/models/topic_digest_request.rb +23 -11
- data/lib/courier/models/topic_digest_schedule_request.rb +6 -0
- data/lib/courier/models/topic_digest_schedule_response.rb +8 -0
- data/lib/courier/models/users/topic_preference.rb +7 -2
- data/lib/courier/models/workspace_preference_topic_create_request.rb +87 -5
- data/lib/courier/resources/journeys.rb +9 -2
- data/lib/courier/resources/workspace_preferences/topics.rb +1 -1
- data/lib/courier/version.rb +1 -1
- data/rbi/courier/models/create_journey_request.rbi +19 -0
- data/rbi/courier/models/elemental_action_node.rbi +46 -3
- data/rbi/courier/models/journey_response.rbi +12 -0
- data/rbi/courier/models/topic_digest_request.rbi +43 -12
- data/rbi/courier/models/topic_digest_schedule_request.rbi +6 -0
- data/rbi/courier/models/topic_digest_schedule_response.rbi +16 -0
- data/rbi/courier/models/users/topic_preference.rbi +14 -4
- data/rbi/courier/models/workspace_preference_topic_create_request.rbi +155 -8
- data/rbi/courier/resources/journeys.rbi +14 -0
- data/rbi/courier/resources/workspace_preferences/topics.rbi +11 -3
- data/sig/courier/models/create_journey_request.rbs +7 -0
- data/sig/courier/models/elemental_action_node.rbs +3 -1
- data/sig/courier/models/journey_response.rbs +5 -0
- data/sig/courier/models/topic_digest_request.rbs +9 -5
- data/sig/courier/models/workspace_preference_topic_create_request.rbs +49 -4
- data/sig/courier/resources/journeys.rbs +2 -0
- data/sig/courier/resources/workspace_preferences/topics.rbs +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5ed0341a28ac90163c1d29bdd7011d64d8fb6296b449a6d1ce17170f05fbc013
|
|
4
|
+
data.tar.gz: 884fc8993f5aadbd4250cd9d16d22c27792142dacd5ceae26d1679eab594e751
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f9ce02df1f3c0e222cbaeb03b6687fa3514a46226027d6850b3e168f1edfa390e5f7483044df2302bf606f85e90ea2d1e8b820da0dcf89f1137074f93bd819a
|
|
7
|
+
data.tar.gz: 36d2bee02a55f61397c3a3a1d770423e1d1bbeef1dd126600f9f65e3b7ec11b997f4a5c2c71c3e655d3a1927f9d9680603ade9a324e7a505a37420a7e5961932
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [6.8.0](https://github.com/trycourier/courier-ruby/compare/v6.7.0...v6.8.0) (2026-09-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **api:** publish the secondary and tertiary action styles [C-19961] ([#159](https://github.com/trycourier/courier-ruby/issues/159)) ([57cb2c8](https://github.com/trycourier/courier-ruby/commit/57cb2c80c80e9f84c140d573759d7d745e277d17))
|
|
9
|
+
|
|
10
|
+
## [6.7.0](https://github.com/trycourier/courier-ruby/compare/v6.6.0...v6.7.0) (2026-09-22)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **api:** add cancelation_token to journey create, replace, and get ([#158](https://github.com/trycourier/courier-ruby/issues/158)) ([ec47880](https://github.com/trycourier/courier-ruby/commit/ec47880a79aaefde00dedcbdc84527ff234a99f2))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Documentation
|
|
19
|
+
|
|
20
|
+
* **api:** correct the digest schedule contract, and make `schedules` optional ([#156](https://github.com/trycourier/courier-ruby/issues/156)) ([8578d77](https://github.com/trycourier/courier-ruby/commit/8578d77848275105865c1b29b799f2cc6621987e))
|
|
21
|
+
|
|
3
22
|
## [6.6.0](https://github.com/trycourier/courier-ruby/compare/v6.5.0...v6.6.0) (2026-09-15)
|
|
4
23
|
|
|
5
24
|
|
data/README.md
CHANGED
|
@@ -13,6 +13,16 @@ module Courier
|
|
|
13
13
|
# @return [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneyAudienceTriggerNode, Courier::Models::JourneyWebhookTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyNode::JourneyAddToDigestNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
|
|
14
14
|
required :nodes, -> { Courier::Internal::Type::ArrayOf[union: Courier::JourneyNode] }
|
|
15
15
|
|
|
16
|
+
# @!attribute cancelation_token
|
|
17
|
+
# Cancelation token stored on the journey definition. It tags every run the
|
|
18
|
+
# journey creates so that `POST /journeys/cancel` can later cancel those runs by
|
|
19
|
+
# token. Accepts a templated string such as `order-{{data.order_id}}`, which is
|
|
20
|
+
# resolved per run when the journey is invoked. On a replace, omitting this field
|
|
21
|
+
# preserves any existing token and sending a value replaces it.
|
|
22
|
+
#
|
|
23
|
+
# @return [String, nil]
|
|
24
|
+
optional :cancelation_token, String
|
|
25
|
+
|
|
16
26
|
# @!attribute enabled
|
|
17
27
|
#
|
|
18
28
|
# @return [Boolean, nil]
|
|
@@ -24,13 +34,18 @@ module Courier
|
|
|
24
34
|
# @return [Symbol, Courier::Models::JourneyState, nil]
|
|
25
35
|
optional :state, enum: -> { Courier::JourneyState }
|
|
26
36
|
|
|
27
|
-
# @!method initialize(name:, nodes:, enabled: nil, state: nil)
|
|
37
|
+
# @!method initialize(name:, nodes:, cancelation_token: nil, enabled: nil, state: nil)
|
|
38
|
+
# Some parameter documentations has been truncated, see
|
|
39
|
+
# {Courier::Models::CreateJourneyRequest} for more details.
|
|
40
|
+
#
|
|
28
41
|
# Request body for creating a journey.
|
|
29
42
|
#
|
|
30
43
|
# @param name [String]
|
|
31
44
|
#
|
|
32
45
|
# @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneyAudienceTriggerNode, Courier::Models::JourneyWebhookTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyNode::JourneyAddToDigestNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
|
|
33
46
|
#
|
|
47
|
+
# @param cancelation_token [String] Cancelation token stored on the journey definition. It tags every run the journe
|
|
48
|
+
#
|
|
34
49
|
# @param enabled [Boolean]
|
|
35
50
|
#
|
|
36
51
|
# @param state [Symbol, Courier::Models::JourneyState] Lifecycle state of a journey.
|
|
@@ -73,7 +73,20 @@ module Courier
|
|
|
73
73
|
optional :padding, String, nil?: true
|
|
74
74
|
|
|
75
75
|
# @!attribute style
|
|
76
|
-
#
|
|
76
|
+
# How prominent the action should be. `button` is the default, `secondary` and
|
|
77
|
+
# `tertiary` are the other two button styles, and `link` renders as inline text
|
|
78
|
+
# rather than a button.
|
|
79
|
+
#
|
|
80
|
+
# Each channel draws these as closely as its medium allows. Email fills `button`,
|
|
81
|
+
# outlines `secondary`, and underlines `tertiary`. The in-app Inbox fills
|
|
82
|
+
# `button`, outlines `secondary`, and draws `tertiary` as a solid button. Slack
|
|
83
|
+
# renders all three as Block Kit buttons, with `secondary` in Slack's `primary`
|
|
84
|
+
# style and `tertiary` in its `danger` style.
|
|
85
|
+
#
|
|
86
|
+
# `background_color` is the fill for `button`, and the border and label color for
|
|
87
|
+
# `secondary`. For `tertiary` it colors the underline and label in email and the
|
|
88
|
+
# fill in the Inbox. It does not apply to `link`. An Inbox theme that sets its own
|
|
89
|
+
# action colors takes precedence over the template.
|
|
77
90
|
#
|
|
78
91
|
# @return [Symbol, Courier::Models::ElementalActionNode::Style, nil]
|
|
79
92
|
optional :style, enum: -> { Courier::ElementalActionNode::Style }, nil?: true
|
|
@@ -106,13 +119,28 @@ module Courier
|
|
|
106
119
|
#
|
|
107
120
|
# @param padding [String, nil] CSS padding applied to the action button. For example, `8px 16px`
|
|
108
121
|
#
|
|
109
|
-
# @param style [Symbol, Courier::Models::ElementalActionNode::Style, nil]
|
|
122
|
+
# @param style [Symbol, Courier::Models::ElementalActionNode::Style, nil] How prominent the action should be. `button` is the default, `secondary` and `te
|
|
110
123
|
|
|
111
|
-
#
|
|
124
|
+
# How prominent the action should be. `button` is the default, `secondary` and
|
|
125
|
+
# `tertiary` are the other two button styles, and `link` renders as inline text
|
|
126
|
+
# rather than a button.
|
|
127
|
+
#
|
|
128
|
+
# Each channel draws these as closely as its medium allows. Email fills `button`,
|
|
129
|
+
# outlines `secondary`, and underlines `tertiary`. The in-app Inbox fills
|
|
130
|
+
# `button`, outlines `secondary`, and draws `tertiary` as a solid button. Slack
|
|
131
|
+
# renders all three as Block Kit buttons, with `secondary` in Slack's `primary`
|
|
132
|
+
# style and `tertiary` in its `danger` style.
|
|
133
|
+
#
|
|
134
|
+
# `background_color` is the fill for `button`, and the border and label color for
|
|
135
|
+
# `secondary`. For `tertiary` it colors the underline and label in email and the
|
|
136
|
+
# fill in the Inbox. It does not apply to `link`. An Inbox theme that sets its own
|
|
137
|
+
# action colors takes precedence over the template.
|
|
112
138
|
module Style
|
|
113
139
|
extend Courier::Internal::Type::Enum
|
|
114
140
|
|
|
115
141
|
BUTTON = :button
|
|
142
|
+
SECONDARY = :secondary
|
|
143
|
+
TERTIARY = :tertiary
|
|
116
144
|
LINK = :link
|
|
117
145
|
|
|
118
146
|
# @!method self.values
|
|
@@ -9,6 +9,14 @@ module Courier
|
|
|
9
9
|
# @return [String]
|
|
10
10
|
required :id, String
|
|
11
11
|
|
|
12
|
+
# @!attribute cancelation_token
|
|
13
|
+
# The journey cancelation token, or null when none is set. A token authored in the
|
|
14
|
+
# dashboard is returned in its raw templated form, such as
|
|
15
|
+
# `order-{{data.order_id}}`, so it can be read back and asserted.
|
|
16
|
+
#
|
|
17
|
+
# @return [String, nil]
|
|
18
|
+
required :cancelation_token, String, nil?: true
|
|
19
|
+
|
|
12
20
|
# @!attribute created
|
|
13
21
|
#
|
|
14
22
|
# @return [Integer, nil]
|
|
@@ -55,11 +63,16 @@ module Courier
|
|
|
55
63
|
# @return [String, nil]
|
|
56
64
|
required :updater, String, nil?: true
|
|
57
65
|
|
|
58
|
-
# @!method initialize(id:, created:, creator:, enabled:, name:, nodes:, published:, state:, updated:, updater:)
|
|
66
|
+
# @!method initialize(id:, cancelation_token:, created:, creator:, enabled:, name:, nodes:, published:, state:, updated:, updater:)
|
|
67
|
+
# Some parameter documentations has been truncated, see
|
|
68
|
+
# {Courier::Models::JourneyResponse} for more details.
|
|
69
|
+
#
|
|
59
70
|
# A journey, with its current draft or published nodes and metadata.
|
|
60
71
|
#
|
|
61
72
|
# @param id [String]
|
|
62
73
|
#
|
|
74
|
+
# @param cancelation_token [String, nil] The journey cancelation token, or null when none is set. A token authored in the
|
|
75
|
+
#
|
|
63
76
|
# @param created [Integer, nil]
|
|
64
77
|
#
|
|
65
78
|
# @param creator [String, nil]
|
|
@@ -3,14 +3,6 @@
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Models
|
|
5
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
6
|
# @!attribute template_id
|
|
15
7
|
# The notification template that renders the digest. A digest with no template
|
|
16
8
|
# collects nothing, so this is required.
|
|
@@ -31,13 +23,33 @@ module Courier
|
|
|
31
23
|
# @return [Array<Courier::Models::TopicDigestCategory>, nil]
|
|
32
24
|
optional :categories, -> { Courier::Internal::Type::ArrayOf[Courier::TopicDigestCategory] }
|
|
33
25
|
|
|
26
|
+
# @!attribute schedules
|
|
27
|
+
# The cadences this digest delivers on.
|
|
28
|
+
#
|
|
29
|
+
# The array replaces the stored schedules wholesale, so a schedule you leave out
|
|
30
|
+
# of it is deleted along with its delivery rule. Omit the key entirely to leave
|
|
31
|
+
# the stored schedules untouched — useful for changing `template_id` or
|
|
32
|
+
# `categories` without restating every schedule.
|
|
33
|
+
#
|
|
34
|
+
# A digest must end up with at least one schedule, because one with none collects
|
|
35
|
+
# events into an instance that can never fire. So sending `[]` is always a `400`,
|
|
36
|
+
# and so is omitting the key on a topic that has no schedules stored yet.
|
|
37
|
+
#
|
|
38
|
+
# On **create** the key is required outright: a topic being created has nothing
|
|
39
|
+
# stored to leave alone, and the topic row is written before its digest, so
|
|
40
|
+
# rejecting it any later would leave the topic behind and let a retry duplicate
|
|
41
|
+
# it.
|
|
42
|
+
#
|
|
43
|
+
# @return [Array<Courier::Models::TopicDigestScheduleRequest>, nil]
|
|
44
|
+
optional :schedules, -> { Courier::Internal::Type::ArrayOf[Courier::TopicDigestScheduleRequest] }
|
|
45
|
+
|
|
34
46
|
# @!attribute trigger_empty
|
|
35
47
|
# Whether to deliver the digest even when nothing was collected.
|
|
36
48
|
#
|
|
37
49
|
# @return [Boolean, nil]
|
|
38
50
|
optional :trigger_empty, Courier::Internal::Type::Boolean
|
|
39
51
|
|
|
40
|
-
# @!method initialize(
|
|
52
|
+
# @!method initialize(template_id:, audience_id: nil, categories: nil, schedules: nil, trigger_empty: nil)
|
|
41
53
|
# Some parameter documentations has been truncated, see
|
|
42
54
|
# {Courier::Models::TopicDigestRequest} for more details.
|
|
43
55
|
#
|
|
@@ -49,14 +61,14 @@ module Courier
|
|
|
49
61
|
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
50
62
|
# merely off.
|
|
51
63
|
#
|
|
52
|
-
# @param schedules [Array<Courier::Models::TopicDigestScheduleRequest>] The cadences this digest delivers on. At least one is required: a digest with no
|
|
53
|
-
#
|
|
54
64
|
# @param template_id [String] The notification template that renders the digest. A digest with no template col
|
|
55
65
|
#
|
|
56
66
|
# @param audience_id [String] Optional audience the digest is scoped to.
|
|
57
67
|
#
|
|
58
68
|
# @param categories [Array<Courier::Models::TopicDigestCategory>] Retention rules per category key. Defaults to a single `digest` category retaini
|
|
59
69
|
#
|
|
70
|
+
# @param schedules [Array<Courier::Models::TopicDigestScheduleRequest>] The cadences this digest delivers on.
|
|
71
|
+
#
|
|
60
72
|
# @param trigger_empty [Boolean] Whether to deliver the digest even when nothing was collected.
|
|
61
73
|
end
|
|
62
74
|
end
|
|
@@ -71,6 +71,12 @@ module Courier
|
|
|
71
71
|
# `schedules` array is a full replacement, so a stored schedule absent from it is
|
|
72
72
|
# deleted along with its delivery rule.
|
|
73
73
|
#
|
|
74
|
+
# Updating by `schedule_id` replaces that schedule rather than merging into it:
|
|
75
|
+
# any field you leave out is cleared. Two of those change delivery silently — an
|
|
76
|
+
# omitted `timezone` reverts the schedule to UTC, and an omitted `is_default` can
|
|
77
|
+
# leave the topic with no default schedule, which is what recipients who have not
|
|
78
|
+
# chosen one fall back to. Restate every field you want to keep.
|
|
79
|
+
#
|
|
74
80
|
# @param frequency [Symbol, Courier::Models::DigestFrequency] How often a digest is delivered. `instant` delivers immediately without batching
|
|
75
81
|
#
|
|
76
82
|
# @param day_of_month [Integer] Required when `frequency` is `monthly`.
|
|
@@ -7,6 +7,14 @@ module Courier
|
|
|
7
7
|
# The schedule's identifier, assigned by the server. This is the value the
|
|
8
8
|
# `/digests/schedules/{schedule_id}` endpoints are keyed by.
|
|
9
9
|
#
|
|
10
|
+
# Two formats are in circulation and only one is safe to drop into a URL.
|
|
11
|
+
# Schedules created through the API are `sch_01m26xfcn3endt3nxy4e2kx2rh` and need
|
|
12
|
+
# no encoding. Schedules created in the Preferences Editor before that format are
|
|
13
|
+
# `sch/{uuid}` and contain a literal `/`, so they must be URL-encoded as
|
|
14
|
+
# `sch%2F{uuid}` — unencoded, the path does not match the route and the response
|
|
15
|
+
# is a bare `404` that reads like a broken endpoint. Existing ids are never
|
|
16
|
+
# migrated.
|
|
17
|
+
#
|
|
10
18
|
# @return [String]
|
|
11
19
|
required :schedule_id, String
|
|
12
20
|
|
|
@@ -44,8 +44,13 @@ module Courier
|
|
|
44
44
|
# @!attribute digest_schedule_id
|
|
45
45
|
# The digest schedule this recipient is on for the topic. Omitted rather than null
|
|
46
46
|
# when they have not chosen one, in which case the topic's default schedule
|
|
47
|
-
# applies. Ids come from the topic's digest configuration
|
|
48
|
-
#
|
|
47
|
+
# applies. Ids come from the topic's digest configuration, returned on any read of
|
|
48
|
+
# the topic.
|
|
49
|
+
#
|
|
50
|
+
# Also omitted when the schedule they chose has since been deleted or disabled:
|
|
51
|
+
# the recipient is on the topic's default from that point on, which is how a send
|
|
52
|
+
# already resolves it, so the field reports what would actually be used rather
|
|
53
|
+
# than a dead id.
|
|
49
54
|
#
|
|
50
55
|
# @return [String, nil]
|
|
51
56
|
optional :digest_schedule_id, String
|
|
@@ -33,16 +33,21 @@ module Courier
|
|
|
33
33
|
optional :description, String, nil?: true
|
|
34
34
|
|
|
35
35
|
# @!attribute digest
|
|
36
|
-
# A topic's digest
|
|
37
|
-
# delivers on, and how collected events are
|
|
36
|
+
# A topic's digest, as supplied when the topic itself is created: the template
|
|
37
|
+
# that renders it, the cadences it delivers on, and how collected events are
|
|
38
|
+
# retained.
|
|
39
|
+
#
|
|
40
|
+
# Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
|
|
41
|
+
# is required — a topic being created has no stored schedules for an absent key to
|
|
42
|
+
# leave alone.
|
|
38
43
|
#
|
|
39
44
|
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
40
45
|
# template and removes its schedules. There is no `enabled` flag, and
|
|
41
46
|
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
42
47
|
# merely off.
|
|
43
48
|
#
|
|
44
|
-
# @return [Courier::Models::
|
|
45
|
-
optional :digest, -> { Courier::
|
|
49
|
+
# @return [Courier::Models::WorkspacePreferenceTopicCreateRequest::Digest, nil]
|
|
50
|
+
optional :digest, -> { Courier::WorkspacePreferenceTopicCreateRequest::Digest }, nil?: true
|
|
46
51
|
|
|
47
52
|
# @!attribute include_unsubscribe_header
|
|
48
53
|
# Whether to include a list-unsubscribe header on emails for this topic.
|
|
@@ -78,7 +83,7 @@ module Courier
|
|
|
78
83
|
#
|
|
79
84
|
# @param description [String, nil] Optional description shown under the topic on the hosted preferences page.
|
|
80
85
|
#
|
|
81
|
-
# @param digest [Courier::Models::
|
|
86
|
+
# @param digest [Courier::Models::WorkspacePreferenceTopicCreateRequest::Digest, nil] A topic's digest, as supplied when the topic itself is created: the template tha
|
|
82
87
|
#
|
|
83
88
|
# @param include_unsubscribe_header [Boolean, nil] Whether to include a list-unsubscribe header on emails for this topic.
|
|
84
89
|
#
|
|
@@ -110,6 +115,83 @@ module Courier
|
|
|
110
115
|
# @!method self.values
|
|
111
116
|
# @return [Array<Symbol>]
|
|
112
117
|
end
|
|
118
|
+
|
|
119
|
+
# @see Courier::Models::WorkspacePreferenceTopicCreateRequest#digest
|
|
120
|
+
class Digest < Courier::Internal::Type::BaseModel
|
|
121
|
+
# @!attribute schedules
|
|
122
|
+
# The cadences this digest delivers on.
|
|
123
|
+
#
|
|
124
|
+
# The array replaces the stored schedules wholesale, so a schedule you leave out
|
|
125
|
+
# of it is deleted along with its delivery rule. Omit the key entirely to leave
|
|
126
|
+
# the stored schedules untouched — useful for changing `template_id` or
|
|
127
|
+
# `categories` without restating every schedule.
|
|
128
|
+
#
|
|
129
|
+
# A digest must end up with at least one schedule, because one with none collects
|
|
130
|
+
# events into an instance that can never fire. So sending `[]` is always a `400`,
|
|
131
|
+
# and so is omitting the key on a topic that has no schedules stored yet.
|
|
132
|
+
#
|
|
133
|
+
# On **create** the key is required outright: a topic being created has nothing
|
|
134
|
+
# stored to leave alone, and the topic row is written before its digest, so
|
|
135
|
+
# rejecting it any later would leave the topic behind and let a retry duplicate
|
|
136
|
+
# it.
|
|
137
|
+
#
|
|
138
|
+
# @return [Array<Courier::Models::TopicDigestScheduleRequest>]
|
|
139
|
+
required :schedules, -> { Courier::Internal::Type::ArrayOf[Courier::TopicDigestScheduleRequest] }
|
|
140
|
+
|
|
141
|
+
# @!attribute template_id
|
|
142
|
+
# The notification template that renders the digest. A digest with no template
|
|
143
|
+
# collects nothing, so this is required.
|
|
144
|
+
#
|
|
145
|
+
# @return [String]
|
|
146
|
+
required :template_id, String
|
|
147
|
+
|
|
148
|
+
# @!attribute audience_id
|
|
149
|
+
# Optional audience the digest is scoped to.
|
|
150
|
+
#
|
|
151
|
+
# @return [String, nil]
|
|
152
|
+
optional :audience_id, String
|
|
153
|
+
|
|
154
|
+
# @!attribute categories
|
|
155
|
+
# Retention rules per category key. Defaults to a single `digest` category
|
|
156
|
+
# retaining `FIRST`.
|
|
157
|
+
#
|
|
158
|
+
# @return [Array<Courier::Models::TopicDigestCategory>, nil]
|
|
159
|
+
optional :categories, -> { Courier::Internal::Type::ArrayOf[Courier::TopicDigestCategory] }
|
|
160
|
+
|
|
161
|
+
# @!attribute trigger_empty
|
|
162
|
+
# Whether to deliver the digest even when nothing was collected.
|
|
163
|
+
#
|
|
164
|
+
# @return [Boolean, nil]
|
|
165
|
+
optional :trigger_empty, Courier::Internal::Type::Boolean
|
|
166
|
+
|
|
167
|
+
# @!method initialize(schedules:, template_id:, audience_id: nil, categories: nil, trigger_empty: nil)
|
|
168
|
+
# Some parameter documentations has been truncated, see
|
|
169
|
+
# {Courier::Models::WorkspacePreferenceTopicCreateRequest::Digest} for more
|
|
170
|
+
# details.
|
|
171
|
+
#
|
|
172
|
+
# A topic's digest, as supplied when the topic itself is created: the template
|
|
173
|
+
# that renders it, the cadences it delivers on, and how collected events are
|
|
174
|
+
# retained.
|
|
175
|
+
#
|
|
176
|
+
# Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
|
|
177
|
+
# is required — a topic being created has no stored schedules for an absent key to
|
|
178
|
+
# leave alone.
|
|
179
|
+
#
|
|
180
|
+
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
181
|
+
# template and removes its schedules. There is no `enabled` flag, and
|
|
182
|
+
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
183
|
+
# merely off.
|
|
184
|
+
#
|
|
185
|
+
# @param schedules [Array<Courier::Models::TopicDigestScheduleRequest>] The cadences this digest delivers on.
|
|
186
|
+
#
|
|
187
|
+
# @param template_id [String] The notification template that renders the digest. A digest with no template col
|
|
188
|
+
#
|
|
189
|
+
# @param audience_id [String] Optional audience the digest is scoped to.
|
|
190
|
+
#
|
|
191
|
+
# @param categories [Array<Courier::Models::TopicDigestCategory>] Retention rules per category key. Defaults to a single `digest` category retaini
|
|
192
|
+
#
|
|
193
|
+
# @param trigger_empty [Boolean] Whether to deliver the digest even when nothing was collected.
|
|
194
|
+
end
|
|
113
195
|
end
|
|
114
196
|
end
|
|
115
197
|
end
|
|
@@ -21,12 +21,14 @@ module Courier
|
|
|
21
21
|
# Creates a journey from a set of nodes, in draft state unless you pass a
|
|
22
22
|
# published state. Send nodes cannot be included until their templates exist.
|
|
23
23
|
#
|
|
24
|
-
# @overload create(name:, nodes:, enabled: nil, state: nil, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
|
|
24
|
+
# @overload create(name:, nodes:, cancelation_token: nil, enabled: nil, state: nil, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
|
|
25
25
|
#
|
|
26
26
|
# @param name [String] Body param
|
|
27
27
|
#
|
|
28
28
|
# @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneyAudienceTriggerNode, Courier::Models::JourneyWebhookTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyNode::JourneyAddToDigestNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>] Body param
|
|
29
29
|
#
|
|
30
|
+
# @param cancelation_token [String] Body param: Cancelation token stored on the journey definition. It tags every ru
|
|
31
|
+
#
|
|
30
32
|
# @param enabled [Boolean] Body param
|
|
31
33
|
#
|
|
32
34
|
# @param state [Symbol, Courier::Models::JourneyState] Body param: Lifecycle state of a journey.
|
|
@@ -259,10 +261,13 @@ module Courier
|
|
|
259
261
|
)
|
|
260
262
|
end
|
|
261
263
|
|
|
264
|
+
# Some parameter documentations has been truncated, see
|
|
265
|
+
# {Courier::Models::JourneyReplaceParams} for more details.
|
|
266
|
+
#
|
|
262
267
|
# Replaces a journey's working draft, leaving the published version live until you
|
|
263
268
|
# publish. Reach for this when editing a journey already running.
|
|
264
269
|
#
|
|
265
|
-
# @overload replace(template_id, name:, nodes:, enabled: nil, state: nil, request_options: {})
|
|
270
|
+
# @overload replace(template_id, name:, nodes:, cancelation_token: nil, enabled: nil, state: nil, request_options: {})
|
|
266
271
|
#
|
|
267
272
|
# @param template_id [String] Journey id
|
|
268
273
|
#
|
|
@@ -270,6 +275,8 @@ module Courier
|
|
|
270
275
|
#
|
|
271
276
|
# @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneyAudienceTriggerNode, Courier::Models::JourneyWebhookTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyNode::JourneyAddToDigestNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
|
|
272
277
|
#
|
|
278
|
+
# @param cancelation_token [String] Cancelation token stored on the journey definition. It tags every run the journe
|
|
279
|
+
#
|
|
273
280
|
# @param enabled [Boolean]
|
|
274
281
|
#
|
|
275
282
|
# @param state [Symbol, Courier::Models::JourneyState] Lifecycle state of a journey.
|
|
@@ -22,7 +22,7 @@ module Courier
|
|
|
22
22
|
#
|
|
23
23
|
# @param description [String, nil] Body param: Optional description shown under the topic on the hosted preferences
|
|
24
24
|
#
|
|
25
|
-
# @param digest [Courier::Models::
|
|
25
|
+
# @param digest [Courier::Models::WorkspacePreferenceTopicCreateRequest::Digest, nil] Body param: A topic's digest, as supplied when the topic itself is created: the
|
|
26
26
|
#
|
|
27
27
|
# @param include_unsubscribe_header [Boolean, nil] Body param: Whether to include a list-unsubscribe header on emails for this topi
|
|
28
28
|
#
|
data/lib/courier/version.rb
CHANGED
|
@@ -37,6 +37,17 @@ module Courier
|
|
|
37
37
|
end
|
|
38
38
|
attr_accessor :nodes
|
|
39
39
|
|
|
40
|
+
# Cancelation token stored on the journey definition. It tags every run the
|
|
41
|
+
# journey creates so that `POST /journeys/cancel` can later cancel those runs by
|
|
42
|
+
# token. Accepts a templated string such as `order-{{data.order_id}}`, which is
|
|
43
|
+
# resolved per run when the journey is invoked. On a replace, omitting this field
|
|
44
|
+
# preserves any existing token and sending a value replaces it.
|
|
45
|
+
sig { returns(T.nilable(String)) }
|
|
46
|
+
attr_reader :cancelation_token
|
|
47
|
+
|
|
48
|
+
sig { params(cancelation_token: String).void }
|
|
49
|
+
attr_writer :cancelation_token
|
|
50
|
+
|
|
40
51
|
sig { returns(T.nilable(T::Boolean)) }
|
|
41
52
|
attr_reader :enabled
|
|
42
53
|
|
|
@@ -75,6 +86,7 @@ module Courier
|
|
|
75
86
|
Courier::JourneyNode::JourneyBranchNode::OrHash
|
|
76
87
|
)
|
|
77
88
|
],
|
|
89
|
+
cancelation_token: String,
|
|
78
90
|
enabled: T::Boolean,
|
|
79
91
|
state: Courier::JourneyState::OrSymbol
|
|
80
92
|
).returns(T.attached_class)
|
|
@@ -82,6 +94,12 @@ module Courier
|
|
|
82
94
|
def self.new(
|
|
83
95
|
name:,
|
|
84
96
|
nodes:,
|
|
97
|
+
# Cancelation token stored on the journey definition. It tags every run the
|
|
98
|
+
# journey creates so that `POST /journeys/cancel` can later cancel those runs by
|
|
99
|
+
# token. Accepts a templated string such as `order-{{data.order_id}}`, which is
|
|
100
|
+
# resolved per run when the journey is invoked. On a replace, omitting this field
|
|
101
|
+
# preserves any existing token and sending a value replaces it.
|
|
102
|
+
cancelation_token: nil,
|
|
85
103
|
enabled: nil,
|
|
86
104
|
# Lifecycle state of a journey.
|
|
87
105
|
state: nil
|
|
@@ -113,6 +131,7 @@ module Courier
|
|
|
113
131
|
Courier::JourneyNode::JourneyBranchNode
|
|
114
132
|
)
|
|
115
133
|
],
|
|
134
|
+
cancelation_token: String,
|
|
116
135
|
enabled: T::Boolean,
|
|
117
136
|
state: Courier::JourneyState::OrSymbol
|
|
118
137
|
}
|
|
@@ -55,7 +55,20 @@ module Courier
|
|
|
55
55
|
sig { returns(T.nilable(String)) }
|
|
56
56
|
attr_accessor :padding
|
|
57
57
|
|
|
58
|
-
#
|
|
58
|
+
# How prominent the action should be. `button` is the default, `secondary` and
|
|
59
|
+
# `tertiary` are the other two button styles, and `link` renders as inline text
|
|
60
|
+
# rather than a button.
|
|
61
|
+
#
|
|
62
|
+
# Each channel draws these as closely as its medium allows. Email fills `button`,
|
|
63
|
+
# outlines `secondary`, and underlines `tertiary`. The in-app Inbox fills
|
|
64
|
+
# `button`, outlines `secondary`, and draws `tertiary` as a solid button. Slack
|
|
65
|
+
# renders all three as Block Kit buttons, with `secondary` in Slack's `primary`
|
|
66
|
+
# style and `tertiary` in its `danger` style.
|
|
67
|
+
#
|
|
68
|
+
# `background_color` is the fill for `button`, and the border and label color for
|
|
69
|
+
# `secondary`. For `tertiary` it colors the underline and label in email and the
|
|
70
|
+
# fill in the Inbox. It does not apply to `link`. An Inbox theme that sets its own
|
|
71
|
+
# action colors takes precedence over the template.
|
|
59
72
|
sig { returns(T.nilable(Courier::ElementalActionNode::Style::OrSymbol)) }
|
|
60
73
|
attr_accessor :style
|
|
61
74
|
|
|
@@ -102,7 +115,20 @@ module Courier
|
|
|
102
115
|
locales: nil,
|
|
103
116
|
# CSS padding applied to the action button. For example, `8px 16px`
|
|
104
117
|
padding: nil,
|
|
105
|
-
#
|
|
118
|
+
# How prominent the action should be. `button` is the default, `secondary` and
|
|
119
|
+
# `tertiary` are the other two button styles, and `link` renders as inline text
|
|
120
|
+
# rather than a button.
|
|
121
|
+
#
|
|
122
|
+
# Each channel draws these as closely as its medium allows. Email fills `button`,
|
|
123
|
+
# outlines `secondary`, and underlines `tertiary`. The in-app Inbox fills
|
|
124
|
+
# `button`, outlines `secondary`, and draws `tertiary` as a solid button. Slack
|
|
125
|
+
# renders all three as Block Kit buttons, with `secondary` in Slack's `primary`
|
|
126
|
+
# style and `tertiary` in its `danger` style.
|
|
127
|
+
#
|
|
128
|
+
# `background_color` is the fill for `button`, and the border and label color for
|
|
129
|
+
# `secondary`. For `tertiary` it colors the underline and label in email and the
|
|
130
|
+
# fill in the Inbox. It does not apply to `link`. An Inbox theme that sets its own
|
|
131
|
+
# action colors takes precedence over the template.
|
|
106
132
|
style: nil
|
|
107
133
|
)
|
|
108
134
|
end
|
|
@@ -128,7 +154,20 @@ module Courier
|
|
|
128
154
|
def to_hash
|
|
129
155
|
end
|
|
130
156
|
|
|
131
|
-
#
|
|
157
|
+
# How prominent the action should be. `button` is the default, `secondary` and
|
|
158
|
+
# `tertiary` are the other two button styles, and `link` renders as inline text
|
|
159
|
+
# rather than a button.
|
|
160
|
+
#
|
|
161
|
+
# Each channel draws these as closely as its medium allows. Email fills `button`,
|
|
162
|
+
# outlines `secondary`, and underlines `tertiary`. The in-app Inbox fills
|
|
163
|
+
# `button`, outlines `secondary`, and draws `tertiary` as a solid button. Slack
|
|
164
|
+
# renders all three as Block Kit buttons, with `secondary` in Slack's `primary`
|
|
165
|
+
# style and `tertiary` in its `danger` style.
|
|
166
|
+
#
|
|
167
|
+
# `background_color` is the fill for `button`, and the border and label color for
|
|
168
|
+
# `secondary`. For `tertiary` it colors the underline and label in email and the
|
|
169
|
+
# fill in the Inbox. It does not apply to `link`. An Inbox theme that sets its own
|
|
170
|
+
# action colors takes precedence over the template.
|
|
132
171
|
module Style
|
|
133
172
|
extend Courier::Internal::Type::Enum
|
|
134
173
|
|
|
@@ -138,6 +177,10 @@ module Courier
|
|
|
138
177
|
|
|
139
178
|
BUTTON =
|
|
140
179
|
T.let(:button, Courier::ElementalActionNode::Style::TaggedSymbol)
|
|
180
|
+
SECONDARY =
|
|
181
|
+
T.let(:secondary, Courier::ElementalActionNode::Style::TaggedSymbol)
|
|
182
|
+
TERTIARY =
|
|
183
|
+
T.let(:tertiary, Courier::ElementalActionNode::Style::TaggedSymbol)
|
|
141
184
|
LINK = T.let(:link, Courier::ElementalActionNode::Style::TaggedSymbol)
|
|
142
185
|
|
|
143
186
|
sig do
|
|
@@ -11,6 +11,12 @@ module Courier
|
|
|
11
11
|
sig { returns(String) }
|
|
12
12
|
attr_accessor :id
|
|
13
13
|
|
|
14
|
+
# The journey cancelation token, or null when none is set. A token authored in the
|
|
15
|
+
# dashboard is returned in its raw templated form, such as
|
|
16
|
+
# `order-{{data.order_id}}`, so it can be read back and asserted.
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_accessor :cancelation_token
|
|
19
|
+
|
|
14
20
|
sig { returns(T.nilable(Integer)) }
|
|
15
21
|
attr_accessor :created
|
|
16
22
|
|
|
@@ -43,6 +49,7 @@ module Courier
|
|
|
43
49
|
sig do
|
|
44
50
|
params(
|
|
45
51
|
id: String,
|
|
52
|
+
cancelation_token: T.nilable(String),
|
|
46
53
|
created: T.nilable(Integer),
|
|
47
54
|
creator: T.nilable(String),
|
|
48
55
|
enabled: T::Boolean,
|
|
@@ -76,6 +83,10 @@ module Courier
|
|
|
76
83
|
end
|
|
77
84
|
def self.new(
|
|
78
85
|
id:,
|
|
86
|
+
# The journey cancelation token, or null when none is set. A token authored in the
|
|
87
|
+
# dashboard is returned in its raw templated form, such as
|
|
88
|
+
# `order-{{data.order_id}}`, so it can be read back and asserted.
|
|
89
|
+
cancelation_token:,
|
|
79
90
|
created:,
|
|
80
91
|
creator:,
|
|
81
92
|
enabled:,
|
|
@@ -93,6 +104,7 @@ module Courier
|
|
|
93
104
|
override.returns(
|
|
94
105
|
{
|
|
95
106
|
id: String,
|
|
107
|
+
cancelation_token: T.nilable(String),
|
|
96
108
|
created: T.nilable(Integer),
|
|
97
109
|
creator: T.nilable(String),
|
|
98
110
|
enabled: T::Boolean,
|