elevenlabs_client 0.6.0 โ 0.7.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/CHANGELOG.md +76 -0
- data/README.md +25 -1
- data/lib/elevenlabs_client/client.rb +4 -1
- data/lib/elevenlabs_client/endpoints/admin/history.rb +1 -1
- data/lib/elevenlabs_client/endpoints/admin/samples.rb +30 -0
- data/lib/elevenlabs_client/endpoints/admin/service_accounts.rb +29 -0
- data/lib/elevenlabs_client/endpoints/admin/webhooks.rb +33 -0
- data/lib/elevenlabs_client/version.rb +1 -1
- data/lib/elevenlabs_client.rb +11 -8
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2ee49fd5b47df50ba23e006446d756683c743cc5b579c38d19ac0e8a2c0ff82
|
4
|
+
data.tar.gz: e3feb0f2445c99a9ed6b97176d55c60f631bcbbc0e96ca990517167bb8e441e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70e78e6e71d8b2976d8323875f3929c2deea23bb56f68db1a02260948972f812ecc58103703592fa07519e4a2e12a4f51630ed2fe28682d879ce7e27536bb82f
|
7
|
+
data.tar.gz: 3b1d5d5176830ca92e28587002fc1bc7716b12b56c23debeae49b0778a06e8451c45aa057e74d684a79ee0202cad17e4c2261a128b0d09fe209e64d8181eec6a
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,82 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.7.0] - 2024-09-15
|
11
|
+
|
12
|
+
### Added
|
13
|
+
- **๐๏ธ Admin Samples Management** - Voice sample deletion and content moderation
|
14
|
+
- **Sample Deletion** (`client.samples.*`) - Delete voice samples by ID for content moderation and cleanup
|
15
|
+
- Comprehensive error handling for voice and sample validation
|
16
|
+
- Security-focused operations with proper authentication and authorization
|
17
|
+
- Method aliases: `delete_voice_sample`, `remove_sample`
|
18
|
+
|
19
|
+
- **๐ข Admin Service Accounts** - Complete service account monitoring and management
|
20
|
+
- **Account Monitoring** (`client.service_accounts.*`) - List all service accounts in workspace
|
21
|
+
- **API Key Analytics** - Monitor API key status, permissions, and usage across all accounts
|
22
|
+
- **Usage Tracking** - Character usage monitoring with limits and projections
|
23
|
+
- **Security Auditing** - Comprehensive security analysis and compliance reporting
|
24
|
+
- Method aliases: `list`, `all`, `service_accounts`
|
25
|
+
|
26
|
+
- **๐ Admin Webhooks Management** - Workspace webhook monitoring and health analysis
|
27
|
+
- **Webhook Monitoring** (`client.webhooks.*`) - List all workspace webhooks with detailed status
|
28
|
+
- **Health Analysis** - Monitor webhook failures, auto-disabled status, and recent error codes
|
29
|
+
- **Security Auditing** - Authentication method analysis and HTTPS compliance checking
|
30
|
+
- **Usage Analytics** - Track webhook usage across different services and features
|
31
|
+
- Method aliases: `get_webhooks`, `all`, `webhooks`
|
32
|
+
|
33
|
+
### Enhanced
|
34
|
+
- **๐ Documentation Expansion** - Comprehensive documentation for new admin endpoints
|
35
|
+
- Added `docs/admin/SAMPLES.md` - Voice sample management and content moderation guide (883 lines)
|
36
|
+
- Added `docs/admin/SERVICE_ACCOUNTS.md` - Service account monitoring and security analysis guide (1,264 lines)
|
37
|
+
- Added `docs/admin/WEBHOOKS.md` - Webhook management and health monitoring guide (1,264 lines)
|
38
|
+
- Updated `docs/admin/README.md` - Enhanced admin overview with all endpoints (548 lines)
|
39
|
+
- Updated main README.md with new admin endpoint documentation
|
40
|
+
- Total: 3,959 lines of additional admin documentation
|
41
|
+
|
42
|
+
- **๐ฏ Example Controllers** - Production-ready Rails integration examples for new endpoints
|
43
|
+
- Added `examples/admin/samples_controller.rb` - Sample deletion with content moderation workflows (767 lines)
|
44
|
+
- Added `examples/admin/service_accounts_controller.rb` - Account monitoring with analytics dashboard (500+ lines)
|
45
|
+
- Added `examples/admin/webhooks_controller.rb` - Webhook health monitoring with export capabilities (761 lines)
|
46
|
+
- All controllers include comprehensive error handling, filtering, and export functionality
|
47
|
+
|
48
|
+
### Improved
|
49
|
+
- **๐งช Test Coverage** - Comprehensive testing for all new admin endpoints
|
50
|
+
- Added 35 new endpoint tests covering samples, service accounts, and webhooks
|
51
|
+
- Added 31 new integration tests with proper WebMock stubbing and response validation
|
52
|
+
- Enhanced error handling tests for all new admin scenarios
|
53
|
+
- Total: 66 new tests, bringing total to 874 examples with 100% pass rate
|
54
|
+
|
55
|
+
- **๐ง Client Integration** - Seamless integration of new admin endpoints
|
56
|
+
- Updated `Client` class to expose new admin endpoints (`samples`, `service_accounts`, `webhooks`)
|
57
|
+
- Enhanced error handling for admin-specific scenarios across all endpoints
|
58
|
+
- Consistent API patterns and response structures
|
59
|
+
- Proper namespacing under `ElevenlabsClient::Admin` module
|
60
|
+
|
61
|
+
### Technical Improvements
|
62
|
+
- **๐ Security Management** - Advanced security monitoring and compliance
|
63
|
+
- Voice sample content moderation with audit trails
|
64
|
+
- Service account permission analysis and excessive privilege detection
|
65
|
+
- Webhook security auditing with HTTPS and authentication validation
|
66
|
+
- Comprehensive security reporting and recommendation systems
|
67
|
+
|
68
|
+
- **๐ Health Monitoring** - Sophisticated health analysis across admin resources
|
69
|
+
- Webhook failure tracking with error code analysis and auto-disable detection
|
70
|
+
- Service account usage monitoring with character limit projections
|
71
|
+
- Sample deletion tracking for content moderation compliance
|
72
|
+
- Real-time health status reporting with actionable insights
|
73
|
+
|
74
|
+
- **๐ก๏ธ Content Moderation** - Professional content management capabilities
|
75
|
+
- Secure sample deletion with proper authentication and logging
|
76
|
+
- Batch sample operations for efficient content cleanup
|
77
|
+
- Audit trail support for compliance and tracking
|
78
|
+
- Integration with content moderation workflows and policies
|
79
|
+
|
80
|
+
- **๐ Analytics & Reporting** - Advanced analytics across all admin functions
|
81
|
+
- Service account usage analytics with trend analysis
|
82
|
+
- Webhook performance monitoring with failure rate calculations
|
83
|
+
- Sample deletion analytics for content moderation reporting
|
84
|
+
- Exportable reports in CSV, JSON, and Excel formats
|
85
|
+
|
10
86
|
## [0.6.0] - 2024-09-15
|
11
87
|
|
12
88
|
### Added
|
data/README.md
CHANGED
@@ -23,7 +23,10 @@ A comprehensive Ruby client library for the ElevenLabs API, supporting voice syn
|
|
23
23
|
- **Usage** - Monitor character usage and analytics
|
24
24
|
- **User** - Access account information and subscription details
|
25
25
|
- **Voice Library** - Browse and manage community shared voices
|
26
|
-
- **Models** - List available models and their capabilities
|
26
|
+
- **Models** - List available models and their capabilities
|
27
|
+
- **Samples** - Delete voice samples for content moderation
|
28
|
+
- **Service Accounts** - Monitor service accounts and API keys
|
29
|
+
- **Webhooks** - Monitor workspace webhooks and their health
|
27
30
|
๐ก **Streaming** - Real-time audio streaming
|
28
31
|
โ๏ธ **Configurable** - Flexible configuration options
|
29
32
|
๐งช **Well-tested** - Comprehensive test coverage
|
@@ -170,6 +173,18 @@ puts "Recent history: #{history['history'].length} items"
|
|
170
173
|
voices = client.voice_library.get_shared_voices(category: "professional", page_size: 5)
|
171
174
|
puts "Professional voices available: #{voices['voices'].length}"
|
172
175
|
|
176
|
+
# Admin Samples Management
|
177
|
+
client.samples.delete_sample(voice_id: "voice_id", sample_id: "sample_id")
|
178
|
+
puts "Sample deleted successfully"
|
179
|
+
|
180
|
+
# Service Accounts Monitoring
|
181
|
+
accounts = client.service_accounts.get_service_accounts
|
182
|
+
puts "Service accounts: #{accounts['service-accounts'].length}"
|
183
|
+
|
184
|
+
# Webhooks Management
|
185
|
+
webhooks = client.webhooks.list_webhooks(include_usages: true)
|
186
|
+
puts "Active webhooks: #{webhooks['webhooks'].length}"
|
187
|
+
|
173
188
|
# Music Generation
|
174
189
|
music_data = client.music.compose(
|
175
190
|
prompt: "Upbeat electronic dance track with synthesizers",
|
@@ -267,6 +282,9 @@ end
|
|
267
282
|
- **[History Management](docs/admin/HISTORY.md)** - Generated audio history management
|
268
283
|
- **[Voice Library](docs/admin/VOICE_LIBRARY.md)** - Community voice browsing and management
|
269
284
|
- **[Models API](docs/admin/MODELS.md)** - List available models and capabilities
|
285
|
+
- **[Samples Management](docs/admin/SAMPLES.md)** - Delete voice samples for content moderation
|
286
|
+
- **[Service Accounts](docs/admin/SERVICE_ACCOUNTS.md)** - Monitor service accounts and API keys
|
287
|
+
- **[Webhooks Management](docs/admin/WEBHOOKS.md)** - Monitor workspace webhooks and their health
|
270
288
|
|
271
289
|
### Available Endpoints
|
272
290
|
|
@@ -290,6 +308,9 @@ end
|
|
290
308
|
| `client.history.*` | Generated audio history management | [HISTORY.md](docs/admin/HISTORY.md) |
|
291
309
|
| `client.voice_library.*` | Community voice browsing and management | [VOICE_LIBRARY.md](docs/admin/VOICE_LIBRARY.md) |
|
292
310
|
| `client.models.*` | Model information and capabilities | [MODELS.md](docs/admin/MODELS.md) |
|
311
|
+
| `client.samples.*` | Voice sample deletion and content moderation | [SAMPLES.md](docs/admin/SAMPLES.md) |
|
312
|
+
| `client.service_accounts.*` | Service account monitoring and management | [SERVICE_ACCOUNTS.md](docs/admin/SERVICE_ACCOUNTS.md) |
|
313
|
+
| `client.webhooks.*` | Workspace webhook monitoring and health analysis | [WEBHOOKS.md](docs/admin/WEBHOOKS.md) |
|
293
314
|
|
294
315
|
## Configuration Options
|
295
316
|
|
@@ -364,6 +385,9 @@ The gem is designed to work seamlessly with Rails applications. See the [example
|
|
364
385
|
- [Admin::UserController](examples/admin/user_controller.rb) - User account and subscription management
|
365
386
|
- [Admin::VoiceLibraryController](examples/admin/voice_library_controller.rb) - Community voice browsing and management
|
366
387
|
- [Admin::ModelsController](examples/admin/models_controller.rb) - Model information and selection guidance
|
388
|
+
- [Admin::SamplesController](examples/admin/samples_controller.rb) - Voice sample deletion and content moderation
|
389
|
+
- [Admin::ServiceAccountsController](examples/admin/service_accounts_controller.rb) - Service account monitoring and analytics
|
390
|
+
- [Admin::WebhooksController](examples/admin/webhooks_controller.rb) - Workspace webhook monitoring and health analysis
|
367
391
|
|
368
392
|
## Development
|
369
393
|
|
@@ -8,7 +8,7 @@ module ElevenlabsClient
|
|
8
8
|
class Client
|
9
9
|
DEFAULT_BASE_URL = "https://api.elevenlabs.io"
|
10
10
|
|
11
|
-
attr_reader :base_url, :api_key, :dubs, :text_to_speech, :text_to_dialogue, :sound_generation, :text_to_voice, :models, :voices, :music, :audio_isolation, :audio_native, :forced_alignment, :speech_to_speech, :speech_to_text, :websocket_text_to_speech, :history, :usage, :user, :voice_library
|
11
|
+
attr_reader :base_url, :api_key, :dubs, :text_to_speech, :text_to_dialogue, :sound_generation, :text_to_voice, :models, :voices, :music, :audio_isolation, :audio_native, :forced_alignment, :speech_to_speech, :speech_to_text, :websocket_text_to_speech, :history, :usage, :user, :voice_library, :samples, :service_accounts, :webhooks
|
12
12
|
|
13
13
|
def initialize(api_key: nil, base_url: nil, api_key_env: "ELEVENLABS_API_KEY", base_url_env: "ELEVENLABS_BASE_URL")
|
14
14
|
@api_key = api_key || fetch_api_key(api_key_env)
|
@@ -24,6 +24,9 @@ module ElevenlabsClient
|
|
24
24
|
@usage = Admin::Usage.new(self)
|
25
25
|
@user = Admin::User.new(self)
|
26
26
|
@voice_library = Admin::VoiceLibrary.new(self)
|
27
|
+
@samples = Admin::Samples.new(self)
|
28
|
+
@service_accounts = Admin::ServiceAccounts.new(self)
|
29
|
+
@webhooks = Admin::Webhooks.new(self)
|
27
30
|
@voices = Voices.new(self)
|
28
31
|
@music = Endpoints::Music.new(self)
|
29
32
|
@audio_isolation = AudioIsolation.new(self)
|
@@ -22,7 +22,7 @@ module ElevenlabsClient
|
|
22
22
|
# @return [Hash] Response containing history items, pagination info
|
23
23
|
def list(**options)
|
24
24
|
endpoint = "/v1/history"
|
25
|
-
|
25
|
+
|
26
26
|
# Build query parameters
|
27
27
|
query_params = {}
|
28
28
|
query_params[:page_size] = options[:page_size] if options[:page_size]
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ElevenlabsClient
|
4
|
+
module Admin
|
5
|
+
class Samples
|
6
|
+
def initialize(client)
|
7
|
+
@client = client
|
8
|
+
end
|
9
|
+
|
10
|
+
# DELETE /v1/voices/:voice_id/samples/:sample_id
|
11
|
+
# Delete voice sample
|
12
|
+
# Documentation: https://elevenlabs.io/docs/api-reference/samples/delete-voice-sample
|
13
|
+
#
|
14
|
+
# @param voice_id [String] ID of the voice to be used. You can use the Get voices endpoint to list all the available voices.
|
15
|
+
# @param sample_id [String] ID of the sample to be used. You can use the Get voices endpoint to list all the available samples for a voice.
|
16
|
+
# @return [Hash] The JSON response containing the status of the deletion request.
|
17
|
+
def delete_sample(voice_id:, sample_id:)
|
18
|
+
endpoint = "/v1/voices/#{voice_id}/samples/#{sample_id}"
|
19
|
+
@client.delete(endpoint)
|
20
|
+
end
|
21
|
+
|
22
|
+
alias_method :delete_voice_sample, :delete_sample
|
23
|
+
alias_method :remove_sample, :delete_sample
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
attr_reader :client
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ElevenlabsClient
|
4
|
+
module Admin
|
5
|
+
class ServiceAccounts
|
6
|
+
def initialize(client)
|
7
|
+
@client = client
|
8
|
+
end
|
9
|
+
|
10
|
+
# GET /v1/service-accounts
|
11
|
+
# Get service accounts
|
12
|
+
# Documentation: https://elevenlabs.io/docs/api-reference/service-accounts/get-service-accounts
|
13
|
+
#
|
14
|
+
# @return [Hash] The JSON response containing all service accounts in the workspace.
|
15
|
+
def get_service_accounts
|
16
|
+
endpoint = "/v1/service-accounts"
|
17
|
+
@client.get(endpoint)
|
18
|
+
end
|
19
|
+
|
20
|
+
alias_method :list, :get_service_accounts
|
21
|
+
alias_method :all, :get_service_accounts
|
22
|
+
alias_method :service_accounts, :get_service_accounts
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
attr_reader :client
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ElevenlabsClient
|
4
|
+
module Admin
|
5
|
+
class Webhooks
|
6
|
+
def initialize(client)
|
7
|
+
@client = client
|
8
|
+
end
|
9
|
+
|
10
|
+
# GET /v1/workspace/webhooks
|
11
|
+
# List workspace webhooks
|
12
|
+
# Documentation: https://elevenlabs.io/docs/api-reference/workspace/list-workspace-webhooks
|
13
|
+
#
|
14
|
+
# @param include_usages [Boolean] Whether to include active usages of the webhook, only usable by admins. Defaults to false.
|
15
|
+
# @return [Hash] The JSON response containing all webhooks for the workspace.
|
16
|
+
def list_webhooks(include_usages: nil)
|
17
|
+
endpoint = "/v1/workspace/webhooks"
|
18
|
+
params = {
|
19
|
+
include_usages: include_usages
|
20
|
+
}.compact
|
21
|
+
@client.get(endpoint, params)
|
22
|
+
end
|
23
|
+
|
24
|
+
alias_method :get_webhooks, :list_webhooks
|
25
|
+
alias_method :all, :list_webhooks
|
26
|
+
alias_method :webhooks, :list_webhooks
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
attr_reader :client
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/elevenlabs_client.rb
CHANGED
@@ -3,23 +3,26 @@
|
|
3
3
|
require_relative "elevenlabs_client/version"
|
4
4
|
require_relative "elevenlabs_client/errors"
|
5
5
|
require_relative "elevenlabs_client/settings"
|
6
|
-
require_relative "elevenlabs_client/endpoints/dubs"
|
7
|
-
require_relative "elevenlabs_client/endpoints/text_to_speech"
|
8
|
-
require_relative "elevenlabs_client/endpoints/text_to_dialogue"
|
9
|
-
require_relative "elevenlabs_client/endpoints/sound_generation"
|
10
|
-
require_relative "elevenlabs_client/endpoints/text_to_voice"
|
11
|
-
require_relative "elevenlabs_client/endpoints/admin/models"
|
12
6
|
require_relative "elevenlabs_client/endpoints/admin/history"
|
7
|
+
require_relative "elevenlabs_client/endpoints/admin/models"
|
8
|
+
require_relative "elevenlabs_client/endpoints/admin/samples"
|
9
|
+
require_relative "elevenlabs_client/endpoints/admin/service_accounts"
|
13
10
|
require_relative "elevenlabs_client/endpoints/admin/usage"
|
14
11
|
require_relative "elevenlabs_client/endpoints/admin/user"
|
15
12
|
require_relative "elevenlabs_client/endpoints/admin/voice_library"
|
16
|
-
require_relative "elevenlabs_client/endpoints/
|
17
|
-
require_relative "elevenlabs_client/endpoints/music"
|
13
|
+
require_relative "elevenlabs_client/endpoints/admin/webhooks"
|
18
14
|
require_relative "elevenlabs_client/endpoints/audio_isolation"
|
19
15
|
require_relative "elevenlabs_client/endpoints/audio_native"
|
16
|
+
require_relative "elevenlabs_client/endpoints/dubs"
|
20
17
|
require_relative "elevenlabs_client/endpoints/forced_alignment"
|
18
|
+
require_relative "elevenlabs_client/endpoints/music"
|
19
|
+
require_relative "elevenlabs_client/endpoints/sound_generation"
|
21
20
|
require_relative "elevenlabs_client/endpoints/speech_to_speech"
|
22
21
|
require_relative "elevenlabs_client/endpoints/speech_to_text"
|
22
|
+
require_relative "elevenlabs_client/endpoints/text_to_speech"
|
23
|
+
require_relative "elevenlabs_client/endpoints/text_to_dialogue"
|
24
|
+
require_relative "elevenlabs_client/endpoints/text_to_voice"
|
25
|
+
require_relative "elevenlabs_client/endpoints/voices"
|
23
26
|
require_relative "elevenlabs_client/endpoints/websocket_text_to_speech"
|
24
27
|
require_relative "elevenlabs_client/client"
|
25
28
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elevenlabs_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitor Oliveira
|
@@ -151,9 +151,12 @@ files:
|
|
151
151
|
- lib/elevenlabs_client/client.rb
|
152
152
|
- lib/elevenlabs_client/endpoints/admin/history.rb
|
153
153
|
- lib/elevenlabs_client/endpoints/admin/models.rb
|
154
|
+
- lib/elevenlabs_client/endpoints/admin/samples.rb
|
155
|
+
- lib/elevenlabs_client/endpoints/admin/service_accounts.rb
|
154
156
|
- lib/elevenlabs_client/endpoints/admin/usage.rb
|
155
157
|
- lib/elevenlabs_client/endpoints/admin/user.rb
|
156
158
|
- lib/elevenlabs_client/endpoints/admin/voice_library.rb
|
159
|
+
- lib/elevenlabs_client/endpoints/admin/webhooks.rb
|
157
160
|
- lib/elevenlabs_client/endpoints/audio_isolation.rb
|
158
161
|
- lib/elevenlabs_client/endpoints/audio_native.rb
|
159
162
|
- lib/elevenlabs_client/endpoints/dubs.rb
|