bridge_api 0.3.0 → 0.3.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 +4 -4
- data/.github/CODEOWNERS +1 -0
- data/.github/dependabot.yml +14 -0
- data/lib/bridge_api/client/user.rb +4 -0
- data/lib/bridge_api/client.rb +2 -0
- data/lib/bridge_api/version.rb +1 -1
- data/spec/bridge_api/client/user_spec.rb +5 -0
- data/spec/fixtures/temporary_users.json +41 -0
- data/spec/support/fake_bridge.rb +4 -0
- metadata +22 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff27f0d72d5680fece15686d58d893adc45efcb001c6040ee3991166579c8091
|
4
|
+
data.tar.gz: 382e064c6305fa078be782f98d47340563b82ddc68825af3ea8f8067cb2ec730
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68066389b21ba31a2c25f85581494c1d32f6bfa2c18aade6c5f6d2361d2b674859c95931cdd8e05190f2fa76088276648b05375174e46a16c1bf17404ce311de
|
7
|
+
data.tar.gz: a261eaa3408de898e96db1f7c8979d27c30e70beaeedd5119962813b0b72f73079311cc15197e7fec2979026229925adfdfbec541b1e0c78d0d7fb66b6be7992
|
data/.github/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* @get-bridge/custom-dev
|
@@ -0,0 +1,14 @@
|
|
1
|
+
version: 2
|
2
|
+
updates:
|
3
|
+
- package-ecosystem: docker
|
4
|
+
directory: /
|
5
|
+
schedule:
|
6
|
+
interval: weekly
|
7
|
+
- package-ecosystem: github-actions
|
8
|
+
directory: /
|
9
|
+
schedule:
|
10
|
+
interval: weekly
|
11
|
+
- package-ecosystem: bundler
|
12
|
+
directory: /
|
13
|
+
schedule:
|
14
|
+
interval: weekly
|
@@ -43,6 +43,10 @@ module BridgeAPI
|
|
43
43
|
put("#{API_PATH}#{ADMIN_PATH}#{USER_PATH}/#{user_id}#{ROLE_PATH}#{BATCH_PATH}", params)
|
44
44
|
end
|
45
45
|
|
46
|
+
def new_temporary_users(params = {})
|
47
|
+
get("#{API_PATH}#{ADMIN_PATH}#{NEW_TEMPORARY_USERS}", params)
|
48
|
+
end
|
49
|
+
|
46
50
|
private
|
47
51
|
|
48
52
|
#++user_id++ Bridge user ID
|
data/lib/bridge_api/client.rb
CHANGED
@@ -46,6 +46,7 @@ module BridgeAPI
|
|
46
46
|
RESTORE_PATH = '/restore'
|
47
47
|
DUE_DATE_PATH = '/due_date'
|
48
48
|
RESET_PATH = '/reset'
|
49
|
+
NEW_TEMPORARY_USERS = '/new_temporary_users'
|
49
50
|
RESULT_MAPPING = {}
|
50
51
|
|
51
52
|
Dir[File.dirname(__FILE__) + '/client/*.rb'].each do |file|
|
@@ -187,6 +188,7 @@ module BridgeAPI
|
|
187
188
|
api_keys.delete(config[:api_key])
|
188
189
|
api_keys.each do |key|
|
189
190
|
limit = rate_limit(key)
|
191
|
+
next unless limit.present?
|
190
192
|
if limit['timestamp'].present? && DateTime.parse(limit['timestamp']) < 1.minute.ago
|
191
193
|
BridgeAPI.logger.debug("Refreshing: #{key}")
|
192
194
|
set_rate_limit(key, 0)
|
data/lib/bridge_api/version.rb
CHANGED
@@ -39,4 +39,9 @@ describe BridgeAPI::Client::User do
|
|
39
39
|
response = @client.add_user_to_role_batch(1)
|
40
40
|
expect(response.length).to eq(7)
|
41
41
|
end
|
42
|
+
|
43
|
+
it 'should get new temporary users' do
|
44
|
+
response = @client.new_temporary_users
|
45
|
+
expect(response.length).to(eq(2))
|
46
|
+
end
|
42
47
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"meta": {
|
3
|
+
"next": "http://bridge.bridgeapp.com/api/admin/new_temporary_users?after=eyJ0eXAiOiJKV1QiLCJhb"
|
4
|
+
},
|
5
|
+
"temporary_users": [
|
6
|
+
{
|
7
|
+
"uid": "test@test.com",
|
8
|
+
"email": "test@test.com",
|
9
|
+
"first_name": "test",
|
10
|
+
"last_name": "mcfake",
|
11
|
+
"full_name": "test name",
|
12
|
+
"status": "Active",
|
13
|
+
"store_id": "",
|
14
|
+
"store_name": "",
|
15
|
+
"franchisee_id": "1892",
|
16
|
+
"franchisee_name": "Test Franchisee",
|
17
|
+
"manager_id": null,
|
18
|
+
"hire_date": null,
|
19
|
+
"job_role": "Admin",
|
20
|
+
"country": "UK",
|
21
|
+
"termination_date": ""
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"uid": "test2@test.com",
|
25
|
+
"email": "test2@test.com",
|
26
|
+
"first_name": "test2",
|
27
|
+
"last_name": "mcfake2",
|
28
|
+
"full_name": "test name 2",
|
29
|
+
"status": "Active",
|
30
|
+
"store_id": "29263",
|
31
|
+
"store_name": "Ashton",
|
32
|
+
"franchisee_id": "2051",
|
33
|
+
"franchisee_name": "Test Franchisee2",
|
34
|
+
"manager_id": null,
|
35
|
+
"hire_date": null,
|
36
|
+
"job_role": "Operations Manager",
|
37
|
+
"country": "UK",
|
38
|
+
"termination_date": ""
|
39
|
+
}
|
40
|
+
]
|
41
|
+
}
|
data/spec/support/fake_bridge.rb
CHANGED
@@ -91,6 +91,10 @@ class FakeBridge < Sinatra::Base
|
|
91
91
|
get_json_data 204, nil
|
92
92
|
end
|
93
93
|
|
94
|
+
get %r{/api/admin/new_temporary_users} do
|
95
|
+
get_json_data 200, 'temporary_users.json'
|
96
|
+
end
|
97
|
+
|
94
98
|
## Managers
|
95
99
|
get %r{/api/author/managers$} do
|
96
100
|
get_json_data 200, 'managers.json'
|
metadata
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bridge_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jay Shaffer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.0'
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: 1.0.0
|
20
|
+
- - "~>"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '1.0'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '1.0'
|
30
27
|
- - ">="
|
31
28
|
- !ruby/object:Gem::Version
|
32
29
|
version: 1.0.0
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: byebug
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -104,22 +104,22 @@ dependencies:
|
|
104
104
|
name: tilt
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- - ">="
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: 1.3.4
|
110
107
|
- - "~>"
|
111
108
|
- !ruby/object:Gem::Version
|
112
109
|
version: '1.3'
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 1.3.4
|
113
113
|
type: :development
|
114
114
|
prerelease: false
|
115
115
|
version_requirements: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
|
-
- - ">="
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
version: 1.3.4
|
120
117
|
- - "~>"
|
121
118
|
- !ruby/object:Gem::Version
|
122
119
|
version: '1.3'
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 1.3.4
|
123
123
|
- !ruby/object:Gem::Dependency
|
124
124
|
name: webmock
|
125
125
|
requirement: !ruby/object:Gem::Requirement
|
@@ -211,6 +211,8 @@ executables: []
|
|
211
211
|
extensions: []
|
212
212
|
extra_rdoc_files: []
|
213
213
|
files:
|
214
|
+
- ".github/CODEOWNERS"
|
215
|
+
- ".github/dependabot.yml"
|
214
216
|
- ".github/workflows/ci.yml"
|
215
217
|
- ".gitignore"
|
216
218
|
- Dockerfile
|
@@ -288,6 +290,7 @@ files:
|
|
288
290
|
- spec/fixtures/sub_account_lti_config_update.json
|
289
291
|
- spec/fixtures/sub_account_new_lti_config.json
|
290
292
|
- spec/fixtures/sub_accounts.json
|
293
|
+
- spec/fixtures/temporary_users.json
|
291
294
|
- spec/fixtures/user.json
|
292
295
|
- spec/fixtures/user_roles_add.json
|
293
296
|
- spec/fixtures/users.json
|
@@ -297,7 +300,7 @@ homepage: https://getbridge.com
|
|
297
300
|
licenses:
|
298
301
|
- MIT
|
299
302
|
metadata: {}
|
300
|
-
post_install_message:
|
303
|
+
post_install_message:
|
301
304
|
rdoc_options: []
|
302
305
|
require_paths:
|
303
306
|
- lib
|
@@ -312,8 +315,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
312
315
|
- !ruby/object:Gem::Version
|
313
316
|
version: '0'
|
314
317
|
requirements: []
|
315
|
-
rubygems_version: 3.1
|
316
|
-
signing_key:
|
318
|
+
rubygems_version: 3.0.3.1
|
319
|
+
signing_key:
|
317
320
|
specification_version: 4
|
318
321
|
summary: Bridge API
|
319
322
|
test_files:
|
@@ -339,6 +342,7 @@ test_files:
|
|
339
342
|
- spec/fixtures/roles.json
|
340
343
|
- spec/fixtures/live_course.json
|
341
344
|
- spec/fixtures/managers.json
|
345
|
+
- spec/fixtures/temporary_users.json
|
342
346
|
- spec/fixtures/program_enrollments.json
|
343
347
|
- spec/fixtures/enrollment.json
|
344
348
|
- spec/fixtures/sub_accounts.json
|