volcano-sdk 0.30.0 → 0.32.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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/volcano/auth.rb +4 -48
  3. data/lib/volcano/auth_session_construction.rb +67 -0
  4. data/lib/volcano/auth_sign_up.rb +2 -0
  5. data/lib/volcano/realtime/broadcast_delivery.rb +26 -2
  6. data/lib/volcano/realtime/channel_callbacks.rb +19 -14
  7. data/lib/volcano/realtime/channel_lifecycle.rb +9 -9
  8. data/lib/volcano/realtime/connection.rb +9 -5
  9. data/lib/volcano/realtime/connection_callbacks.rb +5 -1
  10. data/lib/volcano/realtime/lifecycle.rb +2 -1
  11. data/lib/volcano/realtime/postgres_batch.rb +11 -3
  12. data/lib/volcano/realtime/postgres_changes.rb +31 -16
  13. data/lib/volcano/realtime/postgres_database.rb +14 -1
  14. data/lib/volcano/realtime/postgres_delivery.rb +6 -1
  15. data/lib/volcano/realtime/postgres_expansion.rb +10 -4
  16. data/lib/volcano/realtime/presence.rb +18 -4
  17. data/lib/volcano/realtime/presence_state.rb +23 -6
  18. data/lib/volcano/realtime/protocol.rb +14 -9
  19. data/lib/volcano/realtime/protocol_dispatch.rb +25 -7
  20. data/lib/volcano/realtime/protocol_io.rb +8 -4
  21. data/lib/volcano/realtime/protocol_lifecycle.rb +2 -0
  22. data/lib/volcano/realtime/protocol_publication_dispatch.rb +12 -10
  23. data/lib/volcano/realtime/protocol_recovery.rb +7 -3
  24. data/lib/volcano/realtime/protocol_recovery_dispatch.rb +2 -0
  25. data/lib/volcano/realtime/reconnect.rb +4 -1
  26. data/lib/volcano/realtime.rb +122 -99
  27. data/lib/volcano/storage.rb +18 -34
  28. data/lib/volcano/storage_models.rb +18 -5
  29. data/lib/volcano/storage_mutations.rb +8 -3
  30. data/lib/volcano/storage_object_response.rb +88 -0
  31. data/lib/volcano/storage_response.rb +92 -0
  32. data/lib/volcano/storage_resumable_upload.rb +13 -2
  33. data/lib/volcano/storage_session_adapter.rb +61 -0
  34. data/lib/volcano/storage_transport_adapter.rb +73 -0
  35. data/lib/volcano/storage_upload_models.rb +51 -27
  36. data/lib/volcano/storage_upload_sessions.rb +1 -35
  37. data/lib/volcano/version.rb +1 -1
  38. data/lib/volcano.rb +6 -1
  39. data/sig/auth_credentials.rbs +15 -0
  40. data/sig/realtime.rbs +46 -0
  41. data/sig/realtime_postgres_change.rbs +1 -2
  42. data/sig/storage.rbs +29 -0
  43. data/sig/storage_records.rbs +3 -1
  44. data/sig/upload_session_status.rbs +3 -1
  45. metadata +9 -1
@@ -30,7 +30,7 @@ module Volcano
30
30
  def upload_session_parts(path, source, session, total_size, on_progress)
31
31
  uploaded = 0
32
32
  session.total_parts.times do |part_index|
