lms-api 1.10.0 → 1.11.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 482a52f88bdf7f8a250add3d2ee6c9dfa0aa6c59da5b5e031bb6ccfd8cbc7dd6
|
4
|
+
data.tar.gz: 83469daa01e36894c416ba1b5e319f322b6406df0b1dc9d3c1565f1cab78096c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee1ccb932d188587dfef79303c490932110e0195ac5a6e865893ff6e23ccb08889d2d267f449a187b050f3f48df855963ae1d04dc8cbcc8291005dd322d5a361
|
7
|
+
data.tar.gz: fd480300b210307597887116a80500aef077794ec9b397be4e9265e040727f9733e1b5b8b857a06de50a346c74311748c462f575b8b415d94eafa5c3ecca2474
|
@@ -27,7 +27,14 @@ module CanvasApi
|
|
27
27
|
elsif property["items"]["$ref"] == "DateTime" || property["items"]["$ref"] == "Date"
|
28
28
|
"[LMSGraphQL::Types::DateTimeType]"
|
29
29
|
elsif property["items"]["$ref"]
|
30
|
-
|
30
|
+
# HACK on https://canvas.instructure.com/doc/api/submissions.json
|
31
|
+
# the ref value is set to a full sentence rather than a
|
32
|
+
# simple type, so we look for that specific value
|
33
|
+
if property["items"]["$ref"].include?("UserDisplay if anonymous grading is not enabled")
|
34
|
+
"[LMSGraphQL::Types::Canvas::CanvasUserDisplay]"
|
35
|
+
else
|
36
|
+
"[#{canvas_name(property["items"]["$ref"], input_type)}]"
|
37
|
+
end
|
31
38
|
else
|
32
39
|
graphql_primitive(name, property["items"]["type"].downcase, property["items"]["format"])
|
33
40
|
end
|
@@ -199,4 +206,4 @@ module CanvasApi
|
|
199
206
|
|
200
207
|
end
|
201
208
|
|
202
|
-
end
|
209
|
+
end
|
data/lib/canvas_api/render.rb
CHANGED
@@ -6,15 +6,20 @@ module LMSGraphQL
|
|
6
6
|
module Canvas
|
7
7
|
class <%= @nickname.classify %> < CanvasBaseResolver
|
8
8
|
type <%= type_from_operation(operation) %>, null: false
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
<% if operation["type"] == "array"
|
10
|
+
%> argument :get_all, Boolean, required: false
|
11
|
+
<% end
|
12
|
+
%><%= @parameters.map{|p| " argument :#{nested_arg(p["name"])}, #{graphql_type(p["name"], p)}, required: #{p["required"]}"}.join("\n") %>
|
13
|
+
def resolve(<%= @parameters.map{|p| "#{nested_arg(p['name'])}#{p['required'] ? ':' : ': nil'}"}.push("get_all: false").join(", ") %>)
|
14
|
+
result = context[:canvas_api].call("<%= @nickname.upcase %>").proxy(
|
12
15
|
"<%= @nickname.upcase %>",
|
13
16
|
{
|
14
17
|
<%= @parameters.map{|p| " \"#{p['name']}\": #{nested_arg(p['name'])}"}.join(",\n") -%>
|
15
18
|
},
|
16
19
|
nil,
|
17
|
-
|
20
|
+
get_all,
|
21
|
+
)
|
22
|
+
get_all ? result : result.parsed_response
|
18
23
|
end
|
19
24
|
end
|
20
25
|
end
|
data/lib/lms/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lms-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Atomic Jolt
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-01-
|
13
|
+
date: 2019-01-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|