trycourier 6.12.0 → 7.0.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 +23 -0
- data/README.md +1 -1
- data/lib/courier/models/journey_conditions_field.rb +3 -3
- data/lib/courier/models/journey_run_step.rb +36 -1
- data/lib/courier/models/provider_patch_params.rb +65 -35
- data/lib/courier/resources/providers.rb +7 -12
- data/lib/courier/version.rb +1 -1
- data/rbi/courier/models/journey_run_step.rbi +48 -0
- data/rbi/courier/models/provider_patch_params.rbi +121 -50
- data/rbi/courier/resources/providers.rbi +12 -20
- data/sig/courier/models/journey_run_step.rbs +20 -0
- data/sig/courier/models/provider_patch_params.rbs +55 -28
- data/sig/courier/resources/providers.rbs +1 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b9d4b4d9f0e21df74b5356c321cf2971644a8958e3c342508f8e7f578ce30735
|
|
4
|
+
data.tar.gz: bb6ec33f377d16e6a10207ef9e34795e14fe6de3211228717cb49e315f653a39
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb567ddaa62750f34f3d813b0da206ad46689dfeebad205849409d09435470ed4252a3244a36e1d8c09e336cdc571ba356f3048fa6475d7b74b86fbedfba8936
|
|
7
|
+
data.tar.gz: '09c56af2f9959df9cf30a0683b1f766339b381ab415b6c4273d49405a712d6e42ebeaa730f3cf1d83c4cd8342e757db3b95b0ccbcb7fd3892aa3e6b5ef2b1ca4'
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [7.0.0](https://github.com/trycourier/courier-ruby/compare/v6.13.0...v7.0.0) (2026-10-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* **api:** PATCH /providers/{id} takes JSON Patch operations [C-22022] ([#182](https://github.com/trycourier/courier-ruby/issues/182))
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **api:** PATCH /providers/{id} takes JSON Patch operations [C-22022] ([#182](https://github.com/trycourier/courier-ruby/issues/182)) ([1f14f3f](https://github.com/trycourier/courier-ruby/commit/1f14f3f8011a1a237fdd067a77e64f0499530685))
|
|
13
|
+
|
|
14
|
+
## [6.13.0](https://github.com/trycourier/courier-ruby/compare/v6.12.0...v6.13.0) (2026-10-23)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **api:** journey run steps return error and skip_reason ([#179](https://github.com/trycourier/courier-ruby/issues/179)) ([d5a8120](https://github.com/trycourier/courier-ruby/commit/d5a8120a93e5524ea27c5c075819a9f6d2a8b9f4))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Chores
|
|
23
|
+
|
|
24
|
+
* **api:** regenerate SDK ([#181](https://github.com/trycourier/courier-ruby/issues/181)) ([eadaf17](https://github.com/trycourier/courier-ruby/commit/eadaf17a4f75bd8d8825522d213eecb513b3c872))
|
|
25
|
+
|
|
3
26
|
## [6.12.0](https://github.com/trycourier/courier-ruby/compare/v6.11.3...v6.12.0) (2026-10-21)
|
|
4
27
|
|
|
5
28
|
|
data/README.md
CHANGED
|
@@ -14,7 +14,7 @@ module Courier
|
|
|
14
14
|
# `starts with`, `ends with`, `greater than`, `greater than or equal`,
|
|
15
15
|
# `less than`, `less than or equal`, `was`, `was not`.
|
|
16
16
|
#
|
|
17
|
-
# Example: `["
|
|
17
|
+
# Example: `["profile.tier", "is equal", "gold"]`.
|
|
18
18
|
#
|
|
19
19
|
# `was` / `was not` compare a `send_status.<nodeId>` path (referencing
|
|
20
20
|
# an earlier send node's node id) against one of `SENT`, `DELIVERED`,
|
|
@@ -29,9 +29,9 @@ module Courier
|
|
|
29
29
|
# - Unary form (2 elements): `[path, operator]` where `operator` is
|
|
30
30
|
# one of `exists`, `does not exist`.
|
|
31
31
|
#
|
|
32
|
-
# Example: `["
|
|
32
|
+
# Example: `["profile.email", "exists"]`.
|
|
33
33
|
#
|
|
34
|
-
# The first element is a non-empty dot-path
|
|
34
|
+
# The first element is a non-empty dot-path that starts with `data.`, `profile.`, `tenant.` (only when the trigger sets a tenant), or `send_status.<nodeId>`. The second element is the operator (must come from one of the two operator sets above). For the binary form, the third element is the comparison value (string). Runtime validation of the operator value and arity is performed by the backend; SDKs surface this as a string list.
|
|
35
35
|
variant -> { Courier::JourneyConditionAtom }
|
|
36
36
|
|
|
37
37
|
# A leaf condition group. Exactly one of `AND` or `OR` must be present at runtime; each is a list of `JourneyConditionAtom` tuples.
|
|
@@ -9,6 +9,19 @@ module Courier
|
|
|
9
9
|
# @return [String]
|
|
10
10
|
required :action, String
|
|
11
11
|
|
|
12
|
+
# @!attribute error
|
|
13
|
+
# Why the step failed. Set when `status` is `ERROR`, `null` otherwise.
|
|
14
|
+
#
|
|
15
|
+
# @return [Courier::Models::JourneyRunStep::Error, nil]
|
|
16
|
+
required :error, -> { Courier::JourneyRunStep::Error }, nil?: true
|
|
17
|
+
|
|
18
|
+
# @!attribute skip_reason
|
|
19
|
+
# Why the step was skipped, e.g. `Node conditions not met`. Set when `status` is
|
|
20
|
+
# `SKIPPED`, `null` otherwise.
|
|
21
|
+
#
|
|
22
|
+
# @return [String, nil]
|
|
23
|
+
required :skip_reason, String, nil?: true
|
|
24
|
+
|
|
12
25
|
# @!attribute status
|
|
13
26
|
# The state of the step: the seven run statuses, plus `SKIPPED` and `COMPUTING`.
|
|
14
27
|
# Not an enum — new values have been added before.
|
|
@@ -42,7 +55,7 @@ module Courier
|
|
|
42
55
|
# @return [String, nil]
|
|
43
56
|
optional :updated_at, String
|
|
44
57
|
|
|
45
|
-
# @!method initialize(action:, status:, created_at: nil, message_id: nil, node_id: nil, updated_at: nil)
|
|
58
|
+
# @!method initialize(action:, error:, skip_reason:, status:, created_at: nil, message_id: nil, node_id: nil, updated_at: nil)
|
|
46
59
|
# Some parameter documentations has been truncated, see
|
|
47
60
|
# {Courier::Models::JourneyRunStep} for more details.
|
|
48
61
|
#
|
|
@@ -51,6 +64,10 @@ module Courier
|
|
|
51
64
|
#
|
|
52
65
|
# @param action [String] The kind of node that ran, e.g. `send`, `delay`, or `exit`.
|
|
53
66
|
#
|
|
67
|
+
# @param error [Courier::Models::JourneyRunStep::Error, nil] Why the step failed. Set when `status` is `ERROR`, `null` otherwise.
|
|
68
|
+
#
|
|
69
|
+
# @param skip_reason [String, nil] Why the step was skipped, e.g. `Node conditions not met`. Set when `status` is `
|
|
70
|
+
#
|
|
54
71
|
# @param status [String] The state of the step: the seven run statuses, plus `SKIPPED` and `COMPUTING`. N
|
|
55
72
|
#
|
|
56
73
|
# @param created_at [String] When the step started, as an ISO 8601 timestamp.
|
|
@@ -60,6 +77,24 @@ module Courier
|
|
|
60
77
|
# @param node_id [String] The id of the node in the published Journey that this step executed.
|
|
61
78
|
#
|
|
62
79
|
# @param updated_at [String] When the step last changed state, as an ISO 8601 timestamp.
|
|
80
|
+
|
|
81
|
+
# @see Courier::Models::JourneyRunStep#error
|
|
82
|
+
class Error < Courier::Internal::Type::BaseModel
|
|
83
|
+
# @!attribute message
|
|
84
|
+
# The reason, e.g. `Fetch failed: GET api.example.com returned 404` or
|
|
85
|
+
# `AI step timed out after 15 minutes`.
|
|
86
|
+
#
|
|
87
|
+
# @return [String]
|
|
88
|
+
required :message, String
|
|
89
|
+
|
|
90
|
+
# @!method initialize(message:)
|
|
91
|
+
# Some parameter documentations has been truncated, see
|
|
92
|
+
# {Courier::Models::JourneyRunStep::Error} for more details.
|
|
93
|
+
#
|
|
94
|
+
# Why the step failed. Set when `status` is `ERROR`, `null` otherwise.
|
|
95
|
+
#
|
|
96
|
+
# @param message [String] The reason, e.g. `Fetch failed: GET api.example.com returned 404` or `AI step ti
|
|
97
|
+
end
|
|
63
98
|
end
|
|
64
99
|
end
|
|
65
100
|
end
|
|
@@ -12,50 +12,80 @@ module Courier
|
|
|
12
12
|
# @return [String]
|
|
13
13
|
required :id, String
|
|
14
14
|
|
|
15
|
-
# @!attribute
|
|
16
|
-
#
|
|
15
|
+
# @!attribute patch
|
|
16
|
+
# Operations to apply, in order. Paths address the provider as it is returned:
|
|
17
|
+
# `/title`, `/alias`, `/provider`, and `/settings/<key>` with the snake_case
|
|
18
|
+
# setting keys, including nested paths such as `/settings/rate_limit/rate`. If any
|
|
19
|
+
# operation fails, for example a `test`, nothing is saved and the request returns
|
|
20
|
+
# a 400. The result can't change `provider`, remove `title`, or add other
|
|
21
|
+
# top-level fields. Removing `/alias` clears it.
|
|
17
22
|
#
|
|
18
|
-
# @return [
|
|
19
|
-
|
|
23
|
+
# @return [Array<Courier::Models::ProviderPatchParams::Patch>]
|
|
24
|
+
required :patch, -> { Courier::Internal::Type::ArrayOf[Courier::ProviderPatchParams::Patch] }
|
|
20
25
|
|
|
21
|
-
# @!
|
|
22
|
-
# The provider key identifying the type. Optional. When sent, it must match the
|
|
23
|
-
# stored provider, otherwise the request returns a 400.
|
|
24
|
-
#
|
|
25
|
-
# @return [String, nil]
|
|
26
|
-
optional :provider, String
|
|
27
|
-
|
|
28
|
-
# @!attribute settings
|
|
29
|
-
# Provider-specific settings (snake_case keys) to merge into the stored settings,
|
|
30
|
-
# using JSON Merge Patch (RFC 7396). Each key you send replaces the stored value,
|
|
31
|
-
# a key set to null is removed, nested objects merge recursively, and arrays
|
|
32
|
-
# replace the stored value. Keys you omit keep their stored values. Set
|
|
33
|
-
# `rate_limit` to null to remove this configuration's send rate limit.
|
|
34
|
-
#
|
|
35
|
-
# @return [Hash{Symbol=>Object}, nil]
|
|
36
|
-
optional :settings, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
|
|
37
|
-
|
|
38
|
-
# @!attribute title
|
|
39
|
-
# Updated display title.
|
|
40
|
-
#
|
|
41
|
-
# @return [String, nil]
|
|
42
|
-
optional :title, String
|
|
43
|
-
|
|
44
|
-
# @!method initialize(id:, alias_: nil, provider: nil, settings: nil, title: nil, request_options: {})
|
|
26
|
+
# @!method initialize(id:, patch:, request_options: {})
|
|
45
27
|
# Some parameter documentations has been truncated, see
|
|
46
28
|
# {Courier::Models::ProviderPatchParams} for more details.
|
|
47
29
|
#
|
|
48
30
|
# @param id [String]
|
|
49
31
|
#
|
|
50
|
-
# @param
|
|
51
|
-
#
|
|
52
|
-
# @param provider [String] The provider key identifying the type. Optional. When sent, it must match the st
|
|
53
|
-
#
|
|
54
|
-
# @param settings [Hash{Symbol=>Object}] Provider-specific settings (snake_case keys) to merge into the stored settings,
|
|
55
|
-
#
|
|
56
|
-
# @param title [String] Updated display title.
|
|
32
|
+
# @param patch [Array<Courier::Models::ProviderPatchParams::Patch>] Operations to apply, in order. Paths address the provider as it is returned: `/t
|
|
57
33
|
#
|
|
58
34
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
35
|
+
|
|
36
|
+
class Patch < Courier::Internal::Type::BaseModel
|
|
37
|
+
# @!attribute op
|
|
38
|
+
# The operation to perform.
|
|
39
|
+
#
|
|
40
|
+
# @return [Symbol, Courier::Models::ProviderPatchParams::Patch::Op]
|
|
41
|
+
required :op, enum: -> { Courier::ProviderPatchParams::Patch::Op }
|
|
42
|
+
|
|
43
|
+
# @!attribute path
|
|
44
|
+
# JSON Pointer to the field to operate on, such as `/settings/api_key`.
|
|
45
|
+
#
|
|
46
|
+
# @return [String]
|
|
47
|
+
required :path, String
|
|
48
|
+
|
|
49
|
+
# @!attribute from
|
|
50
|
+
# JSON Pointer to the source field for `move` and `copy`.
|
|
51
|
+
#
|
|
52
|
+
# @return [String, nil]
|
|
53
|
+
optional :from, String
|
|
54
|
+
|
|
55
|
+
# @!attribute value
|
|
56
|
+
# The value for `add`, `replace` and `test`. Any JSON value.
|
|
57
|
+
#
|
|
58
|
+
# @return [Object, nil]
|
|
59
|
+
optional :value, Courier::Internal::Type::Unknown
|
|
60
|
+
|
|
61
|
+
# @!method initialize(op:, path:, from: nil, value: nil)
|
|
62
|
+
# One JSON Patch (RFC 6902) operation.
|
|
63
|
+
#
|
|
64
|
+
# @param op [Symbol, Courier::Models::ProviderPatchParams::Patch::Op] The operation to perform.
|
|
65
|
+
#
|
|
66
|
+
# @param path [String] JSON Pointer to the field to operate on, such as `/settings/api_key`.
|
|
67
|
+
#
|
|
68
|
+
# @param from [String] JSON Pointer to the source field for `move` and `copy`.
|
|
69
|
+
#
|
|
70
|
+
# @param value [Object] The value for `add`, `replace` and `test`. Any JSON value.
|
|
71
|
+
|
|
72
|
+
# The operation to perform.
|
|
73
|
+
#
|
|
74
|
+
# @see Courier::Models::ProviderPatchParams::Patch#op
|
|
75
|
+
module Op
|
|
76
|
+
extend Courier::Internal::Type::Enum
|
|
77
|
+
|
|
78
|
+
ADD = :add
|
|
79
|
+
REMOVE = :remove
|
|
80
|
+
REPLACE = :replace
|
|
81
|
+
MOVE = :move
|
|
82
|
+
COPY = :copy
|
|
83
|
+
TEST = :test
|
|
84
|
+
|
|
85
|
+
# @!method self.values
|
|
86
|
+
# @return [Array<Symbol>]
|
|
87
|
+
end
|
|
88
|
+
end
|
|
59
89
|
end
|
|
60
90
|
end
|
|
61
91
|
end
|
|
@@ -152,28 +152,23 @@ module Courier
|
|
|
152
152
|
# Some parameter documentations has been truncated, see
|
|
153
153
|
# {Courier::Models::ProviderPatchParams} for more details.
|
|
154
154
|
#
|
|
155
|
-
#
|
|
156
|
-
#
|
|
157
|
-
#
|
|
155
|
+
# Applies JSON Patch (RFC 6902) operations to a provider configuration and keeps
|
|
156
|
+
# every field the operations don't touch. Paths address the provider as it is
|
|
157
|
+
# returned: /title, /alias and /settings/<key>. The operations apply in order, and
|
|
158
|
+
# if one fails, nothing is saved.
|
|
158
159
|
#
|
|
159
|
-
# @overload patch(id,
|
|
160
|
+
# @overload patch(id, patch:, request_options: {})
|
|
160
161
|
#
|
|
161
162
|
# @param id [String] A unique identifier of the provider configuration to update.
|
|
162
163
|
#
|
|
163
|
-
# @param
|
|
164
|
-
#
|
|
165
|
-
# @param provider [String] The provider key identifying the type. Optional. When sent, it must match the st
|
|
166
|
-
#
|
|
167
|
-
# @param settings [Hash{Symbol=>Object}] Provider-specific settings (snake_case keys) to merge into the stored settings,
|
|
168
|
-
#
|
|
169
|
-
# @param title [String] Updated display title.
|
|
164
|
+
# @param patch [Array<Courier::Models::ProviderPatchParams::Patch>] Operations to apply, in order. Paths address the provider as it is returned: `/t
|
|
170
165
|
#
|
|
171
166
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
172
167
|
#
|
|
173
168
|
# @return [Courier::Models::Provider]
|
|
174
169
|
#
|
|
175
170
|
# @see Courier::Models::ProviderPatchParams
|
|
176
|
-
def patch(id, params
|
|
171
|
+
def patch(id, params)
|
|
177
172
|
parsed, options = Courier::ProviderPatchParams.dump_request(params)
|
|
178
173
|
@client.request(
|
|
179
174
|
method: :patch,
|
data/lib/courier/version.rb
CHANGED
|
@@ -12,6 +12,20 @@ module Courier
|
|
|
12
12
|
sig { returns(String) }
|
|
13
13
|
attr_accessor :action
|
|
14
14
|
|
|
15
|
+
# Why the step failed. Set when `status` is `ERROR`, `null` otherwise.
|
|
16
|
+
sig { returns(T.nilable(Courier::JourneyRunStep::Error)) }
|
|
17
|
+
attr_reader :error
|
|
18
|
+
|
|
19
|
+
sig do
|
|
20
|
+
params(error: T.nilable(Courier::JourneyRunStep::Error::OrHash)).void
|
|
21
|
+
end
|
|
22
|
+
attr_writer :error
|
|
23
|
+
|
|
24
|
+
# Why the step was skipped, e.g. `Node conditions not met`. Set when `status` is
|
|
25
|
+
# `SKIPPED`, `null` otherwise.
|
|
26
|
+
sig { returns(T.nilable(String)) }
|
|
27
|
+
attr_accessor :skip_reason
|
|
28
|
+
|
|
15
29
|
# The state of the step: the seven run statuses, plus `SKIPPED` and `COMPUTING`.
|
|
16
30
|
# Not an enum — new values have been added before.
|
|
17
31
|
sig { returns(String) }
|
|
@@ -52,6 +66,8 @@ module Courier
|
|
|
52
66
|
sig do
|
|
53
67
|
params(
|
|
54
68
|
action: String,
|
|
69
|
+
error: T.nilable(Courier::JourneyRunStep::Error::OrHash),
|
|
70
|
+
skip_reason: T.nilable(String),
|
|
55
71
|
status: String,
|
|
56
72
|
created_at: String,
|
|
57
73
|
message_id: String,
|
|
@@ -62,6 +78,11 @@ module Courier
|
|
|
62
78
|
def self.new(
|
|
63
79
|
# The kind of node that ran, e.g. `send`, `delay`, or `exit`.
|
|
64
80
|
action:,
|
|
81
|
+
# Why the step failed. Set when `status` is `ERROR`, `null` otherwise.
|
|
82
|
+
error:,
|
|
83
|
+
# Why the step was skipped, e.g. `Node conditions not met`. Set when `status` is
|
|
84
|
+
# `SKIPPED`, `null` otherwise.
|
|
85
|
+
skip_reason:,
|
|
65
86
|
# The state of the step: the seven run statuses, plus `SKIPPED` and `COMPUTING`.
|
|
66
87
|
# Not an enum — new values have been added before.
|
|
67
88
|
status:,
|
|
@@ -82,6 +103,8 @@ module Courier
|
|
|
82
103
|
override.returns(
|
|
83
104
|
{
|
|
84
105
|
action: String,
|
|
106
|
+
error: T.nilable(Courier::JourneyRunStep::Error),
|
|
107
|
+
skip_reason: T.nilable(String),
|
|
85
108
|
status: String,
|
|
86
109
|
created_at: String,
|
|
87
110
|
message_id: String,
|
|
@@ -92,6 +115,31 @@ module Courier
|
|
|
92
115
|
end
|
|
93
116
|
def to_hash
|
|
94
117
|
end
|
|
118
|
+
|
|
119
|
+
class Error < Courier::Internal::Type::BaseModel
|
|
120
|
+
OrHash =
|
|
121
|
+
T.type_alias do
|
|
122
|
+
T.any(Courier::JourneyRunStep::Error, Courier::Internal::AnyHash)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# The reason, e.g. `Fetch failed: GET api.example.com returned 404` or
|
|
126
|
+
# `AI step timed out after 15 minutes`.
|
|
127
|
+
sig { returns(String) }
|
|
128
|
+
attr_accessor :message
|
|
129
|
+
|
|
130
|
+
# Why the step failed. Set when `status` is `ERROR`, `null` otherwise.
|
|
131
|
+
sig { params(message: String).returns(T.attached_class) }
|
|
132
|
+
def self.new(
|
|
133
|
+
# The reason, e.g. `Fetch failed: GET api.example.com returned 404` or
|
|
134
|
+
# `AI step timed out after 15 minutes`.
|
|
135
|
+
message:
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
sig { override.returns({ message: String }) }
|
|
140
|
+
def to_hash
|
|
141
|
+
end
|
|
142
|
+
end
|
|
95
143
|
end
|
|
96
144
|
end
|
|
97
145
|
end
|
|
@@ -14,61 +14,31 @@ module Courier
|
|
|
14
14
|
sig { returns(String) }
|
|
15
15
|
attr_accessor :id
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
sig { returns(T
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
sig { params(provider: String).void }
|
|
27
|
-
attr_writer :provider
|
|
28
|
-
|
|
29
|
-
# Provider-specific settings (snake_case keys) to merge into the stored settings,
|
|
30
|
-
# using JSON Merge Patch (RFC 7396). Each key you send replaces the stored value,
|
|
31
|
-
# a key set to null is removed, nested objects merge recursively, and arrays
|
|
32
|
-
# replace the stored value. Keys you omit keep their stored values. Set
|
|
33
|
-
# `rate_limit` to null to remove this configuration's send rate limit.
|
|
34
|
-
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
35
|
-
attr_reader :settings
|
|
36
|
-
|
|
37
|
-
sig { params(settings: T::Hash[Symbol, T.anything]).void }
|
|
38
|
-
attr_writer :settings
|
|
39
|
-
|
|
40
|
-
# Updated display title.
|
|
41
|
-
sig { returns(T.nilable(String)) }
|
|
42
|
-
attr_reader :title
|
|
43
|
-
|
|
44
|
-
sig { params(title: String).void }
|
|
45
|
-
attr_writer :title
|
|
17
|
+
# Operations to apply, in order. Paths address the provider as it is returned:
|
|
18
|
+
# `/title`, `/alias`, `/provider`, and `/settings/<key>` with the snake_case
|
|
19
|
+
# setting keys, including nested paths such as `/settings/rate_limit/rate`. If any
|
|
20
|
+
# operation fails, for example a `test`, nothing is saved and the request returns
|
|
21
|
+
# a 400. The result can't change `provider`, remove `title`, or add other
|
|
22
|
+
# top-level fields. Removing `/alias` clears it.
|
|
23
|
+
sig { returns(T::Array[Courier::ProviderPatchParams::Patch]) }
|
|
24
|
+
attr_accessor :patch
|
|
46
25
|
|
|
47
26
|
sig do
|
|
48
27
|
params(
|
|
49
28
|
id: String,
|
|
50
|
-
|
|
51
|
-
provider: String,
|
|
52
|
-
settings: T::Hash[Symbol, T.anything],
|
|
53
|
-
title: String,
|
|
29
|
+
patch: T::Array[Courier::ProviderPatchParams::Patch::OrHash],
|
|
54
30
|
request_options: Courier::RequestOptions::OrHash
|
|
55
31
|
).returns(T.attached_class)
|
|
56
32
|
end
|
|
57
33
|
def self.new(
|
|
58
34
|
id:,
|
|
59
|
-
#
|
|
60
|
-
|
|
61
|
-
#
|
|
62
|
-
#
|
|
63
|
-
provider
|
|
64
|
-
#
|
|
65
|
-
|
|
66
|
-
# a key set to null is removed, nested objects merge recursively, and arrays
|
|
67
|
-
# replace the stored value. Keys you omit keep their stored values. Set
|
|
68
|
-
# `rate_limit` to null to remove this configuration's send rate limit.
|
|
69
|
-
settings: nil,
|
|
70
|
-
# Updated display title.
|
|
71
|
-
title: nil,
|
|
35
|
+
# Operations to apply, in order. Paths address the provider as it is returned:
|
|
36
|
+
# `/title`, `/alias`, `/provider`, and `/settings/<key>` with the snake_case
|
|
37
|
+
# setting keys, including nested paths such as `/settings/rate_limit/rate`. If any
|
|
38
|
+
# operation fails, for example a `test`, nothing is saved and the request returns
|
|
39
|
+
# a 400. The result can't change `provider`, remove `title`, or add other
|
|
40
|
+
# top-level fields. Removing `/alias` clears it.
|
|
41
|
+
patch:,
|
|
72
42
|
request_options: {}
|
|
73
43
|
)
|
|
74
44
|
end
|
|
@@ -77,16 +47,117 @@ module Courier
|
|
|
77
47
|
override.returns(
|
|
78
48
|
{
|
|
79
49
|
id: String,
|
|
80
|
-
|
|
81
|
-
provider: String,
|
|
82
|
-
settings: T::Hash[Symbol, T.anything],
|
|
83
|
-
title: String,
|
|
50
|
+
patch: T::Array[Courier::ProviderPatchParams::Patch],
|
|
84
51
|
request_options: Courier::RequestOptions
|
|
85
52
|
}
|
|
86
53
|
)
|
|
87
54
|
end
|
|
88
55
|
def to_hash
|
|
89
56
|
end
|
|
57
|
+
|
|
58
|
+
class Patch < Courier::Internal::Type::BaseModel
|
|
59
|
+
OrHash =
|
|
60
|
+
T.type_alias do
|
|
61
|
+
T.any(
|
|
62
|
+
Courier::ProviderPatchParams::Patch,
|
|
63
|
+
Courier::Internal::AnyHash
|
|
64
|
+
)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# The operation to perform.
|
|
68
|
+
sig { returns(Courier::ProviderPatchParams::Patch::Op::OrSymbol) }
|
|
69
|
+
attr_accessor :op
|
|
70
|
+
|
|
71
|
+
# JSON Pointer to the field to operate on, such as `/settings/api_key`.
|
|
72
|
+
sig { returns(String) }
|
|
73
|
+
attr_accessor :path
|
|
74
|
+
|
|
75
|
+
# JSON Pointer to the source field for `move` and `copy`.
|
|
76
|
+
sig { returns(T.nilable(String)) }
|
|
77
|
+
attr_reader :from
|
|
78
|
+
|
|
79
|
+
sig { params(from: String).void }
|
|
80
|
+
attr_writer :from
|
|
81
|
+
|
|
82
|
+
# The value for `add`, `replace` and `test`. Any JSON value.
|
|
83
|
+
sig { returns(T.nilable(T.anything)) }
|
|
84
|
+
attr_reader :value
|
|
85
|
+
|
|
86
|
+
sig { params(value: T.anything).void }
|
|
87
|
+
attr_writer :value
|
|
88
|
+
|
|
89
|
+
# One JSON Patch (RFC 6902) operation.
|
|
90
|
+
sig do
|
|
91
|
+
params(
|
|
92
|
+
op: Courier::ProviderPatchParams::Patch::Op::OrSymbol,
|
|
93
|
+
path: String,
|
|
94
|
+
from: String,
|
|
95
|
+
value: T.anything
|
|
96
|
+
).returns(T.attached_class)
|
|
97
|
+
end
|
|
98
|
+
def self.new(
|
|
99
|
+
# The operation to perform.
|
|
100
|
+
op:,
|
|
101
|
+
# JSON Pointer to the field to operate on, such as `/settings/api_key`.
|
|
102
|
+
path:,
|
|
103
|
+
# JSON Pointer to the source field for `move` and `copy`.
|
|
104
|
+
from: nil,
|
|
105
|
+
# The value for `add`, `replace` and `test`. Any JSON value.
|
|
106
|
+
value: nil
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
sig do
|
|
111
|
+
override.returns(
|
|
112
|
+
{
|
|
113
|
+
op: Courier::ProviderPatchParams::Patch::Op::OrSymbol,
|
|
114
|
+
path: String,
|
|
115
|
+
from: String,
|
|
116
|
+
value: T.anything
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
end
|
|
120
|
+
def to_hash
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# The operation to perform.
|
|
124
|
+
module Op
|
|
125
|
+
extend Courier::Internal::Type::Enum
|
|
126
|
+
|
|
127
|
+
TaggedSymbol =
|
|
128
|
+
T.type_alias do
|
|
129
|
+
T.all(Symbol, Courier::ProviderPatchParams::Patch::Op)
|
|
130
|
+
end
|
|
131
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
132
|
+
|
|
133
|
+
ADD =
|
|
134
|
+
T.let(:add, Courier::ProviderPatchParams::Patch::Op::TaggedSymbol)
|
|
135
|
+
REMOVE =
|
|
136
|
+
T.let(
|
|
137
|
+
:remove,
|
|
138
|
+
Courier::ProviderPatchParams::Patch::Op::TaggedSymbol
|
|
139
|
+
)
|
|
140
|
+
REPLACE =
|
|
141
|
+
T.let(
|
|
142
|
+
:replace,
|
|
143
|
+
Courier::ProviderPatchParams::Patch::Op::TaggedSymbol
|
|
144
|
+
)
|
|
145
|
+
MOVE =
|
|
146
|
+
T.let(:move, Courier::ProviderPatchParams::Patch::Op::TaggedSymbol)
|
|
147
|
+
COPY =
|
|
148
|
+
T.let(:copy, Courier::ProviderPatchParams::Patch::Op::TaggedSymbol)
|
|
149
|
+
TEST =
|
|
150
|
+
T.let(:test, Courier::ProviderPatchParams::Patch::Op::TaggedSymbol)
|
|
151
|
+
|
|
152
|
+
sig do
|
|
153
|
+
override.returns(
|
|
154
|
+
T::Array[Courier::ProviderPatchParams::Patch::Op::TaggedSymbol]
|
|
155
|
+
)
|
|
156
|
+
end
|
|
157
|
+
def self.values
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
end
|
|
90
161
|
end
|
|
91
162
|
end
|
|
92
163
|
end
|
|
@@ -145,35 +145,27 @@ module Courier
|
|
|
145
145
|
)
|
|
146
146
|
end
|
|
147
147
|
|
|
148
|
-
#
|
|
149
|
-
#
|
|
150
|
-
#
|
|
148
|
+
# Applies JSON Patch (RFC 6902) operations to a provider configuration and keeps
|
|
149
|
+
# every field the operations don't touch. Paths address the provider as it is
|
|
150
|
+
# returned: /title, /alias and /settings/<key>. The operations apply in order, and
|
|
151
|
+
# if one fails, nothing is saved.
|
|
151
152
|
sig do
|
|
152
153
|
params(
|
|
153
154
|
id: String,
|
|
154
|
-
|
|
155
|
-
provider: String,
|
|
156
|
-
settings: T::Hash[Symbol, T.anything],
|
|
157
|
-
title: String,
|
|
155
|
+
patch: T::Array[Courier::ProviderPatchParams::Patch::OrHash],
|
|
158
156
|
request_options: Courier::RequestOptions::OrHash
|
|
159
157
|
).returns(Courier::Provider)
|
|
160
158
|
end
|
|
161
159
|
def patch(
|
|
162
160
|
# A unique identifier of the provider configuration to update.
|
|
163
161
|
id,
|
|
164
|
-
#
|
|
165
|
-
|
|
166
|
-
#
|
|
167
|
-
#
|
|
168
|
-
provider
|
|
169
|
-
#
|
|
170
|
-
|
|
171
|
-
# a key set to null is removed, nested objects merge recursively, and arrays
|
|
172
|
-
# replace the stored value. Keys you omit keep their stored values. Set
|
|
173
|
-
# `rate_limit` to null to remove this configuration's send rate limit.
|
|
174
|
-
settings: nil,
|
|
175
|
-
# Updated display title.
|
|
176
|
-
title: nil,
|
|
162
|
+
# Operations to apply, in order. Paths address the provider as it is returned:
|
|
163
|
+
# `/title`, `/alias`, `/provider`, and `/settings/<key>` with the snake_case
|
|
164
|
+
# setting keys, including nested paths such as `/settings/rate_limit/rate`. If any
|
|
165
|
+
# operation fails, for example a `test`, nothing is saved and the request returns
|
|
166
|
+
# a 400. The result can't change `provider`, remove `title`, or add other
|
|
167
|
+
# top-level fields. Removing `/alias` clears it.
|
|
168
|
+
patch:,
|
|
177
169
|
request_options: {}
|
|
178
170
|
)
|
|
179
171
|
end
|
|
@@ -3,6 +3,8 @@ module Courier
|
|
|
3
3
|
type journey_run_step =
|
|
4
4
|
{
|
|
5
5
|
action: String,
|
|
6
|
+
error: Courier::JourneyRunStep::Error?,
|
|
7
|
+
skip_reason: String?,
|
|
6
8
|
status: String,
|
|
7
9
|
created_at: String,
|
|
8
10
|
message_id: String,
|
|
@@ -13,6 +15,10 @@ module Courier
|
|
|
13
15
|
class JourneyRunStep < Courier::Internal::Type::BaseModel
|
|
14
16
|
attr_accessor action: String
|
|
15
17
|
|
|
18
|
+
attr_accessor error: Courier::JourneyRunStep::Error?
|
|
19
|
+
|
|
20
|
+
attr_accessor skip_reason: String?
|
|
21
|
+
|
|
16
22
|
attr_accessor status: String
|
|
17
23
|
|
|
18
24
|
attr_reader created_at: String?
|
|
@@ -33,6 +39,8 @@ module Courier
|
|
|
33
39
|
|
|
34
40
|
def initialize: (
|
|
35
41
|
action: String,
|
|
42
|
+
error: Courier::JourneyRunStep::Error?,
|
|
43
|
+
skip_reason: String?,
|
|
36
44
|
status: String,
|
|
37
45
|
?created_at: String,
|
|
38
46
|
?message_id: String,
|
|
@@ -42,12 +50,24 @@ module Courier
|
|
|
42
50
|
|
|
43
51
|
def to_hash: -> {
|
|
44
52
|
action: String,
|
|
53
|
+
error: Courier::JourneyRunStep::Error?,
|
|
54
|
+
skip_reason: String?,
|
|
45
55
|
status: String,
|
|
46
56
|
created_at: String,
|
|
47
57
|
message_id: String,
|
|
48
58
|
node_id: String,
|
|
49
59
|
updated_at: String
|
|
50
60
|
}
|
|
61
|
+
|
|
62
|
+
type error = { message: String }
|
|
63
|
+
|
|
64
|
+
class Error < Courier::Internal::Type::BaseModel
|
|
65
|
+
attr_accessor message: String
|
|
66
|
+
|
|
67
|
+
def initialize: (message: String) -> void
|
|
68
|
+
|
|
69
|
+
def to_hash: -> { message: String }
|
|
70
|
+
end
|
|
51
71
|
end
|
|
52
72
|
end
|
|
53
73
|
end
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
module Courier
|
|
2
2
|
module Models
|
|
3
3
|
type provider_patch_params =
|
|
4
|
-
{
|
|
5
|
-
id: String,
|
|
6
|
-
alias_: String?,
|
|
7
|
-
provider: String,
|
|
8
|
-
settings: ::Hash[Symbol, top],
|
|
9
|
-
title: String
|
|
10
|
-
}
|
|
4
|
+
{ id: String, patch: ::Array[Courier::ProviderPatchParams::Patch] }
|
|
11
5
|
& Courier::Internal::Type::request_parameters
|
|
12
6
|
|
|
13
7
|
class ProviderPatchParams < Courier::Internal::Type::BaseModel
|
|
@@ -16,37 +10,70 @@ module Courier
|
|
|
16
10
|
|
|
17
11
|
attr_accessor id: String
|
|
18
12
|
|
|
19
|
-
attr_accessor
|
|
20
|
-
|
|
21
|
-
attr_reader provider: String?
|
|
22
|
-
|
|
23
|
-
def provider=: (String) -> String
|
|
24
|
-
|
|
25
|
-
attr_reader settings: ::Hash[Symbol, top]?
|
|
26
|
-
|
|
27
|
-
def settings=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
|
|
28
|
-
|
|
29
|
-
attr_reader title: String?
|
|
30
|
-
|
|
31
|
-
def title=: (String) -> String
|
|
13
|
+
attr_accessor patch: ::Array[Courier::ProviderPatchParams::Patch]
|
|
32
14
|
|
|
33
15
|
def initialize: (
|
|
34
16
|
id: String,
|
|
35
|
-
|
|
36
|
-
?provider: String,
|
|
37
|
-
?settings: ::Hash[Symbol, top],
|
|
38
|
-
?title: String,
|
|
17
|
+
patch: ::Array[Courier::ProviderPatchParams::Patch],
|
|
39
18
|
?request_options: Courier::request_opts
|
|
40
19
|
) -> void
|
|
41
20
|
|
|
42
21
|
def to_hash: -> {
|
|
43
22
|
id: String,
|
|
44
|
-
|
|
45
|
-
provider: String,
|
|
46
|
-
settings: ::Hash[Symbol, top],
|
|
47
|
-
title: String,
|
|
23
|
+
patch: ::Array[Courier::ProviderPatchParams::Patch],
|
|
48
24
|
request_options: Courier::RequestOptions
|
|
49
25
|
}
|
|
26
|
+
|
|
27
|
+
type patch =
|
|
28
|
+
{
|
|
29
|
+
op: Courier::Models::ProviderPatchParams::Patch::op,
|
|
30
|
+
path: String,
|
|
31
|
+
from: String,
|
|
32
|
+
value: top
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
class Patch < Courier::Internal::Type::BaseModel
|
|
36
|
+
attr_accessor op: Courier::Models::ProviderPatchParams::Patch::op
|
|
37
|
+
|
|
38
|
+
attr_accessor path: String
|
|
39
|
+
|
|
40
|
+
attr_reader from: String?
|
|
41
|
+
|
|
42
|
+
def from=: (String) -> String
|
|
43
|
+
|
|
44
|
+
attr_reader value: top?
|
|
45
|
+
|
|
46
|
+
def value=: (top) -> top
|
|
47
|
+
|
|
48
|
+
def initialize: (
|
|
49
|
+
op: Courier::Models::ProviderPatchParams::Patch::op,
|
|
50
|
+
path: String,
|
|
51
|
+
?from: String,
|
|
52
|
+
?value: top
|
|
53
|
+
) -> void
|
|
54
|
+
|
|
55
|
+
def to_hash: -> {
|
|
56
|
+
op: Courier::Models::ProviderPatchParams::Patch::op,
|
|
57
|
+
path: String,
|
|
58
|
+
from: String,
|
|
59
|
+
value: top
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
type op = :add | :remove | :replace | :move | :copy | :test
|
|
63
|
+
|
|
64
|
+
module Op
|
|
65
|
+
extend Courier::Internal::Type::Enum
|
|
66
|
+
|
|
67
|
+
ADD: :add
|
|
68
|
+
REMOVE: :remove
|
|
69
|
+
REPLACE: :replace
|
|
70
|
+
MOVE: :move
|
|
71
|
+
COPY: :copy
|
|
72
|
+
TEST: :test
|
|
73
|
+
|
|
74
|
+
def self?.values: -> ::Array[Courier::Models::ProviderPatchParams::Patch::op]
|
|
75
|
+
end
|
|
76
|
+
end
|
|
50
77
|
end
|
|
51
78
|
end
|
|
52
79
|
end
|
|
@@ -36,10 +36,7 @@ module Courier
|
|
|
36
36
|
|
|
37
37
|
def patch: (
|
|
38
38
|
String id,
|
|
39
|
-
|
|
40
|
-
?provider: String,
|
|
41
|
-
?settings: ::Hash[Symbol, top],
|
|
42
|
-
?title: String,
|
|
39
|
+
patch: ::Array[Courier::ProviderPatchParams::Patch],
|
|
43
40
|
?request_options: Courier::request_opts
|
|
44
41
|
) -> Courier::Provider
|
|
45
42
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trycourier
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 7.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Courier
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: connection_pool
|