lms-graphql-api 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1553540f1503fbadf467c724f34948954a62af8944523fa61830c7f7c60adcf9
4
- data.tar.gz: 25eb3a5e81880b693c34efba5322ea99bde1ca0f03ad7482aa72e3a8e6725881
3
+ metadata.gz: 8251fc733ff9216d5e9a2bcfc53baef93d995895c688ad6cfd98a5ec850f10f1
4
+ data.tar.gz: 816fa1aa0fe6b1b2decae966aa4b1762348e72d312f669407606d3c19491344a
5
5
  SHA512:
6
- metadata.gz: d421e976ce50d52b71eb9831b5e6883e4e7da6b365eab376dc631116837226e0d8ceced07d6c950a58f2ea2e4e9340ef8f88b8ce6812008e59c1ae40410c3cd5
7
- data.tar.gz: 7996c100441fbc9a65e8ae421e810ac4a72854f8028029aeec0ecfa1462301029686770014cfd987971e33e9648e272eea73e216df38975929e7e6c8a1ded448
6
+ metadata.gz: 83149c4db30d3071b6036952afa1e9d2d8f823ea550a1748f8074691b629ed96a00bd388d8350d898e9a545f43cf43434a4c9970783b3b04fe894512473f44e8
7
+ data.tar.gz: 1f956b28a0417591928e55a11d27da5ba4c9a4e0e591af55d079f9566e58b2a112a8106f388a88a1bdbc5f4fd5fb51019d9e00ebb590d9ec2144c66303c17de4
@@ -0,0 +1,29 @@
1
+ require_relative "../canvas_base_mutation"
2
+ require_relative "../../types/canvas/assignment"
3
+ module LMSGraphQL
4
+ module Mutations
5
+ module Canvas
6
+ class DuplicateAssignnment < BaseMutation
7
+ argument :course_id, ID, required: true
8
+ argument :assignment_id, ID, required: true
9
+ argument :result_type, String, required: false
10
+
11
+
12
+ field :assignment, LMSGraphQL::Types::Canvas::CanvasAssignment, null: false
13
+
14
+ def resolve(course_id:, assignment_id:, result_type: nil)
15
+ context[:canvas_api].call("DUPLICATE_ASSIGNNMENT").proxy(
16
+ "DUPLICATE_ASSIGNNMENT",
17
+ {
18
+ "course_id": course_id,
19
+ "assignment_id": assignment_id
20
+ },
21
+ {
22
+ "result_type": result_type
23
+ },
24
+ ).parsed_response
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,26 @@
1
+ require_relative "../canvas_base_mutation"
2
+ require_relative "../../types/canvas/discussion_topic"
3
+ module LMSGraphQL
4
+ module Mutations
5
+ module Canvas
6
+ class DuplicateDiscussionTopicCourse < BaseMutation
7
+ argument :course_id, ID, required: true
8
+ argument :topic_id, ID, required: true
9
+
10
+
11
+ field :discussion_topic, LMSGraphQL::Types::Canvas::CanvasDiscussionTopic, null: false
12
+
13
+ def resolve(course_id:, topic_id:)
14
+ context[:canvas_api].call("DUPLICATE_DISCUSSION_TOPIC_COURSES").proxy(
15
+ "DUPLICATE_DISCUSSION_TOPIC_COURSES",
16
+ {
17
+ "course_id": course_id,
18
+ "topic_id": topic_id
19
+ },
20
+ {},
21
+ ).parsed_response
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ require_relative "../canvas_base_mutation"
2
+ require_relative "../../types/canvas/discussion_topic"
3
+ module LMSGraphQL
4
+ module Mutations
5
+ module Canvas
6
+ class DuplicateDiscussionTopicGroup < BaseMutation
7
+ argument :group_id, ID, required: true
8
+ argument :topic_id, ID, required: true
9
+
10
+
11
+ field :discussion_topic, LMSGraphQL::Types::Canvas::CanvasDiscussionTopic, null: false
12
+
13
+ def resolve(group_id:, topic_id:)
14
+ context[:canvas_api].call("DUPLICATE_DISCUSSION_TOPIC_GROUPS").proxy(
15
+ "DUPLICATE_DISCUSSION_TOPIC_GROUPS",
16
+ {
17
+ "group_id": group_id,
18
+ "topic_id": topic_id
19
+ },
20
+ {},
21
+ ).parsed_response
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -31,6 +31,7 @@ module LMSGraphQL
31
31
  field :edit_assignment_group, mutation: LMSGraphQL::Mutations::Canvas::EditAssignmentGroup
