Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import edusign from "../../edusign.app.mjs";

export default {
key: "edusign-add-student-to-course",
name: "Add Student to Course",
description: "Add a student to a course. [See the documentation](https://developers.edusign.com/reference/putv1courseattendancecourseid)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
edusign,
courseId: {
propDefinition: [
edusign,
"courseId",
],
},
studentId: {
propDefinition: [
edusign,
"studentId",
],
},
},
async run({ $ }) {
const response = await this.edusign.addStudentToCourse({
$,
courseId: this.courseId,
data: {
studentId: this.studentId,
},
});
$.export("$summary", `Successfully added student ${this.studentId} to course ${this.courseId}`);
return response;
},
};
92 changes: 92 additions & 0 deletions components/edusign/actions/create-course/create-course.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import edusign from "../../edusign.app.mjs";

export default {
key: "edusign-create-course",
name: "Create Course",
description: "Create a new course. [See the documentation](https://developers.edusign.com/reference/postv1course)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
edusign,
name: {
type: "string",
label: "Name",
description: "The name of the course",
},
start: {
type: "string",
label: "Start",
description: "Start date of the course (ISO 8601 datetime, e.g. `2023-02-15T09:00:00Z`)",
},
end: {
type: "string",
label: "End",
description: "End date of the course (ISO 8601 datetime, e.g. `2025-11-29T15:00:00Z`)",
},
professorId: {
propDefinition: [
edusign,
"professorId",
],
},
needStudentSignature: {
type: "boolean",
label: "Need Student Signature",
description: "Whether the course needs a student signature",
},
description: {
type: "string",
label: "Description",
description: "The description of the course",
optional: true,
},
groupIds: {
propDefinition: [
edusign,
"groupId",
],
type: "string[]",
label: "Group IDs",
description: "The IDs of the groups to add to the course",
optional: true,
},
maxStudents: {
type: "integer",
label: "Max Students",
description: "The maximum number of students to add to the course",
optional: true,
},
classroomId: {
propDefinition: [
edusign,
"classroomId",
],
optional: true,
},
},
async run({ $ }) {
const response = await this.edusign.createCourse({
$,
data: {
course: {
NAME: this.name,
START: this.start,
END: this.end,
PROFESSOR: this.professorId,
NEED_STUDENT_SIGNATURE: this.needStudentSignature,
DESCRIPTION: this.description,
SCHOOL_GROUP: this.groupIds,
MAX_STUDENTS: this.maxStudents,
CLASSROOM: this.classroomId,
},
},
});
$.export("$summary", `Successfully created course with ID: ${response.result.ID}`);
return response;
},
};
50 changes: 50 additions & 0 deletions components/edusign/actions/create-group/create-group.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import edusign from "../../edusign.app.mjs";

export default {
key: "edusign-create-group",
name: "Create Group",
description: "Create a new group. [See the documentation](https://developers.edusign.com/reference/postv1group)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
edusign,
name: {
type: "string",
label: "Name",
description: "The name of the group",
},
description: {
type: "string",
label: "Description",
description: "The description of the group",
},
studentIds: {
propDefinition: [
edusign,
"studentId",
],
type: "string[]",
label: "Student IDs",
description: "The IDs of the students to add to the group",
},
},
async run({ $ }) {
const response = await this.edusign.createGroup({
$,
data: {
group: {
NAME: this.name,
DESCRIPTION: this.description,
STUDENTS: this.studentIds,
},
},
});
$.export("$summary", `Successfully created group with ID: ${response.result.ID}`);
return response;
},
};
85 changes: 85 additions & 0 deletions components/edusign/actions/create-student/create-student.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import edusign from "../../edusign.app.mjs";

export default {
key: "edusign-create-student",
name: "Create Student",
description: "Create a new student. [See the documentation](https://developers.edusign.com/reference/postv1student)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
edusign,
firstName: {
type: "string",
label: "First Name",
description: "The first name of the student",
},
lastName: {
type: "string",
label: "Last Name",
description: "The last name of the student",
},
email: {
type: "string",
label: "Email",
description: "The email of the student",
},
phone: {
type: "string",
label: "Phone",
description: "The phone number of the student",
optional: true,
},
photo: {
type: "string",
label: "Photo",
description: "The URL of the student's photo",
optional: true,
},
fileNumber: {
type: "string",
label: "File Number",
description: "The file number of the student",
optional: true,
},
tags: {
type: "string[]",
label: "Tags",
description: "The tags of the student",
optional: true,
},
groupIds: {
propDefinition: [
edusign,
"groupId",
],
type: "string[]",
label: "Groups",
description: "The groups of the student",
optional: true,
},
},
async run({ $ }) {
const response = await this.edusign.createStudent({
$,
data: {
student: {
FIRSTNAME: this.firstName,
LASTNAME: this.lastName,
EMAIL: this.email,
PHONE: this.phone,
PHOTO: this.photo,
FILE_NUMBER: this.fileNumber,
TAGS: this.tags,
GROUPS: this.groupIds,
},
},
});
$.export("$summary", `Successfully created student with ID: ${response.result.ID}`);
return response;
},
};
Loading
Loading