strongmind-platform-sdk 3.0.0 → 3.1.1

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: af0bb9bb301d3ac21ab8b51699c2b55acda385db50d9b40da2f98369c2d1fb03
4
- data.tar.gz: 0acb9f790fb2385dd132f0c83da3210285c60320fe471b6d728b2490239de3f3
3
+ metadata.gz: 86d356f8e5ee88e60e918e174212aa96bed9065dfd0ce46a5b2e55b6590aecef
4
+ data.tar.gz: 26d5eaa60a72b41a9e9e35799d2a0aaf31959013062ccc22aadf58802e4cc934
5
5
  SHA512:
6
- metadata.gz: 8becc23e5879eb0c645cd15b3b4780831f09337e8f01d40573abb2e5f0756ca7cfb75bc3cebd6c865995a81e8e13a928ebcdbc9339ae6e2cce18dfb25e8a6110
7
- data.tar.gz: 336cefee6f259e50f5efef3b4d86ecb6f3778cfa3427043f86a8d5bbbebb7f2f49d59bdd652f2441b3c357cc649e1688df30c32c8c3eea6a4551d1b624ba4b80
6
+ metadata.gz: 157874358905233ab558f97cf57696a7246e23669e0ce5eded6e7000d250c50a3b3548fd5453901bd393aeda251c5076912d6730ca792bff0564ae77031783c7
7
+ data.tar.gz: 81e0b00148eb282a4645bb06a6553309cc9e3f45f368a575e6c8468380360778b9b8d334b3d716a2df4756a7e27eaba0283340738b7e801c89d9079084e6bb77
data/Gemfile CHANGED
@@ -10,6 +10,8 @@ gemspec
10
10
 
11
11
  gem "factory_bot"
12
12
  gem "faker"
13
+ gem "faraday"
14
+ gem "faraday-retry"
13
15
  gem "jwt", "~> 1.5", ">= 1.5.4"
14
16
  gem "rake", "~> 13.0"
15
17
  gem "rspec", "~> 3.6", ">= 3.6.0"
data/Gemfile.lock CHANGED
@@ -1,10 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strongmind-platform-sdk (3.0.0)
4
+ strongmind-platform-sdk (3.1.1)
5
5
  aws-sdk-secretsmanager (~> 1.66)
6
6
  devise
7
7
  faraday (~> 2.5, >= 2.5.2)
8
+ faraday-retry
8
9
  omniauth
9
10
  omniauth-rails_csrf_protection
10
11
  omniauth_openid_connect
@@ -38,16 +39,16 @@ GEM
38
39
  ast (2.4.2)
39
40
  attr_required (1.0.1)
40
41
  aws-eventstream (1.2.0)
41
- aws-partitions (1.781.0)
42
- aws-sdk-core (3.175.0)
42
+ aws-partitions (1.805.0)
43
+ aws-sdk-core (3.180.3)
43
44
  aws-eventstream (~> 1, >= 1.0.2)
44
45
  aws-partitions (~> 1, >= 1.651.0)
45
46
  aws-sigv4 (~> 1.5)
46
47
  jmespath (~> 1, >= 1.6.1)
47
- aws-sdk-secretsmanager (1.77.0)
48
- aws-sdk-core (~> 3, >= 3.174.0)
48
+ aws-sdk-secretsmanager (1.82.0)
49
+ aws-sdk-core (~> 3, >= 3.177.0)
49
50
  aws-sigv4 (~> 1.1)
50
- aws-sigv4 (1.5.2)
51
+ aws-sigv4 (1.6.0)
51
52
  aws-eventstream (~> 1, >= 1.0.2)
52
53
  bcrypt (3.1.19)
53
54
  bindata (2.4.15)
@@ -75,6 +76,8 @@ GEM
75
76
  faraday-follow_redirects (0.3.0)
76
77
  faraday (>= 1, < 3)
77
78
  faraday-net_http (3.0.2)
79
+ faraday-retry (2.1.0)
80
+ faraday (~> 2.0)
78
81
  ffi (1.15.5)
79
82
  hashie (5.0.0)
80
83
  i18n (1.13.0)
@@ -97,10 +100,10 @@ GEM
97
100
  net-pop
98
101
  net-smtp
99
102
  method_source (1.0.0)
100
- mini_mime (1.1.2)
101
- mini_portile2 (2.8.2)
103
+ mini_mime (1.1.5)
104
+ mini_portile2 (2.8.4)
102
105
  minitest (5.18.0)
103
- net-imap (0.3.6)
106
+ net-imap (0.3.7)
104
107
  date
105
108
  net-protocol
106
109
  net-pop (0.1.2)
@@ -109,7 +112,7 @@ GEM
109
112
  timeout
110
113
  net-smtp (0.3.3)
111
114
  net-protocol
112
- nokogiri (1.15.2)
115
+ nokogiri (1.15.4)
113
116
  mini_portile2 (~> 2.8.2)
114
117
  racc (~> 1.4)
115
118
  omniauth (2.1.1)
@@ -139,9 +142,9 @@ GEM
139
142
  parallel (1.23.0)
140
143
  parser (3.2.2.1)
141
144
  ast (~> 2.4.1)
142
- public_suffix (5.0.1)
145
+ public_suffix (5.0.3)
143
146
  racc (1.7.1)