32
32
  field :destroy_assignment_group, mutation: LMSGraphQL::Mutations::Canvas::DestroyAssignmentGroup
33
33
  field :delete_assignment, mutation: LMSGraphQL::Mutations::Canvas::DeleteAssignment
34
+ field :duplicate_assignnment, mutation: LMSGraphQL::Mutations::Canvas::DuplicateAssignnment
34
35
  field :create_assignment, mutation: LMSGraphQL::Mutations::Canvas::CreateAssignment
35
36
  field :edit_assignment, mutation: LMSGraphQL::Mutations::Canvas::EditAssignment
36
37
  field :bulk_update_assignment_dates, mutation: LMSGraphQL::Mutations::Canvas::BulkUpdateAssignmentDate
@@ -123,6 +124,8 @@ module LMSGraphQL
123
124
  field :delete_entry_groups, mutation: LMSGraphQL::Mutations::Canvas::DeleteEntryGroup
124
125
  field :post_entry_courses, mutation: LMSGraphQL::Mutations::Canvas::PostEntryCourse
125
126
  field :post_entry_groups, mutation: LMSGraphQL::Mutations::Canvas::PostEntryGroup
127
+ field :duplicate_discussion_topic_courses, mutation: LMSGraphQL::Mutations::Canvas::DuplicateDiscussionTopicCourse
128
+ field :duplicate_discussion_topic_groups, mutation: LMSGraphQL::Mutations::Canvas::DuplicateDiscussionTopicGroup
126
129
  field :post_reply_courses, mutation: LMSGraphQL::Mutations::Canvas::PostReplyCourse
127
130
  field :post_reply_groups, mutation: LMSGraphQL::Mutations::Canvas::PostReplyGroup
128
131
  field :mark_topic_as_read_courses, mutation: LMSGraphQL::Mutations::Canvas::MarkTopicAsReadCourse
@@ -44,11 +44,12 @@ module LMSGraphQL
44
44
  argument :course_blueprint_restrictions, String, required: false
45
45
  argument :course_use_blueprint_restrictions_by_object_type, Boolean, required: false
46
46
  argument :course_blueprint_restrictions_by_object_type, String, required: false
47
+ argument :course_homeroom_course, Boolean, required: false
47
48
 
48
49
 
49
50
  field :return_value, Boolean, null: false
50
51
 
51
- def resolve(id:, course_account_id: nil, course_name: nil, course_course_code: nil, course_start_at: nil, course_end_at: nil, course_license: nil, course_is_public: nil, course_is_public_to_auth_users: nil, course_public_syllabus: nil, course_public_syllabus_to_auth: nil, course_public_description: nil, course_allow_student_wiki_edits: nil, course_allow_wiki_comments: nil, course_allow_student_forum_attachments: nil, course_open_enrollment: nil, course_self_enrollment: nil, course_restrict_enrollments_to_course_dates: nil, course_term_id: nil, course_sis_course_id: nil, course_integration_id: nil, course_hide_final_grades: nil, course_time_zone: nil, course_apply_assignment_group_weights: nil, course_storage_quota_mb: nil, offer: nil, course_event: nil, course_default_view: nil, course_syllabus_body: nil, course_syllabus_course_summary: nil, course_grading_standard_id: nil, course_grade_passback_setting: nil, course_course_format: nil, course_image_id: nil, course_image_url: nil, course_remove_image: nil, course_blueprint: nil, course_blueprint_restrictions: nil, course_use_blueprint_restrictions_by_object_type: nil, course_blueprint_restrictions_by_object_type: nil)
52
+ def resolve(id:, course_account_id: nil, course_name: nil, course_course_code: nil, course_start_at: nil, course_end_at: nil, course_license: nil, course_is_public: nil, course_is_public_to_auth_users: nil, course_public_syllabus: nil, course_public_syllabus_to_auth: nil, course_public_description: nil, course_allow_student_wiki_edits: nil, course_allow_wiki_comments: nil, course_allow_student_forum_attachments: nil, course_open_enrollment: nil, course_self_enrollment: nil, course_restrict_enrollments_to_course_dates: nil, course_term_id: nil, course_sis_course_id: nil, course_integration_id: nil, course_hide_final_grades: nil, course_time_zone: nil, course_apply_assignment_group_weights: nil, course_storage_quota_mb: nil, offer: nil, course_event: nil, course_default_view: nil, course_syllabus_body: nil, course_syllabus_course_summary: nil, course_grading_standard_id: nil, course_grade_passback_setting: nil, course_course_format: nil, course_image_id: nil, course_image_url: nil, course_remove_image: nil, course_blueprint: nil, course_blueprint_restrictions: nil, course_use_blueprint_restrictions_by_object_type: nil, course_blueprint_restrictions_by_object_type: nil, course_homeroom_course: nil)
52
53
  context[:canvas_api].call("UPDATE_COURSE").proxy(
53
54
  "UPDATE_COURSE",
54
55
  {
@@ -93,7 +94,8 @@ module LMSGraphQL
93
94
  "course[blueprint]": course_blueprint,
94
95
  "course[blueprint_restrictions]": course_blueprint_restrictions,
95
96
  "course[use_blueprint_restrictions_by_object_type]": course_use_blueprint_restrictions_by_object_type,
96
- "course[blueprint_restrictions_by_object_type]": course_blueprint_restrictions_by_object_type
97
+ "course[blueprint_restrictions_by_object_type]": course_blueprint_restrictions_by_object_type,
98
+ "course[homeroom_course]": course_homeroom_course
97
99
  },
98
100
  ).parsed_response
