strongmind-platform-sdk 3.19.0 → 3.19.2

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: a116ab2dded0c9438031825118549bba4f66437bba41e21a05f5b10eee34f0f9
4
- data.tar.gz: cf95cc4393e3718a60f57a41348f11be5b2a5e7e850ba0476a69e9d0a6a604e3
3
+ metadata.gz: dd597a3c3a31921754c613bf53ce663646111eb15958eb9e259f9f8110da7b87
4
+ data.tar.gz: 0ef2bc5c64de9fe8482bc80c5a919b7d7a8a1fe9d9af244052b46cfcdd1a4089
5
5
  SHA512:
6
- metadata.gz: 6789b299100a35dc404bd7d9628949efe05e12c3eedf1642f3dd22d419e43c7f16555f6ac1ffe245e338b06fbb10a22fbb4a1ef2cdec81efb44fb5272402ad55
7
- data.tar.gz: bc04bdfc93c81a2a5c843f70b34d8dc1d7a224771bd31ed17bb3bfed3bf0c9cc60cc85f8f872f6d2e4e1eb2e7dbb11f3b1f217d6982add5599f2a230972ac102
6
+ metadata.gz: 5f8b7902628784c4e38886f7e54b4e59f76bdc18d617439bb05585fbc3185a3675d4911a8dd989a0829e5e86e76876bbfd835ea5ffb278dfdce2a17dc3692409
7
+ data.tar.gz: a14a4e3f84780ef8af02fab7358ba258576f4fe13cc424130f6e3941cde6eed4fed30751a7b57190eb0bb6b2ec209479bc18d4907a3048d12b11cca5622d0571
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strongmind-platform-sdk (3.19.0)
4
+ strongmind-platform-sdk (3.19.2)
5
5
  activesupport (~> 7.1)
6
6
  aws-sdk-secretsmanager (~> 1.66)
7
7
  faraday (~> 2.5, >= 2.5.2)
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.9.2"
14
+ gem "strongmind-platform-sdk", "~> 3.19.1"
15
15
  ```
16
16
 
17
17
  If bundler is not being used to manage dependencies, install the gem by executing:
@@ -67,9 +67,15 @@ gem push --key github --host https://rubygems.pkg.github.com/StrongMind platform
67
67
 
68
68
  ## Development
69
69
 
70
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
70
+ After checking out the repo, run `bin/setup` to install dependencies.
71
71
 
72
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
72
+ Migrate the database for the dummy app:
73
+ ```
74
+ cd spec/dummy
75
+ rails db:migrate
76
+ ```
77
+
78
+ Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
73
79
 
74
80
  ## Contributing
75
81
 
@@ -83,10 +89,78 @@ The gem is available as open source under the terms of the [MIT License](https:/
83
89
 
84
90
  Everyone interacting in the Platform::Ruby::Sdk project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/platform-ruby-sdk/blob/main/CODE_OF_CONDUCT.md).
85
91
 
86
- ## Setting up IRB for OneRoster Calls
92
+ ## Data Pipeline Concern
93
+
94
+ The `DataPipelineable` concern is a shared concern that can be included in models
95
+ automatically to send data to the Data Pipeline on creates, updates, and destroys.
96
+
97
+ ### Installation
98
+ Ensure that `platform-sdk` is required in the application.
99
+
100
+ One way to do this is to require the SDK via the `Gemfile`:
101
+
102
+ ```ruby
103
+ gem 'strongmind-platform-sdk', require: 'platform_sdk'
104
+ ```
105
+
106
+ This provides the application access to the `DataPipelineable` concern and RSpec shared examples.
107
+
108
+ ### Usage
109
+
110
+ To use the `DataPipelineable` concern in a model, include the concern in the model:
111
+
112
+ ```ruby
113
+ class MyModel < ApplicationRecord
114
+ include PlatformSdk::ActiveRecord::DataPipelineable
115
+ end
116
+ ```
117
+
118
+ For the concern to function, the model must have a `pipeline_noun` class method that returns the noun of the model.
119
+
120
+ This can be done once by defining the method in the ApplicationRecord class:
121
+
122
+ ```ruby
123
+ class ApplicationRecord < ActiveRecord::Base
124
+ self.abstract_class = true
125
+
126
+ def self.pipeline_noun
127
+ "StrongMind.Central.#{name}}"
128
+ end
129
+ end
130
+ ```
131
+
132
+ Or it can be defined in each model:
133
+
134
+ ```ruby
135
+ class MyModel < ApplicationRecord
136
+ include PlatformSdk::ActiveRecord::DataPipelineable
137
+
138
+ def self.pipeline_noun
139
+ "StrongMind.Central.#{name}}"
140
+ end
141
+ end
142
+ ```
143
+
144
+ ### Testing
145
+
146
+ To test the `DataPipelineable` concern for a model, include the common shared examples in the model's spec file:
147
+
148
+ ```ruby
149
+ RSpec.describe MyModel, type: :model do
150
+ describe 'sends to the Data Pipeline' do
151
+ it_behaves_like 'DataPipelineable'
152
+ end
153
+ end
154
+ ```
155
+
156
+
157
+
158
+ ## Setting up IRB for API Client Testing
87
159
  Require needed dependencies:
88
160
  `require 'platform_sdk'`
89
161
 
162
+
163
+ ### OneRoster API Client Initialization Example
90
164
  Open IRB and initialize dependencies:
91
165
  * IDENTITY_CLIENT_ID
92
166
  * IDENTITY_CLIENT_SECRET
@@ -102,6 +176,7 @@ Create Identity Auth Client:
102
176
  Create OneRoster Client:
103
177
  `one_roster_client = PlatformSdk::OneRoster::Client.new(ONEROSTER_BASE_URL, auth_client)`
104
178
 
179
+ ### Additional Client Initialization Examples
105
180
  Create Aws Client:
106
181
  `aws_client = PlatformSdk::Aws::SecretsManagerClient.new(access_key_id: 'ACCESS_KEY_ID', secret_access_key: 'SECRET_ACCESS_KEY', region: 'REGION')`
107
182
 
@@ -39,6 +39,8 @@ module PlatformSdk
39
39
 
40
40
  def with_rescue
41
41
  yield
42
+ rescue Faraday::TimeoutError => e
43
+ raise TimeoutError, e
42
44
  rescue Faraday::ServerError => e
43
45
  raise_error_with_payload(ServerError, e)
44
46
  rescue Faraday::ClientError => e
@@ -13,5 +13,6 @@ module PlatformSdk
13
13
  class ResourceNotFound < Faraday::ResourceNotFound; end
14
14
  class ServerError < Faraday::ServerError; end
15
15
  class ClientError < Faraday::ClientError; end
16
+ class TimeoutError < Faraday::TimeoutError; end
16
17
  end
17
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlatformSdk
4
- VERSION = "3.19.0"
4
+ VERSION = "3.19.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strongmind-platform-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.19.0
4
+ version: 3.19.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Platform Team