trailblazer-endpoint 0.0.10 → 0.0.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57e2396200f20eb000c87f7b740ea31dd41c9db79ea6d3ba02bdb2e85e0b8ba0
4
- data.tar.gz: 68fc7c66e7fdebe16cf6a347c0d7104efb520fcf2fc8aabcafd79914df5492d9
3
+ metadata.gz: ca657cac83db192bb913f8820ed265b0b3125c3613398d4306023b8aacd6e370
4
+ data.tar.gz: a361710a4613bd102600313c4690c298684e13d3c85a788fb4fe8502e7282c1c
5
5
  SHA512:
6
- metadata.gz: 93f8b8b7e0fad7959cec6ac2f8b11955867ccc6276ee511748beb072df2f66e00ccb648f082c30e7f776cf3736442688d0334e9c59ea95c06d96b6b26ea6f6ec
7
- data.tar.gz: 200822214d8146292f64390c63fb3104386496b2326e6fd026d61bd477592fb6bc86d3a3acb48c8e9acd279ac5375f8164da816c6744e6ec5e901ec9d3edf718
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 "trailblazer-operation"
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
@@ -1,3 +1,13 @@
1
+ # 0.0.12
2
+
3
+ * Use `trailblazer-activity-dsl-linear` 1.2.0.
4
+ * Remove a deprecation warning by using the `WrapStatic()` extension builder.
5
+
6
+ # 0.0.11
7
+
8
+ * Require `trailblazer-activity-dsl-linear` >= 1.0.0.
9
+ * Use `#terminus` instead of clumsily adding termini to `Protocol` and `Adapter`.
10
+
1
11
  # 0.0.10
2
12
 
3
13
  * Require `dsl-linear` >= 0.5.0.
data/Gemfile CHANGED
@@ -8,7 +8,7 @@ gem "multi_json"
8
8
  gem "minitest-line"
9
9
 
10
10
  # gem "trailblazer-activity", path: "../trailblazer-activity"
11
- # gem "trailblazer-activity-dsl-linear", path: "../trailblazer-activity-dsl-linear"
11
+ gem "trailblazer-activity-dsl-linear", path: "../trailblazer-activity-dsl-linear"
12
12
  # gem "trailblazer-operation", path: "../operation"
13
13
 
14
14
  gem "dry-validation"
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: "../"
@@ -7,6 +7,11 @@ gem "minitest-line"
7
7
  gem "dry-validation"
8
8
  gem "rails", "6.0.3.1"
9
9
  gem "sqlite3", "~> 1.4"
10
- gem "trailblazer-operation"
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"
11
16
 
12
17
  gemspec path: "../"
@@ -15,15 +15,8 @@ module Trailblazer
15
15
  _403_path = ->(*) { step :_403_status }
16
16
  # _422_path = ->(*) { step :_422_status } # TODO: this is currently represented by the {failure} track.
17
17
 
18
- # FIXME: is this really the only way to add an {End} to all this?
19
- @state.update_sequence do |sequence:, **|
20
- sequence = Activity::Path::DSL.append_end(sequence, task: Activity::End.new(semantic: :fail_fast), magnetic_to: :fail_fast, id: "End.fail_fast") # TODO: rename to {protocol_failure}
21
- sequence = Activity::Path::DSL.append_end(sequence, task: Activity::End.new(semantic: :failure), magnetic_to: :failure, id: "End.failure")
22
-
23
- recompile_activity!(sequence)
24
-
25
- sequence
26
- end
18
+ terminus :fail_fast
19
+ terminus :failure
27
20
 
28
21
  step Subprocess(Protocol), # this will get replaced
29
22
  id: :protocol,
@@ -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, config_source: self.class)
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, config_source: self.class, **action_options)
166
- endpoint = endpoint_for(name, config_source: config_source)
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, end_id: "End.#{semantic}", end_task: Activity::End.new(semantic: semantic), &block)
22
+ Path(track_color: semantic, terminus: semantic, &block)
23
23
  end
24
24
 
25
25
  step :authenticate, Output(:failure) => _Path(semantic: :not_authenticated) do
@@ -38,15 +38,8 @@ module Trailblazer
38
38
 
39
39
  # add the {End.not_found} terminus to this Protocol. I'm not sure that's the final style, but since a {Protocol} needs to provide all
40
40
  # termini for the Adapter this is the only way to get it working right now.
41
- # FIXME: is this really the only way to add an {End} to all this?
42
- @state.update_sequence do |sequence:, **|
43
- sequence = Activity::Path::DSL.append_end(sequence, task: Activity::End.new(semantic: :not_found), magnetic_to: :not_found, id: "End.not_found")
44
- sequence = Activity::Path::DSL.append_end(sequence, task: Activity::End.new(semantic: :invalid_data), magnetic_to: :invalid_data, id: "End.invalid_data")
45
-
46
- recompile_activity!(sequence)
47
-
48
- sequence
49
- end
41
+ terminus :not_found
42
+ terminus :invalid_data
50
43
 
51
44
  # Best-practices of useful routes and handlers that work with 2.1-OPs.
52
45
  class Standard < Protocol
@@ -110,7 +103,7 @@ module Trailblazer
110
103
 
111
104
  def self.extension_for_terminus_handler
112
105
  # this is called after {:output}.
113
- [[Trailblazer::Activity::TaskWrap::Pipeline.method(:insert_after), "task_wrap.call_task", ["endpoint.end_signal", method(:terminus_handler)]]]
106
+ [method(:terminus_handler), id: "endpoint.end_signal", append: "task_wrap.call_task"] # the "friendly interface" for extensions.
114
107
  end
115
108
  end
116
109
  end # Protocol
@@ -1,5 +1,5 @@
1
1
  module Trailblazer
2
2
  class Endpoint
3
- VERSION = "0.0.10"
3
+ VERSION = "0.0.12"
4
4
  end
5
5
  end
@@ -18,7 +18,7 @@ module Trailblazer
18
18
 
19
19
 
