volcano-sdk 0.25.0 → 0.27.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea6009c324b19c3a5fb8463b1fca575365773af9caa54972802ff1e86c3f6f69
4
- data.tar.gz: 9577e000a28111f305386ded68b3db03e33c707cbccc6af69e687127f0fae18a
3
+ metadata.gz: d244570ed2e33751efeb30aa873400168dd80c0c490cf4536ce5dbb6a33f057b
4
+ data.tar.gz: ef977dcbbff49ebcb7e43ab1cfdf9aa292a58816281a48988af2de203c8c4dca
5
5
  SHA512:
6
- metadata.gz: f079d7f1856bd0f541027711101330a94af5e759f3f7f31b288721fc8068cd16a3c123658bce716ceec4410dbb8f05abd147073897496d22c7bfe814f0906626
7
- data.tar.gz: 5719ba35ffcc5e6da548aa0f93520c017f7d974ae0cc584db66ba4d52b8e645bcaa4ccafb9ecb6e528b47d1899f2ba1d2baf184c84763d8d9f6744fdc46a7986
6
+ metadata.gz: c8f7c362b7f9c3c7c00dc91409e8816c941e2c2244b2b2e1f2035c3c4c40f2aef9a91eec84701cb4230c4ad741ec3a4fe80063a42592012ce8024532b753f698
7
+ data.tar.gz: f1c26e610f4739303885d5a1d4aa03f86117bc74e4228329e21ef91e379e9f39c55bbee46569dc73ceecb4a68e03d13853e15dcf4cec712ea44fe7d7e6d47bff
@@ -7,28 +7,31 @@ module Volcano
7
7
  module Redaction
8
8
  MARKER = '[REDACTED]'
9
9
 
10
- module_function
11
-
12
- def message(value, secrets:)
10
+ def self.message(value, secrets:)
13
11
  variants(secrets).reduce(value.to_s.dup) do |redacted, secret|
14
12
  redacted.gsub(secret, MARKER)
15
13
  end
16
14
  end
17
15
 
18
- def exception(error, secrets:)
16
+ def self.exception(error, secrets:)
19
17
  redacted = copy_exception(error, message(error.message, secrets: secrets))
20
- redacted.set_backtrace(error.backtrace)
18
+ trace = error.backtrace
19
+ redacted.set_backtrace(trace.map(&:to_s)) if trace
21
20
  redacted
22
21
  end
23
22
 
24
- def copy_exception(error, redacted_message)
25
- return copy_volcano_error(error, redacted_message) if volcano_error?(error)
26
- return error.class.new(redacted_message, code: error.code) if realtime_server_error?(error)
23
+ def self.copy_exception(error, redacted_message)
24
+ if defined?(Error::VolcanoError) && error.is_a?(Error::VolcanoError)
25
+ return copy_volcano_error(error, redacted_message)
26
+ end
27
+ if defined?(Realtime::ServerError) && error.is_a?(Realtime::ServerError)
28
+ return error.class.new(redacted_message, code: error.code)
29
+ end
27
30
 
28
31
  error.exception(redacted_message)
29
32
  end
30
33
 
31
- def copy_volcano_error(error, redacted_message)
34
+ def self.copy_volcano_error(error, redacted_message)
32
35
  error.class.new(
33
36
  redacted_message,
34
37
  status: error.status,
@@ -37,15 +40,7 @@ module Volcano
37
40
  )
38
41
  end
39
42
 
40
- def volcano_error?(error)
41
- defined?(Error::VolcanoError) && error.is_a?(Error::VolcanoError)
42
- end
43
-
44
- def realtime_server_error?(error)
45
- defined?(Realtime::ServerError) && error.is_a?(Realtime::ServerError)
46
- end
47
-
48
- def variants(secrets)
43
+ def self.variants(secrets)
49
44
  values = Array(secrets).compact.flat_map do |value|
50
45
  secret = value.to_s
51
46
  next [] if secret.empty?
@@ -55,6 +50,6 @@ module Volcano
55
50
  end
56
51
  values.uniq.sort_by { |value| -value.length }
57
52
  end
58
- private_class_method :copy_exception, :copy_volcano_error, :realtime_server_error?, :variants, :volcano_error?
53
+ private_class_method :copy_exception, :copy_volcano_error, :variants
59
54
  end
60
55
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Volcano
4
- VERSION = '0.25.0'
4
+ VERSION = '0.27.0'
5
5
  end
@@ -0,0 +1,30 @@
1
+ module Volcano
2
+ class Realtime
3
+ class PostgresChange < Data
4
+ attr_reader type: String
5
+ attr_reader schema: String
6
+ attr_reader table: String
7
+ attr_reader record: Hash[String, json_value]?
8
+ attr_reader old_record: Hash[String, json_value]?
9
+ attr_reader columns: Array[json_value]?
10
+ attr_reader timestamp: String
11
+ attr_reader id: json_value
12
+ attr_reader mode: String?
13
+
14
+ def self.new: (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) -> PostgresChange
15
+ | (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
16
+ def self.[]: (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) -> PostgresChange
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
+ def self.members: () -> [:type, :schema, :table, :record, :old_record, :columns, :timestamp, :id, :mode]
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
22
+ def members: () -> [:type, :schema, :table, :record, :old_record, :columns, :timestamp, :id, :mode]
23
+ 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
+ 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? }
25
+ | [K, V] () { (Symbol, json_value) -> [K, V] } -> Hash[K, V]
26
+ def deconstruct: () -> [String, String, String, Hash[String, json_value]?, Hash[String, json_value]?, Array[json_value]?, String, json_value, String?]
27
+ def deconstruct_keys: (Array[Symbol]?) -> Hash[Symbol, json_value]
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,6 @@
1
+ module Volcano
2
+ class StorageBucket
3
+ def initialize: (Object client, Object transport, String name, api_url: String, anon_key: String) -> void
4
+ def get_public_url: (String path) -> String
5
+ end
6
+ end
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.25.0
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kong
@@ -613,8 +613,10 @@ files:
613
613
  - sig/log_responses.rbs
614
614
  - sig/oauth_records.rbs
615
615
  - sig/realtime_contexts.rbs
616
+ - sig/realtime_postgres_change.rbs
616
617
  - sig/session.rbs
617
618
  - sig/sign_up_result.rbs
619
+ - sig/storage_public_url.rbs
618
620
  - sig/storage_records.rbs
619
621
  - sig/upload_records.rbs
620
622
  - sig/upload_session_status.rbs