trycourier 4.10.1 → 4.11.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 +30 -0
- data/lib/courier/client.rb +15 -1
- data/lib/courier/internal/transport/base_client.rb +2 -0
- data/lib/courier/models/create_journey_request.rb +39 -0
- data/lib/courier/models/journey_ai_node.rb +77 -0
- data/lib/courier/models/journey_api_invoke_trigger_node.rb +73 -0
- data/lib/courier/models/journey_archive_params.rb +20 -0
- data/lib/courier/models/journey_condition_atom.rb +8 -0
- data/lib/courier/models/journey_condition_group.rb +26 -0
- data/lib/courier/models/journey_condition_nested_group.rb +24 -0
- data/lib/courier/models/journey_conditions_field.rb +37 -0
- data/lib/courier/models/journey_create_params.rb +14 -0
- data/lib/courier/models/journey_delay_duration_node.rb +71 -0
- data/lib/courier/models/journey_delay_until_node.rb +71 -0
- data/lib/courier/models/journey_exit_node.rb +33 -0
- data/lib/courier/models/journey_fetch_get_delete_node.rb +103 -0
- data/lib/courier/models/journey_fetch_post_put_node.rb +110 -0
- data/lib/courier/models/journey_list_versions_params.rb +20 -0
- data/lib/courier/models/journey_merge_strategy.rb +18 -0
- data/lib/courier/models/journey_node.rb +139 -0
- data/lib/courier/models/journey_publish_params.rb +20 -0
- data/lib/courier/models/journey_publish_request.rb +18 -0
- data/lib/courier/models/journey_replace_params.rb +20 -0
- data/lib/courier/models/journey_response.rb +82 -0
- data/lib/courier/models/journey_retrieve_params.rb +29 -0
- data/lib/courier/models/journey_segment_trigger_node.rb +90 -0
- data/lib/courier/models/journey_send_node.rb +124 -0
- data/lib/courier/models/journey_state.rb +16 -0
- data/lib/courier/models/journey_template_create_request.rb +138 -0
- data/lib/courier/models/journey_template_get_response.rb +154 -0
- data/lib/courier/models/journey_template_list_response.rb +23 -0
- data/lib/courier/models/journey_template_publish_request.rb +18 -0
- data/lib/courier/models/journey_template_replace_request.rb +126 -0
- data/lib/courier/models/journey_template_summary.rb +60 -0
- data/lib/courier/models/journey_throttle_dynamic_node.rb +86 -0
- data/lib/courier/models/journey_throttle_static_node.rb +80 -0
- data/lib/courier/models/journey_version_item.rb +41 -0
- data/lib/courier/models/journey_versions_list_response.rb +24 -0
- data/lib/courier/models/journeys/template_archive_params.rb +28 -0
- data/lib/courier/models/journeys/template_create_params.rb +22 -0
- data/lib/courier/models/journeys/template_list_params.rb +39 -0
- data/lib/courier/models/journeys/template_list_versions_params.rb +28 -0
- data/lib/courier/models/journeys/template_publish_params.rb +28 -0
- data/lib/courier/models/journeys/template_replace_params.rb +28 -0
- data/lib/courier/models/journeys/template_retrieve_params.rb +28 -0
- data/lib/courier/models/notification_list_response.rb +8 -8
- data/lib/courier/models/notification_template_create_request.rb +3 -3
- data/lib/courier/models/notification_template_payload.rb +2 -2
- data/lib/courier/models/notification_template_response.rb +71 -0
- data/lib/courier/models/notification_template_update_request.rb +3 -3
- data/lib/courier/models/tenants/template_delete_params.rb +28 -0
- data/lib/courier/models.rb +75 -2
- data/lib/courier/resources/journeys/templates.rb +224 -0
- data/lib/courier/resources/journeys.rb +167 -2
- data/lib/courier/resources/notifications/checks.rb +16 -6
- data/lib/courier/resources/notifications.rb +8 -8
- data/lib/courier/resources/tenants/templates.rb +32 -0
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +45 -1
- data/rbi/courier/models/create_journey_request.rbi +113 -0
- data/rbi/courier/models/journey_ai_node.rbi +141 -0
- data/rbi/courier/models/journey_api_invoke_trigger_node.rbi +164 -0
- data/rbi/courier/models/journey_archive_params.rbi +35 -0
- data/rbi/courier/models/journey_condition_atom.rbi +11 -0
- data/rbi/courier/models/journey_condition_group.rbi +43 -0
- data/rbi/courier/models/journey_condition_nested_group.rbi +51 -0
- data/rbi/courier/models/journey_conditions_field.rbi +27 -0
- data/rbi/courier/models/journey_create_params.rbi +27 -0
- data/rbi/courier/models/journey_delay_duration_node.rbi +146 -0
- data/rbi/courier/models/journey_delay_until_node.rbi +139 -0
- data/rbi/courier/models/journey_exit_node.rbi +57 -0
- data/rbi/courier/models/journey_fetch_get_delete_node.rbi +186 -0
- data/rbi/courier/models/journey_fetch_post_put_node.rbi +190 -0
- data/rbi/courier/models/journey_list_versions_params.rbi +35 -0
- data/rbi/courier/models/journey_merge_strategy.rbi +26 -0
- data/rbi/courier/models/journey_node.rbi +227 -0
- data/rbi/courier/models/journey_publish_params.rbi +35 -0
- data/rbi/courier/models/journey_publish_request.rbi +28 -0
- data/rbi/courier/models/journey_replace_params.rbi +35 -0
- data/rbi/courier/models/journey_response.rbi +108 -0
- data/rbi/courier/models/journey_retrieve_params.rbi +52 -0
- data/rbi/courier/models/journey_segment_trigger_node.rbi +200 -0
- data/rbi/courier/models/journey_send_node.rbi +254 -0
- data/rbi/courier/models/journey_state.rbi +20 -0
- data/rbi/courier/models/journey_template_create_request.rbi +381 -0
- data/rbi/courier/models/journey_template_get_response.rbi +334 -0
- data/rbi/courier/models/journey_template_list_response.rbi +45 -0
- data/rbi/courier/models/journey_template_publish_request.rbi +31 -0
- data/rbi/courier/models/journey_template_replace_request.rbi +368 -0
- data/rbi/courier/models/journey_template_summary.rbi +85 -0
- data/rbi/courier/models/journey_throttle_dynamic_node.rbi +162 -0
- data/rbi/courier/models/journey_throttle_static_node.rbi +158 -0
- data/rbi/courier/models/journey_version_item.rbi +54 -0
- data/rbi/courier/models/journey_versions_list_response.rbi +45 -0
- data/rbi/courier/models/journeys/template_archive_params.rbi +48 -0
- data/rbi/courier/models/journeys/template_create_params.rbi +40 -0
- data/rbi/courier/models/journeys/template_list_params.rbi +68 -0
- data/rbi/courier/models/journeys/template_list_versions_params.rbi +48 -0
- data/rbi/courier/models/journeys/template_publish_params.rbi +48 -0
- data/rbi/courier/models/journeys/template_replace_params.rbi +48 -0
- data/rbi/courier/models/journeys/template_retrieve_params.rbi +48 -0
- data/rbi/courier/models/notification_list_response.rbi +9 -6
- data/rbi/courier/models/notification_template_create_request.rbi +4 -4
- data/rbi/courier/models/notification_template_payload.rbi +2 -2
- data/rbi/courier/models/notification_template_response.rbi +120 -0
- data/rbi/courier/models/notification_template_update_request.rbi +4 -4
- data/rbi/courier/models/tenants/template_delete_params.rbi +48 -0
- data/rbi/courier/models.rbi +78 -3
- data/rbi/courier/resources/journeys/templates.rbi +160 -0
- data/rbi/courier/resources/journeys.rbi +156 -3
- data/rbi/courier/resources/notifications/checks.rbi +19 -4
- data/rbi/courier/resources/notifications.rbi +7 -7
- data/rbi/courier/resources/tenants/templates.rbi +22 -0
- data/sig/courier/models/create_journey_request.rbs +41 -0
- data/sig/courier/models/journey_ai_node.rbs +72 -0
- data/sig/courier/models/journey_api_invoke_trigger_node.rbs +68 -0
- data/sig/courier/models/journey_archive_params.rbs +23 -0
- data/sig/courier/models/journey_condition_atom.rbs +7 -0
- data/sig/courier/models/journey_condition_group.rbs +33 -0
- data/sig/courier/models/journey_condition_nested_group.rbs +33 -0
- data/sig/courier/models/journey_conditions_field.rbs +14 -0
- data/sig/courier/models/journey_create_params.rbs +15 -0
- data/sig/courier/models/journey_delay_duration_node.rbs +66 -0
- data/sig/courier/models/journey_delay_until_node.rbs +66 -0
- data/sig/courier/models/journey_exit_node.rbs +34 -0
- data/sig/courier/models/journey_fetch_get_delete_node.rbs +93 -0
- data/sig/courier/models/journey_fetch_post_put_node.rbs +100 -0
- data/sig/courier/models/journey_list_versions_params.rbs +23 -0
- data/sig/courier/models/journey_merge_strategy.rbs +16 -0
- data/sig/courier/models/journey_node.rbs +117 -0
- data/sig/courier/models/journey_publish_params.rbs +25 -0
- data/sig/courier/models/journey_publish_request.rbs +15 -0
- data/sig/courier/models/journey_replace_params.rbs +25 -0
- data/sig/courier/models/journey_response.rbs +65 -0
- data/sig/courier/models/journey_retrieve_params.rbs +30 -0
- data/sig/courier/models/journey_segment_trigger_node.rbs +85 -0
- data/sig/courier/models/journey_send_node.rbs +140 -0
- data/sig/courier/models/journey_state.rbs +14 -0
- data/sig/courier/models/journey_template_create_request.rbs +148 -0
- data/sig/courier/models/journey_template_get_response.rbs +157 -0
- data/sig/courier/models/journey_template_list_response.rbs +25 -0
- data/sig/courier/models/journey_template_publish_request.rbs +15 -0
- data/sig/courier/models/journey_template_replace_request.rbs +136 -0
- data/sig/courier/models/journey_template_summary.rbs +59 -0
- data/sig/courier/models/journey_throttle_dynamic_node.rbs +76 -0
- data/sig/courier/models/journey_throttle_static_node.rbs +72 -0
- data/sig/courier/models/journey_version_item.rbs +40 -0
- data/sig/courier/models/journey_versions_list_response.rbs +22 -0
- data/sig/courier/models/journeys/template_archive_params.rbs +30 -0
- data/sig/courier/models/journeys/template_create_params.rbs +27 -0
- data/sig/courier/models/journeys/template_list_params.rbs +38 -0
- data/sig/courier/models/journeys/template_list_versions_params.rbs +30 -0
- data/sig/courier/models/journeys/template_publish_params.rbs +34 -0
- data/sig/courier/models/journeys/template_replace_params.rbs +34 -0
- data/sig/courier/models/journeys/template_retrieve_params.rbs +30 -0
- data/sig/courier/models/notification_list_response.rbs +7 -5
- data/sig/courier/models/notification_template_response.rbs +70 -0
- data/sig/courier/models/tenants/template_delete_params.rbs +30 -0
- data/sig/courier/models.rbs +74 -2
- data/sig/courier/resources/journeys/templates.rbs +58 -0
- data/sig/courier/resources/journeys.rbs +41 -0
- data/sig/courier/resources/notifications.rbs +3 -3
- data/sig/courier/resources/tenants/templates.rbs +6 -0
- metadata +137 -5
- data/lib/courier/models/notification_template_get_response.rb +0 -92
- data/rbi/courier/models/notification_template_get_response.rbi +0 -162
- data/sig/courier/models/notification_template_get_response.rbs +0 -72
data/lib/courier/version.rb
CHANGED
data/lib/courier.rb
CHANGED
|
@@ -58,7 +58,12 @@ require_relative "courier/models/inbound_bulk_message_user"
|
|
|
58
58
|
require_relative "courier/models/base_check"
|
|
59
59
|
require_relative "courier/models/subscription_topic_new"
|
|
60
60
|
require_relative "courier/models/elemental_channel_node"
|
|
61
|
+
require_relative "courier/models/create_journey_request"
|
|
61
62
|
require_relative "courier/models/journeys_invoke_request"
|
|
63
|
+
require_relative "courier/models/journey_publish_request"
|
|
64
|
+
require_relative "courier/models/journey_template_create_request"
|
|
65
|
+
require_relative "courier/models/journey_template_publish_request"
|
|
66
|
+
require_relative "courier/models/journey_template_replace_request"
|
|
62
67
|
require_relative "courier/models/message_details"
|
|
63
68
|
require_relative "courier/models/notification_template_create_request"
|
|
64
69
|
require_relative "courier/models/notification_template_publish_request"
|
|
@@ -154,10 +159,47 @@ require_relative "courier/models/inbound_track_event_response"
|
|
|
154
159
|
require_relative "courier/models/intercom"
|
|
155
160
|
require_relative "courier/models/intercom_recipient"
|
|
156
161
|
require_relative "courier/models/journey"
|
|
162
|
+
require_relative "courier/models/journey_ai_node"
|
|
163
|
+
require_relative "courier/models/journey_api_invoke_trigger_node"
|
|
164
|
+
require_relative "courier/models/journey_archive_params"
|
|
165
|
+
require_relative "courier/models/journey_condition_atom"
|
|
166
|
+
require_relative "courier/models/journey_condition_group"
|
|
167
|
+
require_relative "courier/models/journey_condition_nested_group"
|
|
168
|
+
require_relative "courier/models/journey_conditions_field"
|
|
169
|
+
require_relative "courier/models/journey_create_params"
|
|
170
|
+
require_relative "courier/models/journey_delay_duration_node"
|
|
171
|
+
require_relative "courier/models/journey_delay_until_node"
|
|
172
|
+
require_relative "courier/models/journey_exit_node"
|
|
173
|
+
require_relative "courier/models/journey_fetch_get_delete_node"
|
|
174
|
+
require_relative "courier/models/journey_fetch_post_put_node"
|
|
157
175
|
require_relative "courier/models/journey_invoke_params"
|
|
158
176
|
require_relative "courier/models/journey_list_params"
|
|
177
|
+
require_relative "courier/models/journey_list_versions_params"
|
|
178
|
+
require_relative "courier/models/journey_merge_strategy"
|
|
179
|
+
require_relative "courier/models/journey_node"
|
|
180
|
+
require_relative "courier/models/journey_publish_params"
|
|
181
|
+
require_relative "courier/models/journey_replace_params"
|
|
182
|
+
require_relative "courier/models/journey_response"
|
|
183
|
+
require_relative "courier/models/journey_retrieve_params"
|
|
184
|
+
require_relative "courier/models/journeys/template_archive_params"
|
|
185
|
+
require_relative "courier/models/journeys/template_create_params"
|
|
186
|
+
require_relative "courier/models/journeys/template_list_params"
|
|
187
|
+
require_relative "courier/models/journeys/template_list_versions_params"
|
|
188
|
+
require_relative "courier/models/journeys/template_publish_params"
|
|
189
|
+
require_relative "courier/models/journeys/template_replace_params"
|
|
190
|
+
require_relative "courier/models/journeys/template_retrieve_params"
|
|
191
|
+
require_relative "courier/models/journey_segment_trigger_node"
|
|
192
|
+
require_relative "courier/models/journey_send_node"
|
|
159
193
|
require_relative "courier/models/journeys_invoke_response"
|
|
160
194
|
require_relative "courier/models/journeys_list_response"
|
|
195
|
+
require_relative "courier/models/journey_state"
|
|
196
|
+
require_relative "courier/models/journey_template_get_response"
|
|
197
|
+
require_relative "courier/models/journey_template_list_response"
|
|
198
|
+
require_relative "courier/models/journey_template_summary"
|
|
199
|
+
require_relative "courier/models/journey_throttle_dynamic_node"
|
|
200
|
+
require_relative "courier/models/journey_throttle_static_node"
|
|
201
|
+
require_relative "courier/models/journey_version_item"
|
|
202
|
+
require_relative "courier/models/journey_versions_list_response"
|
|
161
203
|
require_relative "courier/models/list_delete_params"
|
|
162
204
|
require_relative "courier/models/list_filter"
|
|
163
205
|
require_relative "courier/models/list_list_params"
|
|
@@ -216,7 +258,7 @@ require_relative "courier/models/notifications/check_list_params"
|
|
|
216
258
|
require_relative "courier/models/notifications/check_list_response"
|
|
217
259
|
require_relative "courier/models/notifications/check_update_params"
|
|
218
260
|
require_relative "courier/models/notifications/check_update_response"
|
|
219
|
-
require_relative "courier/models/
|
|
261
|
+
require_relative "courier/models/notification_template_response"
|
|
220
262
|
require_relative "courier/models/notification_template_state"
|
|
221
263
|
require_relative "courier/models/notification_template_summary"
|
|
222
264
|
require_relative "courier/models/notification_template_version_list_response"
|
|
@@ -291,6 +333,7 @@ require_relative "courier/models/tenant_list_users_response"
|
|
|
291
333
|
require_relative "courier/models/tenant_retrieve_params"
|
|
292
334
|
require_relative "courier/models/tenants/preferences/item_delete_params"
|
|
293
335
|
require_relative "courier/models/tenants/preferences/item_update_params"
|
|
336
|
+
require_relative "courier/models/tenants/template_delete_params"
|
|
294
337
|
require_relative "courier/models/tenants/template_list_params"
|
|
295
338
|
require_relative "courier/models/tenants/template_list_response"
|
|
296
339
|
require_relative "courier/models/tenants/template_publish_params"
|
|
@@ -348,6 +391,7 @@ require_relative "courier/resources/brands"
|
|
|
348
391
|
require_relative "courier/resources/bulk"
|
|
349
392
|
require_relative "courier/resources/inbound"
|
|
350
393
|
require_relative "courier/resources/journeys"
|
|
394
|
+
require_relative "courier/resources/journeys/templates"
|
|
351
395
|
require_relative "courier/resources/lists"
|
|
352
396
|
require_relative "courier/resources/lists/subscriptions"
|
|
353
397
|
require_relative "courier/resources/messages"
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class CreateJourneyRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::CreateJourneyRequest, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(String) }
|
|
12
|
+
attr_accessor :name
|
|
13
|
+
|
|
14
|
+
sig do
|
|
15
|
+
returns(
|
|
16
|
+
T::Array[
|
|
17
|
+
T.any(
|
|
18
|
+
Courier::JourneyAPIInvokeTriggerNode,
|
|
19
|
+
Courier::JourneySegmentTriggerNode,
|
|
20
|
+
Courier::JourneySendNode,
|
|
21
|
+
Courier::JourneyDelayDurationNode,
|
|
22
|
+
Courier::JourneyDelayUntilNode,
|
|
23
|
+
Courier::JourneyFetchGetDeleteNode,
|
|
24
|
+
Courier::JourneyFetchPostPutNode,
|
|
25
|
+
Courier::JourneyAINode,
|
|
26
|
+
Courier::JourneyThrottleStaticNode,
|
|
27
|
+
Courier::JourneyThrottleDynamicNode,
|
|
28
|
+
Courier::JourneyExitNode,
|
|
29
|
+
Courier::JourneyNode::JourneyBranchNode
|
|
30
|
+
)
|
|
31
|
+
]
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
attr_accessor :nodes
|
|
35
|
+
|
|
36
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
37
|
+
attr_reader :enabled
|
|
38
|
+
|
|
39
|
+
sig { params(enabled: T::Boolean).void }
|
|
40
|
+
attr_writer :enabled
|
|
41
|
+
|
|
42
|
+
# Lifecycle state of a journey.
|
|
43
|
+
sig { returns(T.nilable(Courier::JourneyState::OrSymbol)) }
|
|
44
|
+
attr_reader :state
|
|
45
|
+
|
|
46
|
+
sig { params(state: Courier::JourneyState::OrSymbol).void }
|
|
47
|
+
attr_writer :state
|
|
48
|
+
|
|
49
|
+
# Request body for creating a journey.
|
|
50
|
+
sig do
|
|
51
|
+
params(
|
|
52
|
+
name: String,
|
|
53
|
+
nodes:
|
|
54
|
+
T::Array[
|
|
55
|
+
T.any(
|
|
56
|
+
Courier::JourneyAPIInvokeTriggerNode::OrHash,
|
|
57
|
+
Courier::JourneySegmentTriggerNode::OrHash,
|
|
58
|
+
Courier::JourneySendNode::OrHash,
|
|
59
|
+
Courier::JourneyDelayDurationNode::OrHash,
|
|
60
|
+
Courier::JourneyDelayUntilNode::OrHash,
|
|
61
|
+
Courier::JourneyFetchGetDeleteNode::OrHash,
|
|
62
|
+
Courier::JourneyFetchPostPutNode::OrHash,
|
|
63
|
+
Courier::JourneyAINode::OrHash,
|
|
64
|
+
Courier::JourneyThrottleStaticNode::OrHash,
|
|
65
|
+
Courier::JourneyThrottleDynamicNode::OrHash,
|
|
66
|
+
Courier::JourneyExitNode::OrHash,
|
|
67
|
+
Courier::JourneyNode::JourneyBranchNode::OrHash
|
|
68
|
+
)
|
|
69
|
+
],
|
|
70
|
+
enabled: T::Boolean,
|
|
71
|
+
state: Courier::JourneyState::OrSymbol
|
|
72
|
+
).returns(T.attached_class)
|
|
73
|
+
end
|
|
74
|
+
def self.new(
|
|
75
|
+
name:,
|
|
76
|
+
nodes:,
|
|
77
|
+
enabled: nil,
|
|
78
|
+
# Lifecycle state of a journey.
|
|
79
|
+
state: nil
|
|
80
|
+
)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
sig do
|
|
84
|
+
override.returns(
|
|
85
|
+
{
|
|
86
|
+
name: String,
|
|
87
|
+
nodes:
|
|
88
|
+
T::Array[
|
|
89
|
+
T.any(
|
|
90
|
+
Courier::JourneyAPIInvokeTriggerNode,
|
|
91
|
+
Courier::JourneySegmentTriggerNode,
|
|
92
|
+
Courier::JourneySendNode,
|
|
93
|
+
Courier::JourneyDelayDurationNode,
|
|
94
|
+
Courier::JourneyDelayUntilNode,
|
|
95
|
+
Courier::JourneyFetchGetDeleteNode,
|
|
96
|
+
Courier::JourneyFetchPostPutNode,
|
|
97
|
+
Courier::JourneyAINode,
|
|
98
|
+
Courier::JourneyThrottleStaticNode,
|
|
99
|
+
Courier::JourneyThrottleDynamicNode,
|
|
100
|
+
Courier::JourneyExitNode,
|
|
101
|
+
Courier::JourneyNode::JourneyBranchNode
|
|
102
|
+
)
|
|
103
|
+
],
|
|
104
|
+
enabled: T::Boolean,
|
|
105
|
+
state: Courier::JourneyState::OrSymbol
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
def to_hash
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyAINode < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::JourneyAINode, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
|
|
12
|
+
sig { returns(T::Hash[Symbol, T.anything]) }
|
|
13
|
+
attr_accessor :output_schema
|
|
14
|
+
|
|
15
|
+
sig { returns(Courier::JourneyAINode::Type::OrSymbol) }
|
|
16
|
+
attr_accessor :type
|
|
17
|
+
|
|
18
|
+
sig { returns(T.nilable(String)) }
|
|
19
|
+
attr_reader :id
|
|
20
|
+
|
|
21
|
+
sig { params(id: String).void }
|
|
22
|
+
attr_writer :id
|
|
23
|
+
|
|
24
|
+
# Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
25
|
+
# group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
26
|
+
# express "no conditions".
|
|
27
|
+
sig do
|
|
28
|
+
returns(
|
|
29
|
+
T.nilable(
|
|
30
|
+
T.any(
|
|
31
|
+
T::Array[String],
|
|
32
|
+
Courier::JourneyConditionGroup,
|
|
33
|
+
Courier::JourneyConditionNestedGroup
|
|
34
|
+
)
|
|
35
|
+
)
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
attr_reader :conditions
|
|
39
|
+
|
|
40
|
+
sig do
|
|
41
|
+
params(
|
|
42
|
+
conditions:
|
|
43
|
+
T.any(
|
|
44
|
+
T::Array[String],
|
|
45
|
+
Courier::JourneyConditionGroup::OrHash,
|
|
46
|
+
Courier::JourneyConditionNestedGroup::OrHash
|
|
47
|
+
)
|
|
48
|
+
).void
|
|
49
|
+
end
|
|
50
|
+
attr_writer :conditions
|
|
51
|
+
|
|
52
|
+
sig { returns(T.nilable(String)) }
|
|
53
|
+
attr_reader :model
|
|
54
|
+
|
|
55
|
+
sig { params(model: String).void }
|
|
56
|
+
attr_writer :model
|
|
57
|
+
|
|
58
|
+
sig { returns(T.nilable(String)) }
|
|
59
|
+
attr_reader :user_prompt
|
|
60
|
+
|
|
61
|
+
sig { params(user_prompt: String).void }
|
|
62
|
+
attr_writer :user_prompt
|
|
63
|
+
|
|
64
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
65
|
+
attr_reader :web_search
|
|
66
|
+
|
|
67
|
+
sig { params(web_search: T::Boolean).void }
|
|
68
|
+
attr_writer :web_search
|
|
69
|
+
|
|
70
|
+
# Invoke an AI step with `user_prompt` and optional `web_search`. Returns a
|
|
71
|
+
# structured response conforming to `output_schema`.
|
|
72
|
+
sig do
|
|
73
|
+
params(
|
|
74
|
+
output_schema: T::Hash[Symbol, T.anything],
|
|
75
|
+
type: Courier::JourneyAINode::Type::OrSymbol,
|
|
76
|
+
id: String,
|
|
77
|
+
conditions:
|
|
78
|
+
T.any(
|
|
79
|
+
T::Array[String],
|
|
80
|
+
Courier::JourneyConditionGroup::OrHash,
|
|
81
|
+
Courier::JourneyConditionNestedGroup::OrHash
|
|
82
|
+
),
|
|
83
|
+
model: String,
|
|
84
|
+
user_prompt: String,
|
|
85
|
+
web_search: T::Boolean
|
|
86
|
+
).returns(T.attached_class)
|
|
87
|
+
end
|
|
88
|
+
def self.new(
|
|
89
|
+
# A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
|
|
90
|
+
output_schema:,
|
|
91
|
+
type:,
|
|
92
|
+
id: nil,
|
|
93
|
+
# Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
94
|
+
# group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
95
|
+
# express "no conditions".
|
|
96
|
+
conditions: nil,
|
|
97
|
+
model: nil,
|
|
98
|
+
user_prompt: nil,
|
|
99
|
+
web_search: nil
|
|
100
|
+
)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
sig do
|
|
104
|
+
override.returns(
|
|
105
|
+
{
|
|
106
|
+
output_schema: T::Hash[Symbol, T.anything],
|
|
107
|
+
type: Courier::JourneyAINode::Type::OrSymbol,
|
|
108
|
+
id: String,
|
|
109
|
+
conditions:
|
|
110
|
+
T.any(
|
|
111
|
+
T::Array[String],
|
|
112
|
+
Courier::JourneyConditionGroup,
|
|
113
|
+
Courier::JourneyConditionNestedGroup
|
|
114
|
+
),
|
|
115
|
+
model: String,
|
|
116
|
+
user_prompt: String,
|
|
117
|
+
web_search: T::Boolean
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
end
|
|
121
|
+
def to_hash
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
module Type
|
|
125
|
+
extend Courier::Internal::Type::Enum
|
|
126
|
+
|
|
127
|
+
TaggedSymbol =
|
|
128
|
+
T.type_alias { T.all(Symbol, Courier::JourneyAINode::Type) }
|
|
129
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
130
|
+
|
|
131
|
+
AI = T.let(:ai, Courier::JourneyAINode::Type::TaggedSymbol)
|
|
132
|
+
|
|
133
|
+
sig do
|
|
134
|
+
override.returns(T::Array[Courier::JourneyAINode::Type::TaggedSymbol])
|
|
135
|
+
end
|
|
136
|
+
def self.values
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyAPIInvokeTriggerNode < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::JourneyAPIInvokeTriggerNode,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig do
|
|
15
|
+
returns(Courier::JourneyAPIInvokeTriggerNode::TriggerType::OrSymbol)
|
|
16
|
+
end
|
|
17
|
+
attr_accessor :trigger_type
|
|
18
|
+
|
|
19
|
+
sig { returns(Courier::JourneyAPIInvokeTriggerNode::Type::OrSymbol) }
|
|
20
|
+
attr_accessor :type
|
|
21
|
+
|
|
22
|
+
sig { returns(T.nilable(String)) }
|
|
23
|
+
attr_reader :id
|
|
24
|
+
|
|
25
|
+
sig { params(id: String).void }
|
|
26
|
+
attr_writer :id
|
|
27
|
+
|
|
28
|
+
# Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
29
|
+
# group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
30
|
+
# express "no conditions".
|
|
31
|
+
sig do
|
|
32
|
+
returns(
|
|
33
|
+
T.nilable(
|
|
34
|
+
T.any(
|
|
35
|
+
T::Array[String],
|
|
36
|
+
Courier::JourneyConditionGroup,
|
|
37
|
+
Courier::JourneyConditionNestedGroup
|
|
38
|
+
)
|
|
39
|
+
)
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
attr_reader :conditions
|
|
43
|
+
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
conditions:
|
|
47
|
+
T.any(
|
|
48
|
+
T::Array[String],
|
|
49
|
+
Courier::JourneyConditionGroup::OrHash,
|
|
50
|
+
Courier::JourneyConditionNestedGroup::OrHash
|
|
51
|
+
)
|
|
52
|
+
).void
|
|
53
|
+
end
|
|
54
|
+
attr_writer :conditions
|
|
55
|
+
|
|
56
|
+
# A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
|
|
57
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
58
|
+
attr_reader :schema
|
|
59
|
+
|
|
60
|
+
sig { params(schema: T::Hash[Symbol, T.anything]).void }
|
|
61
|
+
attr_writer :schema
|
|
62
|
+
|
|
63
|
+
# Trigger fired when the journey is invoked via the API. The optional `schema`
|
|
64
|
+
# field is a JSON Schema that validates the invocation payload.
|
|
65
|
+
sig do
|
|
66
|
+
params(
|
|
67
|
+
trigger_type:
|
|
68
|
+
Courier::JourneyAPIInvokeTriggerNode::TriggerType::OrSymbol,
|
|
69
|
+
type: Courier::JourneyAPIInvokeTriggerNode::Type::OrSymbol,
|
|
70
|
+
id: String,
|
|
71
|
+
conditions:
|
|
72
|
+
T.any(
|
|
73
|
+
T::Array[String],
|
|
74
|
+
Courier::JourneyConditionGroup::OrHash,
|
|
75
|
+
Courier::JourneyConditionNestedGroup::OrHash
|
|
76
|
+
),
|
|
77
|
+
schema: T::Hash[Symbol, T.anything]
|
|
78
|
+
).returns(T.attached_class)
|
|
79
|
+
end
|
|
80
|
+
def self.new(
|
|
81
|
+
trigger_type:,
|
|
82
|
+
type:,
|
|
83
|
+
id: nil,
|
|
84
|
+
# Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
85
|
+
# group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
86
|
+
# express "no conditions".
|
|
87
|
+
conditions: nil,
|
|
88
|
+
# A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
|
|
89
|
+
schema: nil
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
sig do
|
|
94
|
+
override.returns(
|
|
95
|
+
{
|
|
96
|
+
trigger_type:
|
|
97
|
+
Courier::JourneyAPIInvokeTriggerNode::TriggerType::OrSymbol,
|
|
98
|
+
type: Courier::JourneyAPIInvokeTriggerNode::Type::OrSymbol,
|
|
99
|
+
id: String,
|
|
100
|
+
conditions:
|
|
101
|
+
T.any(
|
|
102
|
+
T::Array[String],
|
|
103
|
+
Courier::JourneyConditionGroup,
|
|
104
|
+
Courier::JourneyConditionNestedGroup
|
|
105
|
+
),
|
|
106
|
+
schema: T::Hash[Symbol, T.anything]
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
def to_hash
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
module TriggerType
|
|
114
|
+
extend Courier::Internal::Type::Enum
|
|
115
|
+
|
|
116
|
+
TaggedSymbol =
|
|
117
|
+
T.type_alias do
|
|
118
|
+
T.all(Symbol, Courier::JourneyAPIInvokeTriggerNode::TriggerType)
|
|
119
|
+
end
|
|
120
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
121
|
+
|
|
122
|
+
API_INVOKE =
|
|
123
|
+
T.let(
|
|
124
|
+
:"api-invoke",
|
|
125
|
+
Courier::JourneyAPIInvokeTriggerNode::TriggerType::TaggedSymbol
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
sig do
|
|
129
|
+
override.returns(
|
|
130
|
+
T::Array[
|
|
131
|
+
Courier::JourneyAPIInvokeTriggerNode::TriggerType::TaggedSymbol
|
|
132
|
+
]
|
|
133
|
+
)
|
|
134
|
+
end
|
|
135
|
+
def self.values
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
module Type
|
|
140
|
+
extend Courier::Internal::Type::Enum
|
|
141
|
+
|
|
142
|
+
TaggedSymbol =
|
|
143
|
+
T.type_alias do
|
|
144
|
+
T.all(Symbol, Courier::JourneyAPIInvokeTriggerNode::Type)
|
|
145
|
+
end
|
|
146
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
147
|
+
|
|
148
|
+
TRIGGER =
|
|
149
|
+
T.let(
|
|
150
|
+
:trigger,
|
|
151
|
+
Courier::JourneyAPIInvokeTriggerNode::Type::TaggedSymbol
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
sig do
|
|
155
|
+
override.returns(
|
|
156
|
+
T::Array[Courier::JourneyAPIInvokeTriggerNode::Type::TaggedSymbol]
|
|
157
|
+
)
|
|
158
|
+
end
|
|
159
|
+
def self.values
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyArchiveParams < Courier::Internal::Type::BaseModel
|
|
6
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Courier::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Courier::JourneyArchiveParams, Courier::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :template_id
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(
|
|
19
|
+
template_id: String,
|
|
20
|
+
request_options: Courier::RequestOptions::OrHash
|
|
21
|
+
).returns(T.attached_class)
|
|
22
|
+
end
|
|
23
|
+
def self.new(template_id:, request_options: {})
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
override.returns(
|
|
28
|
+
{ template_id: String, request_options: Courier::RequestOptions }
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
def to_hash
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyConditionGroup < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::JourneyConditionGroup, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(T.nilable(T::Array[T::Array[String]])) }
|
|
12
|
+
attr_reader :and_
|
|
13
|
+
|
|
14
|
+
sig { params(and_: T::Array[T::Array[String]]).void }
|
|
15
|
+
attr_writer :and_
|
|
16
|
+
|
|
17
|
+
sig { returns(T.nilable(T::Array[T::Array[String]])) }
|
|
18
|
+
attr_reader :or_
|
|
19
|
+
|
|
20
|
+
sig { params(or_: T::Array[T::Array[String]]).void }
|
|
21
|
+
attr_writer :or_
|
|
22
|
+
|
|
23
|
+
# A leaf condition group. Exactly one of `AND` or `OR` must be present at runtime;
|
|
24
|
+
# each is a list of `JourneyConditionAtom` tuples.
|
|
25
|
+
sig do
|
|
26
|
+
params(
|
|
27
|
+
and_: T::Array[T::Array[String]],
|
|
28
|
+
or_: T::Array[T::Array[String]]
|
|
29
|
+
).returns(T.attached_class)
|
|
30
|
+
end
|
|
31
|
+
def self.new(and_: nil, or_: nil)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{ and_: T::Array[T::Array[String]], or_: T::Array[T::Array[String]] }
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
def to_hash
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyConditionNestedGroup < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::JourneyConditionNestedGroup,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(T.nilable(T::Array[Courier::JourneyConditionGroup])) }
|
|
15
|
+
attr_reader :and_
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(and_: T::Array[Courier::JourneyConditionGroup::OrHash]).void
|
|
19
|
+
end
|
|
20
|
+
attr_writer :and_
|
|
21
|
+
|
|
22
|
+
sig { returns(T.nilable(T::Array[Courier::JourneyConditionGroup])) }
|
|
23
|
+
attr_reader :or_
|
|
24
|
+
|
|
25
|
+
sig { params(or_: T::Array[Courier::JourneyConditionGroup::OrHash]).void }
|
|
26
|
+
attr_writer :or_
|
|
27
|
+
|
|
28
|
+
# A nested condition group. Exactly one of `AND` or `OR` must be present at
|
|
29
|
+
# runtime; each is a list of `JourneyConditionGroup` items.
|
|
30
|
+
sig do
|
|
31
|
+
params(
|
|
32
|
+
and_: T::Array[Courier::JourneyConditionGroup::OrHash],
|
|
33
|
+
or_: T::Array[Courier::JourneyConditionGroup::OrHash]
|
|
34
|
+
).returns(T.attached_class)
|
|
35
|
+
end
|
|
36
|
+
def self.new(and_: nil, or_: nil)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
sig do
|
|
40
|
+
override.returns(
|
|
41
|
+
{
|
|
42
|
+
and_: T::Array[Courier::JourneyConditionGroup],
|
|
43
|
+
or_: T::Array[Courier::JourneyConditionGroup]
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
def to_hash
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
6
|
+
# group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
7
|
+
# express "no conditions".
|
|
8
|
+
module JourneyConditionsField
|
|
9
|
+
extend Courier::Internal::Type::Union
|
|
10
|
+
|
|
11
|
+
Variants =
|
|
12
|
+
T.type_alias do
|
|
13
|
+
T.any(
|
|
14
|
+
T::Array[String],
|
|
15
|
+
Courier::JourneyConditionGroup,
|
|
16
|
+
Courier::JourneyConditionNestedGroup
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
sig do
|
|
21
|
+
override.returns(T::Array[Courier::JourneyConditionsField::Variants])
|
|
22
|
+
end
|
|
23
|
+
def self.variants
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|