20
20
  extensions_options = {
21
- extensions: [Trailblazer::Activity::TaskWrap::Extension(merge: Trailblazer::Endpoint::Protocol::Domain.extension_for_terminus_handler)],
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, id: :domain_activity, replace: :domain_activity,
62
+ step(Subprocess(domain_activity), {inherit: true, replace: :domain_activity,
63
63
 
64
64
  # FIXME: where does this go?
65
65
  }.
@@ -0,0 +1,5 @@
1
+ module App
2
+ class API < Grape::API
3
+ mount V1::API => "/v1"
4
+ end
5
+ end
@@ -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,6 @@
1
+ module V1
2
+ class API < Grape::API
3
+ format :json
4
+ mount V1::Album => "/albums"
5
+ end
6
+ end
@@ -0,0 +1,7 @@
1
+ class Album::Operation::Index < Trailblazer::Operation
2
+ step :model
3
+
4
+ def model(ctx, **)
5
+ ctx[:model] = 3.times.collect{ |i| Album.new(i) }
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'representable'
2
+
3
+ class Album::Representer < Representable::Decorator
4
+ include Representable::JSON
5
+
6
+ property :id
7
+ end
@@ -0,0 +1,6 @@
1
+ module Application::Endpoint
2
+ class Adapter < Trailblazer::Endpoint::Adapter::API
3
+ include Errors::Handlers
4
+ insert_error_handler_steps!(self)
5
+ end
6
+ 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,7 @@
1
+ class Song::Operation::Create < Trailblazer::Operation
2
+ step :model
3
+
4
+ def model(ctx, params:, **)
5
+ ctx[:model] = Song.new(1, params.fetch(:album_id), "current_user.username") # TODO: Access current_user
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ class Song::Operation::Index < Trailblazer::Operation
2
+ step :model
3
+
4
+ def model(ctx, **)
5
+ ctx[:model] = 3.times.collect{ |i| Song.new(i) }
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ require 'representable'
2
+
3
+ class Song::Representer < Representable::Decorator
4
+ include Representable::JSON
5
+
6
+ property :id
7
+ property :album_id
8
+ property :created_by
9
+ end
@@ -0,0 +1,2 @@
1
+ class Album < Struct.new(:id)
2
+ end
@@ -0,0 +1,2 @@
1
+ class Song < Struct.new(:id, :album_id, :created_by)
2
+ end
@@ -0,0 +1,2 @@
1
+ class User < Struct.new(:username)
2
+ 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
@@ -14,10 +14,9 @@ gem 'sqlite3', '~> 1.4'
14
14
  # gem 'rack-cors'
15
15
 
16
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"
17
+ # # gem "trailblazer-context", path: "../../../trailblazer-context"
18
+ # gem "trailblazer-activity-dsl-linear", path: "../../../trailblazer-activity-dsl-linear"
19
+ # gem "trailblazer-activity", path: "../../../trailblazer-activity"
21
20
 
22
21
 
23
22
  gem "trailblazer-endpoint", path: "../../."
@@ -27,9 +26,12 @@ gem "minitest-line"
27
26
  gem "trailblazer-cells"
28
27
  gem "cells-erb"
29
28
  gem "cells-rails"
30
-
29
+ gem "representable"
30
+ gem "trailblazer-operation"
31
31
 
32
32
  # FIXME
33
33
  # gem "trailblazer-workflow", path: "../../../trailblazer-workflow"
34
- # gem "trailblazer-activity-dsl-linear", path: "../../../trailblazer-activity-dsl-linear"
35
- # gem "trailblazer-activity-dsl-linear", ">= 0.3.4"
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"
@@ -1,89 +1,62 @@
1
- PATH
2
- remote: ../../../trailblazer-activity-dsl-linear
3
- specs:
4
- trailblazer-activity-dsl-linear (0.5.0)
5
- trailblazer-activity (>= 0.13.0, < 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)
27
-
28
1
  PATH
29
2
  remote: ../..
30
3
  specs:
31
- trailblazer-endpoint (0.0.9)
32
- trailblazer-activity-dsl-linear (>= 0.5.0, < 0.6.0)
4
+ trailblazer-endpoint (0.0.11)
5
+ trailblazer-activity-dsl-linear (>= 1.2.0, < 1.3.0)
33
6
 
34
7
  GEM
35
8
  remote: https://rubygems.org/
36
9
  specs:
37
- actioncable (6.0.3.4)
38
- actionpack (= 6.0.3.4)
10
+ actioncable (6.0.6.1)
11
+ actionpack (= 6.0.6.1)
39
12
  nio4r (~> 2.0)
40
13
  websocket-driver (>= 0.6.1)
41
- actionmailbox (6.0.3.4)
42
- actionpack (= 6.0.3.4)
43
- activejob (= 6.0.3.4)
44
- activerecord (= 6.0.3.4)
45
- activestorage (= 6.0.3.4)
46
- activesupport (= 6.0.3.4)
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)
47
20
  mail (>= 2.7.1)
48
- actionmailer (6.0.3.4)
49
- actionpack (= 6.0.3.4)
50
- actionview (= 6.0.3.4)
51
- activejob (= 6.0.3.4)
21
+ actionmailer (6.0.6.1)
22
+ actionpack (= 6.0.6.1)
23
+ actionview (= 6.0.6.1)
24
+ activejob (= 6.0.6.1)
52
25
  mail (~> 2.5, >= 2.5.4)
53
26
  rails-dom-testing (~> 2.0)
54
- actionpack (6.0.3.4)
55
- actionview (= 6.0.3.4)
56
- activesupport (= 6.0.3.4)
27
+ actionpack (6.0.6.1)
28
+ actionview (= 6.0.6.1)
29
+ activesupport (= 6.0.6.1)
57
30
  rack (~> 2.0, >= 2.0.8)
58
31
  rack-test (>= 0.6.3)
59
32
  rails-dom-testing (~> 2.0)
60
33
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
61
- actiontext (6.0.3.4)
62
- actionpack (= 6.0.3.4)
63
- activerecord (= 6.0.3.4)
64
- activestorage (= 6.0.3.4)
65
- activesupport (= 6.0.3.4)
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)
66
39
  nokogiri (>= 1.8.5)
67
- actionview (6.0.3.4)
68
- activesupport (= 6.0.3.4)
40
+ actionview (6.0.6.1)
41
+ activesupport (= 6.0.6.1)
69
42
  builder (~> 3.1)
70
43
  erubi (~> 1.4)
