strongmind-platform-sdk 3.26.12 → 3.26.14

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: 76a88fa5bcf1116f4ceb27dc7ed698d0994c3029d5019423045362bd67ffcfa5
4
- data.tar.gz: 6d73a946f8937b43a2dd53114eb2ad77f8427253c3d45ae547c5698b3f2f9b80
3
+ metadata.gz: e32339c1ac422b88104e8ee07dd671f8ffbc4d545ba5bdd2e23c386f960f3ad5
4
+ data.tar.gz: 0d12d419c9179d38ddca9b89adc1001ceeee411420504b9f7514c3c7f71fb1c0
5
5
  SHA512:
6
- metadata.gz: 6aa5579badc87f4598a329505e7a3f66eb11ee5d7bd9dd1cb6d087cdf47820a1672a54f77c1627ffeb73cd0478534b721e33188c5f656f6aeb4c1c54d12edb6b
7
- data.tar.gz: 23991472c49feda6c433518cb387e4190b5ef76e6bd09f7f33b01ca39d16d6375b4f43c5fbe58009850e8476046f12a11e8c0a4e5ea3acaadb8935010d9d5aac
6
+ metadata.gz: 9e7f5401179755f238e49216b175a27c55b59a8b5691233c7005c0929e044a6a49ace100c09313cc9b9b64bd6df5840d097ff862e2f3b247d8a088d7e24970aa
7
+ data.tar.gz: 35cd1ba453e0f8a546ff699b7fde26e254804fbe9c05a0912cb6d5cc623dfc904fceec9d802c3ea6acd65f4fb65633595bec2a80fae40c286b2174e1c768b89a
@@ -35,6 +35,21 @@ module PlatformSdk
35
35
  end
36
36
  end
37
37
 
38
+ def user_course_modules(course_id:, user_id:)
39
+ response = @connection.get("/api/v1/courses/#{course_id}/modules?as_user_id=#{user_id}")
40
+ handle_rate_limiting response
41
+ if success?(response.status)
42
+ paginated_items headers: response.headers, initial_response: response.body
43
+ else
44
+ result = MultiJson.load response.body, symbolize_keys: true
45
+ error_messages = String.new
46
+ result[:errors].each do |error|
47
+ error_messages << "#{error[:message]} "
48
+ end
49
+ raise "Error getting course modules: #{error_messages}"
50
+ end
51
+ end
52
+
38
53
  # @param course_id [Integer]
39
54
  # @param module_id [Integer]
40
55
  # @returns [Array]
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PlatformSdk
4
+ module CatalogManager
5
+ # Client for making calls to the Catalog Manager API
6
+ class Client
7
+ attr_reader :base_url, :conn
8
+
9
+ def initialize(base_url, conn: nil)
10
+ @base_url = base_url
11
+ @conn = conn || build_connection
12
+ end
13
+
14
+ # Schools operations
15
+ def schools
16
+ get_payload('/api/v1/schools')
17
+ end
18
+
19
+ def school(school_id)
20
+ get_payload("/api/v1/schools/#{school_id}")
21
+ end
22
+
23
+ # Detail Models operations
24
+ def detail_models
25
+ get_payload('/api/v1/DetailModels/all')
26
+ end
27
+
28
+ def detail_model(detail_model_id)
29
+ get_payload("/api/v1/DetailModels/#{detail_model_id}")
30
+ end
31
+
32
+ private
33
+
34
+ def build_connection
35
+ Faraday.new(@base_url) do |conn|
36
+ conn.request :retry
37
+ conn.request :json
38
+ conn.response :raise_error
39
+ conn.response :json, content_type: /\bjson$/
40
+ conn.adapter :net_http
41
+ end
42
+ end
43
+
44
+ def get_payload(path)
45
+ response = @conn.get(path)
46
+ response.body
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'faraday'
4
+ require 'faraday/net_http'
5
+ require 'faraday/retry'
6
+ require 'platform_sdk/catalog_manager/client'
7
+
8
+ module PlatformSdk
9
+ module CatalogManager
10
+ class Error < StandardError; end
11
+ end
12
+ end
@@ -3,7 +3,7 @@
3
3
  module PlatformSdk
4
4
  MAJOR = 3
5
5
  MINOR = 26
6
- PATCH = 12
6
+ PATCH = 14
7
7
 
8
8
  VERSION = "#{PlatformSdk::MAJOR}.#{PlatformSdk::MINOR}.#{PlatformSdk::PATCH}"
9
9
  end
data/lib/platform_sdk.rb CHANGED
@@ -25,6 +25,7 @@ require "platform_sdk/sidekiq/ecs_task_protection_middleware"
25
25
  require "platform_sdk/sidekiq"
26
26
  require "platform_sdk/jobs/send_noun_to_pipeline_job"
27
27
  require "platform_sdk/jira"
28
+ require "platform_sdk/catalog_manager"
28
29
 
29
30
  module PlatformSdk
30
31
  class Error < StandardError; 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.12
4
+ version: 3.26.14
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-08-21 00:00:00.000000000 Z
11
+ date: 2025-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -256,6 +256,8 @@ files:
256
256
  - lib/platform_sdk/bynder/client.rb
257
257
  - lib/platform_sdk/canvas_api.rb
258
258
  - lib/platform_sdk/canvas_api/client.rb
259
+ - lib/platform_sdk/catalog_manager.rb
260
+ - lib/platform_sdk/catalog_manager/client.rb
259
261
  - lib/platform_sdk/central.rb
260
262
  - lib/platform_sdk/central/client.rb
261
263
  - lib/platform_sdk/data_pipeline.rb