33
- part = source.read(session.part_size)
33
+ part = source.read(session.part_size) || raise(IOError, 'upload source ended before completion')
34
34
  upload_part(
35
35
  path,
36
36
  session_id: session.session_id,
@@ -64,11 +64,22 @@ module Volcano
64
64
  def remaining_upload_bytes(source)
65
65
  return unless source.respond_to?(:size) && source.respond_to?(:pos)
66
66
 
67
- source.size - source.pos
67
+ dimensions = upload_source_dimensions(source)
68
+ return unless dimensions
69
+
70
+ dimensions.fetch(0) - dimensions.fetch(1)
68
71
  rescue IOError, SystemCallError
69
72
  nil
70
73
  end
71
74
 
75
+ def upload_source_dimensions(source)
76
+ size = source.method(:size).call
77
+ position = source.method(:pos).call
78
+ return unless size.is_a?(Integer) && position.is_a?(Integer)
79
+
80
+ [size, position]
81
+ end
82
+
72
83
  def with_spooled_upload_source(source)
73
84
  Tempfile.create('volcano-upload') do |file|
74
85
  file.binmode
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Volcano
4
+ # Validates the client methods that storage uses for session-scoped requests.
5
+ class StorageSessionAdapter
6
+ def initialize(client)
7
+ @client = client
8
+ end
9
+
10
+ def capture_session_binding
11
+ binding = storage_binding_array(@client.method(:capture_session_binding).call)
12
+ generation, owner, session = binding
13
+ [storage_generation(generation), storage_owner(owner), storage_session(session)]
14
+ end
15
+
16
+ def session_token
17
+ token = @client.method(:session_token).call
18
+ raise Error::TransportError, 'invalid storage session token' unless token.is_a?(String)
19
+
20
+ token
21
+ end
22
+
23
+ def session_request(binding:, &)
24
+ method_name = :session_request
25
+ response = @client.public_send(method_name, binding: binding) do |token|
26
+ raise Error::TransportError, 'invalid storage session token' unless token.is_a?(String)
27
+
28
+ yield token
29
+ end
30
+ raise Error::TransportError, 'invalid storage session response' unless response.is_a?(Transport::Response)
31
+
32
+ response
33
+ end
34
+
35
+ private
36
+
37
+ def storage_binding_array(value)
38
+ raise Error::TransportError, 'invalid storage session binding' unless value.is_a?(Array) && value.size == 3
39
+
40
+ value
41
+ end
42
+
43
+ def storage_generation(value)
44
+ raise Error::TransportError, 'invalid storage session binding' unless value.is_a?(Integer)
45
+
46
+ value
47
+ end
48
+
49
+ def storage_owner(value)
50
+ raise Error::TransportError, 'invalid storage session binding' unless value.is_a?(SessionOperations)
51
+
52
+ value
53
+ end
54
+
55
+ def storage_session(value)
56
+ raise Error::TransportError, 'invalid storage session binding' unless value.nil? || value.is_a?(Session)
57
+
58
+ value
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Volcano
4
+ # Narrows generated and test transport calls to checked storage responses.
5
+ class StorageTransportAdapter
6
+ def initialize(transport)
7
+ @transport = transport
8
+ end
9
+
10
+ def upload_storage_object(authorization:, bucket_name:, path:, data:, content_type:)
11
+ invoke(:upload_storage_object, authorization: authorization, bucket_name: bucket_name,
12
+ path: path, data: data, content_type: content_type)
13
+ end
14
+
15
+ def download_storage_object(authorization:, bucket_name:, path:, byte_range:)
16
+ invoke(:download_storage_object, authorization: authorization, bucket_name: bucket_name,
17
+ path: path, byte_range: byte_range)
18
+ end
19
+
20
+ def list_storage_objects(authorization:, bucket_name:, prefix:, limit:, cursor:)
21
+ invoke(:list_storage_objects, authorization: authorization, bucket_name: bucket_name,
22
+ prefix: prefix, limit: limit, cursor: cursor)
23
+ end
24
+
25
+ def delete_storage_object(authorization:, bucket_name:, path:)
26
+ invoke(:delete_storage_object, authorization: authorization, bucket_name: bucket_name, path: path)
27
+ end
28
+
29
+ def move_storage_object(authorization:, bucket_name:, from_path:, to_path:)
30
+ invoke(:move_storage_object, authorization: authorization, bucket_name: bucket_name,
31
+ from_path: from_path, to_path: to_path)
32
+ end
33
+
34
+ def copy_storage_object(authorization:, bucket_name:, from_path:, to_path:)
35
+ invoke(:copy_storage_object, authorization: authorization, bucket_name: bucket_name,
36
+ from_path: from_path, to_path: to_path)
37
+ end
38
+
39
+ def update_storage_object_visibility(authorization:, bucket_name:, path:, is_public:)
40
+ invoke(:update_storage_object_visibility, authorization: authorization, bucket_name: bucket_name,
41
+ path: path, is_public: is_public)
42
+ end
43
+
44
+ def create_upload_session(authorization:, bucket_name:, request:)
45
+ invoke(:create_upload_session, authorization: authorization, bucket_name: bucket_name, request: request)
46
+ end
47
+
48
+ def upload_part(authorization:, bucket_name:, request:)
49
+ invoke(:upload_part, authorization: authorization, bucket_name: bucket_name, request: request)
50
+ end
51
+
52
+ def complete_upload_session(authorization:, bucket_name:, request:)
53
+ invoke(:complete_upload_session, authorization: authorization, bucket_name: bucket_name, request: request)
54
+ end
55
+
56
+ def get_upload_session(authorization:, bucket_name:, request:)
57
+ invoke(:get_upload_session, authorization: authorization, bucket_name: bucket_name, request: request)
58
+ end
59
+
60
+ def abort_upload_session(authorization:, bucket_name:, request:)
61
+ invoke(:abort_upload_session, authorization: authorization, bucket_name: bucket_name, request: request)
62
+ end
63
+
64
+ private
65
+
66
+ def invoke(name, **arguments)
67
+ response = @transport.public_send(name, **arguments)
68
+ raise Error::TransportError, 'invalid storage transport response' unless response.is_a?(Transport::Response)
69
+
70
+ response
71
+ end
72
+ end
73
+ end
@@ -1,51 +1,68 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Volcano
4
- UploadSessionRequest = Data.define(:path, :content_type, :total_size, :part_size) do
4
+ UploadSessionRequest = Data.define(:path, :content_type, :total_size, :part_size)
5
+
6
+ # Freezes the arguments sent to create a resumable upload.
7
+ class UploadSessionRequest
8
+ # @dynamic path, content_type, total_size, part_size
5
9
  def initialize(path:, content_type:, total_size:, part_size: nil)
6
- super(
7
- path: path.dup.freeze,
8
- content_type: content_type.dup.freeze,
9
- total_size: total_size,
10
- part_size: part_size
11
- )
10
+ path = path.dup.freeze
11
+ content_type = content_type.dup.freeze
12
+ super
12
13
  end
13
14
  end
14
15
  private_constant :UploadSessionRequest
15
16
 
16
- UploadPartRequest = Data.define(:path, :session_id, :part_number, :data) do
17
+ UploadPartRequest = Data.define(:path, :session_id, :part_number, :data)
18
+
19
+ # Freezes one resumable upload part before transport dispatch.
20
+ class UploadPartRequest
21
+ # @dynamic path, session_id, part_number, data
17
22
  def initialize(path:, session_id:, part_number:, data:)
18
- super(
19
- path: path.dup.freeze,
20
- session_id: session_id.dup.freeze,
21
- part_number: part_number,
22
- data: data.dup.freeze
23
- )
23
+ path = path.dup.freeze
24
+ session_id = session_id.dup.freeze
25
+ data = data.dup.freeze
26
+ super
24
27
  end
25
28
  end
26
29
  private_constant :UploadPartRequest
27
30
 
28
- UploadSessionReference = Data.define(:path, :session_id) do
31
+ UploadSessionReference = Data.define(:path, :session_id)
32
+
33
+ # Freezes the path and identifier used for upload session operations.
34
+ class UploadSessionReference
35
+ # @dynamic path, session_id
29
36
  def initialize(path:, session_id:)
30
- super(path: path.dup.freeze, session_id: session_id.dup.freeze)
37
+ path = path.dup.freeze
38
+ session_id = session_id.dup.freeze
39
+ super
31
40
  end
32
41
  end
33
42
  private_constant :UploadSessionReference
34
43
 
35
- UploadSession = Data.define(:session_id, :part_size, :total_parts, :expires_at) do
44
+ UploadSession = Data.define(:session_id, :part_size, :total_parts, :expires_at)
45
+
46
+ # Describes a newly created upload session.
47
+ class UploadSession
48
+ # @dynamic session_id, part_size, total_parts, expires_at, members, with, to_h, deconstruct, deconstruct_keys
49
+ # @dynamic self.[], self.members
36
50
  def initialize(session_id:, part_size:, total_parts:, expires_at:)
37
- super(
38
- session_id: session_id.dup.freeze,
39
- part_size: part_size,
40
- total_parts: total_parts,
41
- expires_at: expires_at.dup.freeze
42
- )
51
+ session_id = session_id.dup.freeze
52
+ expires_at = expires_at.dup.freeze
53
+ super
43
54
  end
44
55
  end
45
56
 
46
- UploadPart = Data.define(:part_number, :etag, :size) do
57
+ UploadPart = Data.define(:part_number, :etag, :size)
58
+
59
+ # Describes an accepted upload part.
60
+ class UploadPart
61
+ # @dynamic part_number, etag, size, members, with, to_h, deconstruct, deconstruct_keys
62
+ # @dynamic self.[], self.members
47
63
  def initialize(part_number:, etag:, size:)
48
- super(part_number: part_number, etag: etag.dup.freeze, size: size)
64
+ etag = etag.dup.freeze
65
+ super
49
66
  end
50
67
  end
51
68
 
@@ -55,7 +72,13 @@ module Volcano
55
72
  ].freeze
