bridge_api 0.3.2 → 0.3.4
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/pull_request_template.md +29 -0
- data/.github/workflows/ci.yml +1 -1
- data/lib/bridge_api/client/enrollment.rb +5 -0
- data/lib/bridge_api/client/sub_account.rb +4 -0
- data/lib/bridge_api/client.rb +1 -0
- data/lib/bridge_api/version.rb +1 -1
- data/spec/bridge_api/client/enrollment_spec.rb +5 -0
- data/spec/bridge_api/client/sub_account_spec.rb +13 -0
- data/spec/fixtures/custom_attribute_values.json +3 -0
- data/spec/fixtures/learner_enrollments.json +18 -0
- data/spec/support/fake_bridge.rb +8 -0
- metadata +59 -54
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4162b5cdc4ae4af9f0c51f4bcdeb7d078a0094f297d91bf11d325119642922f9
|
|
4
|
+
data.tar.gz: 4af7c5d96b3e95df14ca20c1f2d60c678e5b3a90ad33c2fe86c9daa8eaadc758
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ba2625d2ef598d6e6a6ecd33ee4f2e69b13e896ed7588f520da817af9ccc543905d4f51d4c91b6598f7c0ac1023ca51c3b8827edc5b2c306ed6f91d8af05ce4
|
|
7
|
+
data.tar.gz: 2e70fc5fa2905cc3872b071f94306b628f52b0c8becbddf8085564ed5ec5efc1b70b199962cd7841101ebcff4818df85209f5efb03a004c9766385590f0dd27c
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#### JIRA
|
|
2
|
+
-
|
|
3
|
+
|
|
4
|
+
#### Changes
|
|
5
|
+
-
|
|
6
|
+
|
|
7
|
+
#### Checklist
|
|
8
|
+
- - [ ] Feature Flag Required
|
|
9
|
+
- - [ ] Bug
|
|
10
|
+
|
|
11
|
+
#### Test plan
|
|
12
|
+
|
|
13
|
+
- - [ ] Walk-through
|
|
14
|
+
- - [ ] Peer review
|
|
15
|
+
- - [ ] Inspection
|
|
16
|
+
- Detailed steps and prerequisites for validating the change:
|
|
17
|
+
- <!-- Replace this with the bullet points about the steps how to execute the test -->
|
|
18
|
+
|
|
19
|
+
#### Risk Analysis - the risk of change is evaluated
|
|
20
|
+
|
|
21
|
+
- - [ ] Low - Majority of the changes are low risk which doesn’t require extra testing, only code review by 1 reviewer
|
|
22
|
+
- - [ ] 1 reviewer
|
|
23
|
+
- - [ ] Medium - Some portions of changes are medium risk which needs peer testing and review by 2 reviewers
|
|
24
|
+
- - [ ] 2 reviewers
|
|
25
|
+
- - [ ] peer testing
|
|
26
|
+
- - [ ] High - A very few breaking changes are high risk and need very throughout testing and review and also a coordinated release process.
|
|
27
|
+
- - [ ] 2 reviewers
|
|
28
|
+
- - [ ] peer testing
|
|
29
|
+
- - [ ] coordinated release
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -26,6 +26,11 @@ module BridgeAPI
|
|
|
26
26
|
def reset_enrollment(enrollment_id, params = {})
|
|
27
27
|
post("#{API_PATH}#{ADMIN_PATH}#{ENROLLMENT_PATH}/#{enrollment_id}#{RESET_PATH}", params)
|
|
28
28
|
end
|
|
29
|
+
|
|
30
|
+
# Get all current enrollments for the learner.
|
|
31
|
+
def get_learner_enrollments(learner_id, params = {})
|
|
32
|
+
get("#{API_PATH}#{AUTHOR_PATH}#{LEARNERS_PATH}/#{learner_id}#{LEARNER_ENROLLMENTS}", params)
|
|
33
|
+
end
|
|
29
34
|
end
|
|
30
35
|
end
|
|
31
36
|
end
|
|
@@ -54,6 +54,10 @@ module BridgeAPI
|
|
|
54
54
|
def delete_lti_config(sub_account_id, lti_tool_id, params = {})
|
|
55
55
|
delete("#{API_PATH}#{SUPPORT_PATH}#{SUB_ACCOUNT_PATH}/#{sub_account_id}#{LTI_TOOLS_PATH}/#{lti_tool_id}", params)
|
|
56
56
|
end
|
|
57
|
+
|
|
58
|
+
def upsert_custom_attribute_values(sub_account_id, params = {})
|
|
59
|
+
put("#{API_PATH}#{ADMIN_PATH}#{SUB_ACCOUNT_PATH}/#{sub_account_id}/custom_attribute_values", params)
|
|
60
|
+
end
|
|
57
61
|
end
|
|
58
62
|
end
|
|
59
63
|
end
|
data/lib/bridge_api/client.rb
CHANGED
data/lib/bridge_api/version.rb
CHANGED
|
@@ -31,4 +31,9 @@ describe BridgeAPI::Client::Enrollment do
|
|
|
31
31
|
response = @client.reset_enrollment(1)
|
|
32
32
|
expect(response.status).to(eq(204))
|
|
33
33
|
end
|
|
34
|
+
|
|
35
|
+
it 'should get all current learner enrollments' do
|
|
36
|
+
learner_enrollments = @client.get_learner_enrollments(1)
|
|
37
|
+
expect(learner_enrollments.length).to(eq(2))
|
|
38
|
+
end
|
|
34
39
|
end
|
|
@@ -52,4 +52,17 @@ describe BridgeAPI::Client::SubAccount do
|
|
|
52
52
|
response = @client.delete_lti_config(2, 15)
|
|
53
53
|
expect(response.status).to(eq 204)
|
|
54
54
|
end
|
|
55
|
+
|
|
56
|
+
it 'should upsert the custom attribute values of a sub account' do
|
|
57
|
+
params = {
|
|
58
|
+
custom_attributes: [
|
|
59
|
+
{
|
|
60
|
+
product_type: 'YoooKey',
|
|
61
|
+
client_type: 'SomeKey'
|
|
62
|
+
},
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
response = @client.upsert_custom_attribute_values(2, params)
|
|
66
|
+
expect(response.status).to(eq 200)
|
|
67
|
+
end
|
|
55
68
|
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"learner_enrollments": [
|
|
3
|
+
{
|
|
4
|
+
"id": "1",
|
|
5
|
+
"learnable_id": 1,
|
|
6
|
+
"learnable_type": "CourseTemplate",
|
|
7
|
+
"state": "created",
|
|
8
|
+
"inactive": null
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "2",
|
|
12
|
+
"learnable_id": 2,
|
|
13
|
+
"learnable_type": "CourseTemplate",
|
|
14
|
+
"state": "created",
|
|
15
|
+
"inactive": null
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
data/spec/support/fake_bridge.rb
CHANGED
|
@@ -130,6 +130,10 @@ class FakeBridge < Sinatra::Base
|
|
|
130
130
|
get_json_data 204, 'enrollment.json'
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
+
get %r{/api/author/learners/\d+/learner_enrollments$} do
|
|
134
|
+
get_json_data 200, 'learner_enrollments.json'
|
|
135
|
+
end
|
|
136
|
+
|
|
133
137
|
# Custom Fields
|
|
134
138
|
|
|
135
139
|
get %r{/api/author/custom_fields} do
|
|
@@ -266,6 +270,10 @@ class FakeBridge < Sinatra::Base
|
|
|
266
270
|
get_json_data 204, 'sub_account_lti_config.json'
|
|
267
271
|
end
|
|
268
272
|
|
|
273
|
+
put %r{/api/admin/sub_accounts/\d+/custom_attribute_values} do
|
|
274
|
+
get_json_data 200, 'custom_attribute_values.json'
|
|
275
|
+
end
|
|
276
|
+
|
|
269
277
|
# Accounts
|
|
270
278
|
put %r{/api/support/accounts} do
|
|
271
279
|
get_json_data 200, 'accounts.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.4
|
|
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: 2024-
|
|
11
|
+
date: 2024-11-14 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.0
|
|
20
17
|
- - "~>"
|
|
21
18
|
- !ruby/object:Gem::Version
|
|
22
19
|
version: '1.0'
|
|
20
|
+
- - ">="
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: 1.0.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.0
|
|
30
27
|
- - "~>"
|
|
31
28
|
- !ruby/object:Gem::Version
|
|
32
29
|
version: '1.0'
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: 1.0.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'
|
|
110
107
|
- - ">="
|
|
111
108
|
- !ruby/object:Gem::Version
|
|
112
109
|
version: 1.3.4
|
|
110
|
+
- - "~>"
|
|
111
|
+
- !ruby/object:Gem::Version
|
|
112
|
+
version: '1.3'
|
|
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'
|
|
120
117
|
- - ">="
|
|
121
118
|
- !ruby/object:Gem::Version
|
|
122
119
|
version: 1.3.4
|
|
120
|
+
- - "~>"
|
|
121
|
+
- !ruby/object:Gem::Version
|
|
122
|
+
version: '1.3'
|
|
123
123
|
- !ruby/object:Gem::Dependency
|
|
124
124
|
name: webmock
|
|
125
125
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -213,6 +213,7 @@ extra_rdoc_files: []
|
|
|
213
213
|
files:
|
|
214
214
|
- ".github/CODEOWNERS"
|
|
215
215
|
- ".github/dependabot.yml"
|
|
216
|
+
- ".github/pull_request_template.md"
|
|
216
217
|
- ".github/workflows/ci.yml"
|
|
217
218
|
- ".gitignore"
|
|
218
219
|
- Dockerfile
|
|
@@ -269,6 +270,7 @@ files:
|
|
|
269
270
|
- spec/fixtures/clone_objects.json
|
|
270
271
|
- spec/fixtures/course.json
|
|
271
272
|
- spec/fixtures/courses.json
|
|
273
|
+
- spec/fixtures/custom_attribute_values.json
|
|
272
274
|
- spec/fixtures/custom_fields.json
|
|
273
275
|
- spec/fixtures/data_dump.json
|
|
274
276
|
- spec/fixtures/data_dumps.json
|
|
@@ -277,6 +279,7 @@ files:
|
|
|
277
279
|
- spec/fixtures/enrollment.json
|
|
278
280
|
- spec/fixtures/enrollments.json
|
|
279
281
|
- spec/fixtures/group.json
|
|
282
|
+
- spec/fixtures/learner_enrollments.json
|
|
280
283
|
- spec/fixtures/learner_items.json
|
|
281
284
|
- spec/fixtures/live_course.json
|
|
282
285
|
- spec/fixtures/live_course_enrollments.json
|
|
@@ -300,7 +303,7 @@ homepage: https://getbridge.com
|
|
|
300
303
|
licenses:
|
|
301
304
|
- MIT
|
|
302
305
|
metadata: {}
|
|
303
|
-
post_install_message:
|
|
306
|
+
post_install_message:
|
|
304
307
|
rdoc_options: []
|
|
305
308
|
require_paths:
|
|
306
309
|
- lib
|
|
@@ -315,58 +318,60 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
315
318
|
- !ruby/object:Gem::Version
|
|
316
319
|
version: '0'
|
|
317
320
|
requirements: []
|
|
318
|
-
rubygems_version: 3.
|
|
319
|
-
signing_key:
|
|
321
|
+
rubygems_version: 3.4.10
|
|
322
|
+
signing_key:
|
|
320
323
|
specification_version: 4
|
|
321
324
|
summary: Bridge API
|
|
322
325
|
test_files:
|
|
323
|
-
- spec/bridge_api/client_spec.rb
|
|
324
|
-
- spec/bridge_api/client/enrollment_spec.rb
|
|
325
|
-
- spec/bridge_api/client/custom_field_spec.rb
|
|
326
326
|
- spec/bridge_api/client/account_spec.rb
|
|
327
|
-
- spec/bridge_api/client/
|
|
328
|
-
- spec/bridge_api/client/live_course_spec.rb
|
|
327
|
+
- spec/bridge_api/client/affiliations_spec.rb
|
|
329
328
|
- spec/bridge_api/client/clone_object_spec.rb
|
|
330
329
|
- spec/bridge_api/client/course_template_spec.rb
|
|
331
|
-
- spec/bridge_api/client/
|
|
332
|
-
- spec/bridge_api/client/
|
|
330
|
+
- spec/bridge_api/client/custom_field_spec.rb
|
|
331
|
+
- spec/bridge_api/client/data_dump_spec.rb
|
|
332
|
+
- spec/bridge_api/client/enrollment_spec.rb
|
|
333
333
|
- spec/bridge_api/client/group_spec.rb
|
|
334
|
+
- spec/bridge_api/client/learner_items_spec.rb
|
|
335
|
+
- spec/bridge_api/client/live_course_enrollments_spec.rb
|
|
334
336
|
- spec/bridge_api/client/live_course_session_spec.rb
|
|
337
|
+
- spec/bridge_api/client/live_course_spec.rb
|
|
338
|
+
- spec/bridge_api/client/manager_spec.rb
|
|
335
339
|
- spec/bridge_api/client/program_enrollment_spec.rb
|
|
336
|
-
- spec/bridge_api/client/user_spec.rb
|
|
337
340
|
- spec/bridge_api/client/role_spec.rb
|
|
338
|
-
- spec/bridge_api/client/
|
|
339
|
-
- spec/bridge_api/client/
|
|
340
|
-
- spec/bridge_api/
|
|
341
|
-
- spec/
|
|
342
|
-
- spec/fixtures/
|
|
343
|
-
- spec/fixtures/
|
|
344
|
-
- spec/fixtures/managers.json
|
|
345
|
-
- spec/fixtures/temporary_users.json
|
|
346
|
-
- spec/fixtures/program_enrollments.json
|
|
347
|
-
- spec/fixtures/enrollment.json
|
|
348
|
-
- spec/fixtures/sub_accounts.json
|
|
349
|
-
- spec/fixtures/user_roles_add.json
|
|
341
|
+
- spec/bridge_api/client/sub_account_spec.rb
|
|
342
|
+
- spec/bridge_api/client/user_spec.rb
|
|
343
|
+
- spec/bridge_api/client_spec.rb
|
|
344
|
+
- spec/fixtures/accounts.json
|
|
345
|
+
- spec/fixtures/affiliations.json
|
|
346
|
+
- spec/fixtures/clone_objects.json
|
|
350
347
|
- spec/fixtures/course.json
|
|
351
|
-
- spec/fixtures/live_course_sessions.json
|
|
352
|
-
- spec/fixtures/data_dumps.json
|
|
353
|
-
- spec/fixtures/users.json
|
|
354
|
-
- spec/fixtures/direct_reports.json
|
|
355
|
-
- spec/fixtures/sub_account_lti_config.json
|
|
356
|
-
- spec/fixtures/user.json
|
|
357
348
|
- spec/fixtures/courses.json
|
|
358
|
-
- spec/fixtures/
|
|
349
|
+
- spec/fixtures/custom_attribute_values.json
|
|
350
|
+
- spec/fixtures/custom_fields.json
|
|
351
|
+
- spec/fixtures/data_dump.json
|
|
352
|
+
- spec/fixtures/data_dumps.json
|
|
359
353
|
- spec/fixtures/default_web_conference.json
|
|
360
|
-
- spec/fixtures/
|
|
361
|
-
- spec/fixtures/
|
|
362
|
-
- spec/fixtures/sub_account_new_lti_config.json
|
|
354
|
+
- spec/fixtures/direct_reports.json
|
|
355
|
+
- spec/fixtures/enrollment.json
|
|
363
356
|
- spec/fixtures/enrollments.json
|
|
364
357
|
- spec/fixtures/group.json
|
|
365
|
-
- spec/fixtures/
|
|
366
|
-
- spec/fixtures/
|
|
367
|
-
- spec/fixtures/
|
|
368
|
-
- spec/fixtures/clone_objects.json
|
|
369
|
-
- spec/fixtures/data_dump.json
|
|
358
|
+
- spec/fixtures/learner_enrollments.json
|
|
359
|
+
- spec/fixtures/learner_items.json
|
|
360
|
+
- spec/fixtures/live_course.json
|
|
370
361
|
- spec/fixtures/live_course_enrollments.json
|
|
371
|
-
- spec/fixtures/
|
|
362
|
+
- spec/fixtures/live_course_sessions.json
|
|
363
|
+
- spec/fixtures/live_courses.json
|
|
364
|
+
- spec/fixtures/managers.json
|
|
365
|
+
- spec/fixtures/program_enrollments.json
|
|
366
|
+
- spec/fixtures/programs.json
|
|
367
|
+
- spec/fixtures/roles.json
|
|
368
|
+
- spec/fixtures/sub_account_lti_config.json
|
|
369
|
+
- spec/fixtures/sub_account_lti_config_update.json
|
|
370
|
+
- spec/fixtures/sub_account_new_lti_config.json
|
|
371
|
+
- spec/fixtures/sub_accounts.json
|
|
372
|
+
- spec/fixtures/temporary_users.json
|
|
373
|
+
- spec/fixtures/user.json
|
|
374
|
+
- spec/fixtures/user_roles_add.json
|
|
375
|
+
- spec/fixtures/users.json
|
|
376
|
+
- spec/support/fake_bridge.rb
|
|
372
377
|
- spec/test_helper.rb
|