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
|
@@ -40,6 +40,21 @@ module Courier
|
|
|
40
40
|
sig { returns(T.nilable(String)) }
|
|
41
41
|
attr_accessor :description
|
|
42
42
|
|
|
43
|
+
# A topic's digest configuration: the template that renders it, the cadences it
|
|
44
|
+
# delivers on, and how collected events are retained.
|
|
45
|
+
#
|
|
46
|
+
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
47
|
+
# template and removes its schedules. There is no `enabled` flag, and
|
|
48
|
+
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
49
|
+
# merely off.
|
|
50
|
+
sig { returns(T.nilable(Courier::TopicDigestRequest)) }
|
|
51
|
+
attr_reader :digest
|
|
52
|
+
|
|
53
|
+
sig do
|
|
54
|
+
params(digest: T.nilable(Courier::TopicDigestRequest::OrHash)).void
|
|
55
|
+
end
|
|
56
|
+
attr_writer :digest
|
|
57
|
+
|
|
43
58
|
# Whether to include a list-unsubscribe header on emails for this topic.
|
|
44
59
|
sig { returns(T.nilable(T::Boolean)) }
|
|
45
60
|
attr_accessor :include_unsubscribe_header
|
|
@@ -67,6 +82,7 @@ module Courier
|
|
|
67
82
|
]
|
|
68
83
|
),
|
|
69
84
|
description: T.nilable(String),
|
|
85
|
+
digest: T.nilable(Courier::TopicDigestRequest::OrHash),
|
|
70
86
|
include_unsubscribe_header: T.nilable(T::Boolean),
|
|
71
87
|
routing_options:
|
|
72
88
|
T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
|
|
@@ -83,6 +99,14 @@ module Courier
|
|
|
83
99
|
allowed_preferences: nil,
|
|
84
100
|
# Optional description shown under the topic on the hosted preferences page.
|
|
85
101
|
description: nil,
|
|
102
|
+
# A topic's digest configuration: the template that renders it, the cadences it
|
|
103
|
+
# delivers on, and how collected events are retained.
|
|
104
|
+
#
|
|
105
|
+
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
106
|
+
# template and removes its schedules. There is no `enabled` flag, and
|
|
107
|
+
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
108
|
+
# merely off.
|
|
109
|
+
digest: nil,
|
|
86
110
|
# Whether to include a list-unsubscribe header on emails for this topic.
|
|
87
111
|
include_unsubscribe_header: nil,
|
|
88
112
|
# Default channels delivered for this topic. Defaults to empty if omitted.
|
|
@@ -105,6 +129,7 @@ module Courier
|
|
|
105
129
|
]
|
|
106
130
|
),
|
|
107
131
|
description: T.nilable(String),
|
|
132
|
+
digest: T.nilable(Courier::TopicDigestRequest),
|
|
108
133
|
include_unsubscribe_header: T.nilable(T::Boolean),
|
|
109
134
|
routing_options:
|
|
110
135
|
T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
|
|
@@ -65,6 +65,15 @@ module Courier
|
|
|
65
65
|
sig { returns(T.nilable(String)) }
|
|
66
66
|
attr_accessor :description
|
|
67
67
|
|
|
68
|
+
# A topic's digest configuration.
|
|
69
|
+
sig { returns(T.nilable(Courier::TopicDigestResponse)) }
|
|
70
|
+
attr_reader :digest
|
|
71
|
+
|
|
72
|
+
sig do
|
|
73
|
+
params(digest: T.nilable(Courier::TopicDigestResponse::OrHash)).void
|
|
74
|
+
end
|
|
75
|
+
attr_writer :digest
|
|
76
|
+
|
|
68
77
|
# Id of the last updater.
|
|
69
78
|
sig { returns(T.nilable(String)) }
|
|
70
79
|
attr_accessor :updater
|
|
@@ -87,6 +96,7 @@ module Courier
|
|
|
87
96
|
updated: String,
|
|
88
97
|
creator: T.nilable(String),
|
|
89
98
|
description: T.nilable(String),
|
|
99
|
+
digest: T.nilable(Courier::TopicDigestResponse::OrHash),
|
|
90
100
|
updater: T.nilable(String)
|
|
91
101
|
).returns(T.attached_class)
|
|
92
102
|
end
|
|
@@ -113,6 +123,8 @@ module Courier
|
|
|
113
123
|
creator: nil,
|
|
114
124
|
# Optional description shown under the topic on the hosted preferences page.
|
|
115
125
|
description: nil,
|
|
126
|
+
# A topic's digest configuration.
|
|
127
|
+
digest: nil,
|
|
116
128
|
# Id of the last updater.
|
|
117
129
|
updater: nil
|
|
118
130
|
)
|
|
@@ -137,6 +149,7 @@ module Courier
|
|
|
137
149
|
updated: String,
|
|
138
150
|
creator: T.nilable(String),
|
|
139
151
|
description: T.nilable(String),
|
|
152
|
+
digest: T.nilable(Courier::TopicDigestResponse),
|
|
140
153
|
updater: T.nilable(String)
|
|
141
154
|
}
|
|
142
155
|
)
|
|
@@ -40,6 +40,21 @@ module Courier
|
|
|
40
40
|
sig { returns(T.nilable(String)) }
|
|
41
41
|
attr_accessor :description
|
|
42
42
|
|
|
43
|
+
# A topic's digest configuration: the template that renders it, the cadences it
|
|
44
|
+
# delivers on, and how collected events are retained.
|
|
45
|
+
#
|
|
46
|
+
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
47
|
+
# template and removes its schedules. There is no `enabled` flag, and
|
|
48
|
+
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
49
|
+
# merely off.
|
|
50
|
+
sig { returns(T.nilable(Courier::TopicDigestRequest)) }
|
|
51
|
+
attr_reader :digest
|
|
52
|
+
|
|
53
|
+
sig do
|
|
54
|
+
params(digest: T.nilable(Courier::TopicDigestRequest::OrHash)).void
|
|
55
|
+
end
|
|
56
|
+
attr_writer :digest
|
|
57
|
+
|
|
43
58
|
# Whether to include a list-unsubscribe header on emails for this topic.
|
|
44
59
|
sig { returns(T.nilable(T::Boolean)) }
|
|
45
60
|
attr_accessor :include_unsubscribe_header
|
|
@@ -68,6 +83,7 @@ module Courier
|
|
|
68
83
|
]
|
|
69
84
|
),
|
|
70
85
|
description: T.nilable(String),
|
|
86
|
+
digest: T.nilable(Courier::TopicDigestRequest::OrHash),
|
|
71
87
|
include_unsubscribe_header: T.nilable(T::Boolean),
|
|
72
88
|
routing_options:
|
|
73
89
|
T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
|
|
@@ -84,6 +100,14 @@ module Courier
|
|
|
84
100
|
# Optional description shown under the topic on the hosted preferences page. Omit
|
|
85
101
|
# to clear.
|
|
86
102
|
description: nil,
|
|
103
|
+
# A topic's digest configuration: the template that renders it, the cadences it
|
|
104
|
+
# delivers on, and how collected events are retained.
|
|
105
|
+
#
|
|
106
|
+
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
107
|
+
# template and removes its schedules. There is no `enabled` flag, and
|
|
108
|
+
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
109
|
+
# merely off.
|
|
110
|
+
digest: nil,
|
|
87
111
|
# Whether to include a list-unsubscribe header on emails for this topic.
|
|
88
112
|
include_unsubscribe_header: nil,
|
|
89
113
|
# Default channels delivered for this topic. Omit to clear.
|
|
@@ -106,6 +130,7 @@ module Courier
|
|
|
106
130
|
]
|
|
107
131
|
),
|
|
108
132
|
description: T.nilable(String),
|
|
133
|
+
digest: T.nilable(Courier::TopicDigestRequest),
|
|
109
134
|
include_unsubscribe_header: T.nilable(T::Boolean),
|
|
110
135
|
routing_options:
|
|
111
136
|
T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
module WorkspacePreferences
|
|
6
|
+
class TopicDeleteDigestParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Courier::WorkspacePreferences::TopicDeleteDigestParams,
|
|
14
|
+
Courier::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :section_id
|
|
20
|
+
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :topic_id
|
|
23
|
+
|
|
24
|
+
sig do
|
|
25
|
+
params(
|
|
26
|
+
section_id: String,
|
|
27
|
+
topic_id: String,
|
|
28
|
+
request_options: Courier::RequestOptions::OrHash
|
|
29
|
+
).returns(T.attached_class)
|
|
30
|
+
end
|
|
31
|
+
def self.new(section_id:, topic_id:, request_options: {})
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{
|
|
37
|
+
section_id: String,
|
|
38
|
+
topic_id: String,
|
|
39
|
+
request_options: Courier::RequestOptions
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
def to_hash
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
module WorkspacePreferences
|
|
6
|
+
class TopicReleaseDigestParams < Courier::Models::TopicDigestReleaseRequest
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Courier::WorkspacePreferences::TopicReleaseDigestParams,
|
|
14
|
+
Courier::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :section_id
|
|
20
|
+
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :topic_id
|
|
23
|
+
|
|
24
|
+
sig do
|
|
25
|
+
params(
|
|
26
|
+
section_id: String,
|
|
27
|
+
topic_id: String,
|
|
28
|
+
request_options: Courier::RequestOptions::OrHash
|
|
29
|
+
).returns(T.attached_class)
|
|
30
|
+
end
|
|
31
|
+
def self.new(section_id:, topic_id:, request_options: {})
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{
|
|
37
|
+
section_id: String,
|
|
38
|
+
topic_id: String,
|
|
39
|
+
request_options: Courier::RequestOptions
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
def to_hash
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
data/rbi/courier/models.rbi
CHANGED
|
@@ -152,6 +152,10 @@ module Courier
|
|
|
152
152
|
|
|
153
153
|
DigestCategory = Courier::Models::DigestCategory
|
|
154
154
|
|
|
155
|
+
DigestDayOfWeek = Courier::Models::DigestDayOfWeek
|
|
156
|
+
|
|
157
|
+
DigestFrequency = Courier::Models::DigestFrequency
|
|
158
|
+
|
|
155
159
|
DigestInstance = Courier::Models::DigestInstance
|
|
156
160
|
|
|
157
161
|
DigestInstanceListResponse = Courier::Models::DigestInstanceListResponse
|
|
@@ -622,6 +626,18 @@ module Courier
|
|
|
622
626
|
|
|
623
627
|
Token = Courier::Models::Token
|
|
624
628
|
|
|
629
|
+
TopicDigestCategory = Courier::Models::TopicDigestCategory
|
|
630
|
+
|
|
631
|
+
TopicDigestReleaseRequest = Courier::Models::TopicDigestReleaseRequest
|
|
632
|
+
|
|
633
|
+
TopicDigestRequest = Courier::Models::TopicDigestRequest
|
|
634
|
+
|
|
635
|
+
TopicDigestResponse = Courier::Models::TopicDigestResponse
|
|
636
|
+
|
|
637
|
+
TopicDigestScheduleRequest = Courier::Models::TopicDigestScheduleRequest
|
|
638
|
+
|
|
639
|
+
TopicDigestScheduleResponse = Courier::Models::TopicDigestScheduleResponse
|
|
640
|
+
|
|
625
641
|
TranslationRetrieveParams = Courier::Models::TranslationRetrieveParams
|
|
626
642
|
|
|
627
643
|
TranslationUpdateParams = Courier::Models::TranslationUpdateParams
|
|
@@ -38,8 +38,11 @@ module Courier
|
|
|
38
38
|
).void
|
|
39
39
|
end
|
|
40
40
|
def release(
|
|
41
|
-
# The ID of the digest schedule to release
|
|
42
|
-
#
|
|
41
|
+
# The ID of the digest schedule to release. Newer schedules are
|
|
42
|
+
# `sch_01m26xfcn3endt3nxy4e2kx2rh` and need no encoding. Schedules created before
|
|
43
|
+
# that format are `sch/{uuid}` and contain a literal `/`, so those must be
|
|
44
|
+
# URL-encoded (e.g. `sch%2F00000000-0000-0000-0000-000000000000`). Both forms
|
|
45
|
+
# remain valid; existing ids are never migrated.
|
|
43
46
|
schedule_id,
|
|
44
47
|
request_options: {}
|
|
45
48
|
)
|
|
@@ -122,8 +122,12 @@ module Courier
|
|
|
122
122
|
provider_key:,
|
|
123
123
|
# Body param: Information about the device the token came from.
|
|
124
124
|
device: nil,
|
|
125
|
-
# Body param:
|
|
126
|
-
#
|
|
125
|
+
# Body param: When the token expires. Accepts a date, or the boolean `false` to
|
|
126
|
+
# disable expiration entirely. ISO 8601 is recommended (for example
|
|
127
|
+
# `2026-10-25T00:00:00.000Z`). A value that cannot be parsed as a date is
|
|
128
|
+
# rejected; it is not treated as "no expiration" and does not fall back to the
|
|
129
|
+
# default. `true` is not a supported value. Omit the field to use the default,
|
|
130
|
+
# which expires a token that has not been re-registered for 60 days.
|
|
127
131
|
expiry_date: nil,
|
|
128
132
|
# Body param: Properties about the token.
|
|
129
133
|
properties: nil,
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Resources
|
|
5
5
|
class WorkspacePreferences
|
|
6
|
-
# Manage the workspace catalog of subscription topics, the sections that group
|
|
7
|
-
# them, and publishing the preference page.
|
|
8
6
|
class Topics
|
|
9
7
|
# Creates a subscription topic inside a workspace preference. The default status
|
|
10
8
|
# sets whether users start opted in, opted out, or required.
|
|
@@ -21,6 +19,7 @@ module Courier
|
|
|
21
19
|
]
|
|
22
20
|
),
|
|
23
21
|
description: T.nilable(String),
|
|
22
|
+
digest: T.nilable(Courier::TopicDigestRequest::OrHash),
|
|
24
23
|
include_unsubscribe_header: T.nilable(T::Boolean),
|
|
25
24
|
routing_options:
|
|
26
25
|
T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
|
|
@@ -44,6 +43,14 @@ module Courier
|
|
|
44
43
|
# Body param: Optional description shown under the topic on the hosted preferences
|
|
45
44
|
# page.
|
|
46
45
|
description: nil,
|
|
46
|
+
# Body param: A topic's digest configuration: the template that renders it, the
|
|
47
|
+
# cadences it delivers on, and how collected events are retained.
|
|
48
|
+
#
|
|
49
|
+
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
50
|
+
# template and removes its schedules. There is no `enabled` flag, and
|
|
51
|
+
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
52
|
+
# merely off.
|
|
53
|
+
digest: nil,
|
|
47
54
|
# Body param: Whether to include a list-unsubscribe header on emails for this
|
|
48
55
|
# topic.
|
|
49
56
|
include_unsubscribe_header: nil,
|
|
@@ -119,6 +126,60 @@ module Courier
|
|
|
119
126
|
)
|
|
120
127
|
end
|
|
121
128
|
|
|
129
|
+
# Turn off a topic's digest, leaving the topic itself in place. The template is
|
|
130
|
+
# unlinked and the digest's schedules are removed along with their delivery rules.
|
|
131
|
+
# Equivalent to sending `digest: null` on a topic replace.
|
|
132
|
+
sig do
|
|
133
|
+
params(
|
|
134
|
+
topic_id: String,
|
|
135
|
+
section_id: String,
|
|
136
|
+
request_options: Courier::RequestOptions::OrHash
|
|
137
|
+
).void
|
|
138
|
+
end
|
|
139
|
+
def delete_digest(
|
|
140
|
+
# The preference topic whose digest to turn off.
|
|
141
|
+
topic_id,
|
|
142
|
+
# The preference section containing the topic.
|
|
143
|
+
section_id:,
|
|
144
|
+
request_options: {}
|
|
145
|
+
)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Send one recipient's held digest now, instead of waiting for its schedule. Use
|
|
149
|
+
# it to preview what a digest will look like, or to let someone flush their own.
|
|
150
|
+
#
|
|
151
|
+
# Keyed on the topic because that is how a held digest is stored: one per
|
|
152
|
+
# recipient per topic, with the schedule recorded on it rather than part of its
|
|
153
|
+
# identity. To flush every recipient on a schedule instead, use
|
|
154
|
+
# `POST /digests/schedules/{schedule_id}/trigger`.
|
|
155
|
+
sig do
|
|
156
|
+
params(
|
|
157
|
+
topic_id: String,
|
|
158
|
+
section_id: String,
|
|
159
|
+
user_id: String,
|
|
160
|
+
tenant_id: String,
|
|
161
|
+
request_options: Courier::RequestOptions::OrHash
|
|
162
|
+
).void
|
|
163
|
+
end
|
|
164
|
+
def release_digest(
|
|
165
|
+
# Path param: The preference topic whose digest to release.
|
|
166
|
+
topic_id,
|
|
167
|
+
# Path param: The preference section containing the topic.
|
|
168
|
+
section_id:,
|
|
169
|
+
# Body param: The recipient whose digest to release. Required: there is no
|
|
170
|
+
# "release everyone on this topic" form, because a whole-schedule flush already
|
|
171
|
+
# has its own endpoint and a body-shaped difference between one recipient and all
|
|
172
|
+
# of them is too easy to get wrong.
|
|
173
|
+
user_id:,
|
|
174
|
+
# Body param: The recipient's tenant, when they were sent to as part of one -- the
|
|
175
|
+
# same value returned as `tenant_id` on a digest instance and sent as
|
|
176
|
+
# `message.context.tenant_id`. It is part of the held digest's key, so a tenanted
|
|
177
|
+
# recipient cannot be found without it. Omit for an ordinary recipient.
|
|
178
|
+
tenant_id: nil,
|
|
179
|
+
request_options: {}
|
|
180
|
+
)
|
|
181
|
+
end
|
|
182
|
+
|
|
122
183
|
# Replace a topic within a workspace preference. Full document replacement;
|
|
123
184
|
# missing optional fields are cleared. Same 404 rules as GET.
|
|
124
185
|
sig do
|
|
@@ -135,6 +196,7 @@ module Courier
|
|
|
135
196
|
]
|
|
136
197
|
),
|
|
137
198
|
description: T.nilable(String),
|
|
199
|
+
digest: T.nilable(Courier::TopicDigestRequest::OrHash),
|
|
138
200
|
include_unsubscribe_header: T.nilable(T::Boolean),
|
|
139
201
|
routing_options:
|
|
140
202
|
T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
|
|
@@ -157,6 +219,14 @@ module Courier
|
|
|
157
219
|
# Body param: Optional description shown under the topic on the hosted preferences
|
|
158
220
|
# page. Omit to clear.
|
|
159
221
|
description: nil,
|
|
222
|
+
# Body param: A topic's digest configuration: the template that renders it, the
|
|
223
|
+
# cadences it delivers on, and how collected events are retained.
|
|
224
|
+
#
|
|
225
|
+
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
226
|
+
# template and removes its schedules. There is no `enabled` flag, and
|
|
227
|
+
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
228
|
+
# merely off.
|
|
229
|
+
digest: nil,
|
|
160
230
|
# Body param: Whether to include a list-unsubscribe header on emails for this
|
|
161
231
|
# topic.
|
|
162
232
|
include_unsubscribe_header: nil,
|
|
@@ -5,8 +5,6 @@ module Courier
|
|
|
5
5
|
# Manage the workspace catalog of subscription topics, the sections that group
|
|
6
6
|
# them, and publishing the preference page.
|
|
7
7
|
class WorkspacePreferences
|
|
8
|
-
# Manage the workspace catalog of subscription topics, the sections that group
|
|
9
|
-
# them, and publishing the preference page.
|
|
10
8
|
sig { returns(Courier::Resources::WorkspacePreferences::Topics) }
|
|
11
9
|
attr_reader :topics
|
|
12
10
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module Courier
|
|
2
|
+
module Models
|
|
3
|
+
type digest_day_of_week =
|
|
4
|
+
:sunday
|
|
5
|
+
| :monday
|
|
6
|
+
| :tuesday
|
|
7
|
+
| :wednesday
|
|
8
|
+
| :thursday
|
|
9
|
+
| :friday
|
|
10
|
+
| :saturday
|
|
11
|
+
|
|
12
|
+
module DigestDayOfWeek
|
|
13
|
+
extend Courier::Internal::Type::Enum
|
|
14
|
+
|
|
15
|
+
SUNDAY: :sunday
|
|
16
|
+
MONDAY: :monday
|
|
17
|
+
TUESDAY: :tuesday
|
|
18
|
+
WEDNESDAY: :wednesday
|
|
19
|
+
THURSDAY: :thursday
|
|
20
|
+
FRIDAY: :friday
|
|
21
|
+
SATURDAY: :saturday
|
|
22
|
+
|
|
23
|
+
def self?.values: -> ::Array[Courier::Models::digest_day_of_week]
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module Courier
|
|
2
|
+
module Models
|
|
3
|
+
type digest_frequency =
|
|
4
|
+
:instant | :daily | :weekdays | :weekly | :custom_days | :monthly
|
|
5
|
+
|
|
6
|
+
module DigestFrequency
|
|
7
|
+
extend Courier::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
INSTANT: :instant
|
|
10
|
+
DAILY: :daily
|
|
11
|
+
WEEKDAYS: :weekdays
|
|
12
|
+
WEEKLY: :weekly
|
|
13
|
+
CUSTOM_DAYS: :custom_days
|
|
14
|
+
MONTHLY: :monthly
|
|
15
|
+
|
|
16
|
+
def self?.values: -> ::Array[Courier::Models::digest_frequency]
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -1,15 +1,117 @@
|
|
|
1
1
|
module Courier
|
|
2
2
|
module Models
|
|
3
|
-
type email_footer =
|
|
3
|
+
type email_footer =
|
|
4
|
+
{
|
|
5
|
+
inherit_default: bool?,
|
|
6
|
+
markdown: String?,
|
|
7
|
+
social: Courier::EmailFooter::Social?
|
|
8
|
+
}
|
|
4
9
|
|
|
5
10
|
class EmailFooter < Courier::Internal::Type::BaseModel
|
|
6
|
-
attr_accessor content: String?
|
|
7
|
-
|
|
8
11
|
attr_accessor inherit_default: bool?
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
attr_accessor markdown: String?
|
|
14
|
+
|
|
15
|
+
attr_accessor social: Courier::EmailFooter::Social?
|
|
16
|
+
|
|
17
|
+
def initialize: (
|
|
18
|
+
?inherit_default: bool?,
|
|
19
|
+
?markdown: String?,
|
|
20
|
+
?social: Courier::EmailFooter::Social?
|
|
21
|
+
) -> void
|
|
22
|
+
|
|
23
|
+
def to_hash: -> {
|
|
24
|
+
inherit_default: bool?,
|
|
25
|
+
markdown: String?,
|
|
26
|
+
social: Courier::EmailFooter::Social?
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type social =
|
|
30
|
+
{
|
|
31
|
+
facebook: Courier::EmailFooter::Social::Facebook?,
|
|
32
|
+
instagram: Courier::EmailFooter::Social::Instagram?,
|
|
33
|
+
linkedin: Courier::EmailFooter::Social::Linkedin?,
|
|
34
|
+
medium: Courier::EmailFooter::Social::Medium?,
|
|
35
|
+
twitter: Courier::EmailFooter::Social::Twitter?
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
class Social < Courier::Internal::Type::BaseModel
|
|
39
|
+
attr_accessor facebook: Courier::EmailFooter::Social::Facebook?
|
|
40
|
+
|
|
41
|
+
attr_accessor instagram: Courier::EmailFooter::Social::Instagram?
|
|
42
|
+
|
|
43
|
+
attr_accessor linkedin: Courier::EmailFooter::Social::Linkedin?
|
|
44
|
+
|
|
45
|
+
attr_accessor medium: Courier::EmailFooter::Social::Medium?
|
|
46
|
+
|
|
47
|
+
attr_accessor twitter: Courier::EmailFooter::Social::Twitter?
|
|
48
|
+
|
|
49
|
+
def initialize: (
|
|
50
|
+
?facebook: Courier::EmailFooter::Social::Facebook?,
|
|
51
|
+
?instagram: Courier::EmailFooter::Social::Instagram?,
|
|
52
|
+
?linkedin: Courier::EmailFooter::Social::Linkedin?,
|
|
53
|
+
?medium: Courier::EmailFooter::Social::Medium?,
|
|
54
|
+
?twitter: Courier::EmailFooter::Social::Twitter?
|
|
55
|
+
) -> void
|
|
56
|
+
|
|
57
|
+
def to_hash: -> {
|
|
58
|
+
facebook: Courier::EmailFooter::Social::Facebook?,
|
|
59
|
+
instagram: Courier::EmailFooter::Social::Instagram?,
|
|
60
|
+
linkedin: Courier::EmailFooter::Social::Linkedin?,
|
|
61
|
+
medium: Courier::EmailFooter::Social::Medium?,
|
|
62
|
+
twitter: Courier::EmailFooter::Social::Twitter?
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type facebook = { url: String? }
|
|
66
|
+
|
|
67
|
+
class Facebook < Courier::Internal::Type::BaseModel
|
|
68
|
+
attr_accessor url: String?
|
|
69
|
+
|
|
70
|
+
def initialize: (?url: String?) -> void
|
|
71
|
+
|
|
72
|
+
def to_hash: -> { url: String? }
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
type instagram = { url: String? }
|
|
76
|
+
|
|
77
|
+
class Instagram < Courier::Internal::Type::BaseModel
|
|
78
|
+
attr_accessor url: String?
|
|
79
|
+
|
|
80
|
+
def initialize: (?url: String?) -> void
|
|
81
|
+
|
|
82
|
+
def to_hash: -> { url: String? }
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
type linkedin = { url: String? }
|
|
86
|
+
|
|
87
|
+
class Linkedin < Courier::Internal::Type::BaseModel
|
|
88
|
+
attr_accessor url: String?
|
|
89
|
+
|
|
90
|
+
def initialize: (?url: String?) -> void
|
|
91
|
+
|
|
92
|
+
def to_hash: -> { url: String? }
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
type medium = { url: String? }
|
|
96
|
+
|
|
97
|
+
class Medium < Courier::Internal::Type::BaseModel
|
|
98
|
+
attr_accessor url: String?
|
|
99
|
+
|
|
100
|
+
def initialize: (?url: String?) -> void
|
|
101
|
+
|
|
102
|
+
def to_hash: -> { url: String? }
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
type twitter = { url: String? }
|
|
106
|
+
|
|
107
|
+
class Twitter < Courier::Internal::Type::BaseModel
|
|
108
|
+
attr_accessor url: String?
|
|
109
|
+
|
|
110
|
+
def initialize: (?url: String?) -> void
|
|
11
111
|
|
|
12
|
-
|
|
112
|
+
def to_hash: -> { url: String? }
|
|
113
|
+
end
|
|
114
|
+
end
|
|
13
115
|
end
|
|
14
116
|
end
|
|
15
117
|
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module Courier
|
|
2
|
+
module Models
|
|
3
|
+
type topic_digest_category =
|
|
4
|
+
{
|
|
5
|
+
category_key: String,
|
|
6
|
+
limit: Integer,
|
|
7
|
+
retain: Courier::Models::TopicDigestCategory::retain,
|
|
8
|
+
sort_key: String
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class TopicDigestCategory < Courier::Internal::Type::BaseModel
|
|
12
|
+
attr_accessor category_key: String
|
|
13
|
+
|
|
14
|
+
attr_reader limit: Integer?
|
|
15
|
+
|
|
16
|
+
def limit=: (Integer) -> Integer
|
|
17
|
+
|
|
18
|
+
attr_reader retain: Courier::Models::TopicDigestCategory::retain?
|
|
19
|
+
|
|
20
|
+
def retain=: (
|
|
21
|
+
Courier::Models::TopicDigestCategory::retain
|
|
22
|
+
) -> Courier::Models::TopicDigestCategory::retain
|
|
23
|
+
|
|
24
|
+
attr_reader sort_key: String?
|
|
25
|
+
|
|
26
|
+
def sort_key=: (String) -> String
|
|
27
|
+
|
|
28
|
+
def initialize: (
|
|
29
|
+
category_key: String,
|
|
30
|
+
?limit: Integer,
|
|
31
|
+
?retain: Courier::Models::TopicDigestCategory::retain,
|
|
32
|
+
?sort_key: String
|
|
33
|
+
) -> void
|
|
34
|
+
|
|
35
|
+
def to_hash: -> {
|
|
36
|
+
category_key: String,
|
|
37
|
+
limit: Integer,
|
|
38
|
+
retain: Courier::Models::TopicDigestCategory::retain,
|
|
39
|
+
sort_key: String
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
type retain = :FIRST | :LAST | :HIGHEST | :LOWEST | :NONE
|
|
43
|
+
|
|
44
|
+
module Retain
|
|
45
|
+
extend Courier::Internal::Type::Enum
|
|
46
|
+
|
|
47
|
+
FIRST: :FIRST
|
|
48
|
+
LAST: :LAST
|
|
49
|
+
HIGHEST: :HIGHEST
|
|
50
|
+
LOWEST: :LOWEST
|
|
51
|
+
NONE: :NONE
|
|
52
|
+
|
|
53
|
+
def self?.values: -> ::Array[Courier::Models::TopicDigestCategory::retain]
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Courier
|
|
2
|
+
module Models
|
|
3
|
+
type topic_digest_release_request = { user_id: String, tenant_id: String }
|
|
4
|
+
|
|
5
|
+
class TopicDigestReleaseRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
attr_accessor user_id: String
|
|
7
|
+
|
|
8
|
+
attr_reader tenant_id: String?
|
|
9
|
+
|
|
10
|
+
def tenant_id=: (String) -> String
|
|
11
|
+
|
|
12
|
+
def initialize: (user_id: String, ?tenant_id: String) -> void
|
|
13
|
+
|
|
14
|
+
def to_hash: -> { user_id: String, tenant_id: String }
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|