strongmind-platform-sdk 3.19.35 → 3.19.37
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/Gemfile.lock +11 -11
- data/bump_version.sh +36 -0
- data/lib/platform_sdk/canvas_api/client.rb +50 -0
- data/lib/platform_sdk/version.rb +5 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18e4fb90410361b5289ba338324c28f65a518895ca467a8d6b34e947be312417
|
4
|
+
data.tar.gz: dbab8c1e6d0a140fd04a27e8b8dbb7c8cdfb0a5e5783f38574531ddde768a15b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3aa0a687f61971d5e01427134922aab95a9bc4629746a713a312480e95c15aa0348c79fb1c3342732d68451c97f75aa29e88bb53dc9169fd275be011d0fee73
|
7
|
+
data.tar.gz: 57b95fde7cef4af37d55fbb1bc16d3dea06654fe379122c3e80001e4f3887b536b33e460bf4dd0db962077b3566f4163d716675976e191cd3df4d377ae8abf4d
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
strongmind-platform-sdk (3.19.
|
4
|
+
strongmind-platform-sdk (3.19.0)
|
5
5
|
activesupport (~> 7.1)
|
6
6
|
asset_sync
|
7
7
|
aws-sdk-secretsmanager (~> 1.66)
|
@@ -103,17 +103,17 @@ GEM
|
|
103
103
|
unf
|
104
104
|
ast (2.4.2)
|
105
105
|
aws-eventstream (1.3.0)
|
106
|
-
aws-partitions (1.
|
107
|
-
aws-sdk-cloudwatch (1.
|
108
|
-
aws-sdk-core (~> 3, >= 3.
|
106
|
+
aws-partitions (1.974.0)
|
107
|
+
aws-sdk-cloudwatch (1.100.0)
|
108
|
+
aws-sdk-core (~> 3, >= 3.205.0)
|
109
109
|
aws-sigv4 (~> 1.5)
|
110
|
-
aws-sdk-core (3.
|
110
|
+
aws-sdk-core (3.205.0)
|
111
111
|
aws-eventstream (~> 1, >= 1.3.0)
|
112
112
|
aws-partitions (~> 1, >= 1.651.0)
|
113
113
|
aws-sigv4 (~> 1.9)
|
114
114
|
jmespath (~> 1, >= 1.6.1)
|
115
|
-
aws-sdk-secretsmanager (1.
|
116
|
-
aws-sdk-core (~> 3, >= 3.
|
115
|
+
aws-sdk-secretsmanager (1.105.0)
|
116
|
+
aws-sdk-core (~> 3, >= 3.205.0)
|
117
117
|
aws-sigv4 (~> 1.5)
|
118
118
|
aws-sigv4 (1.9.1)
|
119
119
|
aws-eventstream (~> 1, >= 1.0.2)
|
@@ -150,7 +150,7 @@ GEM
|
|
150
150
|
ffi (1.17.0)
|
151
151
|
ffi (1.17.0-x86_64-darwin)
|
152
152
|
ffi (1.17.0-x86_64-linux-gnu)
|
153
|
-
fog-aws (3.
|
153
|
+
fog-aws (3.26.0)
|
154
154
|
base64 (~> 0.2.0)
|
155
155
|
fog-core (~> 2.1)
|
156
156
|
fog-json (~> 1.1)
|
@@ -195,7 +195,7 @@ GEM
|
|
195
195
|
method_source (1.1.0)
|
196
196
|
mime-types (3.5.2)
|
197
197
|
mime-types-data (~> 3.2015)
|
198
|
-
mime-types-data (3.2024.
|
198
|
+
mime-types-data (3.2024.0903)
|
199
199
|
mini_mime (1.1.5)
|
200
200
|
mini_portile2 (2.8.7)
|
201
201
|
minitest (5.24.1)
|
@@ -204,7 +204,7 @@ GEM
|
|
204
204
|
mutex_m (0.2.0)
|
205
205
|
net-http (0.4.1)
|
206
206
|
uri
|
207
|
-
net-imap (0.4.
|
207
|
+
net-imap (0.4.16)
|
208
208
|
date
|
209
209
|
net-protocol
|
210
210
|
net-pop (0.1.2)
|
@@ -318,7 +318,7 @@ GEM
|
|
318
318
|
sentry-ruby (5.18.2)
|
319
319
|
bigdecimal
|
320
320
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
321
|
-
sidekiq (7.3.
|
321
|
+
sidekiq (7.3.2)
|
322
322
|
concurrent-ruby (< 2)
|
323
323
|
connection_pool (>= 2.3.0)
|
324
324
|
logger
|
data/bump_version.sh
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
major=$(awk '/MAJOR =/ {print $3}' lib/platform_sdk/version.rb)
|
4
|
+
minor=$(awk '/MINOR =/ {print $3}' lib/platform_sdk/version.rb)
|
5
|
+
|
6
|
+
regex="\(([0-9]+)\.([0-9]+)\.([0-9]+)\)"
|
7
|
+
|
8
|
+
output=$(gem info strongmind-platform-sdk --remote)
|
9
|
+
|
10
|
+
if [[ $output =~ $regex ]]
|
11
|
+
then
|
12
|
+
current_major="${BASH_REMATCH[1]}"
|
13
|
+
current_minor="${BASH_REMATCH[2]}"
|
14
|
+
|
15
|
+
if [[ $current_major != $major || $current_minor != $minor ]]
|
16
|
+
then
|
17
|
+
# New major or minor version, so reset patch to 0
|
18
|
+
new_version="0"
|
19
|
+
else
|
20
|
+
new_version="$((BASH_REMATCH[3] + 1))"
|
21
|
+
fi
|
22
|
+
|
23
|
+
new_line=" PATCH = $new_version"
|
24
|
+
if [[ "$OSTYPE" == "darwin"* ]]; then
|
25
|
+
# macOS
|
26
|
+
# Replace line 6 with new patch version
|
27
|
+
sed -i "" "6s/.*/$new_line/" "lib/platform_sdk/version.rb"
|
28
|
+
else
|
29
|
+
# Linux
|
30
|
+
# Replace line 6 with new patch version
|
31
|
+
sed -i "6s/.*/$new_line/" "lib/platform_sdk/version.rb"
|
32
|
+
fi
|
33
|
+
else
|
34
|
+
echo "No match"
|
35
|
+
fi
|
36
|
+
|
@@ -423,6 +423,56 @@ module PlatformSdk
|
|
423
423
|
end
|
424
424
|
end
|
425
425
|
|
426
|
+
# @param course_id [Integer]
|
427
|
+
# @param module_id [Integer]
|
428
|
+
# @param body [Hash]
|
429
|
+
# @option body [String] 'module_item[title]' The name of the module_item and associated content
|
430
|
+
# @option body [String] 'module_item[type]' Allowed: ExternalUrl, ExternalTool
|
431
|
+
# @option body [Integer] 'module_item[content_id]' The id of the content to link to the module_item. Required
|
432
|
+
# @option body [Integer] 'module_item[position]' The position of this item in the module (1-based). Default 0
|
433
|
+
# @option body [String] 'module_item[external_url]' External url that the item points to. Required for: ExternalUrl, ExternalTool.
|
434
|
+
# @option body [String] 'module_item[completion_requirement][type]' Allowed: must_view, must_contribute, must_submit, must_mark_done.
|
435
|
+
def post_module_item(course_id:, module_id:, body:)
|
436
|
+
uri = "/api/v1/courses/#{course_id}/modules/#{module_id}/items"
|
437
|
+
response = @connection.post(uri) do |req|
|
438
|
+
req.headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
439
|
+
req.body = body
|
440
|
+
end
|
441
|
+
handle_rate_limiting response
|
442
|
+
result = MultiJson.load response.body, symbolize_keys: true
|
443
|
+
if success?(response.status)
|
444
|
+
result
|
445
|
+
else
|
446
|
+
error_messages = String.new
|
447
|
+
result[:errors]&.each do |error|
|
448
|
+
error_messages << "#{error[:message]} "
|
449
|
+
end
|
450
|
+
raise "Error creating module item: #{error_messages}"
|
451
|
+
end
|
452
|
+
end
|
453
|
+
|
454
|
+
# @param course_id [Integer]
|
455
|
+
# @param module_id [Integer]
|
456
|
+
# @param module_item_id [Integer]
|
457
|
+
def put_publish_module_item(course_id:, module_id:, module_item_id:)
|
458
|
+
uri = "/api/v1/courses/#{course_id}/modules/#{module_id}/items/#{module_item_id}"
|
459
|
+
response = @connection.put(uri) do |req|
|
460
|
+
req.headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
461
|
+
req.body = { 'module_item[published]' => true }
|
462
|
+
end
|
463
|
+
handle_rate_limiting response
|
464
|
+
result = MultiJson.load response.body, symbolize_keys: true
|
465
|
+
if success?(response.status)
|
466
|
+
result
|
467
|
+
else
|
468
|
+
error_messages = String.new
|
469
|
+
result[:errors]&.each do |error|
|
470
|
+
error_messages << "#{error[:message]} "
|
471
|
+
end
|
472
|
+
raise "Error publishing module item: #{error_messages}"
|
473
|
+
end
|
474
|
+
end
|
475
|
+
|
426
476
|
private
|
427
477
|
|
428
478
|
# @param headers [Faraday::Utils::Headers]
|
data/lib/platform_sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strongmind-platform-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.19.
|
4
|
+
version: 3.19.37
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platform Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -231,6 +231,7 @@ files:
|
|
231
231
|
- Makefile
|
232
232
|
- README.md
|
233
233
|
- Rakefile
|
234
|
+
- bump_version.sh
|
234
235
|
- docs/identity_installation_in_rails.md
|
235
236
|
- lib/platform_sdk.rb
|
236
237
|
- lib/platform_sdk/active_record/data_pipelineable.rb
|