vortex-ruby-sdk 1.5.0 → 1.6.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/lib/vortex/client.rb +75 -0
- data/lib/vortex/types.rb +41 -0
- data/lib/vortex/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c4007275edb1f0eeffa2386fa04e11236f7a12402ad3169c729f4d5bd73faa6b
|
|
4
|
+
data.tar.gz: 0ce765593b51887883c4de24671481fcca207285e4314625914b485f199d65b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c537cdd1f516a455cd01e648d5f6e62fc7ece380d604480d4b618b0168186fbd01f441b4bf6072c48bf8ad367a5a45bdf287b81d6f337c2e0cbeddcf7fb2667c
|
|
7
|
+
data.tar.gz: fa0e660c5faf465511c1fa5fb43fdd6ee8648d35ed95e96c48e2efb79d79586186be4dc39c90a8c9397dcfbd86581565cca8cfccc794cf3ed52e490793f30ac4
|
data/lib/vortex/client.rb
CHANGED
|
@@ -383,6 +383,81 @@ module Vortex
|
|
|
383
383
|
raise VortexError, "Failed to create invitation: #{e.message}"
|
|
384
384
|
end
|
|
385
385
|
|
|
386
|
+
# Get autojoin domains configured for a specific scope
|
|
387
|
+
#
|
|
388
|
+
# @param scope_type [String] The type of scope (e.g., "organization", "team", "project")
|
|
389
|
+
# @param scope [String] The scope identifier (customer's group ID)
|
|
390
|
+
# @return [Hash] Response with :autojoin_domains array and :invitation
|
|
391
|
+
# @raise [VortexError] If the request fails
|
|
392
|
+
#
|
|
393
|
+
# @example
|
|
394
|
+
# result = client.get_autojoin_domains('organization', 'acme-org')
|
|
395
|
+
# result['autojoinDomains'].each do |domain|
|
|
396
|
+
# puts "Domain: #{domain['domain']}"
|
|
397
|
+
# end
|
|
398
|
+
def get_autojoin_domains(scope_type, scope)
|
|
399
|
+
encoded_scope_type = URI.encode_www_form_component(scope_type)
|
|
400
|
+
encoded_scope = URI.encode_www_form_component(scope)
|
|
401
|
+
|
|
402
|
+
response = @connection.get("/api/v1/invitations/by-scope/#{encoded_scope_type}/#{encoded_scope}/autojoin")
|
|
403
|
+
handle_response(response)
|
|
404
|
+
rescue VortexError
|
|
405
|
+
raise
|
|
406
|
+
rescue => e
|
|
407
|
+
raise VortexError, "Failed to get autojoin domains: #{e.message}"
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
# Configure autojoin domains for a specific scope
|
|
411
|
+
#
|
|
412
|
+
# This endpoint syncs autojoin domains - it will add new domains, remove domains
|
|
413
|
+
# not in the provided list, and deactivate the autojoin invitation if all domains
|
|
414
|
+
# are removed (empty array).
|
|
415
|
+
#
|
|
416
|
+
# @param scope [String] The scope identifier (customer's group ID)
|
|
417
|
+
# @param scope_type [String] The type of scope (e.g., "organization", "team")
|
|
418
|
+
# @param domains [Array<String>] Array of domains to configure for autojoin
|
|
419
|
+
# @param widget_id [String] The widget configuration ID
|
|
420
|
+
# @param scope_name [String, nil] Optional display name for the scope
|
|
421
|
+
# @param metadata [Hash, nil] Optional metadata to attach to the invitation
|
|
422
|
+
# @return [Hash] Response with :autojoin_domains array and :invitation
|
|
423
|
+
# @raise [VortexError] If the request fails
|
|
424
|
+
#
|
|
425
|
+
# @example
|
|
426
|
+
# result = client.configure_autojoin(
|
|
427
|
+
# 'acme-org',
|
|
428
|
+
# 'organization',
|
|
429
|
+
# ['acme.com', 'acme.org'],
|
|
430
|
+
# 'widget-123',
|
|
431
|
+
# 'Acme Corporation'
|
|
432
|
+
# )
|
|
433
|
+
def configure_autojoin(scope, scope_type, domains, widget_id, scope_name = nil, metadata = nil)
|
|
434
|
+
raise VortexError, 'scope is required' if scope.nil? || scope.empty?
|
|
435
|
+
raise VortexError, 'scope_type is required' if scope_type.nil? || scope_type.empty?
|
|
436
|
+
raise VortexError, 'widget_id is required' if widget_id.nil? || widget_id.empty?
|
|
437
|
+
raise VortexError, 'domains must be an array' unless domains.is_a?(Array)
|
|
438
|
+
|
|
439
|
+
body = {
|
|
440
|
+
scope: scope,
|
|
441
|
+
scopeType: scope_type,
|
|
442
|
+
domains: domains,
|
|
443
|
+
widgetId: widget_id
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
body[:scopeName] = scope_name if scope_name
|
|
447
|
+
body[:metadata] = metadata if metadata
|
|
448
|
+
|
|
449
|
+
response = @connection.post('/api/v1/invitations/autojoin') do |req|
|
|
450
|
+
req.headers['Content-Type'] = 'application/json'
|
|
451
|
+
req.body = JSON.generate(body)
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
handle_response(response)
|
|
455
|
+
rescue VortexError
|
|
456
|
+
raise
|
|
457
|
+
rescue => e
|
|
458
|
+
raise VortexError, "Failed to configure autojoin: #{e.message}"
|
|
459
|
+
end
|
|
460
|
+
|
|
386
461
|
private
|
|
387
462
|
|
|
388
463
|
def build_connection
|
data/lib/vortex/types.rb
CHANGED
|
@@ -113,5 +113,46 @@ module Vortex
|
|
|
113
113
|
name: String, # Optional: Display name of the person being invited
|
|
114
114
|
avatarUrl: String # Optional: Avatar URL for the person being invited
|
|
115
115
|
}.freeze
|
|
116
|
+
|
|
117
|
+
# AutojoinDomain structure for autojoin domain configuration
|
|
118
|
+
# @example
|
|
119
|
+
# {
|
|
120
|
+
# id: '550e8400-e29b-41d4-a716-446655440000',
|
|
121
|
+
# domain: 'acme.com'
|
|
122
|
+
# }
|
|
123
|
+
AUTOJOIN_DOMAIN = {
|
|
124
|
+
id: String, # Vortex internal UUID
|
|
125
|
+
domain: String # The domain configured for autojoin
|
|
126
|
+
}.freeze
|
|
127
|
+
|
|
128
|
+
# AutojoinDomainsResponse from autojoin API endpoints
|
|
129
|
+
# @example
|
|
130
|
+
# {
|
|
131
|
+
# autojoinDomains: [AUTOJOIN_DOMAIN, ...],
|
|
132
|
+
# invitation: INVITATION # or nil
|
|
133
|
+
# }
|
|
134
|
+
AUTOJOIN_DOMAINS_RESPONSE = {
|
|
135
|
+
autojoinDomains: Array, # Array of AUTOJOIN_DOMAIN structures
|
|
136
|
+
invitation: Hash # INVITATION structure or nil
|
|
137
|
+
}.freeze
|
|
138
|
+
|
|
139
|
+
# ConfigureAutojoinRequest for configuring autojoin domains
|
|
140
|
+
# @example
|
|
141
|
+
# {
|
|
142
|
+
# scope: 'acme-org',
|
|
143
|
+
# scopeType: 'organization',
|
|
144
|
+
# scopeName: 'Acme Corporation', # Optional
|
|
145
|
+
# domains: ['acme.com', 'acme.org'],
|
|
146
|
+
# widgetId: 'widget-123',
|
|
147
|
+
# metadata: { ... } # Optional
|
|
148
|
+
# }
|
|
149
|
+
CONFIGURE_AUTOJOIN_REQUEST = {
|
|
150
|
+
scope: String, # Required: Customer's group ID
|
|
151
|
+
scopeType: String, # Required: Type of scope (e.g., "organization", "team")
|
|
152
|
+
scopeName: String, # Optional: Display name for the scope
|
|
153
|
+
domains: Array, # Required: Array of domain strings
|
|
154
|
+
widgetId: String, # Required: Widget configuration ID
|
|
155
|
+
metadata: Hash # Optional: Metadata to attach to the invitation
|
|
156
|
+
}.freeze
|
|
116
157
|
end
|
|
117
158
|
end
|
data/lib/vortex/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vortex-ruby-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vortex Software
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|