bridge_api 0.3.1 → 0.3.3

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: 4f66a7397b5d87936e16a5548f3a4a0642ad7661938d97bec0f708af3efc3785
4
- data.tar.gz: 3e2c8f4d85960a4979c7f0264a17df899829c3d406a227e8556f883fa4fe92d3
3
+ metadata.gz: 88f17e825afd96df492d4be2c073dbe10eef3f97c6c835ffdcfaeb3d6819e82f
4
+ data.tar.gz: 3b79209eea1c6b981b09d7601026b1f4c68452cd14b8fe7e76cdde0cc193d706
5
5
  SHA512:
6
- metadata.gz: 62488f89036eb5e44644cd049200ed5223409fdd171d4bf76aacafe0cb3cf7f73e58fda9c8e606d0431c6948ca90a0cc5103b3c368550a79421379ca391dab06
7
- data.tar.gz: 70307423e9a89547c01e7512106be2d2c96188bfc40586524c6f7e59d75f04b28a22113b9f61b9486f9a171b640ee8152226fca28b622445ed8818992602568f
6
+ metadata.gz: 66eb8df82ecce9bf89f0a087b7f15eb105793137e91edce41d0c68829610a006fba0dc666fff77bf588763508ee26efabf54d2522f84181110cf0eb11eda6946
7
+ data.tar.gz: a418a116fd8ec3e290116e9ee16e0f63140159a65c278394d454a944e16e6e917275f7c51797c73ebf349cceca28dc547e9f516ef922cfa41ed415fb7860534e
@@ -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
@@ -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
@@ -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
@@ -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|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgeAPI
4
- VERSION = '0.3.1' unless defined?(BridgeAPI::VERSION)
4
+ VERSION = '0.3.3' unless defined?(BridgeAPI::VERSION)
5
5
  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
@@ -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,3 @@
1
+ {
2
+ "message": "Custom attributes upserted successfully."
3
+ }
@@ -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
+ }
@@ -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'
@@ -262,6 +266,10 @@ class FakeBridge < Sinatra::Base
262
266
  get_json_data 204, 'sub_account_lti_config.json'
263
267
  end
264
268
 
269
+ put %r{/api/admin/sub_accounts/\d+/custom_attribute_values} do
270
+ get_json_data 200, 'custom_attribute_values.json'
271
+ end
272
+
265
273
  # Accounts
266
274
  put %r{/api/support/accounts} do
267
275
  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.1
4
+ version: 0.3.3
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: 2023-12-06 00:00:00.000000000 Z
11
+ date: 2024-11-11 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
@@ -290,6 +292,7 @@ files:
290
292
  - spec/fixtures/sub_account_lti_config_update.json
291
293
  - spec/fixtures/sub_account_new_lti_config.json
292
294
  - spec/fixtures/sub_accounts.json
295
+ - spec/fixtures/temporary_users.json
293
296
  - spec/fixtures/user.json
294
297
  - spec/fixtures/user_roles_add.json
295
298
  - spec/fixtures/users.json
@@ -299,7 +302,7 @@ homepage: https://getbridge.com
299
302
  licenses:
300
303
  - MIT
301
304
  metadata: {}
302
- post_install_message:
305
+ post_install_message:
303
306
  rdoc_options: []
304
307
  require_paths:
305
308
  - lib
@@ -314,57 +317,59 @@ required_rubygems_version: !ruby/object:Gem::Requirement
314
317
  - !ruby/object:Gem::Version
315
318
  version: '0'
316
319
  requirements: []
317
- rubygems_version: 3.0.3.1
318
- signing_key:
320
+ rubygems_version: 3.4.10
321
+ signing_key:
319
322
  specification_version: 4
320
323
  summary: Bridge API
321
324
  test_files:
322
- - spec/bridge_api/client_spec.rb
323
- - spec/bridge_api/client/enrollment_spec.rb
324
- - spec/bridge_api/client/custom_field_spec.rb
325
325
  - spec/bridge_api/client/account_spec.rb
326
- - spec/bridge_api/client/data_dump_spec.rb
327
- - spec/bridge_api/client/live_course_spec.rb
326
+ - spec/bridge_api/client/affiliations_spec.rb
328
327
  - spec/bridge_api/client/clone_object_spec.rb
