skyward-api 0.1.0 → 0.2.0
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/README.md +185 -47
- data/lib/skyward/api/assembly/application.rb +26 -0
- data/lib/skyward/api/assembly/boot.rb +533 -0
- data/lib/skyward/api/assembly/builder.rb +83 -0
- data/lib/skyward/api/assembly/dispatcher.rb +121 -0
- data/lib/skyward/api/assembly/static.rb +115 -0
- data/lib/skyward/api/assembly.rb +4 -0
- data/lib/skyward/api/cli/app_file.rb +38 -0
- data/lib/skyward/api/cli/check.rb +145 -0
- data/lib/skyward/api/cli/executable.rb +15 -0
- data/lib/skyward/api/cli/routes.rb +30 -0
- data/lib/skyward/api/cli/serve/reloader.rb +77 -0
- data/lib/skyward/api/cli/serve.rb +137 -0
- data/lib/skyward/api/cli/serve.ru +16 -0
- data/lib/skyward/api/cli.rb +4 -0
- data/lib/skyward/api/commands.rb +38 -0
- data/lib/skyward/api/endpoints/declarations.rb +124 -0
- data/lib/skyward/api/endpoints/helpers.rb +49 -0
- data/lib/skyward/api/endpoints/route.rb +13 -0
- data/lib/skyward/api/endpoints.rb +4 -0
- data/lib/skyward/api/inputs/coercer.rb +425 -0
- data/lib/skyward/api/inputs.rb +164 -0
- data/lib/skyward/api/middleware/line_logger.rb +20 -0
- data/lib/skyward/api/middleware/request_id.rb +26 -0
- data/lib/skyward/api/middleware/request_log.rb +46 -0
- data/lib/skyward/api/middleware/rescue.rb +81 -0
- data/lib/skyward/api/middleware.rb +4 -0
- data/lib/skyward/api/openapi/docs.rb +39 -0
- data/lib/skyward/api/openapi.rb +393 -0
- data/lib/skyward/api/request.rb +127 -0
- data/lib/skyward/api/responses/bad_request.rb +18 -0
- data/lib/skyward/api/responses/conflict.rb +18 -0
- data/lib/skyward/api/responses/created.rb +19 -0
- data/lib/skyward/api/responses/forbidden.rb +18 -0
- data/lib/skyward/api/responses/no_content.rb +13 -0
- data/lib/skyward/api/responses/not_found.rb +18 -0
- data/lib/skyward/api/responses/redirect.rb +25 -0
- data/lib/skyward/api/responses/unauthorized.rb +18 -0
- data/lib/skyward/api/responses/unprocessable.rb +18 -0
- data/lib/skyward/api/responses.rb +4 -0
- data/lib/skyward/api/return_type_error.rb +4 -0
- data/lib/skyward/api/routing/percent_encoding.rb +15 -0
- data/lib/skyward/api/routing/router.rb +115 -0
- data/lib/skyward/api/routing.rb +4 -0
- data/lib/skyward/api/serializer/writers.rb +230 -0
- data/lib/skyward/api/serializer.rb +139 -0
- data/lib/skyward/api/test/client.rb +160 -0
- data/lib/skyward/api/test.rb +8 -0
- data/lib/skyward/api/version.rb +5 -1
- data/lib/skyward/api.rb +118 -1
- data/sig/generated/skyward/api/assembly/application.rbs +22 -0
- data/sig/generated/skyward/api/assembly/boot.rbs +217 -0
- data/sig/generated/skyward/api/assembly/builder.rbs +77 -0
- data/sig/generated/skyward/api/assembly/dispatcher.rbs +84 -0
- data/sig/generated/skyward/api/assembly/static.rbs +47 -0
- data/sig/generated/skyward/api/assembly.rbs +4 -0
- data/sig/generated/skyward/api/cli/app_file.rbs +15 -0
- data/sig/generated/skyward/api/cli/check.rbs +76 -0
- data/sig/generated/skyward/api/cli/executable.rbs +11 -0
- data/sig/generated/skyward/api/cli/routes.rbs +19 -0
- data/sig/generated/skyward/api/cli/serve/reloader.rbs +46 -0
- data/sig/generated/skyward/api/cli/serve.rbs +56 -0
- data/sig/generated/skyward/api/cli.rbs +4 -0
- data/sig/generated/skyward/api/commands.rbs +2 -0
- data/sig/generated/skyward/api/endpoints/declarations.rbs +81 -0
- data/sig/generated/skyward/api/endpoints/helpers.rbs +49 -0
- data/sig/generated/skyward/api/endpoints/route.rbs +24 -0
- data/sig/generated/skyward/api/endpoints.rbs +4 -0
- data/sig/generated/skyward/api/inputs/coercer.rbs +231 -0
- data/sig/generated/skyward/api/inputs.rbs +75 -0
- data/sig/generated/skyward/api/middleware/line_logger.rbs +13 -0
- data/sig/generated/skyward/api/middleware/request_id.rbs +17 -0
- data/sig/generated/skyward/api/middleware/request_log.rbs +18 -0
- data/sig/generated/skyward/api/middleware/rescue.rbs +41 -0
- data/sig/generated/skyward/api/middleware.rbs +4 -0
- data/sig/generated/skyward/api/openapi/docs.rbs +17 -0
- data/sig/generated/skyward/api/openapi.rbs +198 -0
- data/sig/generated/skyward/api/request.rbs +65 -0
- data/sig/generated/skyward/api/responses/bad_request.rbs +14 -0
- data/sig/generated/skyward/api/responses/conflict.rbs +14 -0
- data/sig/generated/skyward/api/responses/created.rbs +15 -0
- data/sig/generated/skyward/api/responses/forbidden.rbs +14 -0
- data/sig/generated/skyward/api/responses/no_content.rbs +10 -0
- data/sig/generated/skyward/api/responses/not_found.rbs +14 -0
- data/sig/generated/skyward/api/responses/redirect.rbs +20 -0
- data/sig/generated/skyward/api/responses/unauthorized.rbs +14 -0
- data/sig/generated/skyward/api/responses/unprocessable.rbs +14 -0
- data/sig/generated/skyward/api/responses.rbs +4 -0
- data/sig/generated/skyward/api/return_type_error.rbs +4 -0
- data/sig/generated/skyward/api/routing/percent_encoding.rbs +11 -0
- data/sig/generated/skyward/api/routing/router.rbs +158 -0
- data/sig/generated/skyward/api/routing.rbs +4 -0
- data/sig/generated/skyward/api/serializer/writers.rbs +126 -0
- data/sig/generated/skyward/api/serializer.rbs +79 -0
- data/sig/generated/skyward/api/test/client.rbs +117 -0
- data/sig/generated/skyward/api/test.rbs +6 -0
- data/sig/generated/skyward/api.rbs +38 -0
- data/sig/manual/skyward/api/assembly/boot.rbs +3 -0
- data/sig/manual/skyward/api/cli/app_file.rbs +3 -0
- data/sig/manual/skyward/api/cli/check.rbs +3 -0
- data/sig/manual/skyward/api/cli/executable.rbs +3 -0
- data/sig/manual/skyward/api/cli/routes.rbs +3 -0
- data/sig/manual/skyward/api/cli/serve.rbs +3 -0
- data/sig/manual/skyward/api/inputs/coercer.rbs +3 -0
- data/sig/manual/skyward/api/openapi/docs.rbs +3 -0
- data/sig/manual/skyward/api/openapi.rbs +3 -0
- data/sig/manual/skyward/api/routing/percent_encoding.rbs +3 -0
- data/sig/manual/skyward/api/serializer/writers.rbs +3 -0
- data/sig/manual/skyward/api/test.rbs +3 -0
- data/sig/manual/skyward/api.rbs +21 -0
- data/sig/manual/zeitwerk/loader.rbs +6 -0
- metadata +110 -3
data/lib/skyward/api.rb
CHANGED
|
@@ -1,9 +1,126 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "securerandom"
|
|
3
4
|
require "skyward/core"
|
|
4
5
|
require "zeitwerk"
|
|
5
6
|
require_relative "api/version"
|
|
6
7
|
|
|
7
8
|
loader = Zeitwerk::Loader.for_gem_extension(Skyward)
|
|
8
|
-
loader.inflector.inflect("api" => "API")
|
|
9
|
+
loader.inflector.inflect("api" => "API", "cli" => "CLI", "openapi" => "OpenAPI")
|
|
10
|
+
# The skyward executable loads it, and it defines no constant.
|
|
11
|
+
loader.ignore("#{__dir__}/api/commands.rb")
|
|
9
12
|
loader.setup
|
|
13
|
+
|
|
14
|
+
# An app's signatures subclass Skyward::API, so RBS needs its declaration.
|
|
15
|
+
dir = __dir__ #: String
|
|
16
|
+
Skyward::Core::Signatures.register(File.expand_path("../../sig", dir))
|
|
17
|
+
|
|
18
|
+
class Skyward::API
|
|
19
|
+
# @rbs! type rack_response = [Integer, Hash[String, untyped], untyped]
|
|
20
|
+
# @rbs! type rack = [Integer, Hash[String, String], untyped]
|
|
21
|
+
|
|
22
|
+
extend Endpoints::Declarations
|
|
23
|
+
include Endpoints::Helpers
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
module Skyward
|
|
27
|
+
# @rbs (?signatures: String, ?strict: bool, ?docs: bool, ?title: String, ?version: String, ?description: String?,
|
|
28
|
+
# ?schema_names: Hash[Class, String], ?scalar_url: String, ?logger: API::_Logger?, ?on_error: API::_OnError?,
|
|
29
|
+
# ?max_body_size: Integer) { (API::Assembly::Builder) -> void } -> API::Assembly::Application
|
|
30
|
+
def self.app(
|
|
31
|
+
signatures: "sig",
|
|
32
|
+
strict: false,
|
|
33
|
+
docs: false,
|
|
34
|
+
title: "API",
|
|
35
|
+
version: "0.1.0",
|
|
36
|
+
description: nil,
|
|
37
|
+
schema_names: {},
|
|
38
|
+
scalar_url: API::OpenAPI::Docs::SCALAR_URL,
|
|
39
|
+
logger: API::Middleware::LineLogger.new($stdout),
|
|
40
|
+
on_error: nil,
|
|
41
|
+
max_body_size: 1_048_576,
|
|
42
|
+
&
|
|
43
|
+
)
|
|
44
|
+
raise ArgumentError, "Skyward.app needs a block that mounts the app's APIs" unless block_given?
|
|
45
|
+
|
|
46
|
+
builder = API::Assembly::Builder.new
|
|
47
|
+
yield builder
|
|
48
|
+
builder.freeze
|
|
49
|
+
reader = Core::Types::Reader.new(Core::Signatures.load(signatures))
|
|
50
|
+
endpoints = API::Assembly::Boot.endpoints(
|
|
51
|
+
builder.mounts,
|
|
52
|
+
providers: builder.providers,
|
|
53
|
+
reader:,
|
|
54
|
+
max_body_size:,
|
|
55
|
+
strict: strict || ENV.fetch("SKYWARD_STRICT", nil) == "1"
|
|
56
|
+
)
|
|
57
|
+
static = API::Assembly::Static.new(builder.statics)
|
|
58
|
+
openapi = -> { API::OpenAPI.document(endpoints, title:, version:, description:, schema_names:) }
|
|
59
|
+
documents =
|
|
60
|
+
if docs
|
|
61
|
+
json = API::OpenAPI.json(endpoints, static:, document: openapi)
|
|
62
|
+
page = API::OpenAPI::Docs.page(title:, scalar_url:)
|
|
63
|
+
document = API::Assembly::Dispatcher::Document
|
|
64
|
+
{
|
|
65
|
+
API::OpenAPI::PATH => document.new(type: API::OpenAPI::JSON_TYPE, body: json),
|
|
66
|
+
API::OpenAPI::Docs::PATH => document.new(type: API::OpenAPI::Docs::HTML_TYPE, body: page)
|
|
67
|
+
}
|
|
68
|
+
else
|
|
69
|
+
{} #: Hash[String, API::Assembly::Dispatcher::Document]
|
|
70
|
+
end
|
|
71
|
+
app = API::Middleware::Rescue.new(
|
|
72
|
+
API::Assembly::Dispatcher.new(API::Routing::Router.new(endpoints), static, builder.middleware, documents),
|
|
73
|
+
logger:,
|
|
74
|
+
on_error:,
|
|
75
|
+
development: ENV.fetch("RACK_ENV") { ENV.fetch("APP_ENV", nil) } == "development"
|
|
76
|
+
)
|
|
77
|
+
logged =
|
|
78
|
+
if logger
|
|
79
|
+
API::Middleware::RequestLog.new(
|
|
80
|
+
app,
|
|
81
|
+
logger:,
|
|
82
|
+
now: -> { Time.now },
|
|
83
|
+
clock_ms: -> { Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond) }
|
|
84
|
+
)
|
|
85
|
+
else
|
|
86
|
+
app
|
|
87
|
+
end
|
|
88
|
+
API::Assembly::Application.new(
|
|
89
|
+
API::Middleware::RequestId.new(logged, generate: -> { SecureRandom.uuid }),
|
|
90
|
+
endpoints:,
|
|
91
|
+
openapi:
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# These response helpers are public here, for code outside an API class, such as a provider.
|
|
96
|
+
# @rbs detail: String
|
|
97
|
+
# @rbs headers: Hash[String, String]
|
|
98
|
+
# @rbs return: API::Responses::BadRequest
|
|
99
|
+
def self.bad_request(detail, headers: {}) = API::Responses::BadRequest.new(detail:, headers:)
|
|
100
|
+
|
|
101
|
+
# @rbs detail: String
|
|
102
|
+
# @rbs headers: Hash[String, String]
|
|
103
|
+
# @rbs return: API::Responses::Unauthorized
|
|
104
|
+
def self.unauthorized(detail, headers: {}) = API::Responses::Unauthorized.new(detail:, headers:)
|
|
105
|
+
|
|
106
|
+
# @rbs detail: String
|
|
107
|
+
# @rbs headers: Hash[String, String]
|
|
108
|
+
# @rbs return: API::Responses::Forbidden
|
|
109
|
+
def self.forbidden(detail, headers: {}) = API::Responses::Forbidden.new(detail:, headers:)
|
|
110
|
+
|
|
111
|
+
# @rbs to: String
|
|
112
|
+
# @rbs status: Integer
|
|
113
|
+
# @rbs headers: Hash[String, String]
|
|
114
|
+
# @rbs return: API::Responses::Redirect
|
|
115
|
+
def self.redirect(to, status: 303, headers: {})
|
|
116
|
+
statuses = API::Responses::Redirect::STATUSES
|
|
117
|
+
unless statuses.include?(status)
|
|
118
|
+
raise ArgumentError, "A redirect's status must be one of #{statuses.join(", ")}, not #{status}"
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# A line break in the location would let it smuggle in headers of its own.
|
|
122
|
+
raise ArgumentError, "A redirect's location can't contain a line break: #{to.inspect}" if to.match?(/[\r\n]/)
|
|
123
|
+
|
|
124
|
+
API::Responses::Redirect.new(to:, status:, headers:)
|
|
125
|
+
end
|
|
126
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Generated from lib/skyward/api/assembly/application.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
class Skyward::API::Assembly::Application
|
|
4
|
+
@app: Skyward::API::_RackApp
|
|
5
|
+
|
|
6
|
+
@openapi: ^() -> Skyward::API::OpenAPI::schema
|
|
7
|
+
|
|
8
|
+
# @dynamic endpoints
|
|
9
|
+
attr_reader endpoints: Array[Skyward::API::Routing::Router::Endpoint]
|
|
10
|
+
|
|
11
|
+
# @rbs (Skyward::API::_RackApp app, endpoints: Array[Skyward::API::Routing::Router::Endpoint],
|
|
12
|
+
# openapi: ^() -> Skyward::API::OpenAPI::schema) -> void
|
|
13
|
+
def initialize: (Skyward::API::_RackApp app, endpoints: Array[Skyward::API::Routing::Router::Endpoint], openapi: ^() -> Skyward::API::OpenAPI::schema) -> void
|
|
14
|
+
|
|
15
|
+
# @rbs env: Hash[String, untyped]
|
|
16
|
+
# @rbs return: Skyward::API::rack_response
|
|
17
|
+
def call: (Hash[String, untyped] env) -> Skyward::API::rack_response
|
|
18
|
+
|
|
19
|
+
# Built when asked for, because only an app with docs: true refuses to boot over a document that can't be built.
|
|
20
|
+
# @rbs return: Skyward::API::OpenAPI::schema
|
|
21
|
+
def openapi: () -> Skyward::API::OpenAPI::schema
|
|
22
|
+
end
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Generated from lib/skyward/api/assembly/boot.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Skyward::API::Assembly::Boot
|
|
4
|
+
UNNAMED: Array[Symbol]
|
|
5
|
+
|
|
6
|
+
KEYWORD: Array[Symbol]
|
|
7
|
+
|
|
8
|
+
RACK: Array[RBS::Types::t?]
|
|
9
|
+
|
|
10
|
+
REQUEST: RBS::Types::t?
|
|
11
|
+
|
|
12
|
+
REQUEST_TYPE: Skyward::Core::Types::Named
|
|
13
|
+
|
|
14
|
+
# A method with no signature is read as if each keyword and the return were
|
|
15
|
+
# untyped, which is what rbs-inline writes for a method with no annotations.
|
|
16
|
+
ANY: RBS::Types::Bases::Any
|
|
17
|
+
|
|
18
|
+
# @rbs (Array[Skyward::API::Assembly::Builder::Mount] mounts,
|
|
19
|
+
# providers: Hash[Symbol, Skyward::API::_Provider & Object], reader: Skyward::Core::Types::Reader,
|
|
20
|
+
# max_body_size: Integer, strict: bool) ->
|
|
21
|
+
# Array[Skyward::API::Routing::Router::Endpoint]
|
|
22
|
+
def endpoints: (Array[Skyward::API::Assembly::Builder::Mount] mounts, providers: Hash[Symbol, Skyward::API::_Provider & Object], reader: Skyward::Core::Types::Reader, max_body_size: Integer, strict: bool) -> Array[Skyward::API::Routing::Router::Endpoint]
|
|
23
|
+
|
|
24
|
+
private
|
|
25
|
+
|
|
26
|
+
# @rbs (Skyward::API::_Provider & Object callable) -> Method
|
|
27
|
+
def call_method: (Skyward::API::_Provider & Object callable) -> Method
|
|
28
|
+
|
|
29
|
+
# The reader finds a signature only for an instance method of a class.
|
|
30
|
+
# @rbs (Symbol name, Skyward::API::_Provider & Object callable) -> String?
|
|
31
|
+
def single_object: (Symbol name, Skyward::API::_Provider & Object callable) -> String?
|
|
32
|
+
|
|
33
|
+
# @rbs (Symbol name, Skyward::API::_Provider & Object callable, Skyward::Core::Types::Reader reader) ->
|
|
34
|
+
# Skyward::API::Routing::Router::Provider
|
|
35
|
+
def provider: (Symbol name, Skyward::API::_Provider & Object callable, Skyward::Core::Types::Reader reader) -> Skyward::API::Routing::Router::Provider
|
|
36
|
+
|
|
37
|
+
# @rbs mount: Skyward::API::Assembly::Builder::Mount
|
|
38
|
+
# @rbs route: Skyward::API::Endpoints::Route
|
|
39
|
+
# @rbs built: Array[Skyward::API::Routing::Router::Endpoint]
|
|
40
|
+
# @rbs providers: Hash[Symbol, Skyward::API::Routing::Router::Provider]
|
|
41
|
+
# @rbs reader: Skyward::Core::Types::Reader
|
|
42
|
+
# @rbs max_body_size: Integer
|
|
43
|
+
# @rbs return: Skyward::API::Routing::Router::Endpoint
|
|
44
|
+
def boot: (Skyward::API::Assembly::Builder::Mount mount, Skyward::API::Endpoints::Route route, Array[Skyward::API::Routing::Router::Endpoint] built, Hash[Symbol, Skyward::API::Routing::Router::Provider] providers, Skyward::Core::Types::Reader reader, Integer max_body_size) -> Skyward::API::Routing::Router::Endpoint
|
|
45
|
+
|
|
46
|
+
# @rbs route: Skyward::API::Endpoints::Route
|
|
47
|
+
# @rbs return: String?
|
|
48
|
+
def summary: (Skyward::API::Endpoints::Route route) -> String?
|
|
49
|
+
|
|
50
|
+
# @rbs prefix: String
|
|
51
|
+
# @rbs path: String
|
|
52
|
+
# @rbs return: String
|
|
53
|
+
def full_path: (String prefix, String path) -> String
|
|
54
|
+
|
|
55
|
+
# @rbs path: String
|
|
56
|
+
# @rbs return: Array[String | Symbol]
|
|
57
|
+
def pattern: (String path) -> Array[String | Symbol]
|
|
58
|
+
|
|
59
|
+
# @rbs verb: String
|
|
60
|
+
# @rbs pattern: Array[String | Symbol]
|
|
61
|
+
# @rbs built: Array[Skyward::API::Routing::Router::Endpoint]
|
|
62
|
+
# @rbs return: String?
|
|
63
|
+
def shadowing: (String verb, Array[String | Symbol] pattern, Array[Skyward::API::Routing::Router::Endpoint] built) -> String?
|
|
64
|
+
|
|
65
|
+
# A path parameter matches any segment but an empty one, which only the root path has.
|
|
66
|
+
# @rbs pattern: Array[String | Symbol]
|
|
67
|
+
# @rbs other: Array[String | Symbol]
|
|
68
|
+
# @rbs return: bool
|
|
69
|
+
def covers?: (Array[String | Symbol] pattern, Array[String | Symbol] other) -> bool
|
|
70
|
+
|
|
71
|
+
# @rbs api: Skyward::API
|
|
72
|
+
# @rbs route: Skyward::API::Endpoints::Route
|
|
73
|
+
# @rbs verb: String
|
|
74
|
+
# @rbs pattern: Array[String | Symbol]
|
|
75
|
+
# @rbs label: String
|
|
76
|
+
# @rbs providers: Hash[Symbol, Skyward::API::Routing::Router::Provider]
|
|
77
|
+
# @rbs reader: Skyward::Core::Types::Reader
|
|
78
|
+
# @rbs max_body_size: Integer
|
|
79
|
+
# @rbs return: Skyward::API::Routing::Router::Endpoint | String
|
|
80
|
+
def endpoint: (Skyward::API api, Skyward::API::Endpoints::Route route, String verb, Array[String | Symbol] pattern, String label, Hash[Symbol, Skyward::API::Routing::Router::Provider] providers, Skyward::Core::Types::Reader reader, Integer max_body_size) -> (Skyward::API::Routing::Router::Endpoint | String)
|
|
81
|
+
|
|
82
|
+
# @rbs klass: Class
|
|
83
|
+
# @rbs to: Symbol
|
|
84
|
+
# @rbs reader: Skyward::Core::Types::Reader
|
|
85
|
+
# @rbs return: RBS::MethodType | String | nil
|
|
86
|
+
def method_type: (Class klass, Symbol to, Skyward::Core::Types::Reader reader) -> (RBS::MethodType | String | nil)
|
|
87
|
+
|
|
88
|
+
# @rbs owner: Module
|
|
89
|
+
# @rbs name: Symbol
|
|
90
|
+
# @rbs reader: Skyward::Core::Types::Reader
|
|
91
|
+
# @rbs return: RBS::MethodType?
|
|
92
|
+
def signature: (Module owner, Symbol name, Skyward::Core::Types::Reader reader) -> RBS::MethodType?
|
|
93
|
+
|
|
94
|
+
# @rbs parameters: Method::param_types
|
|
95
|
+
# @rbs type: RBS::Types::function?
|
|
96
|
+
# @rbs return: Array[[Symbol, bool, RBS::Types::t]] | String
|
|
97
|
+
def signed: (Method::param_types parameters, RBS::Types::function? type) -> (Array[[ Symbol, bool, RBS::Types::t ]] | String)
|
|
98
|
+
|
|
99
|
+
# @rbs method_type: RBS::MethodType
|
|
100
|
+
# @rbs return: String
|
|
101
|
+
def written_signature: (RBS::MethodType method_type) -> String
|
|
102
|
+
|
|
103
|
+
# @rbs signed: Array[[Symbol, bool, RBS::Types::t]]
|
|
104
|
+
# @rbs return: RBS::MethodType
|
|
105
|
+
def unannotated: (Array[[ Symbol, bool, RBS::Types::t ]] signed) -> RBS::MethodType
|
|
106
|
+
|
|
107
|
+
# @rbs keywords: Hash[Symbol, bool]
|
|
108
|
+
# @rbs function: RBS::Types::function
|
|
109
|
+
# @rbs return: String
|
|
110
|
+
def stale: (Hash[Symbol, bool] keywords, RBS::Types::function function) -> String
|
|
111
|
+
|
|
112
|
+
# @rbs function: RBS::Types::function
|
|
113
|
+
# @rbs return: RBS::Types::Function?
|
|
114
|
+
def keyword_only: (RBS::Types::function function) -> RBS::Types::Function?
|
|
115
|
+
|
|
116
|
+
# @rbs function: RBS::Types::Function
|
|
117
|
+
# @rbs return: Hash[Symbol, bool]
|
|
118
|
+
def keyword_requirements: (RBS::Types::Function function) -> Hash[Symbol, bool]
|
|
119
|
+
|
|
120
|
+
# @rbs name: Symbol
|
|
121
|
+
# @rbs required: bool
|
|
122
|
+
# @rbs type: RBS::Types::t
|
|
123
|
+
# @rbs pattern: Array[String | Symbol]
|
|
124
|
+
# @rbs providers: Hash[Symbol, Skyward::API::Routing::Router::Provider]
|
|
125
|
+
# @rbs reader: Skyward::Core::Types::Reader
|
|
126
|
+
# @rbs return: Skyward::API::Routing::Router::Keyword | Skyward::API::Routing::Router::Provider | String
|
|
127
|
+
def keyword: (Symbol name, bool required, RBS::Types::t type, Array[String | Symbol] pattern, Hash[Symbol, Skyward::API::Routing::Router::Provider] providers, Skyward::Core::Types::Reader reader) -> (Skyward::API::Routing::Router::Keyword | Skyward::API::Routing::Router::Provider | String)
|
|
128
|
+
|
|
129
|
+
# @rbs name: Symbol
|
|
130
|
+
# @rbs pattern: Array[String | Symbol]
|
|
131
|
+
# @rbs return: :path | :query | :body | :request
|
|
132
|
+
def source: (Symbol name, Array[String | Symbol] pattern) -> (:path | :query | :body | :request)
|
|
133
|
+
|
|
134
|
+
# @rbs required: bool
|
|
135
|
+
# @rbs type: RBS::Types::t
|
|
136
|
+
# @rbs return: Skyward::API::Routing::Router::Keyword | String
|
|
137
|
+
def request: (bool required, RBS::Types::t type) -> (Skyward::API::Routing::Router::Keyword | String)
|
|
138
|
+
|
|
139
|
+
# A provided keyword's type is the provider's to give, so it's compared, never
|
|
140
|
+
# read, except that an untyped keyword is left unchecked, as untyped code is.
|
|
141
|
+
# @rbs name: Symbol
|
|
142
|
+
# @rbs type: RBS::Types::t
|
|
143
|
+
# @rbs provider: Skyward::API::Routing::Router::Provider
|
|
144
|
+
# @rbs return: Skyward::API::Routing::Router::Provider | String
|
|
145
|
+
def provided: (Symbol name, RBS::Types::t type, Skyward::API::Routing::Router::Provider provider) -> (Skyward::API::Routing::Router::Provider | String)
|
|
146
|
+
|
|
147
|
+
# @rbs type: RBS::Types::t
|
|
148
|
+
# @rbs return: bool
|
|
149
|
+
def untyped_type?: (RBS::Types::t type) -> bool
|
|
150
|
+
|
|
151
|
+
# A union means the same in any order.
|
|
152
|
+
# @rbs types: Array[RBS::Types::t]
|
|
153
|
+
# @rbs others: Array[RBS::Types::t]
|
|
154
|
+
# @rbs return: bool
|
|
155
|
+
def same?: (Array[RBS::Types::t] types, Array[RBS::Types::t] others) -> bool
|
|
156
|
+
|
|
157
|
+
# @rbs name: Symbol
|
|
158
|
+
# @rbs source: :path | :query | :body | :request
|
|
159
|
+
# @rbs type: Skyward::Core::Types::t
|
|
160
|
+
# @rbs return: String?
|
|
161
|
+
def carried: (Symbol name, :path | :query | :body | :request source, Skyward::Core::Types::t type) -> String?
|
|
162
|
+
|
|
163
|
+
# @rbs type: Skyward::Core::Types::t
|
|
164
|
+
# @rbs within: :path | :query | :array
|
|
165
|
+
# @rbs return: String?
|
|
166
|
+
def uncarried: (Skyward::Core::Types::t type, :path | :query | :array within) -> String?
|
|
167
|
+
|
|
168
|
+
# Response values are found in the signature, because the reader can't read them.
|
|
169
|
+
# @rbs type: RBS::Types::t
|
|
170
|
+
# @rbs reader: Skyward::Core::Types::Reader
|
|
171
|
+
# @rbs return: Array[Skyward::API::Routing::Router::returned] | String
|
|
172
|
+
def returns: (RBS::Types::t type, Skyward::Core::Types::Reader reader) -> (Array[Skyward::API::Routing::Router::returned] | String)
|
|
173
|
+
|
|
174
|
+
# @rbs type: RBS::Types::t
|
|
175
|
+
# @rbs return: Array[RBS::Types::t]
|
|
176
|
+
def parts: (RBS::Types::t type) -> Array[RBS::Types::t]
|
|
177
|
+
|
|
178
|
+
# @rbs type: RBS::Types::t
|
|
179
|
+
# @rbs reader: Skyward::Core::Types::Reader
|
|
180
|
+
# @rbs return: Skyward::API::Routing::Router::Created | Skyward::API::Routing::Router::Response | Skyward::API::Routing::Router::Rack
|
|
181
|
+
# | Skyward::Core::Types::Unreadable | nil
|
|
182
|
+
def response: (RBS::Types::t type, Skyward::Core::Types::Reader reader) -> (Skyward::API::Routing::Router::Created | Skyward::API::Routing::Router::Response | Skyward::API::Routing::Router::Rack | Skyward::Core::Types::Unreadable | nil)
|
|
183
|
+
|
|
184
|
+
# @rbs type: RBS::Types::t
|
|
185
|
+
# @rbs return: Skyward::API::Routing::Router::Response?
|
|
186
|
+
def response_value: (RBS::Types::t type) -> Skyward::API::Routing::Router::Response?
|
|
187
|
+
|
|
188
|
+
# @rbs type: RBS::Types::ClassInstance
|
|
189
|
+
# @rbs reader: Skyward::Core::Types::Reader
|
|
190
|
+
# @rbs return: Skyward::API::Routing::Router::Created | Skyward::Core::Types::Unreadable
|
|
191
|
+
def created: (RBS::Types::ClassInstance type, Skyward::Core::Types::Reader reader) -> (Skyward::API::Routing::Router::Created | Skyward::Core::Types::Unreadable)
|
|
192
|
+
|
|
193
|
+
# @rbs type: Skyward::API::Routing::Router::returned
|
|
194
|
+
# @rbs return: Array[Skyward::API::Routing::Router::returned]
|
|
195
|
+
def members: (Skyward::API::Routing::Router::returned type) -> Array[Skyward::API::Routing::Router::returned]
|
|
196
|
+
|
|
197
|
+
# @rbs endpoint: Skyward::API::Routing::Router::Endpoint
|
|
198
|
+
# @rbs reader: Skyward::Core::Types::Reader
|
|
199
|
+
# @rbs return: String?
|
|
200
|
+
def untyped: (Skyward::API::Routing::Router::Endpoint endpoint, Skyward::Core::Types::Reader reader) -> String?
|
|
201
|
+
|
|
202
|
+
# Only a keyword's whole type, nullable or not, or a member of the return type
|
|
203
|
+
# counts, so strict: true lets through untyped inside a type, as in Array[untyped].
|
|
204
|
+
# @rbs endpoint: Skyward::API::Routing::Router::Endpoint
|
|
205
|
+
# @rbs function: RBS::Types::Function
|
|
206
|
+
# @rbs return: String?
|
|
207
|
+
def untyped_parts: (Skyward::API::Routing::Router::Endpoint endpoint, RBS::Types::Function function) -> String?
|
|
208
|
+
|
|
209
|
+
# @rbs subject: String
|
|
210
|
+
# @rbs type: Skyward::Core::Types::Unreadable
|
|
211
|
+
# @rbs return: String
|
|
212
|
+
def unreadable: (String subject, Skyward::Core::Types::Unreadable type) -> String
|
|
213
|
+
|
|
214
|
+
# @rbs text: String
|
|
215
|
+
# @rbs return: String
|
|
216
|
+
def written: (String text) -> String
|
|
217
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Generated from lib/skyward/api/assembly/builder.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
class Skyward::API::Assembly::Builder
|
|
4
|
+
class Mount < Data
|
|
5
|
+
attr_reader api(): Skyward::API
|
|
6
|
+
|
|
7
|
+
attr_reader at(): String
|
|
8
|
+
|
|
9
|
+
def self.new: (Skyward::API api, String at) -> instance
|
|
10
|
+
| (api: Skyward::API, at: String) -> instance
|
|
11
|
+
|
|
12
|
+
def self.members: () -> [ :api, :at ]
|
|
13
|
+
|
|
14
|
+
def members: () -> [ :api, :at ]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class Use < Data
|
|
18
|
+
attr_reader middleware(): Skyward::API::_Middleware
|
|
19
|
+
|
|
20
|
+
attr_reader args(): Array[untyped]
|
|
21
|
+
|
|
22
|
+
attr_reader kwargs(): Hash[Symbol, untyped]
|
|
23
|
+
|
|
24
|
+
attr_reader block(): (^(?) -> untyped)?
|
|
25
|
+
|
|
26
|
+
def self.new: (Skyward::API::_Middleware middleware, Array[untyped] args, Hash[Symbol, untyped] kwargs, (^(?) -> untyped)? block) -> instance
|
|
27
|
+
| (middleware: Skyward::API::_Middleware, args: Array[untyped], kwargs: Hash[Symbol, untyped], block: (^(?) -> untyped)?) -> instance
|
|
28
|
+
|
|
29
|
+
def self.members: () -> [ :middleware, :args, :kwargs, :block ]
|
|
30
|
+
|
|
31
|
+
def members: () -> [ :middleware, :args, :kwargs, :block ]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
class Static < Data
|
|
35
|
+
attr_reader prefix(): String
|
|
36
|
+
|
|
37
|
+
attr_reader from(): String
|
|
38
|
+
|
|
39
|
+
def self.new: (String prefix, String from) -> instance
|
|
40
|
+
| (prefix: String, from: String) -> instance
|
|
41
|
+
|
|
42
|
+
def self.members: () -> [ :prefix, :from ]
|
|
43
|
+
|
|
44
|
+
def members: () -> [ :prefix, :from ]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# @dynamic mounts
|
|
48
|
+
attr_reader mounts: Array[Mount]
|
|
49
|
+
|
|
50
|
+
# @dynamic middleware
|
|
51
|
+
attr_reader middleware: Array[Use]
|
|
52
|
+
|
|
53
|
+
# @dynamic statics
|
|
54
|
+
attr_reader statics: Array[Static]
|
|
55
|
+
|
|
56
|
+
# @dynamic providers
|
|
57
|
+
attr_reader providers: Hash[Symbol, Skyward::API::_Provider & Object]
|
|
58
|
+
|
|
59
|
+
# @rbs return: void
|
|
60
|
+
def initialize: () -> void
|
|
61
|
+
|
|
62
|
+
# @rbs api: Skyward::API
|
|
63
|
+
# @rbs at: String
|
|
64
|
+
# @rbs return: void
|
|
65
|
+
def mount: (Skyward::API api, ?at: String) -> void
|
|
66
|
+
|
|
67
|
+
# @rbs (Skyward::API::_Middleware middleware, *untyped args, **untyped kwargs) ?{ (?) -> untyped } -> void
|
|
68
|
+
def use: (Skyward::API::_Middleware middleware, *untyped args, **untyped kwargs) ?{ (?) -> untyped } -> void
|
|
69
|
+
|
|
70
|
+
# @rbs prefix: String
|
|
71
|
+
# @rbs from: String
|
|
72
|
+
# @rbs return: void
|
|
73
|
+
def static: (String prefix, from: String) -> void
|
|
74
|
+
|
|
75
|
+
# @rbs (Symbol name, Skyward::API::_Provider & Object provider) -> void
|
|
76
|
+
def provide: (Symbol name, Skyward::API::_Provider & Object provider) -> void
|
|
77
|
+
end
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Generated from lib/skyward/api/assembly/dispatcher.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
class Skyward::API::Assembly::Dispatcher
|
|
4
|
+
type response = [ Integer, Hash[String, String], Array[String] ]
|
|
5
|
+
|
|
6
|
+
INPUT_TITLES: Hash[Integer, String]
|
|
7
|
+
|
|
8
|
+
class Document < Data
|
|
9
|
+
attr_reader type(): String
|
|
10
|
+
|
|
11
|
+
attr_reader body(): String
|
|
12
|
+
|
|
13
|
+
def self.new: (String type, String body) -> instance
|
|
14
|
+
| (type: String, body: String) -> instance
|
|
15
|
+
|
|
16
|
+
def self.members: () -> [ :type, :body ]
|
|
17
|
+
|
|
18
|
+
def members: () -> [ :type, :body ]
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
@documents: Hash[String, Document]
|
|
22
|
+
|
|
23
|
+
@stack: Skyward::API::_RackApp
|
|
24
|
+
|
|
25
|
+
@static: Skyward::API::Assembly::Static
|
|
26
|
+
|
|
27
|
+
@router: Skyward::API::Routing::Router
|
|
28
|
+
|
|
29
|
+
# @rbs router: Skyward::API::Routing::Router
|
|
30
|
+
# @rbs static: Skyward::API::Assembly::Static
|
|
31
|
+
# @rbs middleware: Array[Skyward::API::Assembly::Builder::Use]
|
|
32
|
+
# @rbs documents: Hash[String, Document]
|
|
33
|
+
# @rbs return: void
|
|
34
|
+
def initialize: (Skyward::API::Routing::Router router, Skyward::API::Assembly::Static static, Array[Skyward::API::Assembly::Builder::Use] middleware, Hash[String, Document] documents) -> void
|
|
35
|
+
|
|
36
|
+
# @rbs env: Hash[String, untyped]
|
|
37
|
+
# @rbs return: Skyward::API::rack_response
|
|
38
|
+
def call: (Hash[String, untyped] env) -> Skyward::API::rack_response
|
|
39
|
+
|
|
40
|
+
private
|
|
41
|
+
|
|
42
|
+
# @rbs env: Hash[String, untyped]
|
|
43
|
+
# @rbs return: Skyward::API::rack
|
|
44
|
+
def route: (Hash[String, untyped] env) -> Skyward::API::rack
|
|
45
|
+
|
|
46
|
+
# @rbs verb: String
|
|
47
|
+
# @rbs path: String
|
|
48
|
+
# @rbs return: response?
|
|
49
|
+
def served: (String verb, String path) -> response?
|
|
50
|
+
|
|
51
|
+
# @rbs env: Hash[String, untyped]
|
|
52
|
+
# @rbs verb: String
|
|
53
|
+
# @rbs path: String
|
|
54
|
+
# @rbs return: Skyward::API::rack
|
|
55
|
+
def routed: (Hash[String, untyped] env, String verb, String path) -> Skyward::API::rack
|
|
56
|
+
|
|
57
|
+
# @rbs match: Skyward::API::Routing::Router::Match
|
|
58
|
+
# @rbs env: Hash[String, untyped]
|
|
59
|
+
# @rbs return: Skyward::API::rack
|
|
60
|
+
def respond: (Skyward::API::Routing::Router::Match match, Hash[String, untyped] env) -> Skyward::API::rack
|
|
61
|
+
|
|
62
|
+
# A server closes the body it sends, so one that's never sent is closed here.
|
|
63
|
+
# @rbs body: untyped
|
|
64
|
+
# @rbs return: Array[String]
|
|
65
|
+
def dropped: (untyped body) -> Array[String]
|
|
66
|
+
|
|
67
|
+
# @rbs verb: String
|
|
68
|
+
# @rbs allowed: Array[String]
|
|
69
|
+
# @rbs return: response
|
|
70
|
+
def unmatched: (String verb, Array[String] allowed) -> response
|
|
71
|
+
|
|
72
|
+
# @rbs status: Integer
|
|
73
|
+
# @rbs title: String
|
|
74
|
+
# @rbs headers: Hash[String, String]
|
|
75
|
+
# @rbs **members: untyped
|
|
76
|
+
# @rbs return: response
|
|
77
|
+
def problem: (Integer status, String title, ?Hash[String, String] headers, **untyped members) -> response
|
|
78
|
+
|
|
79
|
+
# @rbs status: Integer
|
|
80
|
+
# @rbs headers: Hash[String, String]
|
|
81
|
+
# @rbs value: untyped
|
|
82
|
+
# @rbs return: response
|
|
83
|
+
def json: (Integer status, Hash[String, String] headers, untyped value) -> response
|
|
84
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Generated from lib/skyward/api/assembly/static.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
class Skyward::API::Assembly::Static
|
|
4
|
+
TYPES: Hash[String, String]
|
|
5
|
+
|
|
6
|
+
@statics: Array[Skyward::API::Assembly::Builder::Static]
|
|
7
|
+
|
|
8
|
+
# @rbs statics: Array[Skyward::API::Assembly::Builder::Static]
|
|
9
|
+
# @rbs return: void
|
|
10
|
+
def initialize: (Array[Skyward::API::Assembly::Builder::Static] statics) -> void
|
|
11
|
+
|
|
12
|
+
# @rbs env: Hash[String, untyped]
|
|
13
|
+
# @rbs return: Skyward::API::Assembly::Dispatcher::response?
|
|
14
|
+
def call: (Hash[String, untyped] env) -> Skyward::API::Assembly::Dispatcher::response?
|
|
15
|
+
|
|
16
|
+
# @rbs path: String
|
|
17
|
+
# @rbs return: String?
|
|
18
|
+
def file: (String path) -> String?
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
# @rbs static: Skyward::API::Assembly::Builder::Static
|
|
23
|
+
# @rbs path: String
|
|
24
|
+
# @rbs return: String?
|
|
25
|
+
def find: (Skyward::API::Assembly::Builder::Static static, String path) -> String?
|
|
26
|
+
|
|
27
|
+
# @rbs file: String
|
|
28
|
+
# @rbs env: Hash[String, untyped]
|
|
29
|
+
# @rbs return: Skyward::API::Assembly::Dispatcher::response
|
|
30
|
+
def serve: (String file, Hash[String, untyped] env) -> Skyward::API::Assembly::Dispatcher::response
|
|
31
|
+
|
|
32
|
+
# @rbs stat: File::Stat
|
|
33
|
+
# @rbs return: String
|
|
34
|
+
def etag: (File::Stat stat) -> String
|
|
35
|
+
|
|
36
|
+
# If-Modified-Since only counts without If-None-Match (RFC 9110, 13.2.2),
|
|
37
|
+
# and to the second, the precision of last-modified.
|
|
38
|
+
# @rbs env: Hash[String, untyped]
|
|
39
|
+
# @rbs etag: String
|
|
40
|
+
# @rbs modified: Time
|
|
41
|
+
# @rbs return: bool
|
|
42
|
+
def fresh?: (Hash[String, untyped] env, String etag, Time modified) -> bool
|
|
43
|
+
|
|
44
|
+
# @rbs value: String?
|
|
45
|
+
# @rbs return: Time?
|
|
46
|
+
def http_date: (String? value) -> Time?
|
|
47
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Generated from lib/skyward/api/cli/app_file.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Skyward::API::CLI::AppFile
|
|
4
|
+
FILE: String
|
|
5
|
+
|
|
6
|
+
ASSIGNMENT: String
|
|
7
|
+
|
|
8
|
+
# @rbs (String directory, out: _Writer, kernel: singleton(Kernel)) { (Skyward::API::Assembly::Application) -> String }
|
|
9
|
+
# -> void
|
|
10
|
+
def run: (String directory, out: _Writer, kernel: singleton(Kernel)) { (Skyward::API::Assembly::Application) -> String } -> void
|
|
11
|
+
|
|
12
|
+
# @rbs directory: String
|
|
13
|
+
# @rbs return: Skyward::API::Assembly::Application | String
|
|
14
|
+
def load: (String directory) -> (Skyward::API::Assembly::Application | String)
|
|
15
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Generated from lib/skyward/api/cli/check.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Skyward::API::CLI::Check
|
|
4
|
+
type capture = ^(Hash[String, String] env, Array[String] command, String chdir) -> [ String, bool ]
|
|
5
|
+
|
|
6
|
+
class Outcome < Data
|
|
7
|
+
attr_reader passed(): bool
|
|
8
|
+
|
|
9
|
+
attr_reader detail(): String
|
|
10
|
+
|
|
11
|
+
def self.new: (bool passed, String detail) -> instance
|
|
12
|
+
| (passed: bool, detail: String) -> instance
|
|
13
|
+
|
|
14
|
+
def self.members: () -> [ :passed, :detail ]
|
|
15
|
+
|
|
16
|
+
def members: () -> [ :passed, :detail ]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
PASSED: Outcome
|
|
20
|
+
|
|
21
|
+
GENERATED: String
|
|
22
|
+
|
|
23
|
+
STEEPFILE: String
|
|
24
|
+
|
|
25
|
+
# None holds the app's contract: its tests, its installed gems and scratch.
|
|
26
|
+
UNCHECKED: Array[String]
|
|
27
|
+
|
|
28
|
+
# The strict boot's own Ruby runs it, so the forced strict mode, the app's
|
|
29
|
+
# side effects and an exit or crash stay out of skyward check. The require
|
|
30
|
+
# lives here because a `-r` on the command line runs before RUBYOPT's
|
|
31
|
+
# `-rbundler/setup` on newer Rubies, before the bundle's gems are loadable.
|
|
32
|
+
BOOT: String
|
|
33
|
+
|
|
34
|
+
INSTALL_RBS_INLINE: String
|
|
35
|
+
|
|
36
|
+
INSTALL_STEEP: String
|
|
37
|
+
|
|
38
|
+
# @rbs (String directory, out: _Writer, capture: capture, rbs_inline: String?, steep: String?) -> Integer
|
|
39
|
+
def run: (String directory, out: _Writer, capture: capture, rbs_inline: String?, steep: String?) -> Integer
|
|
40
|
+
|
|
41
|
+
# @rbs directory: String
|
|
42
|
+
# @rbs capture: capture
|
|
43
|
+
# @rbs rbs_inline: String?
|
|
44
|
+
# @rbs return: Outcome
|
|
45
|
+
def signatures: (String directory, capture: capture, rbs_inline: String?) -> Outcome
|
|
46
|
+
|
|
47
|
+
# @rbs directory: String
|
|
48
|
+
# @rbs capture: capture
|
|
49
|
+
# @rbs return: Outcome
|
|
50
|
+
def strict_boot: (String directory, capture: capture) -> Outcome
|
|
51
|
+
|
|
52
|
+
# @rbs directory: String
|
|
53
|
+
# @rbs capture: capture
|
|
54
|
+
# @rbs steep: String?
|
|
55
|
+
# @rbs return: Outcome
|
|
56
|
+
def type_check: (String directory, capture: capture, steep: String?) -> Outcome
|
|
57
|
+
|
|
58
|
+
private
|
|
59
|
+
|
|
60
|
+
# @rbs detail: String
|
|
61
|
+
# @rbs return: Outcome
|
|
62
|
+
def failed: (String detail) -> Outcome
|
|
63
|
+
|
|
64
|
+
# @rbs directory: String
|
|
65
|
+
# @rbs return: Array[String]
|
|
66
|
+
def sources: (String directory) -> Array[String]
|
|
67
|
+
|
|
68
|
+
# @rbs directory: String
|
|
69
|
+
# @rbs return: Hash[String, String]
|
|
70
|
+
def rbs_files: (String directory) -> Hash[String, String]
|
|
71
|
+
|
|
72
|
+
# @rbs current: Hash[String, String]
|
|
73
|
+
# @rbs expected: Hash[String, String]
|
|
74
|
+
# @rbs return: Array[String]
|
|
75
|
+
def differences: (Hash[String, String] current, Hash[String, String] expected) -> Array[String]
|
|
76
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Generated from lib/skyward/api/cli/executable.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Skyward::API::CLI::Executable
|
|
4
|
+
# Under Bundler, Gem.find_files and Gem.bin_path see only the bundle's gems,
|
|
5
|
+
# so a gem installed outside the app's bundle isn't found. Checking first
|
|
6
|
+
# spares rescuing the error bin_path raises for a missing gem.
|
|
7
|
+
# @rbs name: String
|
|
8
|
+
# @rbs feature: String
|
|
9
|
+
# @rbs return: String?
|
|
10
|
+
def find: (String name, ?feature: String) -> String?
|
|
11
|
+
end
|