99
101
  end
@@ -0,0 +1,24 @@
1
+ require_relative "../canvas_base_resolver"
2
+ require_relative "../../types/canvas/course_progress"
3
+ module LMSGraphQL
4
+ module Resolvers
5
+ module Canvas
6
+ class GetUserProgress < CanvasBaseResolver
7
+ type LMSGraphQL::Types::Canvas::CanvasCourseProgress, null: false
8
+ argument :course_id, ID, required: true
9
+ argument :user_id, ID, required: true
10
+ def resolve(course_id:, user_id:, get_all: false)
11
+ result = context[:canvas_api].call("GET_USER_PROGRESS").proxy(
12
+ "GET_USER_PROGRESS",
13
+ {
14
+ "course_id": course_id,
15
+ "user_id": user_id },
16
+ nil,
17
+ get_all,
18
+ )
19
+ get_all ? result : result.parsed_response
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,22 @@
1
+ require_relative "../canvas_base_resolver"
2
+
3
+ module LMSGraphQL
4
+ module Resolvers
5
+ module Canvas
6
+ class ListEnvironmentFeature < CanvasBaseResolver
7
+ type Boolean, null: false
8
+
9
+ def resolve(get_all: false)
10
+ result = context[:canvas_api].call("LIST_ENVIRONMENT_FEATURES").proxy(
11
+ "LIST_ENVIRONMENT_FEATURES",
12
+ {
13
+ },
14
+ nil,
15
+ get_all,
16
+ )
17
+ get_all ? result : result.parsed_response
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -13,6 +13,7 @@ module LMSGraphQL
13
13
  class FeatureFlagStateEnum < ::GraphQL::Schema::Enum
14
14
  value "off"
15
15
  value "allowed"
16
+ value "allowed_on"
16
17
  value "on"
17
18
  end
18
19
  class CanvasFeatureFlag < BaseType
@@ -20,7 +21,7 @@ module LMSGraphQL
20
21
  field :context_type, FeatureFlagContextTypeEnum, "The type of object to which this flag applies (Account, Course, or User). (This field is not present if this FeatureFlag represents the global Canvas default).Example: Account", null: true
21
22
  field :context_id, ID, "The id of the object to which this flag applies (This field is not present if this FeatureFlag represents the global Canvas default).Example: 1038", null: true
22
23
  field :feature, String, "The feature this flag controls.Example: fancy_wickets", null: true
23
- field :state, FeatureFlagStateEnum, "The policy for the feature at this context. can be 'off', 'allowed', or 'on'..Example: allowed", null: true
24
+ field :state, FeatureFlagStateEnum, "The policy for the feature at this context. can be 'off', 'allowed', 'allowed_on', or 'on'..Example: allowed", null: true
24
25
  field :locked, Boolean, "If set, this feature flag cannot be changed in the caller's context because the flag is set 'off' or 'on' in a higher context.", null: true
