eryph-compute 0.1.1 → 0.1.2

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: b325ab23bab7159f9739f2ca245c2c9610643d5cd80aeba5471b0a9ddda30596
4
- data.tar.gz: 532c3c97b205016b2135d539950e74b2889ee8cd5b6dd1e362a7ef77cc26b036
3
+ metadata.gz: 2ac68797a73529c566499a19c788994c8e3b6645b9ee4f635e54cbe18dea2897
4
+ data.tar.gz: 69ef70085be9323a8c047d4cbd840457bd2a4d63d7952f7b29cfb825f57f4957
5
5
  SHA512:
6
- metadata.gz: 631697c5902ab1f3c954b31d9b3ee9c12615b63b0373e54386b3236d018fdbebc08d28c2ee2e36058a250f858c6b9eb6f67ccc8ce60082126dd857dbf8e721ea
7
- data.tar.gz: 04e0985c3d88904066af5a635338bc40a2a3405b6f9ed9e73b03457000a4566c8456a5beab01396ed03b7fe9436afbc26bf4be1ebcddbebf6526f5d0487c965e
6
+ metadata.gz: 88bd56b8fc45f16801f83191c9ba4fbab0ba0e818fc33deb76e2dbe65cd53e0eb066775f1ea3b6c33777f6cbf08d72ab206f109b7d2884257aa282bc25ce43fe
7
+ data.tar.gz: 178a58c068b137f1ffc1d5fea84b6465df7bd552e4e79283ce7a32d1ed4726117d4de3803d70303378f506098ce60f0832821c4d101511cfb7ab8deaa6dd49eb
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.metadata = {
17
17
  'bug_tracker_uri' => 'https://github.com/eryph-org/ruby-client/issues',
18
- 'changelog_uri' => 'https://github.com/eryph-org/ruby-client/blob/main/CHANGELOG.md',
18
+ 'changelog_uri' => 'https://github.com/eryph-org/ruby-client/blob/main/packages/clientruntime/CHANGELOG.md',
19
19
  'source_code_uri' => 'https://github.com/eryph-org/ruby-client',
20
20
  'homepage_uri' => 'https://eryph.io',
21
21
  'documentation_uri' => 'https://www.eryph.io/docs',
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32
32
  'lib/eryph/clientruntime.rb',
33
33
  'lib/eryph/clientruntime/**/*',
34
34
  'README.md',
35
- 'CHANGELOG.md',
35
+ 'packages/clientruntime/CHANGELOG.md',
36
36
  'LICENSE',
37
37
  '*.gemspec'
38
38
  ].select { |f| File.file?(f) }
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.metadata = {
17
17
  'bug_tracker_uri' => 'https://github.com/eryph-org/ruby-client/issues',
18
- 'changelog_uri' => 'https://github.com/eryph-org/ruby-client/blob/main/CHANGELOG.md',
18
+ 'changelog_uri' => 'https://github.com/eryph-org/ruby-client/blob/main/packages/compute-client/CHANGELOG.md',
19
19
  'source_code_uri' => 'https://github.com/eryph-org/ruby-client',
20
20
  'homepage_uri' => 'https://eryph.io',
21
21
  'documentation_uri' => 'https://www.eryph.io/docs',
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.files = Dir[
35
35
  'lib/**/*',
36
36
  'README.md',
37
- 'CHANGELOG.md',
37
+ 'packages/compute-client/CHANGELOG.md',
38
38
  'LICENSE',
39
39
  '*.gemspec'
40
40
  ].select { |f| File.file?(f) }
@@ -126,33 +126,10 @@ module Eryph
126
126
  return result
127
127
  end
128
128
 
129
- # Fallback to common local endpoints if no runtime info found
130
- fallback_zero_endpoints
129
+ # No fallback - if runtime info not found, return empty hash
130
+ {}
131
131
  end
132
132
 
133
- # Fallback endpoint discovery for eryph-zero when runtime file is not available
134
- # @return [Hash] endpoint name -> URL mapping
135
- def fallback_zero_endpoints
136
- endpoints = {}
137
-
138
- # Try common local endpoints for eryph-zero
139
- zero_candidates = [
140
- 'https://localhost:8080',
141
- 'https://127.0.0.1:8080',
142
- 'http://localhost:8080',
143
- 'http://127.0.0.1:8080',
144
- ]
145
-
146
- zero_candidates.each do |candidate_url|
147
- next unless test_zero_endpoint(candidate_url)
148
-
149
- endpoints['identity'] = candidate_url
150
- endpoints['compute'] = "#{candidate_url}/compute"
151
- break
152
- end
153
-
154
- endpoints
155
- end
156
133
 
157
134
  # Get endpoints for eryph-local configuration
158
135
  # This discovers running eryph-local instances from runtime lock files
@@ -193,34 +170,6 @@ module Eryph
193
170
  {}
194
171
  end
195
172
 
196
- # Test if a URL hosts an eryph-zero instance
197
- # @param base_url [String] base URL to test
198
- # @return [Boolean] true if eryph-zero is detected
199
- def test_zero_endpoint(base_url)
200
- # This is a simplified test - in a full implementation you might:
201
- # 1. Make an HTTP request to check for eryph-zero health endpoint
202
- # 2. Check for specific response headers or content
203
- # 3. Verify SSL certificates if applicable
204
-
205
- # In test environments, don't activate fallback endpoints
206
- # This prevents tests from accidentally finding "running" services
207
- # when they're testing the "not running" scenario
208
- return false if @reader.environment.instance_of?(::TestEnvironment)
209
-
210
- # For now, we'll just check if the URL format is valid
211
- # In production, this might make actual HTTP requests
212
- begin
213
- uri = URI.parse(base_url)
214
- # Check if scheme, host, and explicit port are present
215
- has_scheme = !uri.scheme.nil?
216
- has_host = !uri.host.nil? && !uri.host.empty?
217
- has_explicit_port = base_url.include?(':') && base_url.match(/:(\d+)/)
218
-
219
- !(has_scheme && has_host && has_explicit_port).nil?
220
- rescue URI::InvalidURIError
221
- false
222
- end
223
- end
224
173
  end
225
174
  end
226
175
  end
@@ -1,6 +1,6 @@
1
1
  module Eryph
2
2
  module ClientRuntime
3
3
  # Current version of the Eryph Client Runtime
4
- VERSION = '0.1.1'.freeze
4
+ VERSION = '0.1.2'.freeze
5
5
  end
6
6
  end
@@ -83,7 +83,7 @@ module Eryph
83
83
  # Test the connection and authentication
84
84
  # @return [Boolean] true if connection and authentication work
85
85
  def test_connection
86
- # For now, just test if we can get a token
86
+ # Test authentication by ensuring we can get a valid token
87
87
  token = @token_provider.ensure_access_token
88
88
  !token.nil? && !token.empty?
89
89
  rescue StandardError => e
@@ -110,43 +110,43 @@ module Eryph
110
110
  end
111
111
 
112
112
  # Access the catlets API
113
- # @return [Eryph::ComputeClient::CatletsApi, PlaceholderApiClient] catlets API client
113
+ # @return [Eryph::ComputeClient::CatletsApi] catlets API client
114
114
  def catlets
115
115
  @catlets ||= create_api_client('catlets', 'CatletsApi')
116
116
  end
117
117
 
118
118
  # Access the operations API
119
- # @return [Eryph::ComputeClient::OperationsApi, PlaceholderApiClient] operations API client
119
+ # @return [Eryph::ComputeClient::OperationsApi] operations API client
120
120
  def operations
121
121
  @operations ||= create_api_client('operations', 'OperationsApi')
122
122
  end
123
123
 
124
124
  # Access the projects API
125
- # @return [Eryph::ComputeClient::ProjectsApi, PlaceholderApiClient] projects API client
125
+ # @return [Eryph::ComputeClient::ProjectsApi] projects API client
126
126
  def projects
127
127
  @projects ||= create_api_client('projects', 'ProjectsApi')
128
128
  end
129
129
 
130
130
  # Access the virtual disks API
131
- # @return [Eryph::ComputeClient::VirtualDisksApi, PlaceholderApiClient] virtual disks API client
131
+ # @return [Eryph::ComputeClient::VirtualDisksApi] virtual disks API client
132
132
  def virtual_disks
133
133
  @virtual_disks ||= create_api_client('virtual_disks', 'VirtualDisksApi')
134
134
  end
135
135
 
136
136
  # Access the virtual networks API
137
- # @return [Eryph::ComputeClient::VirtualNetworksApi, PlaceholderApiClient] virtual networks API client
137
+ # @return [Eryph::ComputeClient::VirtualNetworksApi] virtual networks API client
138
138
  def virtual_networks
139
139
  @virtual_networks ||= create_api_client('virtual_networks', 'VirtualNetworksApi')
140
140
  end
141
141
 
142
142
  # Access the genes API
143
- # @return [Eryph::ComputeClient::GenesApi, PlaceholderApiClient] genes API client
143
+ # @return [Eryph::ComputeClient::GenesApi] genes API client
144
144
  def genes
145
145
  @genes ||= create_api_client('genes', 'GenesApi')
146
146
  end
147
147
 
148
148
  # Access the version API
149
- # @return [Eryph::ComputeClient::VersionApi, PlaceholderApiClient] version API client
149
+ # @return [Eryph::ComputeClient::VersionApi] version API client
150
150
  def version
151
151
  @version ||= create_api_client('version', 'VersionApi')
152
152
  end
@@ -351,9 +351,9 @@ module Eryph
351
351
  # Wrap the API client to handle errors
352
352
  ErrorHandlingApiClientWrapper.new(raw_client, self)
353
353
  rescue LoadError, NameError => e
354
- # Fall back to placeholder if generated client is not available
355
- @logger.warn "Generated client not available for #{api_name}, using placeholder: #{e.class}: #{e.message}"
356
- PlaceholderApiClient.new(api_name, self)
354
+ # Generated client must be available - fail fast
355
+ raise ClientRuntime::ConfigurationError,
356
+ "Generated client not available for #{api_name}: #{e.class}: #{e.message}"
357
357
  end
358
358
 
359
359
  def create_generated_api_client
@@ -413,30 +413,5 @@ module Eryph
413
413
  end
414
414
  end
415
415
 
416
- # Placeholder API client until generated client is available
417
- class PlaceholderApiClient
418
- def initialize(api_name, parent_client)
419
- @api_name = api_name
420
- @parent_client = parent_client
421
- end
422
-
423
- def method_missing(method_name, *args, **kwargs)
424
- @parent_client.logger.info "#{@api_name.capitalize} API call: #{method_name} " \
425
- '(placeholder - requires generated client)'
426
-
427
- # Return a simple response structure
428
- {
429
- api: @api_name,
430
- method: method_name,
431
- args: args,
432
- kwargs: kwargs,
433
- message: 'This is a placeholder response. Please run the generator script to create the actual API client.',
434
- }
435
- end
436
-
437
- def respond_to_missing?(_method_name, _include_private = false)
438
- true
439
- end
440
- end
441
416
  end
442
417
  end
data/lib/eryph/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Eryph
2
2
  # Current version of the Eryph Ruby Compute Client
3
- VERSION = '0.1.1'.freeze
3
+ VERSION = '0.1.2'.freeze
4
4
  end
@@ -0,0 +1,17 @@
1
+ # @eryph/compute-client
2
+
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [a27d510]
8
+ - @eryph/clientruntime@0.1.2
9
+
10
+ ## 0.1.1
11
+
12
+ ### Patch Changes
13
+
14
+ - Test changeset system setup and integration
15
+
16
+ - Updated dependencies []:
17
+ - @eryph/clientruntime@0.1.1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eryph-compute
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eryph Team
@@ -79,7 +79,6 @@ executables: []
79
79
  extensions: []
80
80
  extra_rdoc_files: []
81
81
  files:
82
- - CHANGELOG.md
83
82
  - LICENSE
84
83
  - README.md
85
84
  - eryph-clientruntime.gemspec
@@ -299,12 +298,13 @@ files:
299
298
  - lib/eryph/compute/problem_details_error.rb
300
299
  - lib/eryph/compute/version.rb
301
300
  - lib/eryph/version.rb
301
+ - packages/compute-client/CHANGELOG.md
302
302
  homepage: https://github.com/eryph-org/ruby-client
303
303
  licenses:
304
304
  - MIT
305
305
  metadata:
306
306
  bug_tracker_uri: https://github.com/eryph-org/ruby-client/issues
307
- changelog_uri: https://github.com/eryph-org/ruby-client/blob/main/CHANGELOG.md
307
+ changelog_uri: https://github.com/eryph-org/ruby-client/blob/main/packages/compute-client/CHANGELOG.md
308
308
  source_code_uri: https://github.com/eryph-org/ruby-client
309
309
  homepage_uri: https://eryph.io
310
310
  documentation_uri: https://www.eryph.io/docs
data/CHANGELOG.md DELETED
@@ -1,47 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to the Eryph Ruby client libraries will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- ### Added
11
- - Initial release of Eryph Ruby compute client
12
- - OAuth2 authentication with JWT support
13
- - **Automatic credential discovery** - Tries multiple configurations (default → zero → local) without requiring explicit config name
14
- - **Client ID-based discovery** - Find specific client across all configurations
15
- - **Enhanced Client constructor** - Support for `client_id` parameter and automatic discovery
16
- - System client credential detection for eryph-zero
17
- - Complete Compute API coverage via OpenAPI generation
18
- - Configuration-based endpoint management
19
- - SSL/TLS configuration support
20
- - Comprehensive error handling and logging
21
- - **Cross-platform admin privilege detection** - Windows Administrator and Linux root support
22
-
23
- ### Changed
24
-
25
- ### Deprecated
26
-
27
- ### Removed
28
-
29
- ### Fixed
30
-
31
- ### Security
32
-
33
- ## [0.1.0] - 2025-01-24
34
-
35
- ### Added
36
- - Initial release of `eryph-clientruntime` gem with authentication and configuration management
37
- - Initial release of `eryph-compute` gem with complete Compute API coverage
38
- - Support for Windows DPAPI credential decryption
39
- - Automatic endpoint discovery from running eryph-zero instances
40
- - Generated API client with proper authentication
41
- - Monorepo structure with separate versioning for runtime and compute client using changesets
42
- - Examples and documentation for common usage patterns
43
- - Integration with @changesets/cli for version management
44
- - Automated version synchronization between NPM packages and Ruby gems
45
-
46
- [Unreleased]: https://github.com/eryph-org/ruby-client/compare/v0.1.0...HEAD
47
- [0.1.0]: https://github.com/eryph-org/ruby-client/releases/tag/v0.1.0