starkcore 0.2.1 → 0.3.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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/utils/parse.rb +4 -2
  3. data/lib/utils/rest.rb +22 -5
  4. metadata +3 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c9293c96de36e40de9041b365e5e8022680065be489eaf39074dbb811ce1e0b
4
- data.tar.gz: be929408d2b8dbdc6eb4bf020be8df665b260dfc235cc215cf28695d64148812
3
+ metadata.gz: c0f60ad58e8522145f24faadd1c468c0f353f796f2258ed1d542b45b5a1f6c97
4
+ data.tar.gz: a08947bd074ddc200653f043dd1796b8ec135ee182cdd7325d5e936a3438c6c7
5
5
  SHA512:
6
- metadata.gz: 45b6a9058d61c39da5f8c1a4e95b0c05969b3bda2117dc3c3a8cdd700696b6e4d60d7debd7d554822f93211c838a00b409c2b316584cdb15b508b503729f0d91
7
- data.tar.gz: 3256cedeb812c826007f3db94bd24a9bf2ec762522e8a22a9511c72eca1559698465e07794df7e98e061d04e1a3e51bb41610ee575587f35491d1e21c4865148
6
+ metadata.gz: d3ef5de1df76541e28400c258269f69291d523da33c29a9cf57be4aa0086fd1e5b1388d93faa7b00a0d558e8627665a4f5e6dda84faf4dff58b7266f4148bf2d
7
+ data.tar.gz: f79124ab6cfaf20ef767b5f5ae712de3fd87742ef14df4cb5f15e3f6b2a08f26b0c804e7b64daaf339249bed19e4cd24e486dbfa96235fad3be08690d660bd60
data/lib/utils/parse.rb CHANGED
@@ -70,8 +70,10 @@ module StarkCore
70
70
  user: user,
71
71
  language: language,
72
72
  timeout: timeout,
73
- limit: 1
74
- )['publicKeys'][0]['content']
73
+ query: {"limit": 1},
74
+ prefix: nil,
75
+ raiseException: true
76
+ ).json['publicKeys'][0]['content']
75
77
  public_key = EllipticCurve::PublicKey.fromPem(pem)
76
78
  StarkCore::Utils::Cache.starkbank_public_key = public_key
77
79
  return public_key
data/lib/utils/rest.rb CHANGED
@@ -167,6 +167,23 @@ module StarkCore
167
167
  return StarkCore::Utils::API.from_api_json(resource_maker, entity_json)
168
168
  end
169
169
 
170
+ def self.post_sub_resource(resource_name:, sub_resource_maker:, sub_resource_name:, sdk_version:, host:, api_version:, user:, language:, timeout:, entity:, id:)
171
+ payload = StarkCore::Utils::API.api_json(entity)
172
+ json = StarkCore::Utils::Request.fetch(
173
+ host: host,
174
+ sdk_version: sdk_version,
175
+ user: user,
176
+ method: 'POST',
177
+ path: "#{StarkCore::Utils::API.endpoint(resource_name)}/#{id}/#{StarkCore::Utils::API.endpoint(sub_resource_name)}",
178
+ payload: payload,
179
+ api_version: api_version,
180
+ timeout: timeout
181
+ ).json
182
+ entity_json = json[StarkCore::Utils::API.last_name(sub_resource_name)]
183
+ return StarkCore::Utils::API.from_api_json(sub_resource_maker, entity_json)
184
+ end
185
+
186
+
170
187
  def self.delete_id(resource_name:, resource_maker:, sdk_version:, host:, api_version:, user:, language:, timeout:, id:)
171
188
  json = StarkCore::Utils::Request.fetch(
172
189
  host: host,
@@ -208,7 +225,7 @@ module StarkCore
208
225
  timeout: timeout,
209
226
  prefix: prefix,
210
227
  raiseException: raiseException
211
- ).json
228
+ )
212
229
  return json
213
230
  end
214
231
 
@@ -226,7 +243,7 @@ module StarkCore
226
243
  timeout: timeout,
227
244
  prefix: prefix,
228
245
  raiseException: raiseException
229
- ).json
246
+ )
230
247
  return json
231
248
  end
232
249
 
@@ -244,7 +261,7 @@ module StarkCore
244
261
  timeout: timeout,
245
262
  prefix: prefix,
246
263
  raiseException: raiseException
247
- ).json
264
+ )
248
265
  return json
249
266
  end
250
267
 
@@ -262,7 +279,7 @@ module StarkCore
262
279
  timeout: timeout,
263
280
  prefix: prefix,
264
281
  raiseException: raiseException
265
- ).json
282
+ )
266
283
  return json
267
284
  end
268
285
 
@@ -279,7 +296,7 @@ module StarkCore
279
296
  timeout: timeout,
280
297
  prefix: prefix,
281
298
  raiseException: raiseException
282
- ).json
299
+ )
283
300
  return json
284
301
  end
285
302
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: starkcore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - starkinfra
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-07-20 00:00:00.000000000 Z
10
+ date: 2025-02-19 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: starkbank-ecdsa
@@ -66,8 +65,6 @@ dependencies:
66
65
  - - "~>"
67
66
  - !ruby/object:Gem::Version
68
67
  version: '0.81'
69
- description:
70
- email:
71
68
  executables: []
72
69
  extensions: []
73
70
  extra_rdoc_files: []
@@ -95,7 +92,6 @@ homepage: https://github.com/starkinfra/core-ruby
95
92
  licenses:
96
93
  - MIT
97
94
  metadata: {}
98
- post_install_message:
99
95
  rdoc_options: []
100
96
  require_paths:
101
97
  - lib
@@ -110,8 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
106
  - !ruby/object:Gem::Version
111
107
  version: '0'
112
108
  requirements: []
113
- rubygems_version: 3.0.3.1
114
- signing_key:
109
+ rubygems_version: 3.6.2
115
110
  specification_version: 4
116
111
  summary: Basic SDK functionalities for the starkbank and starkinfra SDKs
117
112
  test_files: []