25
26
 
26
27
  end
@@ -13,6 +13,7 @@ module LMSGraphQL
13
13
  class FeatureFlagStateEnum < ::GraphQL::Schema::Enum
14
14
  value "off"
15
15
  value "allowed"
16
+ value "allowed_on"
16
17
  value "on"
17
18
  end
18
19
  class CanvasFeatureFlagInput < BaseInputObject
@@ -20,7 +21,7 @@ module LMSGraphQL
20
21
  argument :context_type, FeatureFlagContextTypeEnum, "The type of object to which this flag applies (Account, Course, or User). (This field is not present if this FeatureFlag represents the global Canvas default).Example: Account", required: false
21
22
  argument :context_id, ID, "The id of the object to which this flag applies (This field is not present if this FeatureFlag represents the global Canvas default).Example: 1038", required: false
22
23
  argument :feature, String, "The feature this flag controls.Example: fancy_wickets", required: false
23
- argument :state, FeatureFlagStateEnum, "The policy for the feature at this context. can be 'off', 'allowed', or 'on'..Example: allowed", required: false
24
+ argument :state, FeatureFlagStateEnum, "The policy for the feature at this context. can be 'off', 'allowed', 'allowed_on', or 'on'..Example: allowed", required: false
24
25
  argument :locked, Boolean, "If set, this feature flag cannot be changed in the caller's context because the flag is set 'off' or 'on' in a higher context.", required: false
25
26
 
26
27
  end
@@ -1,5 +1,5 @@
1
1
  require_relative "../canvas_base_type"
2
-
2
+ require_relative "user"
3
3
 
4
4
  module LMSGraphQL
5
5
  module Types
@@ -33,6 +33,7 @@ module LMSGraphQL
33
33
  field :sis_import_id, ID, "The id of the SIS import if created through SIS. Only included if the user has permission to manage SIS information..Example: 14", null: true
34
34
  field :storage_quota_mb, Int, "the storage quota for the group, in megabytes.Example: 50", null: true
35
35
  field :permissions, String, "optional: the permissions the user has for the group. returned only for a single group and include[]=permissions.Example: true, true", null: true
36
+ field :users, [LMSGraphQL::Types::Canvas::CanvasUser], "optional: A list of users that are members in the group. Returned only if include[]=users. WARNING: this collection's size is capped (if there are an extremely large number of users in the group (thousands) not all of them will be returned). If you need to capture all the users in a group with certainty consider using the paginated /api/v1/groups/<group_id>/memberships endpoint..", null: true
36
37
 
37
38
  end
38
39
  end
@@ -1,5 +1,5 @@
1
1
  require_relative "../canvas_base_input_type"
2
-
2
+ require_relative "user"
3
3
 
4
4
  module LMSGraphQL
5
5
  module Types
@@ -33,6 +33,7 @@ module LMSGraphQL
33
33
  argument :sis_import_id, ID, "The id of the SIS import if created through SIS. Only included if the user has permission to manage SIS information..Example: 14", required: false
34
34
  argument :storage_quota_mb, Int, "the storage quota for the group, in megabytes.Example: 50", required: false
35
35
  argument :permissions, String, "optional: the permissions the user has for the group. returned only for a single group and include[]=permissions.Example: true, true", required: false
36
+ argument :users, [LMSGraphQL::Types::Canvas::CanvasUserInput], "optional: A list of users that are members in the group. Returned only if include[]=users. WARNING: this collection's size is capped (if there are an extremely large number of users in the group (thousands) not all of them will be returned). If you need to capture all the users in a group with certainty consider using the paginated /api/v1/groups/<group_id>/memberships endpoint..", required: false
36
37
 
37
38
  end
38
39
  end
@@ -527,6 +527,10 @@ module LMSGraphQL
527
527
  resolver: LMSGraphQL::Resolvers::Canvas::ListCoursesForUser,
528
528
  description: "List courses for a user. Returns a paginated list of active courses for this user. To view the course list for a user other than yourself, you must be either an observer of that user or an administrator."
529
529
 
