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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e5e38bc3e80eba571779f3f8d33190c3fdc604da602c80298a439a9c412bd07
|
4
|
+
data.tar.gz: 01b6d20bf6031049326d308ec0594b8ba1226daf9bd58772f719daabc72273aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
9
|
+
def initialize(base_url, client_id: nil, client_secret: nil, identity_base_url: nil)
|
10
10
|
@base_url = base_url
|
11
|
-
@
|
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
|
data/lib/platform_sdk/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2025-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|