56
73
  private_constant :UPLOAD_SESSION_STATUS_ATTRIBUTES
57
74
 
58
- UploadSessionStatus = Data.define(*UPLOAD_SESSION_STATUS_ATTRIBUTES) do
75
+ UploadSessionStatus = Data.define(*UPLOAD_SESSION_STATUS_ATTRIBUTES)
76
+
77
+ # Freezes upload progress returned by storage.
78
+ class UploadSessionStatus
79
+ # @dynamic session_id, status, path, content_type, total_size, part_size
80
+ # @dynamic total_parts, parts_uploaded, bytes_uploaded, parts, expires_at, created_at
81
+ # @dynamic members, with, to_h, deconstruct, deconstruct_keys, self.[], self.members
59
82
  def initialize(**attributes)
60
83
  unknown = attributes.keys - UPLOAD_SESSION_STATUS_ATTRIBUTES
61
84
  raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
@@ -66,7 +89,8 @@ module Volcano
66
89
  values = UPLOAD_SESSION_STATUS_ATTRIBUTES.to_h do |name|
67
90
  [name, immutable_value(attributes.fetch(name))]
68
91
  end
69
- super(**values)
92
+ attributes = values
93
+ super
70
94
  end
71
95
 
72
96
  private
@@ -51,7 +51,7 @@ module Volcano
51
51
  request: request