144
- rack (2.2.7)
147
+ rack (2.2.8)
145
148
  rack-oauth2 (2.2.0)
146
149
  activesupport
147
150
  attr_required
@@ -149,12 +152,13 @@ GEM
149
152
  faraday-follow_redirects
150
153
  json-jwt (>= 1.11.0)
151
154
  rack (>= 2.1.0)
152
- rack-protection (3.0.6)
153
- rack
155
+ rack-protection (3.1.0)
156
+ rack (~> 2.2, >= 2.2.4)
154
157
  rack-test (2.1.0)
155
158
  rack (>= 1.3)
156
- rails-dom-testing (2.0.3)
157
- activesupport (>= 4.2.0)
159
+ rails-dom-testing (2.2.0)
160
+ activesupport (>= 5.0.0)
161
+ minitest
158
162
  nokogiri (>= 1.6)
159
163
  rails-html-sanitizer (1.6.0)
160
164
  loofah (~> 2.21)
@@ -228,7 +232,7 @@ GEM
228
232
  activesupport
229
233
  faraday (~> 2.0)
230
234
  faraday-follow_redirects
231
- zeitwerk (2.6.8)
235
+ zeitwerk (2.6.11)
232
236
 
233
237
  PLATFORMS
234
238
  ruby
@@ -238,6 +242,8 @@ PLATFORMS
238
242
  DEPENDENCIES
239
243
  factory_bot
240
244
  faker
245
+ faraday
246
+ faraday-retry
241
247
  jwt (~> 1.5, >= 1.5.4)
242
248
  rake (~> 13.0)
243
249
  rspec (~> 3.6, >= 3.6.0)
data/README.md CHANGED
@@ -11,7 +11,7 @@ First [configure your GitHub credentials](#configure-github-credentials)
11
11
  Install the gem and add to the application's Gemfile by executing:
12
12
 
13
13
  ```
14
- gem "strongmind-platform-sdk", "~> 3.0.0"
14
+ gem "strongmind-platform-sdk", "~> 3.1.1"
15
15
  ```
16
16
 
17
17
  If bundler is not being used to manage dependencies, install the gem by executing:
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PlatformSdk
4
+ module DataPipeline
5
+ # DataPipeline::Client
6
+ class Client
7
+ attr_reader :credentials, :conn
8
+
9
+ def initialize(credentials)
10
+ @credentials = credentials
11
+
12
+ raise ArgumentError, "pipeline_host is required" if @credentials[:pipeline_host].nil?
13
+ raise ArgumentError, "pipeline_username is required" if @credentials[:pipeline_username].nil?
14
+ raise ArgumentError, "pipeline_password is required" if @credentials[:pipeline_password].nil?
15
+
16
+ @conn = Faraday.new(url: "https://#{@credentials[:pipeline_host]}") do |faraday|
17
+ faraday.request(:retry, retry_options)
18
+ faraday.request(:authorization, :basic, @credentials[:pipeline_username], @credentials[:pipeline_password])
19
+ faraday.headers = headers
20
+ faraday.adapter(:net_http)
21
+ end
22
+ end
23
+
24
+ private
25
+
26
+ def headers
27
+ { "Content-Type" => "application/json" }
28
+ end
29
+
30
+ def retry_options
31
+ {
32
+ max: 3,
33
+ interval: 0.05,
34
+ interval_randomness: 0.5,
35
+ backoff_factor: 2
36
+ }
37
+ end
38
+
39
+ public
40
+
41
+ def post(message)
42
+ @conn.post("messages", message.to_json)
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "faraday"
4
+ require "faraday/net_http"
5
+ require "faraday/retry"
6
+
7
+ require "platform_sdk/data_pipeline/data_pipeline_client"
8
+
9
+ module PlatformSdk
10
+ module DataPipeline
11
+ class Error < StandardError; end
12
+
13
+
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlatformSdk
4
- VERSION = "3.0.0"
4
+ VERSION = "3.1.1"
5
5
  end
data/lib/platform_sdk.rb CHANGED
@@ -7,6 +7,7 @@ require "platform_sdk/power_school"
7
7
  require "platform_sdk/aws"
8
8
  require "platform_sdk/id_mapper"
9
9
  require "platform_sdk/edkey"
10
+ require "platform_sdk/data_pipeline"
10
11
 
11
12
  module PlatformSdk
12
13
  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.0.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-20 00:00:00.000000000 Z
11
+ date: 2023-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -30,6 +30,20 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.5.2
33
+ - !ruby/object:Gem::Dependency
34
+ name: faraday-retry
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
33
47
  - !ruby/object:Gem::Dependency
34
48
  name: strongmind-oneroster-client
35
49
  requirement: !ruby/object:Gem::Requirement
@@ -158,6 +172,8 @@ files:
158
172
  - lib/platform_sdk.rb
159
173
  - lib/platform_sdk/aws.rb
160
174
  - lib/platform_sdk/aws/secrets_manager_client.rb
175
+ - lib/platform_sdk/data_pipeline.rb
176
+ - lib/platform_sdk/data_pipeline/data_pipeline_client.rb
161
177
  - lib/platform_sdk/edkey.rb
162
178
  - lib/platform_sdk/edkey/client.rb
163
179
  - lib/platform_sdk/id_mapper.rb