ding_sdk 0.11.51 → 0.11.53
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/ding_sdk/ding.rb +22 -23
- data/lib/ding_sdk/lookup.rb +2 -1
- data/lib/ding_sdk/otp.rb +10 -5
- data/lib/ding_sdk/sdkconfiguration.rb +12 -7
- 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: bc62da7ba4224cf0bae4f4a9603630833eb2bd20546853d2c8f834c1dc1063f7
|
4
|
+
data.tar.gz: fa55d8744d6fcb5e15f00bbe9038ae5a08a596e68d43baf92a7913631b823981
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53faca19e2e7f78eb7b47ffab9f503af065f3dbcaf594bf0260ea5ea21f6b60675a833bf5acd96d4218bea2306d47e53c6db8df46c242e064caee1a4a57835e4
|
7
|
+
data.tar.gz: 01eb4ffe5b8ee1239ac1232579118df772f93bee1b83496db4baf6393f79aabe204cfb668a6d9016ad910451651f07f0b5d51a09e23b132694a6ae4bf3701332
|
data/lib/ding_sdk/ding.rb
CHANGED
@@ -16,24 +16,23 @@ module DingSDK
|
|
16
16
|
attr_accessor :otp, :lookup
|
17
17
|
|
18
18
|
sig do
|
19
|
-
params(
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
params(
|
20
|
+
client: T.nilable(Faraday::Request),
|
21
|
+
security: T.nilable(::DingSDK::Shared::Security),
|
22
|
+
security_source: T.nilable(T.proc.returns(::DingSDK::Shared::Security)),
|
23
|
+
server_idx: T.nilable(Integer),
|
24
|
+
server_url: T.nilable(String),
|
25
|
+
url_params: T.nilable(T::Hash[Symbol, String])
|
26
|
+
).void
|
24
27
|
end
|
25
|
-
def initialize(client: nil,
|
26
|
-
security: nil,
|
27
|
-
server_idx: nil,
|
28
|
-
server_url: nil,
|
29
|
-
url_params: nil)
|
30
|
-
|
28
|
+
def initialize(client: nil, security: nil, security_source: nil, server_idx: nil, server_url: nil, url_params: nil)
|
31
29
|
## Instantiates the SDK configuring it with the provided parameters.
|
32
|
-
# @param [Faraday::Request] client The faraday HTTP client to use for all operations
|
33
|
-
# @param [Shared::Security] security The security details required for authentication
|
34
|
-
# @param [::
|
35
|
-
# @param [::
|
36
|
-
# @param [::
|
30
|
+
# @param [T.nilable(Faraday::Request)] client The faraday HTTP client to use for all operations
|
31
|
+
# @param [T.nilable(::DingSDK::Shared::Security)] security: The security details required for authentication
|
32
|
+
# @param [T.proc.returns(T.nilable(::DingSDK::Shared::Security))] security_source: A function that returns security details required for authentication
|
33
|
+
# @param [T.nilable(::Integer)] server_idx The index of the server to use for all operations
|
34
|
+
# @param [T.nilable(::String)] server_url The server URL to use for all operations
|
35
|
+
# @param [T.nilable(::Hash<::Symbol, ::String>)] url_params Parameters to optionally template the server URL with
|
37
36
|
|
38
37
|
if client.nil?
|
39
38
|
client = Faraday.new(request: {
|
@@ -50,8 +49,13 @@ module DingSDK
|
|
50
49
|
end
|
51
50
|
end
|
52
51
|
server_idx = 0 if server_idx.nil?
|
53
|
-
|
54
|
-
|
52
|
+
@sdk_configuration = SDKConfiguration.new(
|
53
|
+
client,
|
54
|
+
security,
|
55
|
+
security_source,
|
56
|
+
server_url,
|
57
|
+
server_idx
|
58
|
+
)
|
55
59
|
init_sdks
|
56
60
|
end
|
57
61
|
|
@@ -68,11 +72,6 @@ module DingSDK
|
|
68
72
|
init_sdks
|
69
73
|
end
|
70
74
|
|
71
|
-
sig { params(security: ::DingSDK::Shared::Security).void }
|
72
|
-
def config_security(security)
|
73
|
-
@sdk_configuration.security = security
|
74
|
-
end
|
75
|
-
|
76
75
|
sig { void }
|
77
76
|
def init_sdks
|
78
77
|
@otp = Otp.new(@sdk_configuration)
|
data/lib/ding_sdk/lookup.rb
CHANGED
@@ -44,7 +44,8 @@ module DingSDK
|
|
44
44
|
r = @sdk_configuration.client.get(url) do |req|
|
45
45
|
req.headers = headers
|
46
46
|
req.params = query_params
|
47
|
-
|
47
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
48
|
+
Utils.configure_request_security(req, security) if !security.nil?
|
48
49
|
end
|
49
50
|
|
50
51
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
data/lib/ding_sdk/otp.rb
CHANGED
@@ -33,7 +33,8 @@ module DingSDK
|
|
33
33
|
|
34
34
|
r = @sdk_configuration.client.post(url) do |req|
|
35
35
|
req.headers = headers
|
36
|
-
|
36
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
37
|
+
Utils.configure_request_security(req, security) if !security.nil?
|
37
38
|
if form
|
38
39
|
req.body = Utils.encode_form(form)
|
39
40
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
@@ -78,7 +79,8 @@ module DingSDK
|
|
78
79
|
|
79
80
|
r = @sdk_configuration.client.post(url) do |req|
|
80
81
|
req.headers = headers
|
81
|
-
|
82
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
83
|
+
Utils.configure_request_security(req, security) if !security.nil?
|
82
84
|
if form
|
83
85
|
req.body = Utils.encode_form(form)
|
84
86
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
@@ -123,7 +125,8 @@ module DingSDK
|
|
123
125
|
|
124
126
|
r = @sdk_configuration.client.post(url) do |req|
|
125
127
|
req.headers = headers
|
126
|
-
|
128
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
129
|
+
Utils.configure_request_security(req, security) if !security.nil?
|
127
130
|
if form
|
128
131
|
req.body = Utils.encode_form(form)
|
129
132
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
@@ -175,7 +178,8 @@ module DingSDK
|
|
175
178
|
|
176
179
|
r = @sdk_configuration.client.get(url) do |req|
|
177
180
|
req.headers = headers
|
178
|
-
|
181
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
182
|
+
Utils.configure_request_security(req, security) if !security.nil?
|
179
183
|
end
|
180
184
|
|
181
185
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -213,7 +217,8 @@ module DingSDK
|
|
213
217
|
|
214
218
|
r = @sdk_configuration.client.post(url) do |req|
|
215
219
|
req.headers = headers
|
216
|
-
|
220
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
221
|
+
Utils.configure_request_security(req, security) if !security.nil?
|
217
222
|
if form
|
218
223
|
req.body = Utils.encode_form(form)
|
219
224
|
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
@@ -19,7 +19,7 @@ module DingSDK
|
|
19
19
|
extend T::Sig
|
20
20
|
|
21
21
|
field :client, T.nilable(Faraday::Connection)
|
22
|
-
field :
|
22
|
+
field :security_source, T.nilable(T.proc.returns(T.nilable(::DingSDK::Shared::Security)))
|
23
23
|
field :server_url, T.nilable(String)
|
24
24
|
field :server_idx, T.nilable(Integer)
|
25
25
|
field :language, String
|
@@ -29,18 +29,23 @@ module DingSDK
|
|
29
29
|
field :user_agent, String
|
30
30
|
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
|
33
|
+
sig { params(client: T.nilable(Faraday::Connection), security: T.nilable(::DingSDK::Shared::Security), security_source: T.nilable(T.proc.returns(::DingSDK::Shared::Security)), server_url: T.nilable(String), server_idx: T.nilable(Integer)).void }
|
34
|
+
def initialize(client, security, security_source, server_url, server_idx)
|
34
35
|
@client = client
|
35
36
|
@server_url = server_url
|
36
37
|
@server_idx = server_idx.nil? ? 0 : server_idx
|
37
38
|
raise StandardError, "Invalid server index #{server_idx}" if @server_idx.negative? || @server_idx >= SERVERS.length
|
38
|
-
|
39
|
+
if !security_source.nil?
|
40
|
+
@security_source = security_source
|
41
|
+
elsif !security.nil?
|
42
|
+
@security_source = -> { security }
|
43
|
+
end
|
39
44
|
@language = 'ruby'
|
40
45
|
@openapi_doc_version = '1.0.0'
|
41
|
-
@sdk_version = '0.11.
|
42
|
-
@gen_version = '2.
|
43
|
-
@user_agent = 'speakeasy-sdk/ruby 0.11.
|
46
|
+
@sdk_version = '0.11.53'
|
47
|
+
@gen_version = '2.539.1'
|
48
|
+
@user_agent = 'speakeasy-sdk/ruby 0.11.53 2.539.1 1.0.0 ding_sdk'
|
44
49
|
end
|
45
50
|
|
46
51
|
sig { returns([String, T::Hash[Symbol, String]]) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ding_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.53
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ding
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|