52
52
  )
53
53
  end
54
- storage_object(Transport.body(response, 200).fetch('object'))
54
+ storage_object(storage_payload(Transport.body(response, 200)).fetch('object'))
55
55
  end
56
56
 
57
57
  def get_upload_session(path, session_id:)
@@ -78,39 +78,5 @@ module Volcano
78
78
  Transport.body(response, 200)
79
79
  nil
80
80
  end
81
-
82
- private
83
-
84
- def upload_session(payload)
85
- UploadSession.new(
86
- session_id: payload.fetch('session_id'),
87
- part_size: payload.fetch('part_size'),
88
- total_parts: payload.fetch('total_parts'),
89
- expires_at: parse_time(payload.fetch('expires_at'))
90
- )
91
- end
92
-
93
- def upload_part_metadata(payload)
94
- UploadPart.new(
95
- part_number: payload.fetch('part_number'),
96
- etag: payload.fetch('etag'),
97
- size: payload.fetch('size')
98
- )
99
- end
100
-
101
- def upload_session_status(payload)
102
- attributes = upload_session_status_attributes(payload)
103
- attributes[:parts] = attributes.fetch(:parts).map { |part| upload_part_metadata(part) }
104
- attributes[:expires_at] = parse_time(attributes.fetch(:expires_at))
105
- attributes[:created_at] = parse_time(attributes.fetch(:created_at))
106
- UploadSessionStatus.new(**attributes)
107
- end
108
-
109
- def upload_session_status_attributes(payload)
110
- UPLOAD_SESSION_STATUS_ATTRIBUTES.to_h do |name|
111
- value = name == :parts ? payload.fetch(name.to_s, []) : payload.fetch(name.to_s)
112
- [name, value]
113
- end
114
- end
115
81
  end
116
82
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Volcano
4
- VERSION = '0.30.0'
4
+ VERSION = '0.32.0'
5
5
  end
data/lib/volcano.rb CHANGED
@@ -26,6 +26,7 @@ require_relative 'volcano/auth_get_user'
26
26
  require_relative 'volcano/auth_update_user'
27
27
  require_relative 'volcano/auth_email_change'
28
28
  require_relative 'volcano/auth_sessions'
29
+ require_relative 'volcano/auth_session_construction'
29
30
  require_relative 'volcano/auth'
30
31
  require_relative 'volcano/auth_sign_up'
31
32
  require_relative 'volcano/sign_up_result'
@@ -44,6 +45,10 @@ require_relative 'volcano/function_resolution'
44
45
  require_relative 'volcano/functions'
45
46
  require_relative 'volcano/durable'
46
47
  require_relative 'volcano/logs'
48
+ require_relative 'volcano/storage_session_adapter'
49
+ require_relative 'volcano/storage_transport_adapter'
50
+ require_relative 'volcano/storage_response'
51
+ require_relative 'volcano/storage_object_response'
47
52
  require_relative 'volcano/storage'
48
53
  require_relative 'volcano/storage_upload_sessions'
49
54
  require_relative 'volcano/storage_resumable_upload'
@@ -63,7 +68,7 @@ require_relative 'volcano/client'
63
68
  # Public namespace for the Volcano Ruby SDK.
64
69
  module Volcano
65
70
  private_constant :AuthRefresh, :AuthSignOut, :AuthProfile, :AuthProfileFields, :AuthUpdateUser, :AuthEmailChange,
66
- :AuthSessions,
71
+ :AuthSessions, :AuthSessionConstruction,
67
72
  :GeneratedTransport, :LockAutoRenewal, :LockLeaseClock, :LockRenewer,
68
73
  :LockSession, :LockResponse, :Redaction, :SessionOperations
69
74
 