71
44
  rails-dom-testing (~> 2.0)
72
45
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
73
- activejob (6.0.3.4)
74
- activesupport (= 6.0.3.4)
46
+ activejob (6.0.6.1)
47
+ activesupport (= 6.0.6.1)
75
48
  globalid (>= 0.3.6)
76
- activemodel (6.0.3.4)
77
- activesupport (= 6.0.3.4)
78
- activerecord (6.0.3.4)
79
- activemodel (= 6.0.3.4)
80
- activesupport (= 6.0.3.4)
81
- activestorage (6.0.3.4)
82
- actionpack (= 6.0.3.4)
83
- activejob (= 6.0.3.4)
84
- activerecord (= 6.0.3.4)
85
- marcel (~> 0.3.1)
86
- activesupport (6.0.3.4)
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)
87
60
  concurrent-ruby (~> 1.0, >= 1.0.2)
88
61
  i18n (>= 0.7, < 2)
89
62
  minitest (~> 5.1)
@@ -98,108 +71,132 @@ GEM
98
71
  cells-erb (0.1.0)
99
72
  cells (~> 4.0)
100
73
  erbse (>= 0.1.1)
101
- cells-rails (0.1.3)
74
+ cells-rails (0.1.5)
102
75
  actionpack (>= 5.0)
103
76
  cells (>= 4.1.6, < 5.0.0)
104
- concurrent-ruby (1.1.7)
77
+ concurrent-ruby (1.2.2)
105
78
  crass (1.0.6)
79
+ date (3.3.3)
106
80
  declarative (0.0.20)
107
81
  declarative-builder (0.1.0)
108
82
  declarative-option (< 0.2.0)
109
83
  declarative-option (0.1.0)
110
84
  erbse (0.1.4)
111
85
  temple
112
- erubi (1.10.0)
113
- globalid (0.4.2)
114
- activesupport (>= 4.2.0)
86
+ erubi (1.12.0)
87
+ globalid (1.1.0)
88
+ activesupport (>= 5.0)
115
89
  hashie (5.0.0)
116
90
  hirb (0.7.3)
117
- i18n (1.8.7)
91
+ i18n (1.12.0)
118
92
  concurrent-ruby (~> 1.0)
119
- jwt (2.2.2)
120
- loofah (2.8.0)
93
+ jwt (2.7.0)
94
+ loofah (2.19.1)
121
95
  crass (~> 1.0.2)
122
96
  nokogiri (>= 1.5.9)
123
- mail (2.7.1)
97
+ mail (2.8.1)
124
98
  mini_mime (>= 0.1.1)
125
- marcel (0.3.3)
126
- mimemagic (~> 0.3.2)
99
+ net-imap
100
+ net-pop
101
+ net-smtp
102
+ marcel (1.0.2)
127
103
  method_source (1.0.0)
128
- mimemagic (0.3.5)
129
- mini_mime (1.0.2)
130
- mini_portile2 (2.5.0)
131
- minitest (5.14.3)
104
+ mini_mime (1.1.2)
105
+ mini_portile2 (2.8.1)
106
+ minitest (5.17.0)
132
107
  minitest-line (0.6.5)
133
108
  minitest (~> 5.0)
134
109
  multi_json (1.15.0)
135
- nio4r (2.5.4)
136
- nokogiri (1.11.1)
137
- mini_portile2 (~> 2.5.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
119
+ nio4r (2.5.8)
120
+ nokogiri (1.14.2)
121
+ mini_portile2 (~> 2.8.0)
138
122
  racc (~> 1.4)
139
- nokogiri (1.11.1-x86_64-linux)
123
+ nokogiri (1.14.2-x86_64-linux)
140
124
  racc (~> 1.4)
141
- racc (1.5.2)
142
- rack (2.2.3)
143
- rack-test (1.1.0)
144
- rack (>= 1.0, < 3)
145
- rails (6.0.3.4)
146
- actioncable (= 6.0.3.4)
147
- actionmailbox (= 6.0.3.4)
148
- actionmailer (= 6.0.3.4)
149
- actionpack (= 6.0.3.4)
150
- actiontext (= 6.0.3.4)
151
- actionview (= 6.0.3.4)
152
- activejob (= 6.0.3.4)
153
- activemodel (= 6.0.3.4)
154
- activerecord (= 6.0.3.4)
155
- activestorage (= 6.0.3.4)
156
- activesupport (= 6.0.3.4)
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)
157
141
  bundler (>= 1.3.0)