329
328
  - spec/bridge_api/client/course_template_spec.rb
330
- - spec/bridge_api/client/affiliations_spec.rb
331
- - spec/bridge_api/client/sub_account_spec.rb
329
+ - spec/bridge_api/client/custom_field_spec.rb
330
+ - spec/bridge_api/client/data_dump_spec.rb
331
+ - spec/bridge_api/client/enrollment_spec.rb
332
332
  - spec/bridge_api/client/group_spec.rb
333
+ - spec/bridge_api/client/learner_items_spec.rb
334
+ - spec/bridge_api/client/live_course_enrollments_spec.rb
333
335
  - spec/bridge_api/client/live_course_session_spec.rb
336
+ - spec/bridge_api/client/live_course_spec.rb
337
+ - spec/bridge_api/client/manager_spec.rb
334
338
  - spec/bridge_api/client/program_enrollment_spec.rb
335
- - spec/bridge_api/client/user_spec.rb
336
339
  - spec/bridge_api/client/role_spec.rb
337
- - spec/bridge_api/client/manager_spec.rb
338
- - spec/bridge_api/client/live_course_enrollments_spec.rb
339
- - spec/bridge_api/client/learner_items_spec.rb
340
- - spec/support/fake_bridge.rb
341
- - spec/fixtures/roles.json
342
- - spec/fixtures/live_course.json
343
- - spec/fixtures/managers.json
344
- - spec/fixtures/program_enrollments.json
345
- - spec/fixtures/enrollment.json
346
- - spec/fixtures/sub_accounts.json
347
- - spec/fixtures/user_roles_add.json
340
+ - spec/bridge_api/client/sub_account_spec.rb
341
+ - spec/bridge_api/client/user_spec.rb
342
+ - spec/bridge_api/client_spec.rb
343
+ - spec/fixtures/accounts.json
344
+ - spec/fixtures/affiliations.json
345
+ - spec/fixtures/clone_objects.json
348
346
  - spec/fixtures/course.json
349
- - spec/fixtures/live_course_sessions.json
350
- - spec/fixtures/data_dumps.json
351
- - spec/fixtures/users.json
352
- - spec/fixtures/direct_reports.json
353
- - spec/fixtures/sub_account_lti_config.json
354
- - spec/fixtures/user.json
355
347
  - spec/fixtures/courses.json
356
- - spec/fixtures/sub_account_lti_config_update.json
348
+ - spec/fixtures/custom_attribute_values.json
349
+ - spec/fixtures/custom_fields.json
350
+ - spec/fixtures/data_dump.json
351
+ - spec/fixtures/data_dumps.json
357
352
  - spec/fixtures/default_web_conference.json
358
- - spec/fixtures/programs.json
359
- - spec/fixtures/learner_items.json
360
- - spec/fixtures/sub_account_new_lti_config.json
353
+ - spec/fixtures/direct_reports.json
354
+ - spec/fixtures/enrollment.json
361
355
  - spec/fixtures/enrollments.json
362
356
  - spec/fixtures/group.json
363
- - spec/fixtures/affiliations.json
364
- - spec/fixtures/accounts.json
365
- - spec/fixtures/live_courses.json
366
- - spec/fixtures/clone_objects.json
367
- - spec/fixtures/data_dump.json
357
+ - spec/fixtures/learner_items.json
358
+ - spec/fixtures/live_course.json
368
359
  - spec/fixtures/live_course_enrollments.json
369
- - spec/fixtures/custom_fields.json
360
+ - spec/fixtures/live_course_sessions.json
361
+ - spec/fixtures/live_courses.json
362
+ - spec/fixtures/managers.json
363
+ - spec/fixtures/program_enrollments.json
364
+ - spec/fixtures/programs.json
365
+ - spec/fixtures/roles.json
366
+ - spec/fixtures/sub_account_lti_config.json
367
+ - spec/fixtures/sub_account_lti_config_update.json
368
+ - spec/fixtures/sub_account_new_lti_config.json
369
+ - spec/fixtures/sub_accounts.json
370
+ - spec/fixtures/temporary_users.json
371
+ - spec/fixtures/user.json
372
+ - spec/fixtures/user_roles_add.json
373
+ - spec/fixtures/users.json
374
+ - spec/support/fake_bridge.rb
370
375
  - spec/test_helper.rb