@@ -0,0 +1,15 @@
1
+ module Volcano
2
+ class Auth
3
+ def current_session: () -> Session?
4
+ def current_session=: (Session session) -> void
5
+ def on_auth_state_change: () { (Symbol, Session?) -> void } -> AuthSubscription
6
+ def sign_in: (email: String, password: String) -> Session
7
+ def sign_up: (email: String, password: String, ?metadata: session_user_input, ?sign_in_when_allowed: bool) -> SignUpResult
8
+ def sign_in_anonymously: (?metadata: session_user_input) -> Session
9
+ def convert_anonymous: (email: String, password: String, ?metadata: session_user_input) -> User
10
+ def confirm_email: (token: String) -> nil
11
+ def resend_confirmation: (email: String) -> nil
12
+ def reset_password_for_email: (email: String) -> nil
13
+ def reset_password: (token: String, new_password: String) -> nil
14
+ end
15
+ end
data/sig/realtime.rbs ADDED
@@ -0,0 +1,46 @@
1
+ module Volcano
2
+ class Client
3
+ attr_reader auth: Auth
4
+ attr_reader realtime: Realtime
5
+
6
+ def initialize: (anon_key: String, ?api_url: String, ?service_key: String?, ?timeout: Integer, ?access_token: String?, ?refresh_token: String?) -> void
7
+ end
8
+
9
+ class Realtime
10
+ def channel: (String name, ?type: String | Symbol, ?auto_fetch: bool, ?fetch_batch_window_ms: Integer, ?fetch_max_batch_size: Integer) -> Channel
11
+ def connected?: () -> bool
12
+ def disconnect: () -> void
13
+ def remove_channel: (String name, ?type: String | Symbol) -> nil
14
+ def remove_all_channels: () -> nil
15
+
16
+ def on_connect: (^(ConnectContext) -> void callback) -> ^() -> Proc?
17
+ | () { (ConnectContext) -> void } -> ^() -> Proc?
18
+ def on_disconnect: (^(DisconnectContext) -> void callback) -> ^() -> Proc?
19
+ | () { (DisconnectContext) -> void } -> ^() -> Proc?
20
+ def on_error: (^(ErrorContext) -> void callback) -> ^() -> Proc?
21
+ | () { (ErrorContext) -> void } -> ^() -> Proc?
22
+
23
+ def database_name: () -> String?
24
+ def database_name=: (String? name) -> String?
25
+
26
+ class Channel
27
+ attr_reader name: String
28
+
29
+ def subscribe: () -> nil
30
+ def unsubscribe: () -> nil
31
+ def send: (event: String | Symbol, **json_value payload) -> nil
32
+
33
+ def on: (String event, ^(Object?) -> void callback) -> self
34
+ | (String event) { (Object?) -> void } -> self
35
+ def on_presence_sync: (^(Hash[String, PresenceInfo]) -> void callback) -> self
36
+ | () { (Hash[String, PresenceInfo]) -> void } -> self
37
+ def on_postgres_changes: (String | Symbol event, schema: String, table: String, callback: ^(PostgresChange) -> void) -> self
38
+ | (String | Symbol event, schema: String, table: String) { (PostgresChange) -> void } -> self
39
+
40
+ def track: (?Hash[String, json_value] state) -> nil
41
+ def presence_state: () -> Hash[String, PresenceInfo]
42
+ def get_presence_state: () -> Hash[String, PresenceInfo]
43
+ def tracked_state: () -> Hash[String, json_value]
44
+ end
45
+ end
46
+ end
@@ -17,8 +17,7 @@ module Volcano
17
17
  | (type: String, schema: String, table: String, timestamp: String, ?record: Hash[String, json_value]?, ?old_record: Hash[String, json_value]?, ?columns: Array[json_value]?, ?id: json_value, ?mode: String?) -> PostgresChange
18
18
  def self.members: () -> [:type, :schema, :table, :record, :old_record, :columns, :timestamp, :id, :mode]
19
19
 
20
- def initialize: (type: String, schema: String, table: String, timestamp: String, ?record: Hash[String, json_value]?, ?old_record: Hash[String, json_value]?, ?columns: Array[json_value]?, ?id: json_value, ?mode: String?) -> void
21
- | (String type, String schema, String table, Hash[String, json_value]? record, Hash[String, json_value]? old_record, Array[json_value]? columns, String timestamp, json_value id, String? mode) -> void
20
+ def initialize: (type: String, schema: String, table: String, timestamp: String, **Object? payload) -> void
22
21
  def members: () -> [:type, :schema, :table, :record, :old_record, :columns, :timestamp, :id, :mode]
23
22
  def with: (?type: String, ?schema: String, ?table: String, ?record: Hash[String, json_value]?, ?old_record: Hash[String, json_value]?, ?columns: Array[json_value]?, ?timestamp: String, ?id: json_value, ?mode: String?) -> PostgresChange
24
23
  def to_h: () -> { type: String, schema: String, table: String, record: Hash[String, json_value]?, old_record: Hash[String, json_value]?, columns: Array[json_value]?, timestamp: String, id: json_value, mode: String? }
