strongmind-platform-sdk 3.14.3 → 3.15.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4863450100f7294639bc50f9dd86af345e96b11b5e49e5e721bde6ea32913dc4
4
- data.tar.gz: 80115971de889e31af9b193a7ffdf829f9819a0815d03bdd9909ba087c80af52
3
+ metadata.gz: 6941d628845b176239f00bebe502b94f6d269fb0f38e08acec7793c446455ae7
4
+ data.tar.gz: 30a19f5580c16199479cafffd74be056d766e1222c3ff3d6360147d1e7f5029e
5
5
  SHA512:
6
- metadata.gz: 07ae6d3b9a435c807af00b8024672d04cc4719fc1c350349003997ee109f5a79c2493c13eb5ec1ac72e8646a60db359081b56ddad67e37505af325a706e6ed88
7
- data.tar.gz: 710c0665dd26ea1bf547da176c0ba01b7451a2c7d90a7455b8136bc64ba7688ec5e4759d04bea4006ec7bf0ec84da2f860d41ee4e4e82f30aa5ec0e03e027637
6
+ metadata.gz: 633d8766b794a806932ff9a303c7ae68ff12b1ef16aab64f756dd4a3807f6dc86d72cf252d31bad964ab0a32b57dbef13e2d686ddb1c60937a63e779a7bb38fc
7
+ data.tar.gz: 946088e561634d8e8e838f03d99af146f19b4c83140a4894b639502eb56a388af766612fd742668da4d13890d7526eb14a89e2798f732793c6c8ec2582715d4b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strongmind-platform-sdk (3.14.3)
4
+ strongmind-platform-sdk (3.15.0)
5
5
  aws-sdk-secretsmanager (~> 1.66)
6
6
  faraday (~> 2.5, >= 2.5.2)
7
7
  faraday-retry
@@ -30,7 +30,7 @@ GEM
30
30
  aws-sdk-cloudwatch (1.90.0)
31
31
  aws-sdk-core (~> 3, >= 3.193.0)
32
32
  aws-sigv4 (~> 1.1)
33
- aws-sdk-core (3.194.2)
33
+ aws-sdk-core (3.194.1)
34
34
  aws-eventstream (~> 1, >= 1.3.0)
35
35
  aws-partitions (~> 1, >= 1.651.0)
36
36
  aws-sigv4 (~> 1.8)
@@ -0,0 +1,42 @@
1
+ module PlatformSdk
2
+ module Central
3
+ class Client
4
+ attr_reader :access_token, :base_url, :conn
5
+
6
+ def initialize(base_url, access_token, conn: nil)
7
+ @access_token = access_token
8
+ @base_url = base_url
9
+ @conn = conn || build_connection
10
+ end
11
+
12
+ def user(uid)
13
+ resource_path = "/api/users/#{uid}"
14
+ response = get(resource_path)
15
+ response.body
16
+ end
17
+
18
+ private
19
+
20
+ def build_connection
21
+ Faraday.new(@base_url) do |faraday|
22
+ faraday.headers = default_headers
23
+ faraday.adapter Faraday.default_adapter
24
+ faraday.response :json, content_type: /\bjson$/, parser_options: { symbolize_names: true }
25
+ faraday.response :raise_error
26
+ end
27
+ end
28
+
29
+ def default_headers
30
+ {
31
+ "Content-Type" => "application/json",
32
+ "Authorization" => "Bearer #{access_token}"
33
+ }
34
+ end
35
+
36
+ def get(path, params = {})
37
+ @conn.get(path, params)
38
+ end
39
+
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "platform_sdk/central/client"
4
+
5
+ module PlatformSdk
6
+ module Central
7
+ class Error < StandardError; end
8
+ end
9
+ end
@@ -45,6 +45,10 @@ module PlatformSdk
45
45
  @conn.put(path, params).body
46
46
  end
47
47
 
48
+ def delete(path, params = nil)
49
+ @conn.delete(path, params).body
50
+ end
51
+
48
52
  def special_programs
49
53
  records_as_json = power_query("specialprograms")
50
54
  records_as_json.map { |record| SpecialProgram.new(record) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlatformSdk
4
- VERSION = "3.14.3"
4
+ VERSION = "3.15.0"
5
5
  end
data/lib/platform_sdk.rb CHANGED
@@ -15,6 +15,7 @@ require "platform_sdk/learnosity_api"
15
15
  require "platform_sdk/canvas_api"
16
16
  require "platform_sdk/bynder"
17
17
  require "platform_sdk/events"
18
+ require "platform_sdk/central"
18
19
 
19
20
  module PlatformSdk
20
21
  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.14.3
4
+ version: 3.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-08 00:00:00.000000000 Z
11
+ date: 2024-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -183,6 +183,8 @@ files:
183
183
  - lib/platform_sdk/bynder/client.rb
184
184
  - lib/platform_sdk/canvas_api.rb
185
185
  - lib/platform_sdk/canvas_api/client.rb
186
+ - lib/platform_sdk/central.rb
187
+ - lib/platform_sdk/central/client.rb
186
188
  - lib/platform_sdk/data_pipeline.rb
187
189
  - lib/platform_sdk/data_pipeline/data_pipeline_client.rb
188
190
  - lib/platform_sdk/edfi.rb