foobara-http-command-connector 0.0.26 → 1.1.1

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: 29aa9d3315dc94a20e2799a25609724d6c07116d468c0187618916ecb294f424
4
- data.tar.gz: a04bbdca1ed113eb63589e437ce5262e2c483704601473f2665fcfe660c2740b
3
+ metadata.gz: 3013f15a6e04c65bfddcc8163eda0216d46ec70e21cf502be342498fc93d7f6a
4
+ data.tar.gz: 5d79f4cbd50aabbca7059fccadeda2d2b3db0411644d0e72700782fa5da20413
5
5
  SHA512:
6
- metadata.gz: 9f3860ea8fa74eec452c33bd8065a3ffae94227ea5123103c1354b4547307060139a9a62badeb9eb33c49b300d281dd70aab9e45f21a9589d6e12cc8920c78a2
7
- data.tar.gz: 5c5e6ad45a9d9af5e732121d1cda3433a0d98a7f2ae1765fa62a2de61e18824c6fef07e02c802034ef040ad7c756b5c60caa55c493d30bfc0216ce29fdd03f8c
6
+ metadata.gz: 69af62d21fdae86bd10d1c58a6676e48ec263cf9dedc1c4c83c315db8243c3dffe85769586aa654dc3f7283a969e618631162e0d4d4adc07373e7fda9d9b71f6
7
+ data.tar.gz: c89d254db34fed4350696e33c63457312fbb939fab9ffa57f79e7e7add24239f1630ee802fb8583837d7dfd725e3862d8c55139a3c03b6405b177e24745d2128
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [1.1.1] - 2025-08-25
2
+
3
+ - Add support for including processors
4
+ - Make detached false by default instead of true
5
+
6
+ ## [1.1.0] - 2025-08-22
7
+
8
+ - Handle new Foobara 0.1.0 type declarations
9
+
1
10
  ## [0.0.26] - 2025-05-03
2
11
 
3
12
  - Deal with CommandConnector interface changes
@@ -6,30 +6,19 @@ module Foobara
6
6
  inputs do
7
7
  manifestable :duck
8
8
  request :duck
9
- detached :boolean, default: true
9
+ detached :boolean, default: false
10
+ include_processors :boolean, default: false
10
11
  end
11
12
 
12
13
  def stamp_request_metadata
13
14
  manifest[:metadata] = super.merge(url: request.url)
14
15
  end
15
16
 
16
- def in_detached_context(&)
17
- TypeDeclarations.with_manifest_context(detached: true, &)
18
- end
19
-
20
17
  def build_manifest
21
- if detached_context?
22
- in_detached_context do
23
- super
24
- end
25
- else
18
+ TypeDeclarations.with_manifest_context(detached:, include_processors:) do
26
19
  super
27
20
  end
28
21
  end
29
-
30
- def detached_context?
31
- detached
32
- end
33
22
  end
34
23
  end
35
24
  end
@@ -125,18 +125,24 @@ module Foobara
125
125
  html << render_html_list({ element_type: data.element_type }, skip_wrapper: true)
126
126
  html << "</ul>" unless skip_wrapper
127
127
  when Manifest::TypeDeclaration
128
- html << "<ul>" unless skip_wrapper
129
- data.relevant_manifest.each_pair do |key, value|
130
- if key.to_s == "type"
131
- value = root_manifest.lookup_path(key, value)
128
+ manifest = data.relevant_manifest
129
+
130
+ if manifest.is_a?(::Symbol)
131
+ html << foobara_reference_link(data.to_type)
132
+ else
133
+ html << "<ul>" unless skip_wrapper
134
+ data.relevant_manifest.each_pair do |key, value|
135
+ if key.to_s == "type"
136
+ value = root_manifest.lookup_path(key, value)
137
+ end
138
+ html << "<li>#{key}"
139
+ html << "<ul>"
140
+ html << render_html_list(value, skip_wrapper: true)
141
+ html << "</ul>"
142
+ html << "</li>"
132
143
  end
133
- html << "<li>#{key}"
134
- html << "<ul>"
135
- html << render_html_list(value, skip_wrapper: true)
136
- html << "</ul>"
137
- html << "</li>"
144
+ html << "</ul>" unless skip_wrapper
138
145
  end
139
- html << "</ul>" unless skip_wrapper
140
146
  when Manifest::Type, Manifest::Command, Manifest::Error
141
147
  html << foobara_reference_link(data)
142
148
  when Manifest::PossibleError