data/sig/storage.rbs ADDED
@@ -0,0 +1,29 @@
1
+ module Volcano
2
+ interface _StorageReadable
3
+ def read: (?Integer length) -> String?
4
+ def is_a?: (Class) -> bool
5
+ def respond_to?: (Symbol) -> bool
6
+ def method: (Symbol) -> Method
7
+ end
8
+
9
+ class Storage
10
+ def from: (String bucket) -> StorageBucket
11
+ end
12
+
13
+ class StorageBucket
14
+ def upload: (String path, String | _StorageReadable value, ?content_type: String?) -> Hash[String, Object?]
15
+ def download: (String path, ?range: String?) -> String
16
+ def list: (?String prefix, ?limit: Integer?, ?cursor: String?) -> StoragePage
17
+ def remove: (String | Array[String] paths) -> Array[String]
18
+ def move: (String from_path, String to_path) -> StorageObject
19
+ def copy: (String from_path, String to_path) -> StorageObject
20
+ def update_visibility: (String path, public: bool) -> StorageObject
21
+
22
+ def create_upload_session: (String path, total_size: Integer, ?content_type: String, ?part_size: Integer?) -> UploadSession
23
+ def upload_part: (String path, session_id: String, part_number: Integer, data: String | _StorageReadable) -> UploadPart
24
+ def complete_upload_session: (String path, session_id: String) -> StorageObject
25
+ def get_upload_session: (String path, session_id: String) -> UploadSessionStatus
26
+ def abort_upload_session: (String path, session_id: String) -> nil
27
+ def upload_resumable: (String path, String | _StorageReadable value, ?content_type: String, ?part_size: Integer?, ?on_progress: (^(Integer, Integer) -> void)?) -> StorageObject
28
+ end
29
+ end
@@ -1,4 +1,6 @@
1
1
  module Volcano
2
+ type storage_object_attribute = String | Integer | bool | Hash[String, json_value] | Time | nil
3
+
2
4
  class StorageObject < Data
3
5
  attr_reader id: String
4
6
  attr_reader bucket_id: String
@@ -19,7 +21,7 @@ module Volcano
19
21
  | (id: String, bucket_id: String, name: String, size: Integer, mime_type: String, is_public: bool, ?owner_id: String?, ?etag: String?, ?metadata: Hash[String, json_value]?, ?created_at: Time?, ?updated_at: Time?, ?public_url: String?) -> StorageObject
20
22
  def self.members: () -> [:id, :bucket_id, :name, :size, :mime_type, :is_public, :owner_id, :etag, :metadata, :created_at, :updated_at, :public_url]
21
23
 
22
- def initialize: (id: String, bucket_id: String, name: String, size: Integer, mime_type: String, is_public: bool, ?owner_id: String?, ?etag: String?, ?metadata: Hash[String, json_value]?, ?created_at: Time?, ?updated_at: Time?, ?public_url: String?) -> void
24
+ def initialize: (**storage_object_attribute attributes) -> void
23
25
  def members: () -> [:id, :bucket_id, :name, :size, :mime_type, :is_public, :owner_id, :etag, :metadata, :created_at, :updated_at, :public_url]
24
26
  def with: (?id: String, ?bucket_id: String, ?name: String, ?size: Integer, ?mime_type: String, ?is_public: bool, ?owner_id: String?, ?etag: String?, ?metadata: Hash[String, json_value]?, ?created_at: Time?, ?updated_at: Time?, ?public_url: String?) -> StorageObject
25
27
  def to_h: () -> { id: String, bucket_id: String, name: String, size: Integer, mime_type: String, is_public: bool, owner_id: String?, etag: String?, metadata: Hash[String, json_value]?, created_at: Time?, updated_at: Time?, public_url: String? }
@@ -1,4 +1,6 @@
1
1
  module Volcano
2
+ type upload_status_attribute = String | Integer | Array[UploadPart] | Time
3
+
2
4
  class UploadSessionStatus < Data
3
5
  attr_reader session_id: String