158
- railties (= 6.0.3.4)
142
+ railties (= 6.0.6.1)
159
143
  sprockets-rails (>= 2.0.0)
160
144
  rails-dom-testing (2.0.3)
161
145
  activesupport (>= 4.2.0)
162
146
  nokogiri (>= 1.6)
163
- rails-html-sanitizer (1.3.0)
164
- loofah (~> 2.3)
165
- railties (6.0.3.4)
166
- actionpack (= 6.0.3.4)
167
- activesupport (= 6.0.3.4)
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)
168
152
  method_source
169
153
  rake (>= 0.8.7)
170
154
  thor (>= 0.20.3, < 2.0)
171
- rake (13.0.3)
172
- representable (3.1.1)
155
+ rake (13.0.6)
156
+ representable (3.2.0)
173
157
  declarative (< 0.1.0)
174
158
  trailblazer-option (>= 0.1.1, < 0.2.0)
175
159
  uber (< 0.2.0)
176
- sprockets (4.0.2)
160
+ sprockets (4.2.0)
177
161
  concurrent-ruby (~> 1.0)
178
- rack (> 1, < 3)
179
- sprockets-rails (3.2.2)
180
- actionpack (>= 4.0)
181
- activesupport (>= 4.0)
162
+ rack (>= 2.2.4, < 4)
163
+ sprockets-rails (3.4.2)
164
+ actionpack (>= 5.2)
165
+ activesupport (>= 5.2)
182
166
  sprockets (>= 3.0.0)
183
- sqlite3 (1.4.2)
184
- temple (0.8.2)
185
- thor (1.0.1)
167
+ sqlite3 (1.6.1)
168
+ mini_portile2 (~> 2.8.0)
169
+ sqlite3 (1.6.1-x86_64-linux)
170
+ temple (0.10.0)
171
+ thor (1.2.1)
186
172
  thread_safe (0.3.6)
187
- tilt (2.0.10)
173
+ tilt (2.1.0)
174
+ timeout (0.3.2)
175
+ trailblazer-activity (0.16.0)
176
+ trailblazer-context (~> 0.5.0)
177
+ trailblazer-option (~> 0.1.0)
178
+ trailblazer-activity-dsl-linear (1.2.0)
179
+ trailblazer-activity (>= 0.16.0, < 0.17.0)
180
+ trailblazer-declarative (>= 0.0.1, < 0.1.0)
188
181
  trailblazer-cells (0.0.3)
189
182
  cells (>= 4.1.0.rc1, < 5.0.0)
190
- trailblazer-developer (0.0.22)
183
+ trailblazer-context (0.5.1)
184
+ hashie (>= 3.0.0)
185
+ trailblazer-declarative (0.0.2)
186
+ trailblazer-developer (0.0.28)
191
187
  hirb
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)
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
195
192
  trailblazer-option (0.1.2)
196
- tzinfo (1.2.9)
193
+ tzinfo (1.2.11)
197
194
  thread_safe (~> 0.1)
198
195
  uber (0.1.0)
199
- websocket-driver (0.7.3)
196
+ websocket-driver (0.7.5)
200
197
  websocket-extensions (>= 0.1.0)
201
198
  websocket-extensions (0.1.5)
202
- zeitwerk (2.4.2)
199
+ zeitwerk (2.6.7)
203
200
 
204
201
  PLATFORMS
205
202
  ruby
@@ -212,13 +209,11 @@ DEPENDENCIES
212
209
  minitest-line
213
210
  multi_json
214
211
  rails (~> 6.0.3, >= 6.0.3.1)
212
+ representable
215
213
  sqlite3 (~> 1.4)
216
- trailblazer-activity!
217
- trailblazer-activity-dsl-linear!
218
214
  trailblazer-cells
219
- trailblazer-context!
220
215
  trailblazer-endpoint!
221
- trailblazer-operation!
216
+ trailblazer-operation
222
217
 
