trycourier 4.21.0 → 4.22.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 +16 -0
- data/lib/courier/client.rb +39 -0
- data/lib/courier/models/automations/invoke_invoke_ad_hoc_params.rb +13 -1
- data/lib/courier/models/automations/invoke_invoke_by_template_params.rb +13 -1
- data/lib/courier/models/brand_create_params.rb +13 -1
- data/lib/courier/models/inbox/message_delete_params.rb +22 -0
- data/lib/courier/models/inbox/message_restore_params.rb +22 -0
- data/lib/courier/models/journey_cancel_params.rb +13 -1
- data/lib/courier/models/journey_create_params.rb +13 -1
- data/lib/courier/models/journey_invoke_params.rb +13 -1
- data/lib/courier/models/journey_publish_params.rb +13 -1
- data/lib/courier/models/journeys/template_create_params.rb +13 -1
- data/lib/courier/models/journeys/template_publish_params.rb +13 -1
- data/lib/courier/models/lists/subscription_add_params.rb +13 -1
- data/lib/courier/models/notification_create_params.rb +13 -1
- data/lib/courier/models/notification_publish_params.rb +13 -1
- data/lib/courier/models/profile_create_params.rb +13 -1
- data/lib/courier/models/profiles/list_subscribe_params.rb +13 -1
- data/lib/courier/models/provider_create_params.rb +15 -1
- data/lib/courier/models/routing_strategy_create_params.rb +13 -1
- data/lib/courier/models/send_message_params.rb +15 -1
- data/lib/courier/models/users/preference_bulk_update_params.rb +15 -1
- data/lib/courier/models/users/preference_update_or_create_topic_params.rb +14 -4
- data/lib/courier/models/users/topic_preference.rb +21 -7
- data/lib/courier/models/workspace_preference_create_params.rb +13 -1
- data/lib/courier/models/workspace_preference_publish_params.rb +13 -1
- data/lib/courier/models/workspace_preferences/topic_create_params.rb +13 -1
- data/lib/courier/models.rb +2 -0
- data/lib/courier/resources/audiences.rb +12 -5
- data/lib/courier/resources/audit_events.rb +5 -2
- data/lib/courier/resources/auth.rb +5 -1
- data/lib/courier/resources/automations/invoke.rb +47 -23
- data/lib/courier/resources/automations.rb +6 -1
- data/lib/courier/resources/brands.rb +38 -12
- data/lib/courier/resources/digests/schedules.rb +4 -3
- data/lib/courier/resources/digests.rb +2 -0
- data/lib/courier/resources/inbound.rb +3 -1
- data/lib/courier/resources/inbox/messages.rb +58 -0
- data/lib/courier/resources/inbox.rb +19 -0
- data/lib/courier/resources/journeys/templates.rb +43 -25
- data/lib/courier/resources/journeys.rb +73 -44
- data/lib/courier/resources/lists/subscriptions.rb +22 -8
- data/lib/courier/resources/lists.rb +14 -5
- data/lib/courier/resources/messages.rb +14 -14
- data/lib/courier/resources/notifications/checks.rb +8 -3
- data/lib/courier/resources/notifications.rb +48 -30
- data/lib/courier/resources/profiles/lists.rb +19 -8
- data/lib/courier/resources/profiles.rb +25 -14
- data/lib/courier/resources/providers/catalog.rb +4 -4
- data/lib/courier/resources/providers.rb +27 -18
- data/lib/courier/resources/requests.rb +4 -1
- data/lib/courier/resources/routing_strategies.rb +24 -12
- data/lib/courier/resources/send.rb +14 -4
- data/lib/courier/resources/tenants/preferences/items.rb +6 -2
- data/lib/courier/resources/tenants/preferences.rb +2 -0
- data/lib/courier/resources/tenants/templates/versions.rb +4 -7
- data/lib/courier/resources/tenants/templates.rb +14 -19
- data/lib/courier/resources/tenants.rb +14 -5
- data/lib/courier/resources/translations.rb +6 -2
- data/lib/courier/resources/users/preferences.rb +23 -42
- data/lib/courier/resources/users/tenants.rb +12 -10
- data/lib/courier/resources/users/tokens.rb +14 -6
- data/lib/courier/resources/users.rb +6 -0
- data/lib/courier/resources/workspace_preferences/topics.rb +27 -19
- data/lib/courier/resources/workspace_preferences.rb +40 -20
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +4 -0
- data/rbi/courier/client.rbi +38 -0
- data/rbi/courier/models/automations/invoke_invoke_ad_hoc_params.rbi +18 -0
- data/rbi/courier/models/automations/invoke_invoke_by_template_params.rbi +18 -0
- data/rbi/courier/models/brand_create_params.rbi +18 -0
- data/rbi/courier/models/inbox/message_delete_params.rbi +40 -0
- data/rbi/courier/models/inbox/message_restore_params.rbi +40 -0
- data/rbi/courier/models/journey_cancel_params.rbi +31 -5
- data/rbi/courier/models/journey_create_params.rbi +31 -5
- data/rbi/courier/models/journey_invoke_params.rbi +26 -2
- data/rbi/courier/models/journey_publish_params.rbi +26 -2
- data/rbi/courier/models/journeys/template_create_params.rbi +26 -2
- data/rbi/courier/models/journeys/template_publish_params.rbi +23 -1
- data/rbi/courier/models/lists/subscription_add_params.rbi +23 -1
- data/rbi/courier/models/notification_create_params.rbi +31 -5
- data/rbi/courier/models/notification_publish_params.rbi +26 -2
- data/rbi/courier/models/profile_create_params.rbi +23 -1
- data/rbi/courier/models/profiles/list_subscribe_params.rbi +23 -1
- data/rbi/courier/models/provider_create_params.rbi +18 -0
- data/rbi/courier/models/routing_strategy_create_params.rbi +31 -5
- data/rbi/courier/models/send_message_params.rbi +18 -0
- data/rbi/courier/models/users/preference_bulk_update_params.rbi +18 -0
- data/rbi/courier/models/users/preference_update_or_create_topic_params.rbi +14 -2
- data/rbi/courier/models/users/topic_preference.rbi +24 -2
- data/rbi/courier/models/workspace_preference_create_params.rbi +31 -5
- data/rbi/courier/models/workspace_preference_publish_params.rbi +31 -5
- data/rbi/courier/models/workspace_preferences/topic_create_params.rbi +26 -2
- data/rbi/courier/models.rbi +2 -0
- data/rbi/courier/resources/audiences.rbi +12 -5
- data/rbi/courier/resources/audit_events.rbi +5 -2
- data/rbi/courier/resources/auth.rbi +5 -1
- data/rbi/courier/resources/automations/invoke.rbi +48 -7
- data/rbi/courier/resources/automations.rbi +6 -1
- data/rbi/courier/resources/brands.rbi +37 -7
- data/rbi/courier/resources/digests/schedules.rbi +4 -3
- data/rbi/courier/resources/digests.rbi +2 -0
- data/rbi/courier/resources/inbound.rbi +3 -1
- data/rbi/courier/resources/inbox/messages.rbi +44 -0
- data/rbi/courier/resources/inbox.rbi +16 -0
- data/rbi/courier/resources/journeys/templates.rbi +47 -17
- data/rbi/courier/resources/journeys.rbi +93 -39
- data/rbi/courier/resources/lists/subscriptions.rbi +24 -5
- data/rbi/courier/resources/lists.rbi +14 -5
- data/rbi/courier/resources/messages.rbi +14 -14
- data/rbi/courier/resources/notifications/checks.rbi +8 -3
- data/rbi/courier/resources/notifications.rbi +58 -28
- data/rbi/courier/resources/profiles/lists.rbi +25 -6
- data/rbi/courier/resources/profiles.rbi +31 -11
- data/rbi/courier/resources/providers/catalog.rbi +4 -4
- data/rbi/courier/resources/providers.rbi +35 -19
- data/rbi/courier/resources/requests.rbi +4 -1
- data/rbi/courier/resources/routing_strategies.rbi +26 -10
- data/rbi/courier/resources/send.rbi +20 -3
- data/rbi/courier/resources/tenants/preferences/items.rbi +6 -2
- data/rbi/courier/resources/tenants/preferences.rbi +2 -0
- data/rbi/courier/resources/tenants/templates/versions.rbi +4 -7
- data/rbi/courier/resources/tenants/templates.rbi +14 -19
- data/rbi/courier/resources/tenants.rbi +14 -5
- data/rbi/courier/resources/translations.rbi +6 -2
- data/rbi/courier/resources/users/preferences.rbi +28 -40
- data/rbi/courier/resources/users/tenants.rbi +12 -10
- data/rbi/courier/resources/users/tokens.rbi +14 -6
- data/rbi/courier/resources/users.rbi +6 -0
- data/rbi/courier/resources/workspace_preferences/topics.rbi +37 -18
- data/rbi/courier/resources/workspace_preferences.rbi +51 -17
- data/sig/courier/client.rbs +2 -0
- data/sig/courier/models/automations/invoke_invoke_ad_hoc_params.rbs +15 -1
- data/sig/courier/models/automations/invoke_invoke_by_template_params.rbs +15 -1
- data/sig/courier/models/brand_create_params.rbs +15 -1
- data/sig/courier/models/inbox/message_delete_params.rbs +25 -0
- data/sig/courier/models/inbox/message_restore_params.rbs +25 -0
- data/sig/courier/models/journey_cancel_params.rbs +20 -3
- data/sig/courier/models/journey_create_params.rbs +20 -3
- data/sig/courier/models/journey_invoke_params.rbs +18 -1
- data/sig/courier/models/journey_publish_params.rbs +18 -1
- data/sig/courier/models/journeys/template_create_params.rbs +18 -1
- data/sig/courier/models/journeys/template_publish_params.rbs +18 -1
- data/sig/courier/models/lists/subscription_add_params.rbs +15 -1
- data/sig/courier/models/notification_create_params.rbs +20 -3
- data/sig/courier/models/notification_publish_params.rbs +18 -2
- data/sig/courier/models/profile_create_params.rbs +18 -1
- data/sig/courier/models/profiles/list_subscribe_params.rbs +15 -1
- data/sig/courier/models/provider_create_params.rbs +15 -1
- data/sig/courier/models/routing_strategy_create_params.rbs +20 -3
- data/sig/courier/models/send_message_params.rbs +17 -1
- data/sig/courier/models/users/preference_bulk_update_params.rbs +15 -1
- data/sig/courier/models/workspace_preference_create_params.rbs +20 -3
- data/sig/courier/models/workspace_preference_publish_params.rbs +20 -3
- data/sig/courier/models/workspace_preferences/topic_create_params.rbs +18 -1
- data/sig/courier/models.rbs +2 -0
- data/sig/courier/resources/automations/invoke.rbs +4 -0
- data/sig/courier/resources/brands.rbs +2 -0
- data/sig/courier/resources/inbox/messages.rbs +19 -0
- data/sig/courier/resources/inbox.rbs +9 -0
- data/sig/courier/resources/journeys/templates.rbs +4 -0
- data/sig/courier/resources/journeys.rbs +8 -0
- data/sig/courier/resources/lists/subscriptions.rbs +2 -0
- data/sig/courier/resources/notifications.rbs +4 -0
- data/sig/courier/resources/profiles/lists.rbs +2 -0
- data/sig/courier/resources/profiles.rbs +2 -0
- data/sig/courier/resources/providers.rbs +2 -0
- data/sig/courier/resources/routing_strategies.rbs +2 -0
- data/sig/courier/resources/send.rbs +2 -0
- data/sig/courier/resources/users/preferences.rbs +2 -0
- data/sig/courier/resources/workspace_preferences/topics.rbs +2 -0
- data/sig/courier/resources/workspace_preferences.rbs +4 -0
- metadata +14 -2
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Resources
|
|
5
|
+
# Read the audit trail of configuration and access changes in your workspace.
|
|
5
6
|
class AuditEvents
|
|
6
|
-
#
|
|
7
|
+
# Returns one audit event by id, including the actor who performed it, the target
|
|
8
|
+
# they changed, the source, the event type, and a timestamp.
|
|
7
9
|
sig do
|
|
8
10
|
params(
|
|
9
11
|
audit_event_id: String,
|
|
@@ -17,7 +19,8 @@ module Courier
|
|
|
17
19
|
)
|
|
18
20
|
end
|
|
19
21
|
|
|
20
|
-
#
|
|
22
|
+
# Returns the workspace's audit event log with cursor paging. Each event records
|
|
23
|
+
# the actor, target, source, type, and timestamp of a change.
|
|
21
24
|
sig do
|
|
22
25
|
params(
|
|
23
26
|
cursor: T.nilable(String),
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Resources
|
|
5
|
+
# Issue scoped, short-lived JWTs so client-side SDKs — Inbox, Preferences, and the
|
|
6
|
+
# embedded designer — can call Courier as a single user. Server-side requests
|
|
7
|
+
# authenticate with your workspace API key instead.
|
|
5
8
|
class Auth
|
|
6
|
-
# Returns a
|
|
9
|
+
# Returns a JWT for authenticating client-side SDKs such as the Inbox. You supply
|
|
10
|
+
# the scope and an expires_in duration, both required.
|
|
7
11
|
sig do
|
|
8
12
|
params(
|
|
9
13
|
expires_in: String,
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Resources
|
|
5
5
|
class Automations
|
|
6
|
+
# Invoke a stored automation template or an ad hoc automation defined in the
|
|
7
|
+
# request.
|
|
6
8
|
class Invoke
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
# checkout the ad hoc automation guide
|
|
10
|
-
# [here](https://www.courier.com/docs/automations/steps/).
|
|
9
|
+
# Runs a series of automation steps supplied inline, without a saved template, and
|
|
10
|
+
# returns a runId.
|
|
11
11
|
sig do
|
|
12
12
|
params(
|
|
13
13
|
automation:
|
|
@@ -17,21 +17,42 @@ module Courier
|
|
|
17
17
|
profile: T.nilable(T::Hash[Symbol, T.anything]),
|
|
18
18
|
recipient: T.nilable(String),
|
|
19
19
|
template: T.nilable(String),
|
|
20
|
+
idempotency_key: String,
|
|
21
|
+
x_idempotency_expiration: String,
|
|
20
22
|
request_options: Courier::RequestOptions::OrHash
|
|
21
23
|
).returns(Courier::AutomationInvokeResponse)
|
|
22
24
|
end
|
|
23
25
|
def invoke_ad_hoc(
|
|
26
|
+
# Body param
|
|
24
27
|
automation:,
|
|
28
|
+
# Body param
|
|
25
29
|
brand: nil,
|
|
30
|
+
# Body param
|
|
26
31
|
data: nil,
|
|
32
|
+
# Body param
|
|
27
33
|
profile: nil,
|
|
34
|
+
# Body param
|
|
28
35
|
recipient: nil,
|
|
36
|
+
# Body param
|
|
29
37
|
template: nil,
|
|
38
|
+
# Header param: A unique key that makes this request idempotent. If Courier
|
|
39
|
+
# receives another request with the same `Idempotency-Key`, it returns the stored
|
|
40
|
+
# response from the first request without performing the operation again
|
|
41
|
+
# (including the original status code and any error). Use it to safely retry
|
|
42
|
+
# `POST` requests after network failures without risking duplicate sends. The key
|
|
43
|
+
# is scoped to this endpoint.
|
|
44
|
+
idempotency_key: nil,
|
|
45
|
+
# Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
46
|
+
# timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
47
|
+
# `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
48
|
+
# maximum is 1 year.
|
|
49
|
+
x_idempotency_expiration: nil,
|
|
30
50
|
request_options: {}
|
|
31
51
|
)
|
|
32
52
|
end
|
|
33
53
|
|
|
34
|
-
#
|
|
54
|
+
# Starts an automation run from a saved template for one recipient, with optional
|
|
55
|
+
# data and profile, and returns a runId.
|
|
35
56
|
sig do
|
|
36
57
|
params(
|
|
37
58
|
template_id: String,
|
|
@@ -40,18 +61,38 @@ module Courier
|
|
|
40
61
|
data: T.nilable(T::Hash[Symbol, T.anything]),
|
|
41
62
|
profile: T.nilable(T::Hash[Symbol, T.anything]),
|
|
42
63
|
template: T.nilable(String),
|
|
64
|
+
idempotency_key: String,
|
|
65
|
+
x_idempotency_expiration: String,
|
|
43
66
|
request_options: Courier::RequestOptions::OrHash
|
|
44
67
|
).returns(Courier::AutomationInvokeResponse)
|
|
45
68
|
end
|
|
46
69
|
def invoke_by_template(
|
|
47
|
-
# A unique identifier representing the automation template to be
|
|
48
|
-
# could be the Automation Template ID or the Automation Template
|
|
70
|
+
# Path param: A unique identifier representing the automation template to be
|
|
71
|
+
# invoked. This could be the Automation Template ID or the Automation Template
|
|
72
|
+
# Alias.
|
|
49
73
|
template_id,
|
|
74
|
+
# Body param
|
|
50
75
|
recipient:,
|
|
76
|
+
# Body param
|
|
51
77
|
brand: nil,
|
|
78
|
+
# Body param
|
|
52
79
|
data: nil,
|
|
80
|
+
# Body param
|
|
53
81
|
profile: nil,
|
|
82
|
+
# Body param
|
|
54
83
|
template: nil,
|
|
84
|
+
# Header param: A unique key that makes this request idempotent. If Courier
|
|
85
|
+
# receives another request with the same `Idempotency-Key`, it returns the stored
|
|
86
|
+
# response from the first request without performing the operation again
|
|
87
|
+
# (including the original status code and any error). Use it to safely retry
|
|
88
|
+
# `POST` requests after network failures without risking duplicate sends. The key
|
|
89
|
+
# is scoped to this endpoint.
|
|
90
|
+
idempotency_key: nil,
|
|
91
|
+
# Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
92
|
+
# timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
93
|
+
# `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
94
|
+
# maximum is 1 year.
|
|
95
|
+
x_idempotency_expiration: nil,
|
|
55
96
|
request_options: {}
|
|
56
97
|
)
|
|
57
98
|
end
|
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Resources
|
|
5
|
+
# Invoke a stored automation template or an ad hoc automation defined in the
|
|
6
|
+
# request.
|
|
5
7
|
class Automations
|
|
8
|
+
# Invoke a stored automation template or an ad hoc automation defined in the
|
|
9
|
+
# request.
|
|
6
10
|
sig { returns(Courier::Resources::Automations::Invoke) }
|
|
7
11
|
attr_reader :invoke
|
|
8
12
|
|
|
9
|
-
#
|
|
13
|
+
# Lists the workspace's saved automation templates, each with its id and a cursor
|
|
14
|
+
# for paging to the next page of results.
|
|
10
15
|
sig do
|
|
11
16
|
params(
|
|
12
17
|
cursor: String,
|
|
@@ -2,22 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Resources
|
|
5
|
+
# Manage the logos, colors, and layout that give the templates you send a
|
|
6
|
+
# consistent look.
|
|
5
7
|
class Brands
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
+
# Creates a brand from a name and settings, including primary and secondary
|
|
9
|
+
# colors. Brands supply the logo, colors, and styling that templates render with.
|
|
8
10
|
sig do
|
|
9
11
|
params(
|
|
10
12
|
name: String,
|
|
11
13
|
settings: Courier::BrandSettings::OrHash,
|
|
12
14
|
id: T.nilable(String),
|
|
13
15
|
snippets: T.nilable(Courier::BrandSnippets::OrHash),
|
|
16
|
+
idempotency_key: String,
|
|
17
|
+
x_idempotency_expiration: String,
|
|
14
18
|
request_options: Courier::RequestOptions::OrHash
|
|
15
19
|
).returns(Courier::Brand)
|
|
16
20
|
end
|
|
17
|
-
def create(
|
|
21
|
+
def create(
|
|
22
|
+
# Body param
|
|
23
|
+
name:,
|
|
24
|
+
# Body param
|
|
25
|
+
settings:,
|
|
26
|
+
# Body param
|
|
27
|
+
id: nil,
|
|
28
|
+
# Body param
|
|
29
|
+
snippets: nil,
|
|
30
|
+
# Header param: A unique key that makes this request idempotent. If Courier
|
|
31
|
+
# receives another request with the same `Idempotency-Key`, it returns the stored
|
|
32
|
+
# response from the first request without performing the operation again
|
|
33
|
+
# (including the original status code and any error). Use it to safely retry
|
|
34
|
+
# `POST` requests after network failures without risking duplicate sends. The key
|
|
35
|
+
# is scoped to this endpoint.
|
|
36
|
+
idempotency_key: nil,
|
|
37
|
+
# Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
38
|
+
# timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
39
|
+
# `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
40
|
+
# maximum is 1 year.
|
|
41
|
+
x_idempotency_expiration: nil,
|
|
42
|
+
request_options: {}
|
|
43
|
+
)
|
|
18
44
|
end
|
|
19
45
|
|
|
20
|
-
#
|
|
46
|
+
# Returns one brand by id, including its colors, logo and styling settings,
|
|
47
|
+
# Handlebars snippets, and published version.
|
|
21
48
|
sig do
|
|
22
49
|
params(
|
|
23
50
|
brand_id: String,
|
|
@@ -31,7 +58,8 @@ module Courier
|
|
|
31
58
|
)
|
|
32
59
|
end
|
|
33
60
|
|
|
34
|
-
#
|
|
61
|
+
# Replaces a brand with the values you supply, so send the complete settings and
|
|
62
|
+
# snippets rather than only the fields you want changed.
|
|
35
63
|
sig do
|
|
36
64
|
params(
|
|
37
65
|
brand_id: String,
|
|
@@ -52,7 +80,8 @@ module Courier
|
|
|
52
80
|
)
|
|
53
81
|
end
|
|
54
82
|
|
|
55
|
-
#
|
|
83
|
+
# Lists the workspace's brands. Every entry carries its name, styling settings,
|
|
84
|
+
# snippets, and published version.
|
|
56
85
|
sig do
|
|
57
86
|
params(
|
|
58
87
|
cursor: T.nilable(String),
|
|
@@ -66,7 +95,8 @@ module Courier
|
|
|
66
95
|
)
|
|
67
96
|
end
|
|
68
97
|
|
|
69
|
-
#
|
|
98
|
+
# Deletes a brand by id. Reassign any template or tenant that references it before
|
|
99
|
+
# deleting to keep their styling intact.
|
|
70
100
|
sig do
|
|
71
101
|
params(
|
|
72
102
|
brand_id: String,
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Resources
|
|
5
5
|
class Digests
|
|
6
|
+
# Inspect what has accumulated in a digest schedule and release a digest ahead of
|
|
7
|
+
# its next scheduled delivery.
|
|
6
8
|
class Schedules
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
# digest accumulation before the digest is released.
|
|
9
|
+
# Returns the digest instances for a schedule, one per user, with cursor paging.
|
|
10
|
+
# Use it to see what has accumulated before a digest releases.
|
|
10
11
|
sig do
|
|
11
12
|
params(
|
|
12
13
|
schedule_id: String,
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Resources
|
|
5
|
+
# Record an inbound event that triggers the journeys and automations mapped to it.
|
|
5
6
|
class Inbound
|
|
6
|
-
#
|
|
7
|
+
# Records an inbound event that can trigger a journey. Requires an event name, a
|
|
8
|
+
# messageId you generate, a type, and a properties object.
|
|
7
9
|
sig do
|
|
8
10
|
params(
|
|
9
11
|
event: String,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Resources
|
|
5
|
+
class Inbox
|
|
6
|
+
# Manage the messages in a user's in-app inbox.
|
|
7
|
+
class Messages
|
|
8
|
+
# Delete a user's inbox message. The message is removed from every inbox read (it
|
|
9
|
+
# stops appearing in the recipient's Inbox); it can be restored.
|
|
10
|
+
sig do
|
|
11
|
+
params(
|
|
12
|
+
message_id: String,
|
|
13
|
+
request_options: Courier::RequestOptions::OrHash
|
|
14
|
+
).void
|
|
15
|
+
end
|
|
16
|
+
def delete(
|
|
17
|
+
# The message ID of the inbox message to delete.
|
|
18
|
+
message_id,
|
|
19
|
+
request_options: {}
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Restore a previously deleted inbox message.
|
|
24
|
+
sig do
|
|
25
|
+
params(
|
|
26
|
+
message_id: String,
|
|
27
|
+
request_options: Courier::RequestOptions::OrHash
|
|
28
|
+
).void
|
|
29
|
+
end
|
|
30
|
+
def restore(
|
|
31
|
+
# The message ID of the inbox message to restore.
|
|
32
|
+
message_id,
|
|
33
|
+
request_options: {}
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# @api private
|
|
38
|
+
sig { params(client: Courier::Client).returns(T.attached_class) }
|
|
39
|
+
def self.new(client:)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Resources
|
|
5
|
+
class Inbox
|
|
6
|
+
# Manage the messages in a user's in-app inbox.
|
|
7
|
+
sig { returns(Courier::Resources::Inbox::Messages) }
|
|
8
|
+
attr_reader :messages
|
|
9
|
+
|
|
10
|
+
# @api private
|
|
11
|
+
sig { params(client: Courier::Client).returns(T.attached_class) }
|
|
12
|
+
def self.new(client:)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Resources
|
|
5
5
|
class Journeys
|
|
6
|
+
# Build, version, publish, invoke, and cancel multi-step notification workflows,
|
|
7
|
+
# along with the templates scoped to them.
|
|
6
8
|
class Templates
|
|
7
9
|
# Create a notification template scoped to this journey. Defaults to `DRAFT`
|
|
8
10
|
# state; pass `state: "PUBLISHED"` to publish on create.
|
|
@@ -14,23 +16,40 @@ module Courier
|
|
|
14
16
|
Courier::JourneyTemplateCreateRequest::Notification::OrHash,
|
|
15
17
|
provider_key: String,
|
|
16
18
|
state: String,
|
|
19
|
+
idempotency_key: String,
|
|
20
|
+
x_idempotency_expiration: String,
|
|
17
21
|
request_options: Courier::RequestOptions::OrHash
|
|
18
22
|
).returns(Courier::JourneyTemplateGetResponse)
|
|
19
23
|
end
|
|
20
24
|
def create(
|
|
21
|
-
# Journey id
|
|
25
|
+
# Path param: Journey id
|
|
22
26
|
template_id,
|
|
27
|
+
# Body param
|
|
23
28
|
channel:,
|
|
29
|
+
# Body param
|
|
24
30
|
notification:,
|
|
31
|
+
# Body param
|
|
25
32
|
provider_key: nil,
|
|
33
|
+
# Body param
|
|
26
34
|
state: nil,
|
|
35
|
+
# Header param: A unique key that makes this request idempotent. If Courier
|
|
36
|
+
# receives another request with the same `Idempotency-Key`, it returns the stored
|
|
37
|
+
# response from the first request without performing the operation again
|
|
38
|
+
# (including the original status code and any error). Use it to safely retry
|
|
39
|
+
# `POST` requests after network failures without risking duplicate sends. The key
|
|
40
|
+
# is scoped to this endpoint.
|
|
41
|
+
idempotency_key: nil,
|
|
42
|
+
# Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
43
|
+
# timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
44
|
+
# `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
45
|
+
# maximum is 1 year.
|
|
46
|
+
x_idempotency_expiration: nil,
|
|
27
47
|
request_options: {}
|
|
28
48
|
)
|
|
29
49
|
end
|
|
30
50
|
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
# historical version.
|
|
51
|
+
# Returns a journey's own notification template with its name, brand, subscription
|
|
52
|
+
# topic, and content. Defaults to the published version.
|
|
34
53
|
sig do
|
|
35
54
|
params(
|
|
36
55
|
notification_id: String,
|
|
@@ -68,8 +87,8 @@ module Courier
|
|
|
68
87
|
)
|
|
69
88
|
end
|
|
70
89
|
|
|
71
|
-
#
|
|
72
|
-
#
|
|
90
|
+
# Archives one journey's notification template, preventing further sends. Detach
|
|
91
|
+
# any send node referencing it beforehand.
|
|
73
92
|
sig do
|
|
74
93
|
params(
|
|
75
94
|
notification_id: String,
|
|
@@ -86,8 +105,8 @@ module Courier
|
|
|
86
105
|
)
|
|
87
106
|
end
|
|
88
107
|
|
|
89
|
-
#
|
|
90
|
-
#
|
|
108
|
+
# Lists the published versions of a template that belongs to a journey, most
|
|
109
|
+
# recent first. Paged by cursor.
|
|
91
110
|
sig do
|
|
92
111
|
params(
|
|
93
112
|
notification_id: String,
|
|
@@ -104,14 +123,15 @@ module Courier
|
|
|
104
123
|
)
|
|
105
124
|
end
|
|
106
125
|
|
|
107
|
-
#
|
|
108
|
-
#
|
|
109
|
-
# `{ "version": "vN" }`.
|
|
126
|
+
# Publishes a journey-scoped template's draft as a new version. Pass a version
|
|
127
|
+
# instead to roll back the template to an earlier publish.
|
|
110
128
|
sig do
|
|
111
129
|
params(
|
|
112
130
|
notification_id: String,
|
|
113
131
|
template_id: String,
|
|
114
132
|
version: String,
|
|
133
|
+
idempotency_key: String,
|
|
134
|
+
x_idempotency_expiration: String,
|
|
115
135
|
request_options: Courier::RequestOptions::OrHash
|
|
116
136
|
).void
|
|
117
137
|
end
|
|
@@ -122,6 +142,18 @@ module Courier
|
|
|
122
142
|
template_id:,
|
|
123
143
|
# Body param
|
|
124
144
|
version: nil,
|
|
145
|
+
# Header param: A unique key that makes this request idempotent. If Courier
|
|
146
|
+
# receives another request with the same `Idempotency-Key`, it returns the stored
|
|
147
|
+
# response from the first request without performing the operation again
|
|
148
|
+
# (including the original status code and any error). Use it to safely retry
|
|
149
|
+
# `POST` requests after network failures without risking duplicate sends. The key
|
|
150
|
+
# is scoped to this endpoint.
|
|
151
|
+
idempotency_key: nil,
|
|
152
|
+
# Header param: How long the idempotency key remains valid, as a Unix epoch
|
|
153
|
+
# timestamp in seconds or an ISO 8601 date string. Only applies when
|
|
154
|
+
# `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
|
|
155
|
+
# maximum is 1 year.
|
|
156
|
+
x_idempotency_expiration: nil,
|
|
125
157
|
request_options: {}
|
|
126
158
|
)
|
|
127
159
|
end
|
|
@@ -179,7 +211,8 @@ module Courier
|
|
|
179
211
|
)
|
|
180
212
|
end
|
|
181
213
|
|
|
182
|
-
#
|
|
214
|
+
# Replaces the draft content of one journey's notification template. Publish it
|
|
215
|
+
# before send nodes referencing it render the change.
|
|
183
216
|
sig do
|
|
184
217
|
params(
|
|
185
218
|
notification_id: String,
|
|
@@ -203,11 +236,8 @@ module Courier
|
|
|
203
236
|
)
|
|
204
237
|
end
|
|
205
238
|
|
|
206
|
-
#
|
|
207
|
-
#
|
|
208
|
-
# which can be used to detect changes between versions. Pass `?version=draft`
|
|
209
|
-
# (default `published`) to retrieve the working draft, or `?version=vN` for a
|
|
210
|
-
# historical version.
|
|
239
|
+
# Returns the Elemental elements and version of a journey-scoped template's
|
|
240
|
+
# content. Compare versions to see what changed between publishes.
|
|
211
241
|
sig do
|
|
212
242
|
params(
|
|
213
243
|
notification_id: String,
|