530
+ field :get_user_progress,
531
+ resolver: LMSGraphQL::Resolvers::Canvas::GetUserProgress,
532
+ description: "Get user progress. Return progress information for the user and course You can supply +self+ as the user_id to query your own progress in a course. To query another user's progress, you must be a teacher in the course, an administrator, or a linked observer of the user."
533
+
530
534
  field :list_students,
531
535
  resolver: LMSGraphQL::Resolvers::Canvas::ListStudent,
532
536
  description: "List students. Returns the paginated list of students enrolled in this course. DEPRECATED: Please use the {api:CoursesController#users course users} endpoint and pass 'student' as the enrollment_type."
@@ -731,6 +735,10 @@ module LMSGraphQL
731
735
  resolver: LMSGraphQL::Resolvers::Canvas::ListEnabledFeaturesUser,
732
736
  description: "List enabled features. A paginated list of all features that are enabled on a given Account, Course, or User. Only the feature names are returned."
733
737
 
738
+ field :list_environment_features,
739
+ resolver: LMSGraphQL::Resolvers::Canvas::ListEnvironmentFeature,
740
+ description: "List environment features. Return a hash of global feature settings that pertain to the Canvas user interface. This is the same information supplied to the web interface as +ENV.FEATURES+."
741
+
734
742
  field :get_feature_flag_courses,
735
743
  resolver: LMSGraphQL::Resolvers::Canvas::GetFeatureFlagCourse,
736
744
  description: "Get feature flag. Get the feature flag that applies to a given Account, Course, or User. The flag may be defined on the object, or it may be inherited from a parent account. You can look at the context_id and context_type of the returned object to determine which is the case. If these fields are missing, then the object is the global Canvas default."
@@ -1,3 +1,3 @@
1
1
  module LMSGraphQL
2
- VERSION = "1.6.0".freeze
2
+ VERSION = "1.7.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lms-graphql-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Atomic Jolt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-12-29 00:00:00.000000000 Z
12
+ date: 2021-02-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: graphql
@@ -277,6 +277,9 @@ files:
277
277
  - lib/lms_graphql/mutations/canvas/deprecated_self_register_user.rb
278
278
  - lib/lms_graphql/mutations/canvas/destroy_assignment_group.rb
279
279
  - lib/lms_graphql/mutations/canvas/disable_assignments_currently_enabled_for_grade_export_to_sis.rb
280
+ - lib/lms_graphql/mutations/canvas/duplicate_assignnment.rb
281
+ - lib/lms_graphql/mutations/canvas/duplicate_discussion_topic_courses.rb
282
+ - lib/lms_graphql/mutations/canvas/duplicate_discussion_topic_groups.rb
280
283
  - lib/lms_graphql/mutations/canvas/duplicate_page.rb
281
284
  - lib/lms_graphql/mutations/canvas/edit_assignment.rb
282
285
  - lib/lms_graphql/mutations/canvas/edit_assignment_group.rb
@@ -663,6 +666,7 @@ files:
663
666
  - lib/lms_graphql/resolvers/canvas/get_user_in_a_course_level_messaging_data.rb
664
667
  - lib/lms_graphql/resolvers/canvas/get_user_in_a_course_level_participation_data.rb
665
668
  - lib/lms_graphql/resolvers/canvas/get_user_profile.rb
669
+ - lib/lms_graphql/resolvers/canvas/get_user_progress.rb
666
670
  - lib/lms_graphql/resolvers/canvas/get_users_most_recently_graded_submissions.rb
667
671
  - lib/lms_graphql/resolvers/canvas/grade_change_log_query_by_course.rb
668
672
  - lib/lms_graphql/resolvers/canvas/group_activity_stream.rb
@@ -741,6 +745,7 @@ files:
741
745
  - lib/lms_graphql/resolvers/canvas/list_entries_groups.rb
742
746
  - lib/lms_graphql/resolvers/canvas/list_entry_replies_courses.rb
743
747
  - lib/lms_graphql/resolvers/canvas/list_entry_replies_groups.rb
748
+ - lib/lms_graphql/resolvers/canvas/list_environment_features.rb
744
749
  - lib/lms_graphql/resolvers/canvas/list_external_feeds_courses.rb
745
750
  - lib/lms_graphql/resolvers/canvas/list_external_feeds_groups.rb
746
751
  - lib/lms_graphql/resolvers/canvas/list_external_tools_accounts.rb