trailblazer-endpoint 0.0.11 → 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: ee7450a17e47e6bb1b31145021159a23d95ae031686a7457988879435f318cde
4
- data.tar.gz: c1777129764926dbbe9baade928d80ec38af237596015d87d85a328e7ffb0ae0
3
+ metadata.gz: ca657cac83db192bb913f8820ed265b0b3125c3613398d4306023b8aacd6e370
4
+ data.tar.gz: a361710a4613bd102600313c4690c298684e13d3c85a788fb4fe8502e7282c1c
5
5
  SHA512:
6
- metadata.gz: 4fac1c090644f9981b01396978d0664ec543af839315947689f5a14816b4c373ee20d8a5393eeffe627ce908479be1666810205e5fc604f8eed845ee313defa5
7
- data.tar.gz: 5ef9f14ed31f5fb5028482a74ce2690ea7853b3bd9543ac380b5f3bc21edf9ad7384bcf761b5b334409f1d93c41ca75d245d8cc05c05fc9d82b0e4bfd6624684
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,8 @@
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
+
1
6
  # 0.0.11
2
7
 
3
8
  * Require `trailblazer-activity-dsl-linear` >= 1.0.0.
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, 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
@@ -103,7 +103,7 @@ module Trailblazer
103
103
 
104
104
  def self.extension_for_terminus_handler
105
105
  # this is called after {:output}.
106
- [[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.
107
107
  end
108
108
  end
109
109
  end # Protocol
@@ -1,5 +1,5 @@
1
1
  module Trailblazer
2
2
  class Endpoint
3
- VERSION = "0.0.11"
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,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-dsl-linear", path: "../../../trailblazer-activity-dsl-linear"
36
- # 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,62 +1,62 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- trailblazer-endpoint (0.0.10)
5
- trailblazer-activity-dsl-linear (>= 1.0.0, < 1.1.0)
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.4.7)
11
- actionpack (= 6.0.4.7)
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.4.7)
15
- actionpack (= 6.0.4.7)
16
- activejob (= 6.0.4.7)
17
- activerecord (= 6.0.4.7)
18
- activestorage (= 6.0.4.7)
19
- activesupport (= 6.0.4.7)
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.4.7)
22
- actionpack (= 6.0.4.7)
23
- actionview (= 6.0.4.7)
24
- activejob (= 6.0.4.7)
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.4.7)
28
- actionview (= 6.0.4.7)
29
- activesupport (= 6.0.4.7)
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.4.7)
35
- actionpack (= 6.0.4.7)
36
- activerecord (= 6.0.4.7)
37
- activestorage (= 6.0.4.7)
38
- activesupport (= 6.0.4.7)
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.4.7)
41
- activesupport (= 6.0.4.7)
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.4.7)
47
- activesupport (= 6.0.4.7)
46
+ activejob (6.0.6.1)
47
+ activesupport (= 6.0.6.1)
48
48
  globalid (>= 0.3.6)
49
- activemodel (6.0.4.7)
50
- activesupport (= 6.0.4.7)
51
- activerecord (6.0.4.7)
52
- activemodel (= 6.0.4.7)
53
- activesupport (= 6.0.4.7)
54
- activestorage (6.0.4.7)
55
- actionpack (= 6.0.4.7)
56
- activejob (= 6.0.4.7)
57
- activerecord (= 6.0.4.7)
58
- marcel (~> 1.0.0)
59
- activesupport (6.0.4.7)
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.4)
74
+ cells-rails (0.1.5)
75
75
  actionpack (>= 5.0)
76
76
  cells (>= 4.1.6, < 5.0.0)
77
- concurrent-ruby (1.1.10)
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.10.0)
86
- globalid (1.0.0)
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.10.0)
91
+ i18n (1.12.0)
91
92
  concurrent-ruby (~> 1.0)
92
- jwt (2.3.0)
93
- loofah (2.16.0)
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.7.1)
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.0)
102
- minitest (5.15.0)
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.13.3)
120
+ nokogiri (1.14.2)
108
121
  mini_portile2 (~> 2.8.0)
109
122
  racc (~> 1.4)
110
- nokogiri (1.13.3-x86_64-linux)
123
+ nokogiri (1.14.2-x86_64-linux)
111
124
  racc (~> 1.4)
112
- racc (1.6.0)
113
- rack (2.2.3)
114
- rack-test (1.1.0)
115
- rack (>= 1.0, < 3)
116
- rails (6.0.4.7)
117
- actioncable (= 6.0.4.7)
118
- actionmailbox (= 6.0.4.7)
119
- actionmailer (= 6.0.4.7)
120
- actionpack (= 6.0.4.7)
121
- actiontext (= 6.0.4.7)
122
- actionview (= 6.0.4.7)
123
- activejob (= 6.0.4.7)
124
- activemodel (= 6.0.4.7)
125
- activerecord (= 6.0.4.7)
126
- activestorage (= 6.0.4.7)
127
- activesupport (= 6.0.4.7)
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.4.7)
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.4.2)
135
- loofah (~> 2.3)
136
- railties (6.0.4.7)
137
- actionpack (= 6.0.4.7)
138
- activesupport (= 6.0.4.7)
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.3)
160
+ sprockets (4.2.0)
148
161
  concurrent-ruby (~> 1.0)
149
- rack (> 1, < 3)
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.4.2)
155
- temple (0.8.2)
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.10)
159
- trailblazer-activity (0.14.0)
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.0.0)
163
- trailblazer-activity (>= 0.14.0, < 0.15.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.0)
183
+ trailblazer-context (0.5.1)
168
184
  hashie (>= 3.0.0)
169
- trailblazer-declarative (0.0.1)
170
- trailblazer-developer (0.0.26)
185
+ trailblazer-declarative (0.0.2)
186
+ trailblazer-developer (0.0.28)
171
187
  hirb
172
- trailblazer-activity-dsl-linear (>= 1.0.0.beta1, < 1.1.0)
173
- trailblazer-operation (0.8.0)
174
- trailblazer-activity-dsl-linear (>= 1.0.0, < 1.1.0)
175
- trailblazer-developer (>= 0.0.26)
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.9)
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.5.4)
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.0.0", "< 1.1.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"
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.11
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-08-24 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: 1.0.0
19
+ version: 1.2.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 1.1.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: 1.0.0
29
+ version: 1.2.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 1.1.0
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