vortex-ruby-sdk 1.8.1 → 1.8.3
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 +34 -0
- data/lib/vortex/client.rb +40 -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: f18c676fb034bb528e9d15103c72c781336265ea591c207c98c3b43011999e19
|
|
4
|
+
data.tar.gz: f93d826ce67bbaf30a0d2c40240f0070c492f277823b9c377d31d0557b989d9f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55f270dd410709b262dded8417c3a0f76362e8650b4611a719cf4061601b0e2c056438c5ebe33f1d6544a2f6b41c22a341fd587ca9f93e97023920404401aec7
|
|
7
|
+
data.tar.gz: aefed295464f5b39ae39bd7738287f8e097b8ad5a1d4da056028019705f1a136856e4d63405a087d93bc268ddf0f27215ba19db53cd165caf833fc09b212785e
|
data/README.md
CHANGED
|
@@ -174,6 +174,7 @@ All methods match the functionality of other Vortex SDKs:
|
|
|
174
174
|
- `get_invitations_by_group(group_type, group_id)` - Get group invitations
|
|
175
175
|
- `delete_invitations_by_group(group_type, group_id)` - Delete group invitations
|
|
176
176
|
- `reinvite(invitation_id)` - Reinvite user
|
|
177
|
+
- `sync_internal_invitation(creator_id, target_value, action, component_id)` - Sync internal invitation action
|
|
177
178
|
|
|
178
179
|
## Route Structure
|
|
179
180
|
|
|
@@ -187,6 +188,39 @@ The SDK provides these routes (same as other SDKs for React provider compatibili
|
|
|
187
188
|
- `GET /api/vortex/invitations/by-group/:type/:id`
|
|
188
189
|
- `DELETE /api/vortex/invitations/by-group/:type/:id`
|
|
189
190
|
- `POST /api/vortex/invitations/:id/reinvite`
|
|
191
|
+
- `POST /api/vortex/invitation-actions/sync-internal-invitation`
|
|
192
|
+
|
|
193
|
+
## Sync Internal Invitation
|
|
194
|
+
|
|
195
|
+
If you're using `internal` delivery type invitations and managing the invitation flow within your own application, you can sync invitation decisions back to Vortex when users accept or decline invitations in your system.
|
|
196
|
+
|
|
197
|
+
```ruby
|
|
198
|
+
# Sync an internal invitation action
|
|
199
|
+
result = client.sync_internal_invitation(
|
|
200
|
+
'user-123', # creator_id - The inviter's user ID in your system
|
|
201
|
+
'user-456', # target_value - The invitee's user ID in your system
|
|
202
|
+
'accepted', # action - "accepted" or "declined"
|
|
203
|
+
'component-uuid' # component_id - The widget component UUID
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
puts "Processed: #{result['processed']}"
|
|
207
|
+
puts "Invitation IDs: #{result['invitationIds']}"
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Parameters:**
|
|
211
|
+
- `creator_id` (String) — The inviter's user ID in your system
|
|
212
|
+
- `target_value` (String) — The invitee's user ID in your system
|
|
213
|
+
- `action` ("accepted" | "declined") — The invitation decision
|
|
214
|
+
- `component_id` (String) — The widget component UUID
|
|
215
|
+
|
|
216
|
+
**Response:**
|
|
217
|
+
- `processed` (Integer) — Count of invitations processed
|
|
218
|
+
- `invitationIds` (Array<String>) — IDs of processed invitations
|
|
219
|
+
|
|
220
|
+
**Use cases:**
|
|
221
|
+
- You handle invitation delivery through your own in-app notifications or UI
|
|
222
|
+
- Users accept/decline invitations within your application
|
|
223
|
+
- You need to keep Vortex updated with the invitation status
|
|
190
224
|
|
|
191
225
|
## JWT Payload Structure
|
|
192
226
|
|
data/lib/vortex/client.rb
CHANGED
|
@@ -479,6 +479,46 @@ module Vortex
|
|
|
479
479
|
raise VortexError, "Failed to configure autojoin: #{e.message}"
|
|
480
480
|
end
|
|
481
481
|
|
|
482
|
+
# Sync an internal invitation action (accept or decline)
|
|
483
|
+
#
|
|
484
|
+
# This method notifies Vortex that an internal invitation was accepted or declined
|
|
485
|
+
# within your application, so Vortex can update the invitation status accordingly.
|
|
486
|
+
#
|
|
487
|
+
# @param creator_id [String] The inviter's user ID
|
|
488
|
+
# @param target_value [String] The invitee's user ID
|
|
489
|
+
# @param action [String] The action taken: "accepted" or "declined"
|
|
490
|
+
# @param component_id [String] The widget component UUID
|
|
491
|
+
# @return [Hash] Response with :processed count and :invitationIds array
|
|
492
|
+
# @raise [VortexError] If the request fails
|
|
493
|
+
#
|
|
494
|
+
# @example
|
|
495
|
+
# result = client.sync_internal_invitation(
|
|
496
|
+
# 'user-123',
|
|
497
|
+
# 'user-456',
|
|
498
|
+
# 'accepted',
|
|
499
|
+
# 'component-uuid-789'
|
|
500
|
+
# )
|
|
501
|
+
# puts "Processed #{result['processed']} invitations"
|
|
502
|
+
def sync_internal_invitation(creator_id, target_value, action, component_id)
|
|
503
|
+
body = {
|
|
504
|
+
creatorId: creator_id,
|
|
505
|
+
targetValue: target_value,
|
|
506
|
+
action: action,
|
|
507
|
+
componentId: component_id
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
response = @connection.post('/api/v1/invitation-actions/sync-internal-invitation') do |req|
|
|
511
|
+
req.headers['Content-Type'] = 'application/json'
|
|
512
|
+
req.body = JSON.generate(body)
|
|
513
|
+
end
|
|
514
|
+
|
|
515
|
+
handle_response(response)
|
|
516
|
+
rescue VortexError
|
|
517
|
+
raise
|
|
518
|
+
rescue => e
|
|
519
|
+
raise VortexError, "Failed to sync internal invitation: #{e.message}"
|
|
520
|
+
end
|
|
521
|
+
|
|
482
522
|
private
|
|
483
523
|
|
|
484
524
|
def build_connection
|
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.8.
|
|
4
|
+
version: 1.8.3
|
|
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-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|