@pipedream/canvas 0.7.0 → 0.8.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.
@@ -4,7 +4,7 @@ export default {
4
4
  key: "canvas-list-assignments",
5
5
  name: "List Assignments",
6
6
  description: "Retrieve a list of assignments for a course. [See the documentation](https://mitt.uib.no/doc/api/all_resources.html#method.assignments_api.user_index)",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
8
  type: "action",
9
9
  annotations: {
10
10
  destructiveHint: false,
@@ -0,0 +1,42 @@
1
+ import canvas from "../../canvas.app.mjs";
2
+
3
+ export default {
4
+ key: "canvas-list-courses",
5
+ name: "List Courses",
6
+ description: "List all the courses associated with a given user. [See the documentation](https://mitt.uib.no/doc/api/all_resources.html#method.courses.user_index)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: true,
13
+ },
14
+ props: {
15
+ canvas,
16
+ accountId: {
17
+ propDefinition: [
18
+ canvas,
19
+ "accountId",
20
+ ],
21
+ },
22
+ userId: {
23
+ propDefinition: [
24
+ canvas,
25
+ "userId",
26
+ (c) => ({
27
+ accountId: c.accountId,
28
+ }),
29
+ ],
30
+ },
31
+ },
32
+ async run({ $ }) {
33
+ const courses = await this.canvas.listCourses({
34
+ $,
35
+ userId: this.userId,
36
+ });
37
+ $.export("$summary", `${courses.length} course${courses.length > 1
38
+ ? "s"
39
+ : ""} were successfully retrieved.`);
40
+ return courses;
41
+ },
42
+ };
@@ -0,0 +1,59 @@
1
+ import canvas from "../../canvas.app.mjs";
2
+
3
+ export default {
4
+ key: "canvas-search-course-content",
5
+ name: "Search Course Content",
6
+ description: "Search for content in a course. [See the documentation](https://mitt.uib.no/doc/api/all_resources.html#method.smart_search.search)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: true,
13
+ },
14
+ props: {
15
+ canvas,
16
+ accountId: {
17
+ propDefinition: [
18
+ canvas,
19
+ "accountId",
20
+ ],
21
+ },
22
+ userId: {
23
+ propDefinition: [
24
+ canvas,
25
+ "userId",
26
+ (c) => ({
27
+ accountId: c.accountId,
28
+ }),
29
+ ],
30
+ },
31
+ courseId: {
32
+ propDefinition: [
33
+ canvas,
34
+ "courseId",
35
+ (c) => ({
36
+ userId: c.userId,
37
+ }),
38
+ ],
39
+ },
40
+ query: {
41
+ type: "string",
42
+ label: "Query",
43
+ description: "The query to search for",
44
+ },
45
+ },
46
+ async run({ $ }) {
47
+ const results = await this.canvas.searchCourseContent({
48
+ $,
49
+ courseId: this.courseId,
50
+ params: {
51
+ q: this.query,
52
+ },
53
+ });
54
+ $.export("$summary", `${results.length} result${results.length > 1
55
+ ? "s"
56
+ : ""} were found.`);
57
+ return results;
58
+ },
59
+ };
@@ -6,7 +6,7 @@ export default {
6
6
  key: "canvas-update-assignment",
7
7
  name: "Update Assignment",
8
8
  description: "Update an assignment. [See the documentation](https://mitt.uib.no/doc/api/all_resources.html#method.assignments_api.update)",
9
- version: "0.0.1",
9
+ version: "0.0.2",
10
10
  type: "action",
11
11
  annotations: {
12
12
  destructiveHint: true,
package/canvas.app.mjs CHANGED
@@ -124,5 +124,13 @@ export default {
124
124
  ...opts,
125
125
  });
126
126
  },
127
+ searchCourseContent({
128
+ courseId, ...opts
129
+ }) {
130
+ return this._makeRequest({
131
+ path: `/courses/${courseId}/smartsearch`,
132
+ ...opts,
133
+ });
134
+ },
127
135
  },
128
136
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/canvas",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Pipedream canvas Components",
5
5
  "main": "canvas.app.mjs",
6
6
  "keywords": [