trailblazer-endpoint 0.0.8 → 0.0.9
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/CHANGES.md +5 -0
- data/lib/trailblazer/endpoint/controller.rb +22 -3
- data/lib/trailblazer/endpoint/protocol/controller.rb +1 -1
- data/lib/trailblazer/endpoint/version.rb +1 -1
- data/lib/trailblazer/endpoint.rb +2 -2
- data/test/rails-app/Gemfile +9 -3
- data/test/rails-app/Gemfile.lock +43 -32
- data/test/rails-app/app/controllers/application_controller/web.rb +2 -2
- data/trailblazer-endpoint.gemspec +2 -2
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31aba7b848760da16d7c5ad9a7ee24f821acac0b4fd72884e263a5e52468d868
|
4
|
+
data.tar.gz: 71d47c02a27874bbc9e16d64d2844d6d930888b77b653c582e9ebd5d94960f71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24837b2a2fc722d9101b56fe9f35d648f7408574a518bc66fbefcd539ffd4363c44232fb8c51373902782d15986134cecb8d5c811fd504cc6a425ee53d90f8a1
|
7
|
+
data.tar.gz: b25455ecd91f83b3e4bf067b6fbb9e1188d162f894379ec01de91fbb09bff5e38e0517684d1220ef49d7a26a6ab1f477bed554ee8bf407f84950629f7329a435
|
data/CHANGES.md
CHANGED
@@ -93,10 +93,11 @@ module Trailblazer
|
|
93
93
|
end
|
94
94
|
|
95
95
|
# Builds and registers an endpoint in a controller class.
|
96
|
-
def endpoint(name, **options, &block)
|
96
|
+
def endpoint(name=nil, **options, &block)
|
97
97
|
options = options.merge(protocol_block: block) if block_given?
|
98
98
|
|
99
|
-
return generic_endpoint_config(**
|
99
|
+
return generic_endpoint_config(**options) if name.nil?
|
100
|
+
|
100
101
|
build_endpoint(name, **options)
|
101
102
|
end
|
102
103
|
|
@@ -114,7 +115,7 @@ module Trailblazer
|
|
114
115
|
def build_endpoint(name, domain_activity: name, **options)
|
115
116
|
build_options = options_for(:generic_options, {}).merge(domain_activity: domain_activity, **options) # DISCUSS: why don't we add this as another directive option/step?
|
116
117
|
|
117
|
-
endpoint = Trailblazer::Endpoint.build(build_options)
|
118
|
+
endpoint = Trailblazer::Endpoint.build(**build_options)
|
118
119
|
|
119
120
|
directive :endpoints, ->(*) { {name.to_s => endpoint} }
|
120
121
|
end
|
@@ -134,6 +135,24 @@ module Trailblazer
|
|
134
135
|
|
135
136
|
endpoint = endpoint_for(name)
|
136
137
|
|
138
|
+
# raise name.inspect unless block_given?
|
139
|
+
# TODO: check {dsl: false}
|
140
|
+
# unless block_given? # FIXME
|
141
|
+
# config_source = self.class # FIXME
|
142
|
+
# block_options = config_source.options_for(:options_for_block_options, **action_options)
|
143
|
+
# block_options = Trailblazer::Endpoint::Options.merge_with(action_options, block_options)
|
144
|
+
|
145
|
+
# signal, (ctx, _) = Trailblazer::Endpoint::Controller.advance_endpoint_for_controller(
|
146
|
+
# endpoint: endpoint,
|
147
|
+
# block_options: block_options,
|
148
|
+
# config_source: config_source,
|
149
|
+
# **action_options
|
150
|
+
# )
|
151
|
+
|
152
|
+
# return ctx
|
153
|
+
# end
|
154
|
+
|
155
|
+
|
137
156
|
invoke_endpoint_with_dsl(endpoint: endpoint, **action_options, &block)
|
138
157
|
end
|
139
158
|
|
@@ -77,7 +77,7 @@ module Trailblazer
|
|
77
77
|
# after: :authenticate
|
78
78
|
end
|
79
79
|
|
80
|
-
insert_copy_to_domain_ctx!(protocol, :process_model => :model)
|
80
|
+
insert_copy_to_domain_ctx!(protocol, {:process_model => :model})
|
81
81
|
end
|
82
82
|
|
83
83
|
def insert_copy_to_domain_ctx!(protocol, variables, before: :domain_activity) # FIXME: `:before` untested!
|
data/lib/trailblazer/endpoint.rb
CHANGED
@@ -48,7 +48,7 @@ module Trailblazer
|
|
48
48
|
end
|
49
49
|
|
50
50
|
if serialize || deserialize
|
51
|
-
Protocol::Controller.insert_copy_to_domain_ctx!(self, :resume_data => :resume_data)
|
51
|
+
Protocol::Controller.insert_copy_to_domain_ctx!(self, {:resume_data => :resume_data})
|
52
52
|
end
|
53
53
|
|
54
54
|
if find_process_model
|
@@ -131,7 +131,7 @@ module Trailblazer
|
|
131
131
|
end
|
132
132
|
|
133
133
|
# FIXME: name will change! this is for controllers, only!
|
134
|
-
def self.advance_from_controller(endpoint, success_block:, failure_block:, protocol_failure_block
|
134
|
+
def self.advance_from_controller(endpoint, success_block:, failure_block:, protocol_failure_block:, **argument_options)
|
135
135
|
args = Trailblazer::Endpoint.arguments_for(argument_options)
|
136
136
|
|
137
137
|
signal, (ctx, _ ) = Trailblazer::Endpoint.with_or_etc(
|
data/test/rails-app/Gemfile
CHANGED
@@ -13,7 +13,13 @@ gem 'sqlite3', '~> 1.4'
|
|
13
13
|
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
|
14
14
|
# gem 'rack-cors'
|
15
15
|
|
16
|
-
gem "trailblazer-operation"
|
16
|
+
# gem "trailblazer-operation"
|
17
|
+
gem "trailblazer-operation", path: "../../../trailblazer-operation"
|
18
|
+
gem "trailblazer-context", path: "../../../trailblazer-context"
|
19
|
+
gem "trailblazer-activity-dsl-linear", path: "../../../trailblazer-activity-dsl-linear"
|
20
|
+
gem "trailblazer-activity", path: "../../../trailblazer-activity"
|
21
|
+
|
22
|
+
|
17
23
|
gem "trailblazer-endpoint", path: "../../."
|
18
24
|
gem "jwt"
|
19
25
|
gem "multi_json"
|
@@ -24,6 +30,6 @@ gem "cells-rails"
|
|
24
30
|
|
25
31
|
|
26
32
|
# FIXME
|
27
|
-
gem "trailblazer-workflow", path: "../../../trailblazer-workflow"
|
33
|
+
# gem "trailblazer-workflow", path: "../../../trailblazer-workflow"
|
28
34
|
# gem "trailblazer-activity-dsl-linear", path: "../../../trailblazer-activity-dsl-linear"
|
29
|
-
gem "trailblazer-activity-dsl-linear", ">= 0.3.4"
|
35
|
+
# gem "trailblazer-activity-dsl-linear", ">= 0.3.4"
|
data/test/rails-app/Gemfile.lock
CHANGED
@@ -1,17 +1,35 @@
|
|
1
1
|
PATH
|
2
|
-
remote: ../../../trailblazer-
|
2
|
+
remote: ../../../trailblazer-activity-dsl-linear
|
3
3
|
specs:
|
4
|
-
trailblazer-
|
5
|
-
trailblazer-activity
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
trailblazer-activity-dsl-linear (0.4.3)
|
5
|
+
trailblazer-activity (>= 0.12.2, < 1.0.0)
|
6
|
+
|
7
|
+
PATH
|
8
|
+
remote: ../../../trailblazer-activity
|
9
|
+
specs:
|
10
|
+
trailblazer-activity (0.13.0)
|
11
|
+
trailblazer-context (~> 0.5.0)
|
12
|
+
trailblazer-option (~> 0.1.0)
|
13
|
+
|
14
|
+
PATH
|
15
|
+
remote: ../../../trailblazer-context
|
16
|
+
specs:
|
17
|
+
trailblazer-context (0.5.0)
|
18
|
+
hashie (>= 3.0.0)
|
19
|
+
|
20
|
+
PATH
|
21
|
+
remote: ../../../trailblazer-operation
|
22
|
+
specs:
|
23
|
+
trailblazer-operation (0.7.5)
|
24
|
+
trailblazer-activity (>= 0.12.2, < 1.0.0)
|
25
|
+
trailblazer-activity-dsl-linear (>= 0.4.1, < 1.0.0)
|
26
|
+
trailblazer-developer (>= 0.0.21, < 1.0.0)
|
9
27
|
|
10
28
|
PATH
|
11
29
|
remote: ../..
|
12
30
|
specs:
|
13
|
-
trailblazer-endpoint (0.0.
|
14
|
-
trailblazer-activity-dsl-linear (>= 0.
|
31
|
+
trailblazer-endpoint (0.0.9)
|
32
|
+
trailblazer-activity-dsl-linear (>= 0.4.0, < 0.5.0)
|
15
33
|
|
16
34
|
GEM
|
17
35
|
remote: https://rubygems.org/
|
@@ -94,7 +112,7 @@ GEM
|
|
94
112
|
erubi (1.10.0)
|
95
113
|
globalid (0.4.2)
|
96
114
|
activesupport (>= 4.2.0)
|
97
|
-
hashie (
|
115
|
+
hashie (5.0.0)
|
98
116
|
hirb (0.7.3)
|
99
117
|
i18n (1.8.7)
|
100
118
|
concurrent-ruby (~> 1.0)
|
@@ -109,11 +127,15 @@ GEM
|
|
109
127
|
method_source (1.0.0)
|
110
128
|
mimemagic (0.3.5)
|
111
129
|
mini_mime (1.0.2)
|
130
|
+
mini_portile2 (2.5.0)
|
112
131
|
minitest (5.14.3)
|
113
132
|
minitest-line (0.6.5)
|
114
133
|
minitest (~> 5.0)
|
115
134
|
multi_json (1.15.0)
|
116
135
|
nio4r (2.5.4)
|
136
|
+
nokogiri (1.11.1)
|
137
|
+
mini_portile2 (~> 2.5.0)
|
138
|
+
racc (~> 1.4)
|
117
139
|
nokogiri (1.11.1-x86_64-linux)
|
118
140
|
racc (~> 1.4)
|
119
141
|
racc (1.5.2)
|
@@ -147,9 +169,9 @@ GEM
|
|
147
169
|
rake (>= 0.8.7)
|
148
170
|
thor (>= 0.20.3, < 2.0)
|
149
171
|
rake (13.0.3)
|
150
|
-
representable (3.
|
172
|
+
representable (3.1.1)
|
151
173
|
declarative (< 0.1.0)
|
152
|
-
|
174
|
+
trailblazer-option (>= 0.1.1, < 0.2.0)
|
153
175
|
uber (< 0.2.0)
|
154
176
|
sprockets (4.0.2)
|
155
177
|
concurrent-ruby (~> 1.0)
|
@@ -163,26 +185,14 @@ GEM
|
|
163
185
|
thor (1.0.1)
|
164
186
|
thread_safe (0.3.6)
|
165
187
|
tilt (2.0.10)
|
166
|
-
trailblazer-activity (0.11.4)
|
167
|
-
trailblazer-context (>= 0.3.1, < 0.4.0)
|
168
|
-
trailblazer-activity-dsl-linear (0.3.4)
|
169
|
-
trailblazer-activity (>= 0.11.3, < 1.0.0)
|
170
|
-
trailblazer-activity-implementation (0.0.4)
|
171
|
-
trailblazer-activity (>= 0.11.4)
|
172
|
-
trailblazer-activity-dsl-linear
|
173
188
|
trailblazer-cells (0.0.3)
|
174
189
|
cells (>= 4.1.0.rc1, < 5.0.0)
|
175
|
-
trailblazer-
|
176
|
-
hashie (~> 4.1)
|
177
|
-
trailblazer-developer (0.0.17)
|
190
|
+
trailblazer-developer (0.0.22)
|
178
191
|
hirb
|
179
|
-
representable
|
180
|
-
trailblazer-activity (>= 0.
|
181
|
-
trailblazer-activity-dsl-linear
|
182
|
-
trailblazer-
|
183
|
-
trailblazer-activity (>= 0.11.2, < 1.0.0)
|
184
|
-
trailblazer-activity-dsl-linear (>= 0.3.2, < 1.0.0)
|
185
|
-
trailblazer-developer (>= 0.0.8)
|
192
|
+
representable (>= 3.1.1, < 4.0.0)
|
193
|
+
trailblazer-activity (>= 0.12.2, < 1.0.0)
|
194
|
+
trailblazer-activity-dsl-linear (>= 0.4.1, < 1.0.0)
|
195
|
+
trailblazer-option (0.1.2)
|
186
196
|
tzinfo (1.2.9)
|
187
197
|
thread_safe (~> 0.1)
|
188
198
|
uber (0.1.0)
|
@@ -203,11 +213,12 @@ DEPENDENCIES
|
|
203
213
|
multi_json
|
204
214
|
rails (~> 6.0.3, >= 6.0.3.1)
|
205
215
|
sqlite3 (~> 1.4)
|
206
|
-
trailblazer-activity
|
216
|
+
trailblazer-activity!
|
217
|
+
trailblazer-activity-dsl-linear!
|
207
218
|
trailblazer-cells
|
219
|
+
trailblazer-context!
|
208
220
|
trailblazer-endpoint!
|
209
|
-
trailblazer-operation
|
210
|
-
trailblazer-workflow!
|
221
|
+
trailblazer-operation!
|
211
222
|
|
212
223
|
BUNDLED WITH
|
213
|
-
2.2.
|
224
|
+
2.2.11
|
@@ -31,8 +31,8 @@ class ApplicationController::Web < ApplicationController
|
|
31
31
|
Policy.(domain_ctx)
|
32
32
|
end
|
33
33
|
|
34
|
-
Trailblazer::Endpoint::Protocol::Controller.insert_copy_to_domain_ctx!(self, :current_user => :current_user)
|
35
|
-
Trailblazer::Endpoint::Protocol::Controller.insert_copy_from_domain_ctx!(self, :model => :process_model)
|
34
|
+
Trailblazer::Endpoint::Protocol::Controller.insert_copy_to_domain_ctx!(self, {:current_user => :current_user})
|
35
|
+
Trailblazer::Endpoint::Protocol::Controller.insert_copy_from_domain_ctx!(self, {:model => :process_model})
|
36
36
|
end
|
37
37
|
#:protocol end
|
38
38
|
Policy = ->(domain_ctx) { domain_ctx[:params][:policy] == "false" ? false : true }
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.email = ["apotonick@gmail.com"]
|
10
10
|
spec.description = %q{Endpoints handle authentication, policies, run your domain operation and set up the rendering.}
|
11
11
|
spec.summary = %q{Endpoints handle authentication, policies, run your domain operation and set up the rendering.}
|
12
|
-
spec.homepage = "http://trailblazer.to/
|
12
|
+
spec.homepage = "http://trailblazer.to/"
|
13
13
|
spec.license = "LGPL-3.0"
|
14
14
|
|
15
15
|
spec.files = `git ls-files`.split($/)
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_dependency "trailblazer-activity-dsl-linear", ">= 0.
|
20
|
+
spec.add_dependency "trailblazer-activity-dsl-linear", ">= 0.4.0", "< 0.5.0"
|
21
21
|
|
22
22
|
spec.add_development_dependency "bundler"
|
23
23
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailblazer-endpoint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trailblazer-activity-dsl-linear
|
@@ -16,20 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.4.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.5.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.4.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.
|
32
|
+
version: 0.5.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -187,7 +187,7 @@ files:
|
|
187
187
|
- test/rails-app/tmp/.keep
|
188
188
|
- test/test_helper.rb
|
189
189
|
- trailblazer-endpoint.gemspec
|
190
|
-
homepage: http://trailblazer.to/
|
190
|
+
homepage: http://trailblazer.to/
|
191
191
|
licenses:
|
192
192
|
- LGPL-3.0
|
193
193
|
metadata: {}
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
- !ruby/object:Gem::Version
|
207
207
|
version: '0'
|
208
208
|
requirements: []
|
209
|
-
rubygems_version: 3.
|
209
|
+
rubygems_version: 3.2.3
|
210
210
|
signing_key:
|
211
211
|
specification_version: 4
|
212
212
|
summary: Endpoints handle authentication, policies, run your domain operation and
|