strongmind-platform-sdk 3.26.14 → 3.26.15

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: e32339c1ac422b88104e8ee07dd671f8ffbc4d545ba5bdd2e23c386f960f3ad5
4
- data.tar.gz: 0d12d419c9179d38ddca9b89adc1001ceeee411420504b9f7514c3c7f71fb1c0
3
+ metadata.gz: 8e5e38bc3e80eba571779f3f8d33190c3fdc604da602c80298a439a9c412bd07
4
+ data.tar.gz: 01b6d20bf6031049326d308ec0594b8ba1226daf9bd58772f719daabc72273aa
5
5
  SHA512:
6
- metadata.gz: 9e7f5401179755f238e49216b175a27c55b59a8b5691233c7005c0929e044a6a49ace100c09313cc9b9b64bd6df5840d097ff862e2f3b247d8a088d7e24970aa
7
- data.tar.gz: 35cd1ba453e0f8a546ff699b7fde26e254804fbe9c05a0912cb6d5cc623dfc904fceec9d802c3ea6acd65f4fb65633595bec2a80fae40c286b2174e1c768b89a
6
+ metadata.gz: 1504f3d4584defb905cf8e4ec34c7dc50a476b89ac184dc1ede042c31a5f2f29afb402183f31accdc7c71f65fe7995c7e2f1e57f524646d6dabb11781b914ebb
7
+ data.tar.gz: 269eae34b9b65f6c5222139967481ebd06e5dd7aeab709cd2f9fff61838ebf3488b78c9fe60c219338b5b53547abd1b6fad0da99745a4d73e9b7b78df8196a79
@@ -6,9 +6,10 @@ module PlatformSdk
6
6
  class Client
7
7
  attr_reader :base_url, :conn
8
8
 
9
- def initialize(base_url, conn: nil)
9
+ def initialize(base_url, client_id: nil, client_secret: nil, identity_base_url: nil)
10
10
  @base_url = base_url
11
- @conn = conn || build_connection
11
+ @auth = setup_auth_client(client_id, client_secret, identity_base_url)
12
+ @conn = build_connection
12
13
  end
13
14
 
14
15
  # Schools operations
@@ -29,6 +30,15 @@ module PlatformSdk
29
30
  get_payload("/api/v1/DetailModels/#{detail_model_id}")
30
31
  end
31
32
 
33
+ def get_course_image_by_external_course(canvas_domain:, canvas_account_id:, external_course_id:)
34
+ params = {
35
+ canvasDomain: canvas_domain,
36
+ canvasAccountId: canvas_account_id,
37
+ externalCourseId: external_course_id
38
+ }
39
+ get_authenticated_payload_with_params('/api/v1/schools/course-image', params)
40
+ end
41
+
32
42
  private
33
43
 
34
44
  def build_connection
@@ -41,10 +51,28 @@ module PlatformSdk
41
51
  end
42
52
  end
43
53
 
54
+ def setup_auth_client(client_id, client_secret, identity_base_url)
55
+ return nil if client_id.nil? || client_secret.nil? || identity_base_url.nil?
56
+
57
+ PlatformSdk::Identity::AuthClient.new(identity_base_url, client_id, client_secret)
58
+ end
59
+
44
60
  def get_payload(path)
45
61
  response = @conn.get(path)
46
62
  response.body
47
63
  end
64
+
65
+ def get_payload_with_params(path, params)
66
+ response = @conn.get(path, params)
67
+ response.body
68
+ end
69
+
70
+ def get_authenticated_payload_with_params(path, params)
71
+ response = @conn.get(path, params) do |req|
72
+ req.headers['Authorization'] = "Bearer #{@auth.auth_token}" if @auth
73
+ end
74
+ response.body
75
+ end
48
76
  end
49
77
  end
50
78
  end
@@ -3,6 +3,7 @@
3
3
  require 'faraday'
4
4
  require 'faraday/net_http'
5
5
  require 'faraday/retry'
6
+ require 'platform_sdk/identity/clients'
6
7
  require 'platform_sdk/catalog_manager/client'
7
8
 
8
9
  module PlatformSdk
@@ -3,7 +3,7 @@
3
3
  module PlatformSdk
4
4
  MAJOR = 3
5
5
  MINOR = 26
6
- PATCH = 14
6
+ PATCH = 15
7
7
 
8
8
  VERSION = "#{PlatformSdk::MAJOR}.#{PlatformSdk::MINOR}.#{PlatformSdk::PATCH}"
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strongmind-platform-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.26.14
4
+ version: 3.26.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-09-12 00:00:00.000000000 Z
11
+ date: 2025-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday