clever 2.3.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ff0b41f8f5609493aaf2935de074f048f4deb32
4
- data.tar.gz: 0630556066c95480e23759940dc631369deef2e9
3
+ metadata.gz: ae0e8318fdecf7c7c7165bef8c0ac88051f66d18
4
+ data.tar.gz: d3d7ae47d72ca7535fa478f4ff5f29dc97b0b192
5
5
  SHA512:
6
- metadata.gz: c469ccfd3a5e2eef2575686cd2704822cba36532a458b9910e87bbb908ce6df7cce0ab58acf78fe5afb92902706920d3cdaa3ca22ab2e8e65934dec7e4a34e61
7
- data.tar.gz: dbb555be80c9b63fc4c2d1600dd0e6906a36a1c69de88817c92eed90904a2d219fb3c4501c7548c3fb1226526aab75ab06abfc67eb7e80c690399fbefd528a44
6
+ metadata.gz: 3041336d755fecb6fc2860439c6bc2b9f94e5bbef769647a0fd767587ac3a9eabda9db14311178920aca7edcd5ef2b5e3ac0c52e93630fc8d0a621a6a8394301
7
+ data.tar.gz: d043aa91dabd5b5e0044cfdd396bbae6f846776e2e126db85ef70b4afb04e6256aad7e4630ff0541c55fd60167d30f8cd82548175dd1e7162753ede4c31db067
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clever (2.3.2)
4
+ clever (3.0.0)
5
5
  faraday
6
6
  faraday_middleware
7
7
 
data/lib/clever.rb CHANGED
@@ -21,14 +21,14 @@ require 'clever/types/term'
21
21
  require 'clever/types/token'
22
22
 
23
23
  module Clever
24
- API_URL = 'https://api.clever.com/v2.0'
24
+ API_URL = 'https://api.clever.com/v3.0'
25
25
  TOKENS_ENDPOINT = 'https://clever.com/oauth/tokens?owner_type=district'
26
- STUDENTS_ENDPOINT = '/v2.0/students'
27
- COURSES_ENDPOINT = '/v2.0/courses'
28
- SECTIONS_ENDPOINT = '/v2.0/sections'
29
- TEACHERS_ENDPOINT = '/v2.0/teachers'
26
+ STUDENTS_ENDPOINT = '/v3.0/users?role=student'
27
+ COURSES_ENDPOINT = '/v3.0/courses'
28
+ SECTIONS_ENDPOINT = '/v3.0/sections'
29
+ TEACHERS_ENDPOINT = '/v3.0/users'
30
30
  EVENTS_ENDPOINT = '/v1.2/events'
31
- TERMS_ENDPOINT = '/v2.0/terms'
31
+ TERMS_ENDPOINT = '/v3.0/terms'
32
32
  GRADES_ENDPOINT = 'https://grades-api.beta.clever.com/v1/grade'
33
33
 
34
34
  class DistrictNotFound < StandardError; end
@@ -6,17 +6,19 @@ module Clever
6
6
  attr_reader :uid,
7
7
  :first_name,
8
8
  :last_name,
9
- :provider
9
+ :provider,
10
+ :legacy_id
10
11
 
11
12
  def initialize(attributes = {}, client: nil)
12
- @uid = attributes['id']
13
+ @district_username = attributes.dig('credentials', 'district_username')
14
+ @email = attributes['email']
13
15
  @first_name = attributes['name']['first']
14
16
  @last_name = attributes['name']['last']
15
- @district_username = attributes.dig('credentials', 'district_username')
17
+ @legacy_id = attributes.dig('roles', 'student', 'legacy_id')
18
+ @provider = 'clever'
16
19
  @sis_id = attributes['sis_id']
17
- @email = attributes['email']
20
+ @uid = attributes['id']
18
21
  @username = username(client)
19
- @provider = 'clever'
20
22
  end
21
23
 
22
24
  def username(client = nil)
@@ -7,17 +7,19 @@ module Clever
7
7
  :email,
8
8
  :first_name,
9
9
  :last_name,
10
- :provider
10
+ :provider,
11
+ :legacy_id
11
12
 
12
13
  def initialize(attributes = {}, *, client: nil)
13
- @uid = attributes['id']
14
- @email = attributes['email']
15
- @first_name = attributes['name']['first']
16
- @last_name = attributes['name']['last']
17
14
  @district_username = attributes.dig('credentials', 'district_username')
15
+ @email = attributes['email']
16
+ @first_name = attributes['name']['first']
17
+ @last_name = attributes['name']['last']
18
+ @legacy_id = attributes.dig('roles', 'teacher', 'legacy_id')
19
+ @provider = 'clever'
18
20
  @sis_id = attributes['sis_id']
19
- @username = username(client)
20
- @provider = 'clever'
21
+ @uid = attributes['id']
22
+ @username = username(client)
21
23
  end
22
24
 
23
25
  def username(client = nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Clever
4
- VERSION = '2.3.2'
4
+ VERSION = '3.0.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clever
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.2
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Julius
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-28 00:00:00.000000000 Z
11
+ date: 2021-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday