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
|
@@ -8,12 +8,6 @@ module Courier
|
|
|
8
8
|
T.any(Courier::TopicDigestRequest, Courier::Internal::AnyHash)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
# The cadences this digest delivers on. At least one is required: a digest with no
|
|
12
|
-
# schedule collects events into an instance that can never fire. Omitting the key
|
|
13
|
-
# on a replace leaves stored schedules untouched; sending `[]` is a `400`.
|
|
14
|
-
sig { returns(T::Array[Courier::TopicDigestScheduleRequest]) }
|
|
15
|
-
attr_accessor :schedules
|
|
16
|
-
|
|
17
11
|
# The notification template that renders the digest. A digest with no template
|
|
18
12
|
# collects nothing, so this is required.
|
|
19
13
|
sig { returns(String) }
|
|
@@ -36,6 +30,31 @@ module Courier
|
|
|
36
30
|
end
|
|
37
31
|
attr_writer :categories
|
|
38
32
|
|
|
33
|
+
# The cadences this digest delivers on.
|
|
34
|
+
#
|
|
35
|
+
# The array replaces the stored schedules wholesale, so a schedule you leave out
|
|
36
|
+
# of it is deleted along with its delivery rule. Omit the key entirely to leave
|
|
37
|
+
# the stored schedules untouched — useful for changing `template_id` or
|
|
38
|
+
# `categories` without restating every schedule.
|
|
39
|
+
#
|
|
40
|
+
# A digest must end up with at least one schedule, because one with none collects
|
|
41
|
+
# events into an instance that can never fire. So sending `[]` is always a `400`,
|
|
42
|
+
# and so is omitting the key on a topic that has no schedules stored yet.
|
|
43
|
+
#
|
|
44
|
+
# On **create** the key is required outright: a topic being created has nothing
|
|
45
|
+
# stored to leave alone, and the topic row is written before its digest, so
|
|
46
|
+
# rejecting it any later would leave the topic behind and let a retry duplicate
|
|
47
|
+
# it.
|
|
48
|
+
sig { returns(T.nilable(T::Array[Courier::TopicDigestScheduleRequest])) }
|
|
49
|
+
attr_reader :schedules
|
|
50
|
+
|
|
51
|
+
sig do
|
|
52
|
+
params(
|
|
53
|
+
schedules: T::Array[Courier::TopicDigestScheduleRequest::OrHash]
|
|
54
|
+
).void
|
|
55
|
+
end
|
|
56
|
+
attr_writer :schedules
|
|
57
|
+
|
|
39
58
|
# Whether to deliver the digest even when nothing was collected.
|
|
40
59
|
sig { returns(T.nilable(T::Boolean)) }
|
|
41
60
|
attr_reader :trigger_empty
|
|
@@ -52,18 +71,14 @@ module Courier
|
|
|
52
71
|
# merely off.
|
|
53
72
|
sig do
|
|
54
73
|
params(
|
|
55
|
-
schedules: T::Array[Courier::TopicDigestScheduleRequest::OrHash],
|
|
56
74
|
template_id: String,
|
|
57
75
|
audience_id: String,
|
|
58
76
|
categories: T::Array[Courier::TopicDigestCategory::OrHash],
|
|
77
|
+
schedules: T::Array[Courier::TopicDigestScheduleRequest::OrHash],
|
|
59
78
|
trigger_empty: T::Boolean
|
|
60
79
|
).returns(T.attached_class)
|
|
61
80
|
end
|
|
62
81
|
def self.new(
|
|
63
|
-
# The cadences this digest delivers on. At least one is required: a digest with no
|
|
64
|
-
# schedule collects events into an instance that can never fire. Omitting the key
|
|
65
|
-
# on a replace leaves stored schedules untouched; sending `[]` is a `400`.
|
|
66
|
-
schedules:,
|
|
67
82
|
# The notification template that renders the digest. A digest with no template
|
|
68
83
|
# collects nothing, so this is required.
|
|
69
84
|
template_id:,
|
|
@@ -72,6 +87,22 @@ module Courier
|
|
|
72
87
|
# Retention rules per category key. Defaults to a single `digest` category
|
|
73
88
|
# retaining `FIRST`.
|
|
74
89
|
categories: nil,
|
|
90
|
+
# The cadences this digest delivers on.
|
|
91
|
+
#
|
|
92
|
+
# The array replaces the stored schedules wholesale, so a schedule you leave out
|
|
93
|
+
# of it is deleted along with its delivery rule. Omit the key entirely to leave
|
|
94
|
+
# the stored schedules untouched — useful for changing `template_id` or
|
|
95
|
+
# `categories` without restating every schedule.
|
|
96
|
+
#
|
|
97
|
+
# A digest must end up with at least one schedule, because one with none collects
|
|
98
|
+
# events into an instance that can never fire. So sending `[]` is always a `400`,
|
|
99
|
+
# and so is omitting the key on a topic that has no schedules stored yet.
|
|
100
|
+
#
|
|
101
|
+
# On **create** the key is required outright: a topic being created has nothing
|
|
102
|
+
# stored to leave alone, and the topic row is written before its digest, so
|
|
103
|
+
# rejecting it any later would leave the topic behind and let a retry duplicate
|
|
104
|
+
# it.
|
|
105
|
+
schedules: nil,
|
|
75
106
|
# Whether to deliver the digest even when nothing was collected.
|
|
76
107
|
trigger_empty: nil
|
|
77
108
|
)
|
|
@@ -80,10 +111,10 @@ module Courier
|
|
|
80
111
|
sig do
|
|
81
112
|
override.returns(
|
|
82
113
|
{
|
|
83
|
-
schedules: T::Array[Courier::TopicDigestScheduleRequest],
|
|
84
114
|
template_id: String,
|
|
85
115
|
audience_id: String,
|
|
86
116
|
categories: T::Array[Courier::TopicDigestCategory],
|
|
117
|
+
schedules: T::Array[Courier::TopicDigestScheduleRequest],
|
|
87
118
|
trigger_empty: T::Boolean
|
|
88
119
|
}
|
|
89
120
|
)
|
|
@@ -79,6 +79,12 @@ module Courier
|
|
|
79
79
|
# existing schedule in place; omit it and one is assigned and returned. The
|
|
80
80
|
# `schedules` array is a full replacement, so a stored schedule absent from it is
|
|
81
81
|
# deleted along with its delivery rule.
|
|
82
|
+
#
|
|
83
|
+
# Updating by `schedule_id` replaces that schedule rather than merging into it:
|
|
84
|
+
# any field you leave out is cleared. Two of those change delivery silently — an
|
|
85
|
+
# omitted `timezone` reverts the schedule to UTC, and an omitted `is_default` can
|
|
86
|
+
# leave the topic with no default schedule, which is what recipients who have not
|
|
87
|
+
# chosen one fall back to. Restate every field you want to keep.
|
|
82
88
|
sig do
|
|
83
89
|
params(
|
|
84
90
|
frequency: Courier::DigestFrequency::OrSymbol,
|
|
@@ -13,6 +13,14 @@ module Courier
|
|
|
13
13
|
|
|
14
14
|
# The schedule's identifier, assigned by the server. This is the value the
|
|
15
15
|
# `/digests/schedules/{schedule_id}` endpoints are keyed by.
|
|
16
|
+
#
|
|
17
|
+
# Two formats are in circulation and only one is safe to drop into a URL.
|
|
18
|
+
# Schedules created through the API are `sch_01m26xfcn3endt3nxy4e2kx2rh` and need
|
|
19
|
+
# no encoding. Schedules created in the Preferences Editor before that format are
|
|
20
|
+
# `sch/{uuid}` and contain a literal `/`, so they must be URL-encoded as
|
|
21
|
+
# `sch%2F{uuid}` — unencoded, the path does not match the route and the response
|
|
22
|
+
# is a bare `404` that reads like a broken endpoint. Existing ids are never
|
|
23
|
+
# migrated.
|
|
16
24
|
sig { returns(String) }
|
|
17
25
|
attr_accessor :schedule_id
|
|
18
26
|
|
|
@@ -110,6 +118,14 @@ module Courier
|
|
|
110
118
|
def self.new(
|
|
111
119
|
# The schedule's identifier, assigned by the server. This is the value the
|
|
112
120
|
# `/digests/schedules/{schedule_id}` endpoints are keyed by.
|
|
121
|
+
#
|
|
122
|
+
# Two formats are in circulation and only one is safe to drop into a URL.
|
|
123
|
+
# Schedules created through the API are `sch_01m26xfcn3endt3nxy4e2kx2rh` and need
|
|
124
|
+
# no encoding. Schedules created in the Preferences Editor before that format are
|
|
125
|
+
# `sch/{uuid}` and contain a literal `/`, so they must be URL-encoded as
|
|
126
|
+
# `sch%2F{uuid}` — unencoded, the path does not match the route and the response
|
|
127
|
+
# is a bare `404` that reads like a broken endpoint. Existing ids are never
|
|
128
|
+
# migrated.
|
|
113
129
|
schedule_id:,
|
|
114
130
|
# ISO-8601 timestamp of when the schedule was created.
|
|
115
131
|
created: nil,
|
|
@@ -40,8 +40,13 @@ module Courier
|
|
|
40
40
|
|
|
41
41
|
# The digest schedule this recipient is on for the topic. Omitted rather than null
|
|
42
42
|
# when they have not chosen one, in which case the topic's default schedule
|
|
43
|
-
# applies. Ids come from the topic's digest configuration
|
|
44
|
-
#
|
|
43
|
+
# applies. Ids come from the topic's digest configuration, returned on any read of
|
|
44
|
+
# the topic.
|
|
45
|
+
#
|
|
46
|
+
# Also omitted when the schedule they chose has since been deleted or disabled:
|
|
47
|
+
# the recipient is on the topic's default from that point on, which is how a send
|
|
48
|
+
# already resolves it, so the field reports what would actually be used rather
|
|
49
|
+
# than a dead id.
|
|
45
50
|
sig { returns(T.nilable(String)) }
|
|
46
51
|
attr_reader :digest_schedule_id
|
|
47
52
|
|
|
@@ -103,8 +108,13 @@ module Courier
|
|
|
103
108
|
custom_routing: nil,
|
|
104
109
|
# The digest schedule this recipient is on for the topic. Omitted rather than null
|
|
105
110
|
# when they have not chosen one, in which case the topic's default schedule
|
|
106
|
-
# applies. Ids come from the topic's digest configuration
|
|
107
|
-
#
|
|
111
|
+
# applies. Ids come from the topic's digest configuration, returned on any read of
|
|
112
|
+
# the topic.
|
|
113
|
+
#
|
|
114
|
+
# Also omitted when the schedule they chose has since been deleted or disabled:
|
|
115
|
+
# the recipient is on the topic's default from that point on, which is how a send
|
|
116
|
+
# already resolves it, so the field reports what would actually be used rather
|
|
117
|
+
# than a dead id.
|
|
108
118
|
digest_schedule_id: nil,
|
|
109
119
|
# Whether the user has chosen specific delivery channels for this topic (listed in
|
|
110
120
|
# custom_routing) rather than the topic's default routing.
|
|
@@ -40,18 +40,32 @@ module Courier
|
|
|
40
40
|
sig { returns(T.nilable(String)) }
|
|
41
41
|
attr_accessor :description
|
|
42
42
|
|
|
43
|
-
# A topic's digest
|
|
44
|
-
# delivers on, and how collected events are
|
|
43
|
+
# A topic's digest, as supplied when the topic itself is created: the template
|
|
44
|
+
# that renders it, the cadences it delivers on, and how collected events are
|
|
45
|
+
# retained.
|
|
46
|
+
#
|
|
47
|
+
# Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
|
|
48
|
+
# is required — a topic being created has no stored schedules for an absent key to
|
|
49
|
+
# leave alone.
|
|
45
50
|
#
|
|
46
51
|
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
47
52
|
# template and removes its schedules. There is no `enabled` flag, and
|
|
48
53
|
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
49
54
|
# merely off.
|
|
50
|
-
sig
|
|
55
|
+
sig do
|
|
56
|
+
returns(
|
|
57
|
+
T.nilable(Courier::WorkspacePreferenceTopicCreateRequest::Digest)
|
|
58
|
+
)
|
|
59
|
+
end
|
|
51
60
|
attr_reader :digest
|
|
52
61
|
|
|
53
62
|
sig do
|
|
54
|
-
params(
|
|
63
|
+
params(
|
|
64
|
+
digest:
|
|
65
|
+
T.nilable(
|
|
66
|
+
Courier::WorkspacePreferenceTopicCreateRequest::Digest::OrHash
|
|
67
|
+
)
|
|
68
|
+
).void
|
|
55
69
|
end
|
|
56
70
|
attr_writer :digest
|
|
57
71
|
|
|
@@ -82,7 +96,10 @@ module Courier
|
|
|
82
96
|
]
|
|
83
97
|
),
|
|
84
98
|
description: T.nilable(String),
|
|
85
|
-
digest:
|
|
99
|
+
digest:
|
|
100
|
+
T.nilable(
|
|
101
|
+
Courier::WorkspacePreferenceTopicCreateRequest::Digest::OrHash
|
|
102
|
+
),
|
|
86
103
|
include_unsubscribe_header: T.nilable(T::Boolean),
|
|
87
104
|
routing_options:
|
|
88
105
|
T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
|
|
@@ -99,8 +116,13 @@ module Courier
|
|
|
99
116
|
allowed_preferences: nil,
|
|
100
117
|
# Optional description shown under the topic on the hosted preferences page.
|
|
101
118
|
description: nil,
|
|
102
|
-
# A topic's digest
|
|
103
|
-
# delivers on, and how collected events are
|
|
119
|
+
# A topic's digest, as supplied when the topic itself is created: the template
|
|
120
|
+
# that renders it, the cadences it delivers on, and how collected events are
|
|
121
|
+
# retained.
|
|
122
|
+
#
|
|
123
|
+
# Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
|
|
124
|
+
# is required — a topic being created has no stored schedules for an absent key to
|
|
125
|
+
# leave alone.
|
|
104
126
|
#
|
|
105
127
|
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
106
128
|
# template and removes its schedules. There is no `enabled` flag, and
|
|
@@ -129,7 +151,8 @@ module Courier
|
|
|
129
151
|
]
|
|
130
152
|
),
|
|
131
153
|
description: T.nilable(String),
|
|
132
|
-
digest:
|
|
154
|
+
digest:
|
|
155
|
+
T.nilable(Courier::WorkspacePreferenceTopicCreateRequest::Digest),
|
|
133
156
|
include_unsubscribe_header: T.nilable(T::Boolean),
|
|
134
157
|
routing_options:
|
|
135
158
|
T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
|
|
@@ -214,6 +237,130 @@ module Courier
|
|
|
214
237
|
def self.values
|
|
215
238
|
end
|
|
216
239
|
end
|
|
240
|
+
|
|
241
|
+
class Digest < Courier::Internal::Type::BaseModel
|
|
242
|
+
OrHash =
|
|
243
|
+
T.type_alias do
|
|
244
|
+
T.any(
|
|
245
|
+
Courier::WorkspacePreferenceTopicCreateRequest::Digest,
|
|
246
|
+
Courier::Internal::AnyHash
|
|
247
|
+
)
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# The cadences this digest delivers on.
|
|
251
|
+
#
|
|
252
|
+
# The array replaces the stored schedules wholesale, so a schedule you leave out
|
|
253
|
+
# of it is deleted along with its delivery rule. Omit the key entirely to leave
|
|
254
|
+
# the stored schedules untouched — useful for changing `template_id` or
|
|
255
|
+
# `categories` without restating every schedule.
|
|
256
|
+
#
|
|
257
|
+
# A digest must end up with at least one schedule, because one with none collects
|
|
258
|
+
# events into an instance that can never fire. So sending `[]` is always a `400`,
|
|
259
|
+
# and so is omitting the key on a topic that has no schedules stored yet.
|
|
260
|
+
#
|
|
261
|
+
# On **create** the key is required outright: a topic being created has nothing
|
|
262
|
+
# stored to leave alone, and the topic row is written before its digest, so
|
|
263
|
+
# rejecting it any later would leave the topic behind and let a retry duplicate
|
|
264
|
+
# it.
|
|
265
|
+
sig { returns(T::Array[Courier::TopicDigestScheduleRequest]) }
|
|
266
|
+
attr_accessor :schedules
|
|
267
|
+
|
|
268
|
+
# The notification template that renders the digest. A digest with no template
|
|
269
|
+
# collects nothing, so this is required.
|
|
270
|
+
sig { returns(String) }
|
|
271
|
+
attr_accessor :template_id
|
|
272
|
+
|
|
273
|
+
# Optional audience the digest is scoped to.
|
|
274
|
+
sig { returns(T.nilable(String)) }
|
|
275
|
+
attr_reader :audience_id
|
|
276
|
+
|
|
277
|
+
sig { params(audience_id: String).void }
|
|
278
|
+
attr_writer :audience_id
|
|
279
|
+
|
|
280
|
+
# Retention rules per category key. Defaults to a single `digest` category
|
|
281
|
+
# retaining `FIRST`.
|
|
282
|
+
sig { returns(T.nilable(T::Array[Courier::TopicDigestCategory])) }
|
|
283
|
+
attr_reader :categories
|
|
284
|
+
|
|
285
|
+
sig do
|
|
286
|
+
params(
|
|
287
|
+
categories: T::Array[Courier::TopicDigestCategory::OrHash]
|
|
288
|
+
).void
|
|
289
|
+
end
|
|
290
|
+
attr_writer :categories
|
|
291
|
+
|
|
292
|
+
# Whether to deliver the digest even when nothing was collected.
|
|
293
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
294
|
+
attr_reader :trigger_empty
|
|
295
|
+
|
|
296
|
+
sig { params(trigger_empty: T::Boolean).void }
|
|
297
|
+
attr_writer :trigger_empty
|
|
298
|
+
|
|
299
|
+
# A topic's digest, as supplied when the topic itself is created: the template
|
|
300
|
+
# that renders it, the cadences it delivers on, and how collected events are
|
|
301
|
+
# retained.
|
|
302
|
+
#
|
|
303
|
+
# Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
|
|
304
|
+
# is required — a topic being created has no stored schedules for an absent key to
|
|
305
|
+
# leave alone.
|
|
306
|
+
#
|
|
307
|
+
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
308
|
+
# template and removes its schedules. There is no `enabled` flag, and
|
|
309
|
+
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
310
|
+
# merely off.
|
|
311
|
+
sig do
|
|
312
|
+
params(
|
|
313
|
+
schedules: T::Array[Courier::TopicDigestScheduleRequest::OrHash],
|
|
314
|
+
template_id: String,
|
|
315
|
+
audience_id: String,
|
|
316
|
+
categories: T::Array[Courier::TopicDigestCategory::OrHash],
|
|
317
|
+
trigger_empty: T::Boolean
|
|
318
|
+
).returns(T.attached_class)
|
|
319
|
+
end
|
|
320
|
+
def self.new(
|
|
321
|
+
# The cadences this digest delivers on.
|
|
322
|
+
#
|
|
323
|
+
# The array replaces the stored schedules wholesale, so a schedule you leave out
|
|
324
|
+
# of it is deleted along with its delivery rule. Omit the key entirely to leave
|
|
325
|
+
# the stored schedules untouched — useful for changing `template_id` or
|
|
326
|
+
# `categories` without restating every schedule.
|
|
327
|
+
#
|
|
328
|
+
# A digest must end up with at least one schedule, because one with none collects
|
|
329
|
+
# events into an instance that can never fire. So sending `[]` is always a `400`,
|
|
330
|
+
# and so is omitting the key on a topic that has no schedules stored yet.
|
|
331
|
+
#
|
|
332
|
+
# On **create** the key is required outright: a topic being created has nothing
|
|
333
|
+
# stored to leave alone, and the topic row is written before its digest, so
|
|
334
|
+
# rejecting it any later would leave the topic behind and let a retry duplicate
|
|
335
|
+
# it.
|
|
336
|
+
schedules:,
|
|
337
|
+
# The notification template that renders the digest. A digest with no template
|
|
338
|
+
# collects nothing, so this is required.
|
|
339
|
+
template_id:,
|
|
340
|
+
# Optional audience the digest is scoped to.
|
|
341
|
+
audience_id: nil,
|
|
342
|
+
# Retention rules per category key. Defaults to a single `digest` category
|
|
343
|
+
# retaining `FIRST`.
|
|
344
|
+
categories: nil,
|
|
345
|
+
# Whether to deliver the digest even when nothing was collected.
|
|
346
|
+
trigger_empty: nil
|
|
347
|
+
)
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
sig do
|
|
351
|
+
override.returns(
|
|
352
|
+
{
|
|
353
|
+
schedules: T::Array[Courier::TopicDigestScheduleRequest],
|
|
354
|
+
template_id: String,
|
|
355
|
+
audience_id: String,
|
|
356
|
+
categories: T::Array[Courier::TopicDigestCategory],
|
|
357
|
+
trigger_empty: T::Boolean
|
|
358
|
+
}
|
|
359
|
+
)
|
|
360
|
+
end
|
|
361
|
+
def to_hash
|
|
362
|
+
end
|
|
363
|
+
end
|
|
217
364
|
end
|
|
218
365
|
end
|
|
219
366
|
end
|
|
@@ -41,6 +41,7 @@ module Courier
|
|
|
41
41
|
Courier::JourneyNode::JourneyBranchNode::OrHash
|
|
42
42
|
)
|
|
43
43
|
],
|
|
44
|
+
cancelation_token: String,
|
|
44
45
|
enabled: T::Boolean,
|
|
45
46
|
state: Courier::JourneyState::OrSymbol,
|
|
46
47
|
idempotency_key: String,
|
|
@@ -53,6 +54,12 @@ module Courier
|
|
|
53
54
|
name:,
|
|
54
55
|
# Body param
|
|
55
56
|
nodes:,
|
|
57
|
+
# Body param: Cancelation token stored on the journey definition. It tags every
|
|
58
|
+
# run the journey creates so that `POST /journeys/cancel` can later cancel those
|
|
59
|
+
# runs by token. Accepts a templated string such as `order-{{data.order_id}}`,
|
|
60
|
+
# which is resolved per run when the journey is invoked. On a replace, omitting
|
|
61
|
+
# this field preserves any existing token and sending a value replaces it.
|
|
62
|
+
cancelation_token: nil,
|
|
56
63
|
# Body param
|
|
57
64
|
enabled: nil,
|
|
58
65
|
# Body param: Lifecycle state of a journey.
|
|
@@ -283,6 +290,7 @@ module Courier
|
|
|
283
290
|
Courier::JourneyNode::JourneyBranchNode::OrHash
|
|
284
291
|
)
|
|
285
292
|
],
|
|
293
|
+
cancelation_token: String,
|
|
286
294
|
enabled: T::Boolean,
|
|
287
295
|
state: Courier::JourneyState::OrSymbol,
|
|
288
296
|
request_options: Courier::RequestOptions::OrHash
|
|
@@ -293,6 +301,12 @@ module Courier
|
|
|
293
301
|
template_id,
|
|
294
302
|
name:,
|
|
295
303
|
nodes:,
|
|
304
|
+
# Cancelation token stored on the journey definition. It tags every run the
|
|
305
|
+
# journey creates so that `POST /journeys/cancel` can later cancel those runs by
|
|
306
|
+
# token. Accepts a templated string such as `order-{{data.order_id}}`, which is
|
|
307
|
+
# resolved per run when the journey is invoked. On a replace, omitting this field
|
|
308
|
+
# preserves any existing token and sending a value replaces it.
|
|
309
|
+
cancelation_token: nil,
|
|
296
310
|
enabled: nil,
|
|
297
311
|
# Lifecycle state of a journey.
|
|
298
312
|
state: nil,
|
|
@@ -19,7 +19,10 @@ module Courier
|
|
|
19
19
|
]
|
|
20
20
|
),
|
|
21
21
|
description: T.nilable(String),
|
|
22
|
-
digest:
|
|
22
|
+
digest:
|
|
23
|
+
T.nilable(
|
|
24
|
+
Courier::WorkspacePreferenceTopicCreateRequest::Digest::OrHash
|
|
25
|
+
),
|
|
23
26
|
include_unsubscribe_header: T.nilable(T::Boolean),
|
|
24
27
|
routing_options:
|
|
25
28
|
T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
|
|
@@ -43,8 +46,13 @@ module Courier
|
|
|
43
46
|
# Body param: Optional description shown under the topic on the hosted preferences
|
|
44
47
|
# page.
|
|
45
48
|
description: nil,
|
|
46
|
-
# Body param: A topic's digest
|
|
47
|
-
# cadences it delivers on, and how collected events
|
|
49
|
+
# Body param: A topic's digest, as supplied when the topic itself is created: the
|
|
50
|
+
# template that renders it, the cadences it delivers on, and how collected events
|
|
51
|
+
# are retained.
|
|
52
|
+
#
|
|
53
|
+
# Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
|
|
54
|
+
# is required — a topic being created has no stored schedules for an absent key to
|
|
55
|
+
# leave alone.
|
|
48
56
|
#
|
|
49
57
|
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
50
58
|
# template and removes its schedules. There is no `enabled` flag, and
|
|
@@ -4,6 +4,7 @@ module Courier
|
|
|
4
4
|
{
|
|
5
5
|
name: String,
|
|
6
6
|
nodes: ::Array[Courier::Models::journey_node],
|
|
7
|
+
cancelation_token: String,
|
|
7
8
|
enabled: bool,
|
|
8
9
|
state: Courier::Models::journey_state
|
|
9
10
|
}
|
|
@@ -13,6 +14,10 @@ module Courier
|
|
|
13
14
|
|
|
14
15
|
attr_accessor nodes: ::Array[Courier::Models::journey_node]
|
|
15
16
|
|
|
17
|
+
attr_reader cancelation_token: String?
|
|
18
|
+
|
|
19
|
+
def cancelation_token=: (String) -> String
|
|
20
|
+
|
|
16
21
|
attr_reader enabled: bool?
|
|
17
22
|
|
|
18
23
|
def enabled=: (bool) -> bool
|
|
@@ -26,6 +31,7 @@ module Courier
|
|
|
26
31
|
def initialize: (
|
|
27
32
|
name: String,
|
|
28
33
|
nodes: ::Array[Courier::Models::journey_node],
|
|
34
|
+
?cancelation_token: String,
|
|
29
35
|
?enabled: bool,
|
|
30
36
|
?state: Courier::Models::journey_state
|
|
31
37
|
) -> void
|
|
@@ -33,6 +39,7 @@ module Courier
|
|
|
33
39
|
def to_hash: -> {
|
|
34
40
|
name: String,
|
|
35
41
|
nodes: ::Array[Courier::Models::journey_node],
|
|
42
|
+
cancelation_token: String,
|
|
36
43
|
enabled: bool,
|
|
37
44
|
state: Courier::Models::journey_state
|
|
38
45
|
}
|
|
@@ -97,12 +97,14 @@ module Courier
|
|
|
97
97
|
style: Courier::Models::ElementalActionNode::style?
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
type style = :button | :link
|
|
100
|
+
type style = :button | :secondary | :tertiary | :link
|
|
101
101
|
|
|
102
102
|
module Style
|
|
103
103
|
extend Courier::Internal::Type::Enum
|
|
104
104
|
|
|
105
105
|
BUTTON: :button
|
|
106
|
+
SECONDARY: :secondary
|
|
107
|
+
TERTIARY: :tertiary
|
|
106
108
|
LINK: :link
|
|
107
109
|
|
|
108
110
|
def self?.values: -> ::Array[Courier::Models::ElementalActionNode::style]
|
|
@@ -3,6 +3,7 @@ module Courier
|
|
|
3
3
|
type journey_response =
|
|
4
4
|
{
|
|
5
5
|
id: String,
|
|
6
|
+
cancelation_token: String?,
|
|
6
7
|
created: Integer?,
|
|
7
8
|
creator: String?,
|
|
8
9
|
enabled: bool,
|
|
@@ -17,6 +18,8 @@ module Courier
|
|
|
17
18
|
class JourneyResponse < Courier::Internal::Type::BaseModel
|
|
18
19
|
attr_accessor id: String
|
|
19
20
|
|
|
21
|
+
attr_accessor cancelation_token: String?
|
|
22
|
+
|
|
20
23
|
attr_accessor created: Integer?
|
|
21
24
|
|
|
22
25
|
attr_accessor creator: String?
|
|
@@ -37,6 +40,7 @@ module Courier
|
|
|
37
40
|
|
|
38
41
|
def initialize: (
|
|
39
42
|
id: String,
|
|
43
|
+
cancelation_token: String?,
|
|
40
44
|
created: Integer?,
|
|
41
45
|
creator: String?,
|
|
42
46
|
enabled: bool,
|
|
@@ -50,6 +54,7 @@ module Courier
|
|
|
50
54
|
|
|
51
55
|
def to_hash: -> {
|
|
52
56
|
id: String,
|
|
57
|
+
cancelation_token: String?,
|
|
53
58
|
created: Integer?,
|
|
54
59
|
creator: String?,
|
|
55
60
|
enabled: bool,
|
|
@@ -2,16 +2,14 @@ module Courier
|
|
|
2
2
|
module Models
|
|
3
3
|
type topic_digest_request =
|
|
4
4
|
{
|
|
5
|
-
schedules: ::Array[Courier::TopicDigestScheduleRequest],
|
|
6
5
|
template_id: String,
|
|
7
6
|
audience_id: String,
|
|
8
7
|
categories: ::Array[Courier::TopicDigestCategory],
|
|
8
|
+
schedules: ::Array[Courier::TopicDigestScheduleRequest],
|
|
9
9
|
trigger_empty: bool
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
class TopicDigestRequest < Courier::Internal::Type::BaseModel
|
|
13
|
-
attr_accessor schedules: ::Array[Courier::TopicDigestScheduleRequest]
|
|
14
|
-
|
|
15
13
|
attr_accessor template_id: String
|
|
16
14
|
|
|
17
15
|
attr_reader audience_id: String?
|
|
@@ -24,23 +22,29 @@ module Courier
|
|
|
24
22
|
::Array[Courier::TopicDigestCategory]
|
|
25
23
|
) -> ::Array[Courier::TopicDigestCategory]
|
|
26
24
|
|
|
25
|
+
attr_reader schedules: ::Array[Courier::TopicDigestScheduleRequest]?
|
|
26
|
+
|
|
27
|
+
def schedules=: (
|
|
28
|
+
::Array[Courier::TopicDigestScheduleRequest]
|
|
29
|
+
) -> ::Array[Courier::TopicDigestScheduleRequest]
|
|
30
|
+
|
|
27
31
|
attr_reader trigger_empty: bool?
|
|
28
32
|
|
|
29
33
|
def trigger_empty=: (bool) -> bool
|
|
30
34
|
|
|
31
35
|
def initialize: (
|
|
32
|
-
schedules: ::Array[Courier::TopicDigestScheduleRequest],
|
|
33
36
|
template_id: String,
|
|
34
37
|
?audience_id: String,
|
|
35
38
|
?categories: ::Array[Courier::TopicDigestCategory],
|
|
39
|
+
?schedules: ::Array[Courier::TopicDigestScheduleRequest],
|
|
36
40
|
?trigger_empty: bool
|
|
37
41
|
) -> void
|
|
38
42
|
|
|
39
43
|
def to_hash: -> {
|
|
40
|
-
schedules: ::Array[Courier::TopicDigestScheduleRequest],
|
|
41
44
|
template_id: String,
|
|
42
45
|
audience_id: String,
|
|
43
46
|
categories: ::Array[Courier::TopicDigestCategory],
|
|
47
|
+
schedules: ::Array[Courier::TopicDigestScheduleRequest],
|
|
44
48
|
trigger_empty: bool
|
|
45
49
|
}
|
|
46
50
|
end
|
|
@@ -6,7 +6,7 @@ module Courier
|
|
|
6
6
|
name: String,
|
|
7
7
|
allowed_preferences: ::Array[Courier::Models::WorkspacePreferenceTopicCreateRequest::allowed_preference]?,
|
|
8
8
|
description: String?,
|
|
9
|
-
digest: Courier::
|
|
9
|
+
digest: Courier::WorkspacePreferenceTopicCreateRequest::Digest?,
|
|
10
10
|
include_unsubscribe_header: bool?,
|
|
11
11
|
routing_options: ::Array[Courier::Models::channel_classification]?,
|
|
12
12
|
topic_data: ::Hash[Symbol, top]?
|
|
@@ -21,7 +21,7 @@ module Courier
|
|
|
21
21
|
|
|
22
22
|
attr_accessor description: String?
|
|
23
23
|
|
|
24
|
-
attr_accessor digest: Courier::
|
|
24
|
+
attr_accessor digest: Courier::WorkspacePreferenceTopicCreateRequest::Digest?
|
|
25
25
|
|
|
26
26
|
attr_accessor include_unsubscribe_header: bool?
|
|
27
27
|
|
|
@@ -34,7 +34,7 @@ module Courier
|
|
|
34
34
|
name: String,
|
|
35
35
|
?allowed_preferences: ::Array[Courier::Models::WorkspacePreferenceTopicCreateRequest::allowed_preference]?,
|
|
36
36
|
?description: String?,
|
|
37
|
-
?digest: Courier::
|
|
37
|
+
?digest: Courier::WorkspacePreferenceTopicCreateRequest::Digest?,
|
|
38
38
|
?include_unsubscribe_header: bool?,
|
|
39
39
|
?routing_options: ::Array[Courier::Models::channel_classification]?,
|
|
40
40
|
?topic_data: ::Hash[Symbol, top]?
|
|
@@ -45,7 +45,7 @@ module Courier
|
|
|
45
45
|
name: String,
|
|
46
46
|
allowed_preferences: ::Array[Courier::Models::WorkspacePreferenceTopicCreateRequest::allowed_preference]?,
|
|
47
47
|
description: String?,
|
|
48
|
-
digest: Courier::
|
|
48
|
+
digest: Courier::WorkspacePreferenceTopicCreateRequest::Digest?,
|
|
49
49
|
include_unsubscribe_header: bool?,
|
|
50
50
|
routing_options: ::Array[Courier::Models::channel_classification]?,
|
|
51
51
|
topic_data: ::Hash[Symbol, top]?
|
|
@@ -73,6 +73,51 @@ module Courier
|
|
|
73
73
|
|
|
74
74
|
def self?.values: -> ::Array[Courier::Models::WorkspacePreferenceTopicCreateRequest::allowed_preference]
|
|
75
75
|
end
|
|
76
|
+
|
|
77
|
+
type digest =
|
|
78
|
+
{
|
|
79
|
+
schedules: ::Array[Courier::TopicDigestScheduleRequest],
|
|
80
|
+
template_id: String,
|
|
81
|
+
audience_id: String,
|
|
82
|
+
categories: ::Array[Courier::TopicDigestCategory],
|
|
83
|
+
trigger_empty: bool
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
class Digest < Courier::Internal::Type::BaseModel
|
|
87
|
+
attr_accessor schedules: ::Array[Courier::TopicDigestScheduleRequest]
|
|
88
|
+
|
|
89
|
+
attr_accessor template_id: String
|
|
90
|
+
|
|
91
|
+
attr_reader audience_id: String?
|
|
92
|
+
|
|
93
|
+
def audience_id=: (String) -> String
|
|
94
|
+
|
|
95
|
+
attr_reader categories: ::Array[Courier::TopicDigestCategory]?
|
|
96
|
+
|
|
97
|
+
def categories=: (
|
|
98
|
+
::Array[Courier::TopicDigestCategory]
|
|
99
|
+
) -> ::Array[Courier::TopicDigestCategory]
|
|
100
|
+
|
|
101
|
+
attr_reader trigger_empty: bool?
|
|
102
|
+
|
|
103
|
+
def trigger_empty=: (bool) -> bool
|
|
104
|
+
|
|
105
|
+
def initialize: (
|
|
106
|
+
schedules: ::Array[Courier::TopicDigestScheduleRequest],
|
|
107
|
+
template_id: String,
|
|
108
|
+
?audience_id: String,
|
|
109
|
+
?categories: ::Array[Courier::TopicDigestCategory],
|
|
110
|
+
?trigger_empty: bool
|
|
111
|
+
) -> void
|
|
112
|
+
|
|
113
|
+
def to_hash: -> {
|
|
114
|
+
schedules: ::Array[Courier::TopicDigestScheduleRequest],
|
|
115
|
+
template_id: String,
|
|
116
|
+
audience_id: String,
|
|
117
|
+
categories: ::Array[Courier::TopicDigestCategory],
|
|
118
|
+
trigger_empty: bool
|
|
119
|
+
}
|
|
120
|
+
end
|
|
76
121
|
end
|
|
77
122
|
end
|
|
78
123
|
end
|