bullet_train-api 1.0.4 → 1.0.5
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/app/controllers/concerns/api/v1/base.rb +31 -0
- data/lib/bullet_train/api/engine.rb +6 -0
- data/lib/bullet_train/api/version.rb +1 -1
- data/lib/bullet_train/api.rb +1 -1
- metadata +3 -3
- data/app/controllers/api/v1/root.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89d0d8de58c2132c0e4f9d5f704a8ca8035126f030ccaf711b2b1a27ebf793f6
|
4
|
+
data.tar.gz: 279210193a45516e0e2ffb2d89c6dc5ac82406154dfef7e7ce0c229b8bc621aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63fe9c16afc1e7d7753504f540304e5d0ed3cfe8812806adbe7f9f52e71ecdc9d2fcbea595968d195d42dd9f7b553af861033d3af6ca5ee1e45aa26d37ac4506
|
7
|
+
data.tar.gz: 572fb40701d7c521c8e03bcff7a2fd5a30295fbba0e3c18e830ea84bc850010bf6cd0b95b1b9219fc0da5903316308257a04b672400d4a6d33761c866ccdfa8a
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Api::V1::Base
|
2
|
+
extend ActiveSupport::Concern
|
3
|
+
|
4
|
+
included do
|
5
|
+
include Api::V1::Base
|
6
|
+
include Api::V1::Defaults
|
7
|
+
include Api::V1::LoadsAndAuthorizesApiResource
|
8
|
+
|
9
|
+
version "v1"
|
10
|
+
use ::WineBouncer::OAuth2
|
11
|
+
|
12
|
+
rescue_from :all do |error|
|
13
|
+
handle_api_error(error)
|
14
|
+
end
|
15
|
+
|
16
|
+
BulletTrain::Api.endpoints.each do |endpoint_class|
|
17
|
+
mount endpoint_class.constantize
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class_methods do
|
22
|
+
# TODO I actually don't know of any way to make this work. This was supposed to be run after all other endpoints
|
23
|
+
# are registered, but I don't know of a way to know when we're done running `initializer` blocks from the engines
|
24
|
+
# a user may have included.
|
25
|
+
def handle_not_found
|
26
|
+
route :any, "*path" do
|
27
|
+
raise StandardError, "Unable to find API endpoint"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -11,6 +11,12 @@ require "rack/cors"
|
|
11
11
|
module BulletTrain
|
12
12
|
module Api
|
13
13
|
class Engine < ::Rails::Engine
|
14
|
+
initializer "bullet_train.api.register_api_endpoints" do |app|
|
15
|
+
if BulletTrain::Api
|
16
|
+
BulletTrain::Api.endpoints << "Api::V1::MeEndpoint"
|
17
|
+
BulletTrain::Api.endpoints << "Api::V1::TeamsEndpoint"
|
18
|
+
end
|
19
|
+
end
|
14
20
|
end
|
15
21
|
end
|
16
22
|
end
|
data/lib/bullet_train/api.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -169,8 +169,8 @@ files:
|
|
169
169
|
- app/controllers/api/v1/exceptions_handler.rb
|
170
170
|
- app/controllers/api/v1/loads_and_authorizes_api_resource.rb
|
171
171
|
- app/controllers/api/v1/me_endpoint.rb
|
172
|
-
- app/controllers/api/v1/root.rb
|
173
172
|
- app/controllers/api/v1/teams_endpoint.rb
|
173
|
+
- app/controllers/concerns/api/v1/base.rb
|
174
174
|
- app/models/platform/application.rb
|
175
175
|
- app/views/account/platform/applications/_application.json.jbuilder
|
176
176
|
- app/views/account/platform/applications/_breadcrumbs.html.erb
|
@@ -1,27 +0,0 @@
|
|
1
|
-
class Api::V1::Root < Api::Base
|
2
|
-
include Api::V1::Defaults
|
3
|
-
include Api::V1::LoadsAndAuthorizesApiResource
|
4
|
-
|
5
|
-
version "v1"
|
6
|
-
use ::WineBouncer::OAuth2
|
7
|
-
|
8
|
-
rescue_from :all do |error|
|
9
|
-
handle_api_error(error)
|
10
|
-
end
|
11
|
-
|
12
|
-
unless scaffolding_things_disabled?
|
13
|
-
mount Api::V1::Scaffolding::AbsolutelyAbstract::CreativeConceptsEndpoint
|
14
|
-
mount Api::V1::Scaffolding::CompletelyConcrete::TangibleThingsEndpoint
|
15
|
-
end
|
16
|
-
|
17
|
-
mount Api::V1::MeEndpoint
|
18
|
-
mount Api::V1::TeamsEndpoint
|
19
|
-
mount Api::V1::Webhooks::Outgoing::EndpointsEndpoint
|
20
|
-
mount Api::V1::Webhooks::Outgoing::DeliveriesEndpoint
|
21
|
-
mount Api::V1::Webhooks::Outgoing::DeliveryAttemptsEndpoint
|
22
|
-
# 🚅 super scaffolding will mount new endpoints above this line.
|
23
|
-
|
24
|
-
route :any, "*path" do
|
25
|
-
raise StandardError, "Unable to find API endpoint"
|
26
|
-
end
|
27
|
-
end
|