223
218
  BUNDLED WITH
224
- 2.2.11
219
+ 2.3.10
@@ -7,9 +7,9 @@ Gem::Specification.new do |spec|
7
7
  spec.version = Trailblazer::Endpoint::VERSION
8
8
  spec.authors = ["Nick Sutterer"]
9
9
  spec.email = ["apotonick@gmail.com"]
10
- spec.description = %q{Endpoints handle authentication, policies, run your domain operation and set up the rendering.}
11
- spec.summary = %q{Endpoints handle authentication, policies, run your domain operation and set up the rendering.}
12
- spec.homepage = "http://trailblazer.to/"
10
+ spec.description = %q{Endpoints handle authentication, policies, run your domain operation and prepare rendering.}
11
+ spec.summary = %q{Endpoints handle authentication, policies, run your domain operation and prepare rendering.}
12
+ spec.homepage = "https://trailblazer.to/2.1/docs/endpoint.html"
13
13
  spec.license = "LGPL-3.0"
14
14
 
15
15
  spec.files = `git ls-files`.split($/)
@@ -17,11 +17,10 @@ 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.5.0", "< 0.6.0"
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"
24
24
  spec.add_development_dependency "minitest"
25
25
  spec.add_development_dependency "trailblazer-developer"
26
- # spec.add_development_dependency "appraisal"
27
26
  end
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.10
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: 2022-02-04 00:00:00.000000000 Z
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: 0.5.0
19
+ version: 1.2.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 0.6.0
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: 0.5.0
29
+ version: 1.2.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 0.6.0
32
+ version: 1.3.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -87,7 +87,7 @@ dependencies:
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  description: Endpoints handle authentication, policies, run your domain operation
90
- and set up the rendering.
90
+ and prepare rendering.
91
91
  email:
92
92
  - apotonick@gmail.com
93
93
  executables: []
@@ -100,6 +100,7 @@ files:
100
100
  - Gemfile
101
101
  - README.md
102
102
  - Rakefile
103
+ - gemfiles/grape_app.gemfile
103
104
  - gemfiles/rails_app.gemfile
104
105
  - lib/trailblazer-endpoint.rb
105
106
  - lib/trailblazer/endpoint.rb
@@ -107,6 +108,7 @@ files:
107
108
  - lib/trailblazer/endpoint/builder.rb
108
109
  - lib/trailblazer/endpoint/controller.rb
109
110
  - lib/trailblazer/endpoint/dsl.rb
111
+ - lib/trailblazer/endpoint/grape/controller.rb
110
112
  - lib/trailblazer/endpoint/options.rb
111
113
  - lib/trailblazer/endpoint/protocol.rb
112
114
  - lib/trailblazer/endpoint/protocol/cipher.rb
@@ -122,6 +124,22 @@ files:
122
124
  - test/docs/controller_test.rb
123
125
  - test/docs/endpoint_test.rb
124
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
125
143
  - test/rails-app/.gitignore
126
144
  - test/rails-app/.ruby-version
127
145
  - test/rails-app/Gemfile
@@ -187,7 +205,7 @@ files:
187
205
  - test/rails-app/tmp/.keep
188
206
  - test/test_helper.rb
189
207
  - trailblazer-endpoint.gemspec
190
- homepage: http://trailblazer.to/
208
+ homepage: https://trailblazer.to/2.1/docs/endpoint.html
191
209
  licenses:
192
210
  - LGPL-3.0
193
211
  metadata: {}
@@ -210,7 +228,7 @@ rubygems_version: 3.2.3
210
228
  signing_key:
211
229
  specification_version: 4
212
230
  summary: Endpoints handle authentication, policies, run your domain operation and
213
- set up the rendering.
231
+ prepare rendering.
214
232
  test_files:
215
233
  - test/adapter/api_test.rb
216
234
  - test/adapter/representable_test.rb
@@ -220,6 +238,22 @@ test_files:
220
238
  - test/docs/controller_test.rb
221
239
  - test/docs/endpoint_test.rb
222
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
223
257
  - test/rails-app/.gitignore
224
258
  - test/rails-app/.ruby-version
225
259
  - test/rails-app/Gemfile