4
6
  attr_reader status: String
@@ -19,7 +21,7 @@ module Volcano
19
21
  | (session_id: String, status: String, path: String, content_type: String, total_size: Integer, part_size: Integer, total_parts: Integer, parts_uploaded: Integer, bytes_uploaded: Integer, parts: Array[UploadPart], expires_at: Time, created_at: Time) -> UploadSessionStatus
20
22
  def self.members: () -> [:session_id, :status, :path, :content_type, :total_size, :part_size, :total_parts, :parts_uploaded, :bytes_uploaded, :parts, :expires_at, :created_at]
21
23
 
22
- def initialize: (session_id: String, status: String, path: String, content_type: String, total_size: Integer, part_size: Integer, total_parts: Integer, parts_uploaded: Integer, bytes_uploaded: Integer, parts: Array[UploadPart], expires_at: Time, created_at: Time) -> void
24
+ def initialize: (**upload_status_attribute attributes) -> void
23
25
  def members: () -> [:session_id, :status, :path, :content_type, :total_size, :part_size, :total_parts, :parts_uploaded, :bytes_uploaded, :parts, :expires_at, :created_at]
24
26
  def with: (?session_id: String, ?status: String, ?path: String, ?content_type: String, ?total_size: Integer, ?part_size: Integer, ?total_parts: Integer, ?parts_uploaded: Integer, ?bytes_uploaded: Integer, ?parts: Array[UploadPart], ?expires_at: Time, ?created_at: Time) -> UploadSessionStatus
25
27
  def to_h: () -> { session_id: String, status: String, path: String, content_type: String, total_size: Integer, part_size: Integer, total_parts: Integer, parts_uploaded: Integer, bytes_uploaded: Integer, parts: Array[UploadPart], expires_at: Time, created_at: Time }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volcano-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.0
4
+ version: 0.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kong
@@ -147,6 +147,7 @@ files:
147
147
  - lib/volcano/auth_reset_password.rb
148
148
  - lib/volcano/auth_reset_password_for_email.rb
149
149
  - lib/volcano/auth_session_binding.rb
150
+ - lib/volcano/auth_session_construction.rb
150
151
  - lib/volcano/auth_sessions.rb
151
152
  - lib/volcano/auth_sign_out.rb
152
153
  - lib/volcano/auth_sign_up.rb
@@ -602,13 +603,18 @@ files:
602
603
  - lib/volcano/storage.rb
603
604
  - lib/volcano/storage_models.rb
604
605
  - lib/volcano/storage_mutations.rb
606
+ - lib/volcano/storage_object_response.rb
605
607
  - lib/volcano/storage_public_url.rb
608
+ - lib/volcano/storage_response.rb
606
609
  - lib/volcano/storage_resumable_upload.rb
610
+ - lib/volcano/storage_session_adapter.rb
611
+ - lib/volcano/storage_transport_adapter.rb
607
612
  - lib/volcano/storage_upload_models.rb
608
613
  - lib/volcano/storage_upload_sessions.rb
609
614
  - lib/volcano/transport.rb
610
615
  - lib/volcano/user.rb
611
616
  - lib/volcano/version.rb
617
+ - sig/auth_credentials.rbs
612
618
  - sig/auth_oauth.rbs
613
619
  - sig/auth_profile.rbs
614
620
  - sig/auth_session_records.rbs
@@ -623,10 +629,12 @@ files:
623
629
  - sig/lock_records.rbs
624
630
  - sig/log_responses.rbs
625
631
  - sig/oauth_records.rbs
632
+ - sig/realtime.rbs
626
633
  - sig/realtime_contexts.rbs
627
634
  - sig/realtime_postgres_change.rbs
628
635
  - sig/session.rbs
629
636
  - sig/sign_up_result.rbs
637
+ - sig/storage.rbs
630
638
  - sig/storage_public_url.rbs
631
639
  - sig/storage_records.rbs
632
640
  - sig/upload_records.rbs