trailblazer-endpoint 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +16 -1
- data/CHANGES.md +5 -0
- data/Rakefile +10 -0
- data/gemfiles/grape_app.gemfile +14 -0
- data/gemfiles/rails_app.gemfile +17 -0
- data/lib/trailblazer/endpoint/controller.rb +7 -4
- data/lib/trailblazer/endpoint/grape/controller.rb +28 -0
- data/lib/trailblazer/endpoint/protocol.rb +2 -2
- data/lib/trailblazer/endpoint/version.rb +1 -1
- data/lib/trailblazer/endpoint.rb +2 -2
- data/test/grape-app/app/api/app.rb +5 -0
- data/test/grape-app/app/api/v1/album.rb +67 -0
- data/test/grape-app/app/api/v1.rb +6 -0
- data/test/grape-app/app/concepts/album/operation/index.rb +7 -0
- data/test/grape-app/app/concepts/album/representer.rb +7 -0
- data/test/grape-app/app/concepts/application/endpoint/adapter.rb +6 -0
- data/test/grape-app/app/concepts/application/endpoint/protocol.rb +14 -0
- data/test/grape-app/app/concepts/song/operation/create.rb +7 -0
- data/test/grape-app/app/concepts/song/operation/index.rb +7 -0
- data/test/grape-app/app/concepts/song/representer.rb +9 -0
- data/test/grape-app/app/models/album.rb +2 -0
- data/test/grape-app/app/models/song.rb +2 -0
- data/test/grape-app/app/models/user.rb +2 -0
- data/test/grape-app/config.ru +15 -0
- data/test/grape-app/test/album_api_test.rb +37 -0
- data/test/grape-app/test/test_helper.rb +11 -0
- data/test/rails-app/Gemfile +4 -3
- data/test/rails-app/Gemfile.lock +104 -88
- data/trailblazer-endpoint.gemspec +1 -1
- metadata +41 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca657cac83db192bb913f8820ed265b0b3125c3613398d4306023b8aacd6e370
|
4
|
+
data.tar.gz: a361710a4613bd102600313c4690c298684e13d3c85a788fb4fe8502e7282c1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5aa3284445b3089cba1017e63b296d43439e88de53ccff7d300a59a5bfb24cefd66254887110a8d7b3a7687ad83a59c726f5fab5be3dcbd73e3c0545cbe0c21e
|
7
|
+
data.tar.gz: cf0ad2f97594c50cea2331c0449f50829e9b665cd1c7045b6df5934f9bb46940d5674a127dca53ca997a6b69c82e96bd8dff447d3e333ee92156f00d524557f9
|
data/Appraisals
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
appraise 'rails-app' do
|
2
2
|
gem 'rails', '6.0.3.1'
|
3
3
|
gem 'sqlite3', '~> 1.4'
|
4
|
-
gem "
|
4
|
+
gem "representable"
|
5
|
+
gem "trailblazer-operation", '>= 0.6.5'
|
6
|
+
gem "trailblazer-cells"
|
7
|
+
gem "cells-rails"
|
8
|
+
gem "cells-erb"
|
9
|
+
gem "jwt"
|
10
|
+
end
|
11
|
+
|
12
|
+
appraise 'grape-app' do
|
13
|
+
gem 'grape', '~> 1.5'
|
14
|
+
gem "zeitwerk", "~> 2.4"
|
15
|
+
gem "representable"
|
16
|
+
gem "trailblazer-operation", '>= 0.6.5'
|
17
|
+
|
18
|
+
gem "minitest-line", "~> 0.6"
|
19
|
+
gem "rack-test", "1.1.0"
|
5
20
|
end
|
data/CHANGES.md
CHANGED
data/Rakefile
CHANGED
@@ -9,8 +9,18 @@ Rake::TestTask.new(:test) do |test|
|
|
9
9
|
test.verbose = true
|
10
10
|
end
|
11
11
|
|
12
|
+
# To run grape app's test, run below command
|
13
|
+
# $ appraisal rails-app rake test-rails-app
|
12
14
|
Rake::TestTask.new('test-rails-app') do |test|
|
13
15
|
test.libs << 'test'
|
14
16
|
test.test_files = FileList['test/rails-app/test/test_helper.rb', 'test/rails-app/test/**/*.rb']
|
15
17
|
test.verbose = true
|
16
18
|
end
|
19
|
+
|
20
|
+
# To run grape app's test, run below command
|
21
|
+
# $ appraisal grape-app rake test-grape-app
|
22
|
+
Rake::TestTask.new('test-grape-app') do |test|
|
23
|
+
test.libs << 'test'
|
24
|
+
test.test_files = FileList['test/grape-app/test/test_helper.rb', 'test/grape-app/test/**/*.rb']
|
25
|
+
test.verbose = true
|
26
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "multi_json"
|
6
|
+
gem "minitest-line", "~> 0.6"
|
7
|
+
gem "dry-validation"
|
8
|
+
gem "grape", "~> 1.5"
|
9
|
+
gem "zeitwerk", "~> 2.4"
|
10
|
+
gem "representable"
|
11
|
+
gem "trailblazer-operation", ">= 0.6.5"
|
12
|
+
gem "rack-test", "1.1.0"
|
13
|
+
|
14
|
+
gemspec path: "../"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "multi_json"
|
6
|
+
gem "minitest-line"
|
7
|
+
gem "dry-validation"
|
8
|
+
gem "rails", "6.0.3.1"
|
9
|
+
gem "sqlite3", "~> 1.4"
|
10
|
+
gem "representable"
|
11
|
+
gem "trailblazer-operation", ">= 0.6.5"
|
12
|
+
gem "trailblazer-cells"
|
13
|
+
gem "cells-rails"
|
14
|
+
gem "cells-erb"
|
15
|
+
gem "jwt"
|
16
|
+
|
17
|
+
gemspec path: "../"
|
@@ -124,8 +124,12 @@ module Trailblazer
|
|
124
124
|
end
|
125
125
|
|
126
126
|
module InstanceMethods
|
127
|
+
# Returns object link between compile-time and run-time config
|
128
|
+
def config_source
|
129
|
+
self.class
|
130
|
+
end
|
127
131
|
|
128
|
-
def endpoint_for(name
|
132
|
+
def endpoint_for(name)
|
129
133
|
config_source.options_for(:endpoints, {}).fetch(name.to_s) # TODO: test non-existant endpoint
|
130
134
|
end
|
131
135
|
|
@@ -162,9 +166,8 @@ module Trailblazer
|
|
162
166
|
end
|
163
167
|
|
164
168
|
module API
|
165
|
-
def endpoint(name,
|
166
|
-
endpoint = endpoint_for(name
|
167
|
-
|
169
|
+
def endpoint(name, **action_options)
|
170
|
+
endpoint = endpoint_for(name)
|
168
171
|
action_options = {controller: self}.merge(action_options) # FIXME: redundant with {InstanceMethods#endpoint}
|
169
172
|
|
170
173
|
block_options = config_source.options_for(:options_for_block_options, **action_options)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Trailblazer
|
2
|
+
class Endpoint
|
3
|
+
# Grape Integration
|
4
|
+
#
|
5
|
+
module Grape
|
6
|
+
module Controller
|
7
|
+
# Make endpoint's compile time methods available in `base` and
|
8
|
+
# instance methods available in it's routes.
|
9
|
+
def self.included(base)
|
10
|
+
base.extend(Trailblazer::Endpoint::Controller)
|
11
|
+
|
12
|
+
base.helpers(
|
13
|
+
Trailblazer::Endpoint::Controller::InstanceMethods,
|
14
|
+
Trailblazer::Endpoint::Controller::InstanceMethods::API
|
15
|
+
)
|
16
|
+
|
17
|
+
base.helpers do
|
18
|
+
# Override `Controller::InstanceMethods#config_source` to return `base`
|
19
|
+
# as the link between compile-time and run-time config.
|
20
|
+
#
|
21
|
+
# @api public
|
22
|
+
define_method(:config_source, ->{ base })
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -19,7 +19,7 @@ module Trailblazer
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self._Path(semantic:, &block) # DISCUSS: the problem with Path currently is https://github.com/trailblazer/trailblazer-activity-dsl-linear/issues/27
|
22
|
-
Path(track_color: semantic,
|
22
|
+
Path(track_color: semantic, terminus: semantic, &block)
|
23
23
|
end
|
24
24
|
|
25
25
|
step :authenticate, Output(:failure) => _Path(semantic: :not_authenticated) do
|
@@ -103,7 +103,7 @@ module Trailblazer
|
|
103
103
|
|
104
104
|
def self.extension_for_terminus_handler
|
105
105
|
# this is called after {:output}.
|
106
|
-
[
|
106
|
+
[method(:terminus_handler), id: "endpoint.end_signal", append: "task_wrap.call_task"] # the "friendly interface" for extensions.
|
107
107
|
end
|
108
108
|
end
|
109
109
|
end # Protocol
|
data/lib/trailblazer/endpoint.rb
CHANGED
@@ -18,7 +18,7 @@ module Trailblazer
|
|
18
18
|
|
19
19
|
|
20
20
|
extensions_options = {
|
21
|
-
extensions: [
|
21
|
+
extensions: [Activity::TaskWrap::Extension.WrapStatic(Trailblazer::Endpoint::Protocol::Domain.extension_for_terminus_handler)],
|
22
22
|
}
|
23
23
|
|
24
24
|
# scoping: {:domain_ctx} becomes ctx
|
@@ -59,7 +59,7 @@ module Trailblazer
|
|
59
59
|
pass Protocol::Controller.method(:deserialize_process_model_id_from_resume_data), after: :deserialize_resume_data, magnetic_to: :deserialize, Output(:success) => Track(:deserialize)
|
60
60
|
end
|
61
61
|
|
62
|
-
step(Subprocess(domain_activity), {inherit: true,
|
62
|
+
step(Subprocess(domain_activity), {inherit: true, replace: :domain_activity,
|
63
63
|
|
64
64
|
# FIXME: where does this go?
|
65
65
|
}.
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module V1
|
2
|
+
class Album < V1::API
|
3
|
+
include Trailblazer::Endpoint::Grape::Controller
|
4
|
+
|
5
|
+
def self.options_for_endpoint(ctx, controller:, **)
|
6
|
+
{
|
7
|
+
request: controller.request,
|
8
|
+
errors: Trailblazer::Endpoint::Adapter::API::Errors.new,
|
9
|
+
}
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.options_for_domain_ctx(ctx, controller:, **)
|
13
|
+
{
|
14
|
+
params: controller.params,
|
15
|
+
# current_user: current_user, # TODO: Access current_user
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.options_for_block_options(ctx, controller:, **)
|
20
|
+
response_block = ->(ctx, endpoint_ctx:, **) do
|
21
|
+
controller.body json: ctx[:model]
|
22
|
+
controller.status endpoint_ctx[:status]
|
23
|
+
end
|
24
|
+
|
25
|
+
failure_block = ->(ctx, endpoint_ctx:, **) do
|
26
|
+
controller.body json: ctx[:errors].message
|
27
|
+
controller.status endpoint_ctx[:status]
|
28
|
+
end
|
29
|
+
|
30
|
+
{
|
31
|
+
success_block: response_block,
|
32
|
+
failure_block: failure_block,
|
33
|
+
protocol_failure_block: failure_block
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
directive :options_for_endpoint, method(:options_for_endpoint)
|
38
|
+
directive :options_for_domain_ctx, method(:options_for_domain_ctx)
|
39
|
+
directive :options_for_block_options, method(:options_for_block_options)
|
40
|
+
|
41
|
+
endpoint ::Album::Operation::Index, protocol: Application::Endpoint::Protocol, adapter: Application::Endpoint::Adapter
|
42
|
+
desc "Get list of albums"
|
43
|
+
get { endpoint ::Album::Operation::Index, representer_class: ::Album::Representer }
|
44
|
+
|
45
|
+
endpoint ::Song::Operation::Index, protocol: Application::Endpoint::Protocol, adapter: Application::Endpoint::Adapter
|
46
|
+
endpoint ::Song::Operation::Create, protocol: Application::Endpoint::Protocol, adapter: Application::Endpoint::Adapter
|
47
|
+
|
48
|
+
# FIXME: Use inheritance same as Rails's ApplicationController for maintaining global config
|
49
|
+
# Grape has anonymous class scope within resource block which doesn't copy inheritance settings
|
50
|
+
# mount ::V1::Song => ':album_id/songs'
|
51
|
+
|
52
|
+
resource ':album_id/songs' do
|
53
|
+
desc "Get list of songs"
|
54
|
+
get { endpoint ::Song::Operation::Index, representer_class: ::Song::Representer }
|
55
|
+
|
56
|
+
desc "Create a song"
|
57
|
+
post do
|
58
|
+
on_create = ->(ctx, model:, endpoint_ctx:, **) do
|
59
|
+
status 201
|
60
|
+
body json: endpoint_ctx[:representer_class].new(model).to_json
|
61
|
+
end
|
62
|
+
|
63
|
+
endpoint ::Song::Operation::Create, success_block: on_create, representer_class: ::Song::Representer
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Application::Endpoint
|
2
|
+
class Protocol < Trailblazer::Endpoint::Protocol
|
3
|
+
def authenticate(ctx, controller:, **)
|
4
|
+
username, password = Rack::Auth::Basic::Request.new(controller.env).credentials
|
5
|
+
return false if username != password
|
6
|
+
|
7
|
+
ctx[:current_user] = User.new(username)
|
8
|
+
end
|
9
|
+
|
10
|
+
def policy(ctx, current_user:, **)
|
11
|
+
current_user.username == 'admin'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "grape"
|
2
|
+
require "zeitwerk"
|
3
|
+
|
4
|
+
require "trailblazer/operation"
|
5
|
+
require "trailblazer/endpoint"
|
6
|
+
require "trailblazer/endpoint/grape/controller"
|
7
|
+
|
8
|
+
loader = Zeitwerk::Loader.new
|
9
|
+
loader.push_dir("#{__dir__}/app/api")
|
10
|
+
loader.push_dir("#{__dir__}/app/models")
|
11
|
+
loader.push_dir("#{__dir__}/app/concepts")
|
12
|
+
loader.setup
|
13
|
+
|
14
|
+
App::API.compile!
|
15
|
+
run App::API
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class AlbumApiTest < Minitest::Spec
|
4
|
+
include Rack::Test::Methods
|
5
|
+
|
6
|
+
def app
|
7
|
+
APP_API
|
8
|
+
end
|
9
|
+
|
10
|
+
it "not_authenticated" do
|
11
|
+
get "/v1/albums", {}, 'HTTP_AUTHORIZATION' => encode_basic_auth('admin', 'wrong')
|
12
|
+
|
13
|
+
assert_equal last_response.status, 401
|
14
|
+
assert_equal last_response.body, "{\"json\":\"Authentication credentials were not provided or are invalid.\"}"
|
15
|
+
end
|
16
|
+
|
17
|
+
it "not_authorized" do
|
18
|
+
get "/v1/albums", {}, 'HTTP_AUTHORIZATION' => encode_basic_auth('not_admin', 'not_admin')
|
19
|
+
|
20
|
+
assert_equal last_response.status, 403
|
21
|
+
assert_equal last_response.body, "{\"json\":\"Action not allowed due to a policy setting.\"}"
|
22
|
+
end
|
23
|
+
|
24
|
+
it "success" do
|
25
|
+
get "/v1/albums", {}, 'HTTP_AUTHORIZATION' => encode_basic_auth('admin', 'admin')
|
26
|
+
|
27
|
+
assert_equal last_response.status, 200
|
28
|
+
# assert_equal last_response.body, "" # TODO: Use representer
|
29
|
+
end
|
30
|
+
|
31
|
+
it "created" do
|
32
|
+
post "/v1/albums/1/songs", {}, 'HTTP_AUTHORIZATION' => encode_basic_auth('admin', 'admin')
|
33
|
+
|
34
|
+
assert_equal last_response.status, 201
|
35
|
+
assert_equal JSON.parse(last_response.body), {"json"=>"{\"id\":1,\"album_id\":\"1\",\"created_by\":\"current_user.username\"}"}
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "rack/test"
|
3
|
+
|
4
|
+
config_path = File.expand_path(File.join(__FILE__, '../../config.ru'))
|
5
|
+
APP_API = Rack::Builder.parse_file(config_path).first
|
6
|
+
|
7
|
+
Minitest::Spec.class_eval do
|
8
|
+
def encode_basic_auth(username, password)
|
9
|
+
'Basic ' + Base64.encode64("#{username}:#{password}")
|
10
|
+
end
|
11
|
+
end
|
data/test/rails-app/Gemfile
CHANGED
@@ -14,7 +14,6 @@ gem 'sqlite3', '~> 1.4'
|
|
14
14
|
# gem 'rack-cors'
|
15
15
|
|
16
16
|
# gem "trailblazer-operation"
|
17
|
-
# gem "trailblazer-operation", path: "../../../trailblazer-operation"
|
18
17
|
# # gem "trailblazer-context", path: "../../../trailblazer-context"
|
19
18
|
# gem "trailblazer-activity-dsl-linear", path: "../../../trailblazer-activity-dsl-linear"
|
20
19
|
# gem "trailblazer-activity", path: "../../../trailblazer-activity"
|
@@ -32,5 +31,7 @@ gem "trailblazer-operation"
|
|
32
31
|
|
33
32
|
# FIXME
|
34
33
|
# gem "trailblazer-workflow", path: "../../../trailblazer-workflow"
|
35
|
-
# gem "trailblazer-activity
|
36
|
-
# gem "trailblazer-activity-dsl-linear", "
|
34
|
+
# gem "trailblazer-activity", path: "../../../trailblazer-activity"
|
35
|
+
# gem "trailblazer-activity-dsl-linear", path: "../../../trailblazer-activity-dsl-linear"
|
36
|
+
# gem "trailblazer-operation", path: "../../../trailblazer-operation"
|
37
|
+
# gem "trailblazer-developer", path: "../../../trailblazer-developer"
|
data/test/rails-app/Gemfile.lock
CHANGED
@@ -1,62 +1,62 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../..
|
3
3
|
specs:
|
4
|
-
trailblazer-endpoint (0.0.
|
5
|
-
trailblazer-activity-dsl-linear (>= 1.
|
4
|
+
trailblazer-endpoint (0.0.11)
|
5
|
+
trailblazer-activity-dsl-linear (>= 1.2.0, < 1.3.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (6.0.
|
11
|
-
actionpack (= 6.0.
|
10
|
+
actioncable (6.0.6.1)
|
11
|
+
actionpack (= 6.0.6.1)
|
12
12
|
nio4r (~> 2.0)
|
13
13
|
websocket-driver (>= 0.6.1)
|
14
|
-
actionmailbox (6.0.
|
15
|
-
actionpack (= 6.0.
|
16
|
-
activejob (= 6.0.
|
17
|
-
activerecord (= 6.0.
|
18
|
-
activestorage (= 6.0.
|
19
|
-
activesupport (= 6.0.
|
14
|
+
actionmailbox (6.0.6.1)
|
15
|
+
actionpack (= 6.0.6.1)
|
16
|
+
activejob (= 6.0.6.1)
|
17
|
+
activerecord (= 6.0.6.1)
|
18
|
+
activestorage (= 6.0.6.1)
|
19
|
+
activesupport (= 6.0.6.1)
|
20
20
|
mail (>= 2.7.1)
|
21
|
-
actionmailer (6.0.
|
22
|
-
actionpack (= 6.0.
|
23
|
-
actionview (= 6.0.
|
24
|
-
activejob (= 6.0.
|
21
|
+
actionmailer (6.0.6.1)
|
22
|
+
actionpack (= 6.0.6.1)
|
23
|
+
actionview (= 6.0.6.1)
|
24
|
+
activejob (= 6.0.6.1)
|
25
25
|
mail (~> 2.5, >= 2.5.4)
|
26
26
|
rails-dom-testing (~> 2.0)
|
27
|
-
actionpack (6.0.
|
28
|
-
actionview (= 6.0.
|
29
|
-
activesupport (= 6.0.
|
27
|
+
actionpack (6.0.6.1)
|
28
|
+
actionview (= 6.0.6.1)
|
29
|
+
activesupport (= 6.0.6.1)
|
30
30
|
rack (~> 2.0, >= 2.0.8)
|
31
31
|
rack-test (>= 0.6.3)
|
32
32
|
rails-dom-testing (~> 2.0)
|
33
33
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
34
|
-
actiontext (6.0.
|
35
|
-
actionpack (= 6.0.
|
36
|
-
activerecord (= 6.0.
|
37
|
-
activestorage (= 6.0.
|
38
|
-
activesupport (= 6.0.
|
34
|
+
actiontext (6.0.6.1)
|
35
|
+
actionpack (= 6.0.6.1)
|
36
|
+
activerecord (= 6.0.6.1)
|
37
|
+
activestorage (= 6.0.6.1)
|
38
|
+
activesupport (= 6.0.6.1)
|
39
39
|
nokogiri (>= 1.8.5)
|
40
|
-
actionview (6.0.
|
41
|
-
activesupport (= 6.0.
|
40
|
+
actionview (6.0.6.1)
|
41
|
+
activesupport (= 6.0.6.1)
|
42
42
|
builder (~> 3.1)
|
43
43
|
erubi (~> 1.4)
|
44
44
|
rails-dom-testing (~> 2.0)
|
45
45
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
46
|
-
activejob (6.0.
|
47
|
-
activesupport (= 6.0.
|
46
|
+
activejob (6.0.6.1)
|
47
|
+
activesupport (= 6.0.6.1)
|
48
48
|
globalid (>= 0.3.6)
|
49
|
-
activemodel (6.0.
|
50
|
-
activesupport (= 6.0.
|
51
|
-
activerecord (6.0.
|
52
|
-
activemodel (= 6.0.
|
53
|
-
activesupport (= 6.0.
|
54
|
-
activestorage (6.0.
|
55
|
-
actionpack (= 6.0.
|
56
|
-
activejob (= 6.0.
|
57
|
-
activerecord (= 6.0.
|
58
|
-
marcel (~> 1.0
|
59
|
-
activesupport (6.0.
|
49
|
+
activemodel (6.0.6.1)
|
50
|
+
activesupport (= 6.0.6.1)
|
51
|
+
activerecord (6.0.6.1)
|
52
|
+
activemodel (= 6.0.6.1)
|
53
|
+
activesupport (= 6.0.6.1)
|
54
|
+
activestorage (6.0.6.1)
|
55
|
+
actionpack (= 6.0.6.1)
|
56
|
+
activejob (= 6.0.6.1)
|
57
|
+
activerecord (= 6.0.6.1)
|
58
|
+
marcel (~> 1.0)
|
59
|
+
activesupport (6.0.6.1)
|
60
60
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
61
61
|
i18n (>= 0.7, < 2)
|
62
62
|
minitest (~> 5.1)
|
@@ -71,71 +71,84 @@ GEM
|
|
71
71
|
cells-erb (0.1.0)
|
72
72
|
cells (~> 4.0)
|
73
73
|
erbse (>= 0.1.1)
|
74
|
-
cells-rails (0.1.
|
74
|
+
cells-rails (0.1.5)
|
75
75
|
actionpack (>= 5.0)
|
76
76
|
cells (>= 4.1.6, < 5.0.0)
|
77
|
-
concurrent-ruby (1.
|
77
|
+
concurrent-ruby (1.2.2)
|
78
78
|
crass (1.0.6)
|
79
|
+
date (3.3.3)
|
79
80
|
declarative (0.0.20)
|
80
81
|
declarative-builder (0.1.0)
|
81
82
|
declarative-option (< 0.2.0)
|
82
83
|
declarative-option (0.1.0)
|
83
84
|
erbse (0.1.4)
|
84
85
|
temple
|
85
|
-
erubi (1.
|
86
|
-
globalid (1.
|
86
|
+
erubi (1.12.0)
|
87
|
+
globalid (1.1.0)
|
87
88
|
activesupport (>= 5.0)
|
88
89
|
hashie (5.0.0)
|
89
90
|
hirb (0.7.3)
|
90
|
-
i18n (1.
|
91
|
+
i18n (1.12.0)
|
91
92
|
concurrent-ruby (~> 1.0)
|
92
|
-
jwt (2.
|
93
|
-
loofah (2.
|
93
|
+
jwt (2.7.0)
|
94
|
+
loofah (2.19.1)
|
94
95
|
crass (~> 1.0.2)
|
95
96
|
nokogiri (>= 1.5.9)
|
96
|
-
mail (2.
|
97
|
+
mail (2.8.1)
|
97
98
|
mini_mime (>= 0.1.1)
|
99
|
+
net-imap
|
100
|
+
net-pop
|
101
|
+
net-smtp
|
98
102
|
marcel (1.0.2)
|
99
103
|
method_source (1.0.0)
|
100
104
|
mini_mime (1.1.2)
|
101
|
-
mini_portile2 (2.8.
|
102
|
-
minitest (5.
|
105
|
+
mini_portile2 (2.8.1)
|
106
|
+
minitest (5.17.0)
|
103
107
|
minitest-line (0.6.5)
|
104
108
|
minitest (~> 5.0)
|
105
109
|
multi_json (1.15.0)
|
110
|
+
net-imap (0.3.4)
|
111
|
+
date
|
112
|
+
net-protocol
|
113
|
+
net-pop (0.1.2)
|
114
|
+
net-protocol
|
115
|
+
net-protocol (0.2.1)
|
116
|
+
timeout
|
117
|
+
net-smtp (0.3.3)
|
118
|
+
net-protocol
|
106
119
|
nio4r (2.5.8)
|
107
|
-
nokogiri (1.
|
120
|
+
nokogiri (1.14.2)
|
108
121
|
mini_portile2 (~> 2.8.0)
|
109
122
|
racc (~> 1.4)
|
110
|
-
nokogiri (1.
|
123
|
+
nokogiri (1.14.2-x86_64-linux)
|
111
124
|
racc (~> 1.4)
|
112
|
-
racc (1.6.
|
113
|
-
rack (2.2.
|
114
|
-
rack-test (
|
115
|
-
rack (>= 1.
|
116
|
-
rails (6.0.
|
117
|
-
actioncable (= 6.0.
|
118
|
-
actionmailbox (= 6.0.
|
119
|
-
actionmailer (= 6.0.
|
120
|
-
actionpack (= 6.0.
|
121
|
-
actiontext (= 6.0.
|
122
|
-
actionview (= 6.0.
|
123
|
-
activejob (= 6.0.
|
124
|
-
activemodel (= 6.0.
|
125
|
-
activerecord (= 6.0.
|
126
|
-
activestorage (= 6.0.
|
127
|
-
activesupport (= 6.0.
|
125
|
+
racc (1.6.2)
|
126
|
+
rack (2.2.6.2)
|
127
|
+
rack-test (2.0.2)
|
128
|
+
rack (>= 1.3)
|
129
|
+
rails (6.0.6.1)
|
130
|
+
actioncable (= 6.0.6.1)
|
131
|
+
actionmailbox (= 6.0.6.1)
|
132
|
+
actionmailer (= 6.0.6.1)
|
133
|
+
actionpack (= 6.0.6.1)
|
134
|
+
actiontext (= 6.0.6.1)
|
135
|
+
actionview (= 6.0.6.1)
|
136
|
+
activejob (= 6.0.6.1)
|
137
|
+
activemodel (= 6.0.6.1)
|
138
|
+
activerecord (= 6.0.6.1)
|
139
|
+
activestorage (= 6.0.6.1)
|
140
|
+
activesupport (= 6.0.6.1)
|
128
141
|
bundler (>= 1.3.0)
|
129
|
-
railties (= 6.0.
|
142
|
+
railties (= 6.0.6.1)
|
130
143
|
sprockets-rails (>= 2.0.0)
|
131
144
|
rails-dom-testing (2.0.3)
|
132
145
|
activesupport (>= 4.2.0)
|
133
146
|
nokogiri (>= 1.6)
|
134
|
-
rails-html-sanitizer (1.
|
135
|
-
loofah (~> 2.
|
136
|
-
railties (6.0.
|
137
|
-
actionpack (= 6.0.
|
138
|
-
activesupport (= 6.0.
|
147
|
+
rails-html-sanitizer (1.5.0)
|
148
|
+
loofah (~> 2.19, >= 2.19.1)
|
149
|
+
railties (6.0.6.1)
|
150
|
+
actionpack (= 6.0.6.1)
|
151
|
+
activesupport (= 6.0.6.1)
|
139
152
|
method_source
|
140
153
|
rake (>= 0.8.7)
|
141
154
|
thor (>= 0.20.3, < 2.0)
|
@@ -144,43 +157,46 @@ GEM
|
|
144
157
|
declarative (< 0.1.0)
|
145
158
|
trailblazer-option (>= 0.1.1, < 0.2.0)
|
146
159
|
uber (< 0.2.0)
|
147
|
-
sprockets (4.0
|
160
|
+
sprockets (4.2.0)
|
148
161
|
concurrent-ruby (~> 1.0)
|
149
|
-
rack (
|
162
|
+
rack (>= 2.2.4, < 4)
|
150
163
|
sprockets-rails (3.4.2)
|
151
164
|
actionpack (>= 5.2)
|
152
165
|
activesupport (>= 5.2)
|
153
166
|
sprockets (>= 3.0.0)
|
154
|
-
sqlite3 (1.
|
155
|
-
|
167
|
+
sqlite3 (1.6.1)
|
168
|
+
mini_portile2 (~> 2.8.0)
|
169
|
+
sqlite3 (1.6.1-x86_64-linux)
|
170
|
+
temple (0.10.0)
|
156
171
|
thor (1.2.1)
|
157
172
|
thread_safe (0.3.6)
|
158
|
-
tilt (2.0
|
159
|
-
|
173
|
+
tilt (2.1.0)
|
174
|
+
timeout (0.3.2)
|
175
|
+
trailblazer-activity (0.16.0)
|
160
176
|
trailblazer-context (~> 0.5.0)
|
161
177
|
trailblazer-option (~> 0.1.0)
|
162
|
-
trailblazer-activity-dsl-linear (1.
|
163
|
-
trailblazer-activity (>= 0.
|
178
|
+
trailblazer-activity-dsl-linear (1.2.0)
|
179
|
+
trailblazer-activity (>= 0.16.0, < 0.17.0)
|
164
180
|
trailblazer-declarative (>= 0.0.1, < 0.1.0)
|
165
181
|
trailblazer-cells (0.0.3)
|
166
182
|
cells (>= 4.1.0.rc1, < 5.0.0)
|
167
|
-
trailblazer-context (0.5.
|
183
|
+
trailblazer-context (0.5.1)
|
168
184
|
hashie (>= 3.0.0)
|
169
|
-
trailblazer-declarative (0.0.
|
170
|
-
trailblazer-developer (0.0.
|
185
|
+
trailblazer-declarative (0.0.2)
|
186
|
+
trailblazer-developer (0.0.28)
|
171
187
|
hirb
|
172
|
-
trailblazer-activity-dsl-linear (>= 1.
|
173
|
-
trailblazer-operation (0.
|
174
|
-
trailblazer-activity-dsl-linear (>= 1.
|
175
|
-
trailblazer-developer
|
188
|
+
trailblazer-activity-dsl-linear (>= 1.2.0, < 1.3.0)
|
189
|
+
trailblazer-operation (0.10.0)
|
190
|
+
trailblazer-activity-dsl-linear (>= 1.2.0, < 1.4.0)
|
191
|
+
trailblazer-developer
|
176
192
|
trailblazer-option (0.1.2)
|
177
|
-
tzinfo (1.2.
|
193
|
+
tzinfo (1.2.11)
|
178
194
|
thread_safe (~> 0.1)
|
179
195
|
uber (0.1.0)
|
180
196
|
websocket-driver (0.7.5)
|
181
197
|
websocket-extensions (>= 0.1.0)
|
182
198
|
websocket-extensions (0.1.5)
|
183
|
-
zeitwerk (2.
|
199
|
+
zeitwerk (2.6.7)
|
184
200
|
|
185
201
|
PLATFORMS
|
186
202
|
ruby
|
@@ -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", ">= 1.
|
20
|
+
spec.add_dependency "trailblazer-activity-dsl-linear", ">= 1.2.0", "< 1.3.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.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-02 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: 1.
|
19
|
+
version: 1.2.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.
|
22
|
+
version: 1.3.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: 1.
|
29
|
+
version: 1.2.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.
|
32
|
+
version: 1.3.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,12 +100,15 @@ files:
|
|
100
100
|
- Gemfile
|
101
101
|
- README.md
|
102
102
|
- Rakefile
|
103
|
+
- gemfiles/grape_app.gemfile
|
104
|
+
- gemfiles/rails_app.gemfile
|
103
105
|
- lib/trailblazer-endpoint.rb
|
104
106
|
- lib/trailblazer/endpoint.rb
|
105
107
|
- lib/trailblazer/endpoint/adapter.rb
|
106
108
|
- lib/trailblazer/endpoint/builder.rb
|
107
109
|
- lib/trailblazer/endpoint/controller.rb
|
108
110
|
- lib/trailblazer/endpoint/dsl.rb
|
111
|
+
- lib/trailblazer/endpoint/grape/controller.rb
|
109
112
|
- lib/trailblazer/endpoint/options.rb
|
110
113
|
- lib/trailblazer/endpoint/protocol.rb
|
111
114
|
- lib/trailblazer/endpoint/protocol/cipher.rb
|
@@ -121,6 +124,22 @@ files:
|
|
121
124
|
- test/docs/controller_test.rb
|
122
125
|
- test/docs/endpoint_test.rb
|
123
126
|
- test/endpoint_test.rb
|
127
|
+
- test/grape-app/app/api/app.rb
|
128
|
+
- test/grape-app/app/api/v1.rb
|
129
|
+
- test/grape-app/app/api/v1/album.rb
|
130
|
+
- test/grape-app/app/concepts/album/operation/index.rb
|
131
|
+
- test/grape-app/app/concepts/album/representer.rb
|
132
|
+
- test/grape-app/app/concepts/application/endpoint/adapter.rb
|
133
|
+
- test/grape-app/app/concepts/application/endpoint/protocol.rb
|
134
|
+
- test/grape-app/app/concepts/song/operation/create.rb
|
135
|
+
- test/grape-app/app/concepts/song/operation/index.rb
|
136
|
+
- test/grape-app/app/concepts/song/representer.rb
|
137
|
+
- test/grape-app/app/models/album.rb
|
138
|
+
- test/grape-app/app/models/song.rb
|
139
|
+
- test/grape-app/app/models/user.rb
|
140
|
+
- test/grape-app/config.ru
|
141
|
+
- test/grape-app/test/album_api_test.rb
|
142
|
+
- test/grape-app/test/test_helper.rb
|
124
143
|
- test/rails-app/.gitignore
|
125
144
|
- test/rails-app/.ruby-version
|
126
145
|
- test/rails-app/Gemfile
|
@@ -219,6 +238,22 @@ test_files:
|
|
219
238
|
- test/docs/controller_test.rb
|
220
239
|
- test/docs/endpoint_test.rb
|
221
240
|
- test/endpoint_test.rb
|
241
|
+
- test/grape-app/app/api/app.rb
|
242
|
+
- test/grape-app/app/api/v1.rb
|
243
|
+
- test/grape-app/app/api/v1/album.rb
|
244
|
+
- test/grape-app/app/concepts/album/operation/index.rb
|
245
|
+
- test/grape-app/app/concepts/album/representer.rb
|
246
|
+
- test/grape-app/app/concepts/application/endpoint/adapter.rb
|
247
|
+
- test/grape-app/app/concepts/application/endpoint/protocol.rb
|
248
|
+
- test/grape-app/app/concepts/song/operation/create.rb
|
249
|
+
- test/grape-app/app/concepts/song/operation/index.rb
|
250
|
+
- test/grape-app/app/concepts/song/representer.rb
|
251
|
+
- test/grape-app/app/models/album.rb
|
252
|
+
- test/grape-app/app/models/song.rb
|
253
|
+
- test/grape-app/app/models/user.rb
|
254
|
+
- test/grape-app/config.ru
|
255
|
+
- test/grape-app/test/album_api_test.rb
|
256
|
+
- test/grape-app/test/test_helper.rb
|
222
257
|
- test/rails-app/.gitignore
|
223
258
|
- test/rails-app/.ruby-version
|
224
259
|
- test/rails-app/Gemfile
|