@@ -19,7 +19,9 @@ module Foobara
19
19
  attr_accessor :raw_manifest, :root_manifest, :object_to_help_with, :manifest_to_help_with
20
20
 
21
21
  def load_manifest
22
- self.raw_manifest = command_connector.foobara_manifest
22
+ self.raw_manifest = TypeDeclarations.with_manifest_context(include_processors: true) do
23
+ command_connector.foobara_manifest
24
+ end
23
25
  self.root_manifest = Manifest::RootManifest.new(raw_manifest)
24
26
  end
25
27
 
@@ -31,21 +33,13 @@ module Foobara
31
33
 
32
34
  if result
33
35
  self.object_to_help_with = result
36
+ elsif mode == Namespace::LookupMode::ABSOLUTE
37
+ determine_object_to_help_with(mode: Namespace::LookupMode::GENERAL)
38
+ elsif mode == Namespace::LookupMode::GENERAL
39
+ determine_object_to_help_with(mode: Namespace::LookupMode::RELAXED)
34
40
  else
35
- # TODO: we should look up from the command connector's namespace instead, right?
36
- result = GlobalOrganization.foobara_lookup(arg, mode:)
37
-
38
- if result && root_manifest.contains?(result.foobara_manifest_reference,
39
- result.scoped_category)
40
- self.object_to_help_with = result
41
- elsif mode == Namespace::LookupMode::ABSOLUTE
42
- determine_object_to_help_with(mode: Namespace::LookupMode::GENERAL)
43
- elsif mode == Namespace::LookupMode::GENERAL
44
- determine_object_to_help_with(mode: Namespace::LookupMode::RELAXED)
45
- else
46
- # TODO: add an input error instead for missing record to trigger 404
47
- add_runtime_error(CommandConnector::NotFoundError.for(arg))
48
- end
41
+ # TODO: add an input error instead for missing record to trigger 404
42
+ add_runtime_error(CommandConnector::NotFoundError.for(arg))
49
43
  end
50
44
  else
51
45
  self.object_to_help_with = root_manifest
data/src/http/cookie.rb CHANGED
@@ -4,7 +4,7 @@ module Foobara
4
4
  class Cookie
5
5
  attr_accessor :name, :value, :opts
6
6
 
7
- ALLOWED_OPTIONS = %i[path httponly secure same_site domain expires max_age].freeze
7
+ ALLOWED_OPTIONS = [:path, :httponly, :secure, :same_site, :domain, :expires, :max_age].freeze
8
8
 
9
9
  def initialize(name, value, **opts)
10
10
  invalid_options = opts.keys - ALLOWED_OPTIONS
data/src/http.rb CHANGED
@@ -143,10 +143,10 @@ module Foobara
143
143
 
144
144
  def static_headers
145
145
  @static_headers ||= ENV.each_with_object({}) do |(key, value), headers|
146
- next if %w[
147
- FOOBARA_HTTP_RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_HEADERS
148
- FOOBARA_HTTP_RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_METHODS
149
- FOOBARA_HTTP_RESPONSE_HEADER_ACCESS_CONTROL_MAX_AGE
146
+ next if [
147
+ "FOOBARA_HTTP_RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_HEADERS",
148
+ "FOOBARA_HTTP_RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_METHODS",
149
+ "FOOBARA_HTTP_RESPONSE_HEADER_ACCESS_CONTROL_MAX_AGE"
150
150
  ].include?(key)
151
151
 
152
152
  match = key.match(/\AFOOBARA_HTTP_RESPONSE_HEADER_(.*)\z/)
metadata CHANGED
@@ -1,28 +1,34 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-http-command-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-03 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foobara
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 0.0.116
18
+ version: 0.1.1
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.0
19
22
  type: :runtime
20
23
  prerelease: false
21
24
  version_requirements: !ruby/object:Gem::Requirement
22
25
  requirements:
23
- - - "~>"
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 0.1.1
29
+ - - "<"
24
30
  - !ruby/object:Gem::Version
25
- version: 0.0.116
31
+ version: 2.0.0
26
32
  email:
27
33
  - azimux@gmail.com
28
34
  executables: []
@@ -95,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
101
  - !ruby/object:Gem::Version
96
102
  version: '0'
97
103
  requirements: []
98
- rubygems_version: 3.6.2
104
+ rubygems_version: 3.6.9
99
105
  specification_version: 4
100
106
  summary: No description. Add one.
101
107
  test_files: []