ed-fi-connect-js
v1.0.1
Published
Connect to Ed-Fi with Node
Downloads
2
Readme
ed-fi-connect-js
Use the Ed-Fi API with nodejs (7+), handles oauth and tokens with auto token regeneration.
Installation
npm install ed-fi-connect-js
Usage
Import into your node application
const edFi = require('ed-fi-connect-js');
Several ways to access the api
Old school, syncronous
api will be available when it's ready
var connection = edFi('http://server:54746', 'populatedSandbox', 'populatedSandboxSecret');
With callback
(optional)
var connection = edFi('http://server:54746', 'populatedSandbox', 'populatedSandboxSecret', function(api) {
console.log(api);
api.students.getStudents().then(students => {
console.log(students);
})
});
Skip the callback
connection.api.then(api => {
console.log(api)
});
Use with object initialization
(callback optional)
var connection = edFi({
serverAddress: 'http://server:54746',
client_id: 'populatedSandbox',
client_seceret:'populatedSandboxSecret'
}, (api) => {
console.log(api);
});
Skip the callback and await
(after initialization)
(async function() {
let api = await connection.api;
console.log(api)
})()
Api object
This is the swagger client apis object that contains all Ed-Fi endpoints. Here is the default Ed-Fi (3.0) functions available
One you have the api object, use it like so:
api.students.getStudents().then(students => {
console.log(students);
})
api.parents.getParents().then(parents => {
console.log(parents);
})
... ect
academicWeeks:
{ getAcademicWeeks: [Function],
postAcademicWeek: [Function],
getAcademicWeeksById: [Function],
putAcademicWeek: [Function],
deleteAcademicWeekById: [Function] },
accounts:
{ getAccounts: [Function],
postAccount: [Function],
getAccountsById: [Function],
putAccount: [Function],
deleteAccountById: [Function] },
accountabilityRatings:
{ getAccountabilityRatings: [Function],
postAccountabilityRating: [Function],
getAccountabilityRatingsById: [Function],
putAccountabilityRating: [Function],
deleteAccountabilityRatingById: [Function] },
accountCodes:
{ getAccountCodes: [Function],
postAccountCode: [Function],
getAccountCodesById: [Function],
putAccountCode: [Function],
deleteAccountCodeById: [Function] },
actuals:
{ getActuals: [Function],
postActual: [Function],
getActualsById: [Function],
putActual: [Function],
deleteActualById: [Function] },
applicants:
{ getApplicants: [Function],
postApplicant: [Function],
getApplicantsById: [Function],
putApplicant: [Function],
deleteApplicantById: [Function] },
assessments:
{ getAssessments: [Function],
postAssessment: [Function],
getAssessmentsById: [Function],
putAssessment: [Function],
deleteAssessmentById: [Function] },
assessmentItems:
{ getAssessmentItems: [Function],
postAssessmentItem: [Function],
getAssessmentItemsById: [Function],
putAssessmentItem: [Function],
deleteAssessmentItemById: [Function] },
bellSchedules:
{ getBellSchedules: [Function],
postBellSchedule: [Function],
getBellSchedulesById: [Function],
putBellSchedule: [Function],
deleteBellScheduleById: [Function] },
budgets:
{ getBudgets: [Function],
postBudget: [Function],
getBudgetsById: [Function],
putBudget: [Function],
deleteBudgetById: [Function] },
calendars:
{ getCalendars: [Function],
postCalendar: [Function],
getCalendarsById: [Function],
putCalendar: [Function],
deleteCalendarById: [Function] },
calendarDates:
{ getCalendarDates: [Function],
postCalendarDate: [Function],
getCalendarDatesById: [Function],
putCalendarDate: [Function],
deleteCalendarDateById: [Function] },
classPeriods:
{ getClassPeriods: [Function],
postClassPeriod: [Function],
getClassPeriodsById: [Function],
putClassPeriod: [Function],
deleteClassPeriodById: [Function] },
cohorts:
{ getCohorts: [Function],
postCohort: [Function],
getCohortsById: [Function],
putCohort: [Function],
deleteCohortById: [Function] },
communityOrganizations:
{ getCommunityOrganizations: [Function],
postCommunityOrganization: [Function],
getCommunityOrganizationsById: [Function],
putCommunityOrganization: [Function],
deleteCommunityOrganizationById: [Function] },
communityProviders:
{ getCommunityProviders: [Function],
postCommunityProvider: [Function],
getCommunityProvidersById: [Function],
putCommunityProvider: [Function],
deleteCommunityProviderById: [Function] },
communityProviderLicenses:
{ getCommunityProviderLicenses: [Function],
postCommunityProviderLicense: [Function],
getCommunityProviderLicensesById: [Function],
putCommunityProviderLicense: [Function],
deleteCommunityProviderLicenseById: [Function] },
competencyObjectives:
{ getCompetencyObjectives: [Function],
postCompetencyObjective: [Function],
getCompetencyObjectivesById: [Function],
putCompetencyObjective: [Function],
deleteCompetencyObjectiveById: [Function] },
contractedStaffs:
{ getContractedStaffs: [Function],
postContractedStaff: [Function],
getContractedStaffsById: [Function],
putContractedStaff: [Function],
deleteContractedStaffById: [Function] },
courses:
{ getCourses: [Function],
postCourse: [Function],
getCoursesById: [Function],
putCourse: [Function],
deleteCourseById: [Function] },
courseOfferings:
{ getCourseOfferings: [Function],
postCourseOffering: [Function],
getCourseOfferingsById: [Function],
putCourseOffering: [Function],
deleteCourseOfferingById: [Function] },
courseTranscripts:
{ getCourseTranscripts: [Function],
postCourseTranscript: [Function],
getCourseTranscriptsById: [Function],
putCourseTranscript: [Function],
deleteCourseTranscriptById: [Function] },
credentials:
{ getCredentials: [Function],
postCredential: [Function],
getCredentialsById: [Function],
putCredential: [Function],
deleteCredentialById: [Function] },
disciplineActions:
{ getDisciplineActions: [Function],
postDisciplineAction: [Function],
getDisciplineActionsById: [Function],
putDisciplineAction: [Function],
deleteDisciplineActionById: [Function] },
disciplineIncidents:
{ getDisciplineIncidents: [Function],
postDisciplineIncident: [Function],
getDisciplineIncidentsById: [Function],
putDisciplineIncident: [Function],
deleteDisciplineIncidentById: [Function] },
educationContents:
{ getEducationContents: [Function],
postEducationContent: [Function],
getEducationContentsById: [Function],
putEducationContent: [Function],
deleteEducationContentById: [Function] },
educationOrganizationInterventionPrescriptionAssociations:
{ getEducationOrganizationInterventionPrescriptionAssociations: [Function],
postEducationOrganizationInterventionPrescriptionAssociation: [Function],
getEducationOrganizationInterventionPrescriptionAssociationsById: [Function],
putEducationOrganizationInterventionPrescriptionAssociation: [Function],
deleteEducationOrganizationInterventionPrescriptionAssociationById: [Function] },
educationOrganizationNetworks:
{ getEducationOrganizationNetworks: [Function],
postEducationOrganizationNetwork: [Function],
getEducationOrganizationNetworksById: [Function],
putEducationOrganizationNetwork: [Function],
deleteEducationOrganizationNetworkById: [Function] },
educationOrganizationNetworkAssociations:
{ getEducationOrganizationNetworkAssociations: [Function],
postEducationOrganizationNetworkAssociation: [Function],
getEducationOrganizationNetworkAssociationsById: [Function],
putEducationOrganizationNetworkAssociation: [Function],
deleteEducationOrganizationNetworkAssociationById: [Function] },
educationOrganizationPeerAssociations:
{ getEducationOrganizationPeerAssociations: [Function],
postEducationOrganizationPeerAssociation: [Function],
getEducationOrganizationPeerAssociationsById: [Function],
putEducationOrganizationPeerAssociation: [Function],
deleteEducationOrganizationPeerAssociationById: [Function] },
educationServiceCenters:
{ getEducationServiceCenters: [Function],
postEducationServiceCenter: [Function],
getEducationServiceCentersById: [Function],
putEducationServiceCenter: [Function],
deleteEducationServiceCenterById: [Function] },
feederSchoolAssociations:
{ getFeederSchoolAssociations: [Function],
postFeederSchoolAssociation: [Function],
getFeederSchoolAssociationsById: [Function],
putFeederSchoolAssociation: [Function],
deleteFeederSchoolAssociationById: [Function] },
generalStudentProgramAssociations:
{ getGeneralStudentProgramAssociations: [Function],
postGeneralStudentProgramAssociation: [Function],
getGeneralStudentProgramAssociationsById: [Function],
putGeneralStudentProgramAssociation: [Function],
deleteGeneralStudentProgramAssociationById: [Function] },
grades:
{ getGrades: [Function],
postGrade: [Function],
getGradesById: [Function],
putGrade: [Function],
deleteGradeById: [Function] },
gradebookEntries:
{ getGradebookEntries: [Function],
postGradebookEntry: [Function],
getGradebookEntriesById: [Function],
putGradebookEntry: [Function],
deleteGradebookEntryById: [Function] },
gradingPeriods:
{ getGradingPeriods: [Function],
postGradingPeriod: [Function],
getGradingPeriodsById: [Function],
putGradingPeriod: [Function],
deleteGradingPeriodById: [Function] },
graduationPlans:
{ getGraduationPlans: [Function],
postGraduationPlan: [Function],
getGraduationPlansById: [Function],
putGraduationPlan: [Function],
deleteGraduationPlanById: [Function] },
interventions:
{ getInterventions: [Function],
postIntervention: [Function],
getInterventionsById: [Function],
putIntervention: [Function],
deleteInterventionById: [Function] },
interventionPrescriptions:
{ getInterventionPrescriptions: [Function],
postInterventionPrescription: [Function],
getInterventionPrescriptionsById: [Function],
putInterventionPrescription: [Function],
deleteInterventionPrescriptionById: [Function] },
interventionStudies:
{ getInterventionStudies: [Function],
postInterventionStudy: [Function],
getInterventionStudiesById: [Function],
putInterventionStudy: [Function],
deleteInterventionStudyById: [Function] },
learningObjectives:
{ getLearningObjectives: [Function],
postLearningObjective: [Function],
getLearningObjectivesById: [Function],
putLearningObjective: [Function],
deleteLearningObjectiveById: [Function] },
learningStandards:
{ getLearningStandards: [Function],
postLearningStandard: [Function],
getLearningStandardsById: [Function],
putLearningStandard: [Function],
deleteLearningStandardById: [Function] },
localEducationAgencies:
{ getLocalEducationAgencies: [Function],
postLocalEducationAgency: [Function],
getLocalEducationAgenciesById: [Function],
putLocalEducationAgency: [Function],
deleteLocalEducationAgencyById: [Function] },
locations:
{ getLocations: [Function],
postLocation: [Function],
getLocationsById: [Function],
putLocation: [Function],
deleteLocationById: [Function] },
objectiveAssessments:
{ getObjectiveAssessments: [Function],
postObjectiveAssessment: [Function],
getObjectiveAssessmentsById: [Function],
putObjectiveAssessment: [Function],
deleteObjectiveAssessmentById: [Function] },
openStaffPositions:
{ getOpenStaffPositions: [Function],
postOpenStaffPosition: [Function],
getOpenStaffPositionsById: [Function],
putOpenStaffPosition: [Function],
deleteOpenStaffPositionById: [Function] },
parents:
{ getParents: [Function],
postParent: [Function],
getParentsById: [Function],
putParent: [Function],
deleteParentById: [Function] },
payrolls:
{ getPayrolls: [Function],
postPayroll: [Function],
getPayrollsById: [Function],
putPayroll: [Function],
deletePayrollById: [Function] },
postSecondaryEvents:
{ getPostSecondaryEvents: [Function],
postPostSecondaryEvent: [Function],
getPostSecondaryEventsById: [Function],
putPostSecondaryEvent: [Function],
deletePostSecondaryEventById: [Function] },
postSecondaryInstitutions:
{ getPostSecondaryInstitutions: [Function],
postPostSecondaryInstitution: [Function],
getPostSecondaryInstitutionsById: [Function],
putPostSecondaryInstitution: [Function],
deletePostSecondaryInstitutionById: [Function] },
programs:
{ getPrograms: [Function],
postProgram: [Function],
getProgramsById: [Function],
putProgram: [Function],
deleteProgramById: [Function] },
reportCards:
{ getReportCards: [Function],
postReportCard: [Function],
getReportCardsById: [Function],
putReportCard: [Function],
deleteReportCardById: [Function] },
restraintEvents:
{ getRestraintEvents: [Function],
postRestraintEvent: [Function],
getRestraintEventsById: [Function],
putRestraintEvent: [Function],
deleteRestraintEventById: [Function] },
schools:
{ getSchools: [Function],
postSchool: [Function],
getSchoolsById: [Function],
putSchool: [Function],
deleteSchoolById: [Function] },
schoolYearTypes:
{ getSchoolYearTypes: [Function],
postSchoolYearType: [Function],
getSchoolYearTypesById: [Function],
putSchoolYearType: [Function],
deleteSchoolYearTypeById: [Function] },
sections:
{ getSections: [Function],
postSection: [Function],
getSectionsById: [Function],
putSection: [Function],
deleteSectionById: [Function] },
sectionAttendanceTakenEvents:
{ getSectionAttendanceTakenEvents: [Function],
postSectionAttendanceTakenEvent: [Function],
getSectionAttendanceTakenEventsById: [Function],
putSectionAttendanceTakenEvent: [Function],
deleteSectionAttendanceTakenEventById: [Function] },
sessions:
{ getSessions: [Function],
postSession: [Function],
getSessionsById: [Function],
putSession: [Function],
deleteSessionById: [Function] },
staffs:
{ getStaffs: [Function],
postStaff: [Function],
getStaffsById: [Function],
putStaff: [Function],
deleteStaffById: [Function] },
staffAbsenceEvents:
{ getStaffAbsenceEvents: [Function],
postStaffAbsenceEvent: [Function],
getStaffAbsenceEventsById: [Function],
putStaffAbsenceEvent: [Function],
deleteStaffAbsenceEventById: [Function] },
staffCohortAssociations:
{ getStaffCohortAssociations: [Function],
postStaffCohortAssociation: [Function],
getStaffCohortAssociationsById: [Function],
putStaffCohortAssociation: [Function],
deleteStaffCohortAssociationById: [Function] },
staffEducationOrganizationAssignmentAssociations:
{ getStaffEducationOrganizationAssignmentAssociations: [Function],
postStaffEducationOrganizationAssignmentAssociation: [Function],
getStaffEducationOrganizationAssignmentAssociationsById: [Function],
putStaffEducationOrganizationAssignmentAssociation: [Function],
deleteStaffEducationOrganizationAssignmentAssociationById: [Function] },
staffEducationOrganizationContactAssociations:
{ getStaffEducationOrganizationContactAssociations: [Function],
postStaffEducationOrganizationContactAssociation: [Function],
getStaffEducationOrganizationContactAssociationsById: [Function],
putStaffEducationOrganizationContactAssociation: [Function],
deleteStaffEducationOrganizationContactAssociationById: [Function] },
staffEducationOrganizationEmploymentAssociations:
{ getStaffEducationOrganizationEmploymentAssociations: [Function],
postStaffEducationOrganizationEmploymentAssociation: [Function],
getStaffEducationOrganizationEmploymentAssociationsById: [Function],
putStaffEducationOrganizationEmploymentAssociation: [Function],
deleteStaffEducationOrganizationEmploymentAssociationById: [Function] },
staffLeaves:
{ getStaffLeaves: [Function],
postStaffLeave: [Function],
getStaffLeavesById: [Function],
putStaffLeave: [Function],
deleteStaffLeaveById: [Function] },
staffProgramAssociations:
{ getStaffProgramAssociations: [Function],
postStaffProgramAssociation: [Function],
getStaffProgramAssociationsById: [Function],
putStaffProgramAssociation: [Function],
deleteStaffProgramAssociationById: [Function] },
staffSchoolAssociations:
{ getStaffSchoolAssociations: [Function],
postStaffSchoolAssociation: [Function],
getStaffSchoolAssociationsById: [Function],
putStaffSchoolAssociation: [Function],
deleteStaffSchoolAssociationById: [Function] },
staffSectionAssociations:
{ getStaffSectionAssociations: [Function],
postStaffSectionAssociation: [Function],
getStaffSectionAssociationsById: [Function],
putStaffSectionAssociation: [Function],
deleteStaffSectionAssociationById: [Function] },
stateEducationAgencies:
{ getStateEducationAgencies: [Function],
postStateEducationAgency: [Function],
getStateEducationAgenciesById: [Function],
putStateEducationAgency: [Function],
deleteStateEducationAgencyById: [Function] },
students:
{ getStudents: [Function],
postStudent: [Function],
getStudentsById: [Function],
putStudent: [Function],
deleteStudentById: [Function] },
studentAcademicRecords:
{ getStudentAcademicRecords: [Function],
postStudentAcademicRecord: [Function],
getStudentAcademicRecordsById: [Function],
putStudentAcademicRecord: [Function],
deleteStudentAcademicRecordById: [Function] },
studentAssessments:
{ getStudentAssessments: [Function],
postStudentAssessment: [Function],
getStudentAssessmentsById: [Function],
putStudentAssessment: [Function],
deleteStudentAssessmentById: [Function] },
studentCohortAssociations:
{ getStudentCohortAssociations: [Function],
postStudentCohortAssociation: [Function],
getStudentCohortAssociationsById: [Function],
putStudentCohortAssociation: [Function],
deleteStudentCohortAssociationById: [Function] },
studentCompetencyObjectives:
{ getStudentCompetencyObjectives: [Function],
postStudentCompetencyObjective: [Function],
getStudentCompetencyObjectivesById: [Function],
putStudentCompetencyObjective: [Function],
deleteStudentCompetencyObjectiveById: [Function] },
studentCTEProgramAssociations:
{ getStudentCTEProgramAssociations: [Function],
postStudentCTEProgramAssociation: [Function],
getStudentCTEProgramAssociationsById: [Function],
putStudentCTEProgramAssociation: [Function],
deleteStudentCTEProgramAssociationById: [Function] },
studentDisciplineIncidentAssociations:
{ getStudentDisciplineIncidentAssociations: [Function],
postStudentDisciplineIncidentAssociation: [Function],
getStudentDisciplineIncidentAssociationsById: [Function],
putStudentDisciplineIncidentAssociation: [Function],
deleteStudentDisciplineIncidentAssociationById: [Function] },
studentEducationOrganizationAssociations:
{ getStudentEducationOrganizationAssociations: [Function],
postStudentEducationOrganizationAssociation: [Function],
getStudentEducationOrganizationAssociationsById: [Function],
putStudentEducationOrganizationAssociation: [Function],
deleteStudentEducationOrganizationAssociationById: [Function] },
studentEducationOrganizationResponsibilityAssociations:
{ getStudentEducationOrganizationResponsibilityAssociations: [Function],
postStudentEducationOrganizationResponsibilityAssociation: [Function],
getStudentEducationOrganizationResponsibilityAssociationsById: [Function],
putStudentEducationOrganizationResponsibilityAssociation: [Function],
deleteStudentEducationOrganizationResponsibilityAssociationById: [Function] },
studentGradebookEntries:
{ getStudentGradebookEntries: [Function],
postStudentGradebookEntry: [Function],
getStudentGradebookEntriesById: [Function],
putStudentGradebookEntry: [Function],
deleteStudentGradebookEntryById: [Function] },
studentHomelessProgramAssociations:
{ getStudentHomelessProgramAssociations: [Function],
postStudentHomelessProgramAssociation: [Function],
getStudentHomelessProgramAssociationsById: [Function],
putStudentHomelessProgramAssociation: [Function],
deleteStudentHomelessProgramAssociationById: [Function] },
studentInterventionAssociations:
{ getStudentInterventionAssociations: [Function],
postStudentInterventionAssociation: [Function],
getStudentInterventionAssociationsById: [Function],
putStudentInterventionAssociation: [Function],
deleteStudentInterventionAssociationById: [Function] },
studentInterventionAttendanceEvents:
{ getStudentInterventionAttendanceEvents: [Function],
postStudentInterventionAttendanceEvent: [Function],
getStudentInterventionAttendanceEventsById: [Function],
putStudentInterventionAttendanceEvent: [Function],
deleteStudentInterventionAttendanceEventById: [Function] },
studentLanguageInstructionProgramAssociations:
{ getStudentLanguageInstructionProgramAssociations: [Function],
postStudentLanguageInstructionProgramAssociation: [Function],
getStudentLanguageInstructionProgramAssociationsById: [Function],
putStudentLanguageInstructionProgramAssociation: [Function],
deleteStudentLanguageInstructionProgramAssociationById: [Function] },
studentLearningObjectives:
{ getStudentLearningObjectives: [Function],
postStudentLearningObjective: [Function],
getStudentLearningObjectivesById: [Function],
putStudentLearningObjective: [Function],
deleteStudentLearningObjectiveById: [Function] },
studentMigrantEducationProgramAssociations:
{ getStudentMigrantEducationProgramAssociations: [Function],
postStudentMigrantEducationProgramAssociation: [Function],
getStudentMigrantEducationProgramAssociationsById: [Function],
putStudentMigrantEducationProgramAssociation: [Function],
deleteStudentMigrantEducationProgramAssociationById: [Function] },
studentNeglectedOrDelinquentProgramAssociations:
{ getStudentNeglectedOrDelinquentProgramAssociations: [Function],
postStudentNeglectedOrDelinquentProgramAssociation: [Function],
getStudentNeglectedOrDelinquentProgramAssociationsById: [Function],
putStudentNeglectedOrDelinquentProgramAssociation: [Function],
deleteStudentNeglectedOrDelinquentProgramAssociationById: [Function] },
studentParentAssociations:
{ getStudentParentAssociations: [Function],
postStudentParentAssociation: [Function],
getStudentParentAssociationsById: [Function],
putStudentParentAssociation: [Function],
deleteStudentParentAssociationById: [Function] },
studentProgramAssociations:
{ getStudentProgramAssociations: [Function],
postStudentProgramAssociation: [Function],
getStudentProgramAssociationsById: [Function],
putStudentProgramAssociation: [Function],
deleteStudentProgramAssociationById: [Function] },
studentProgramAttendanceEvents:
{ getStudentProgramAttendanceEvents: [Function],
postStudentProgramAttendanceEvent: [Function],
getStudentProgramAttendanceEventsById: [Function],
putStudentProgramAttendanceEvent: [Function],
deleteStudentProgramAttendanceEventById: [Function] },
studentSchoolAssociations:
{ getStudentSchoolAssociations: [Function],
postStudentSchoolAssociation: [Function],
getStudentSchoolAssociationsById: [Function],
putStudentSchoolAssociation: [Function],
deleteStudentSchoolAssociationById: [Function] },
studentSchoolAttendanceEvents:
{ getStudentSchoolAttendanceEvents: [Function],
postStudentSchoolAttendanceEvent: [Function],
getStudentSchoolAttendanceEventsById: [Function],
putStudentSchoolAttendanceEvent: [Function],
deleteStudentSchoolAttendanceEventById: [Function] },
studentSchoolFoodServiceProgramAssociations:
{ getStudentSchoolFoodServiceProgramAssociations: [Function],
postStudentSchoolFoodServiceProgramAssociation: [Function],
getStudentSchoolFoodServiceProgramAssociationsById: [Function],
putStudentSchoolFoodServiceProgramAssociation: [Function],
deleteStudentSchoolFoodServiceProgramAssociationById: [Function] },
studentSectionAssociations:
{ getStudentSectionAssociations: [Function],
postStudentSectionAssociation: [Function],
getStudentSectionAssociationsById: [Function],
putStudentSectionAssociation: [Function],
deleteStudentSectionAssociationById: [Function] },
studentSectionAttendanceEvents:
{ getStudentSectionAttendanceEvents: [Function],
postStudentSectionAttendanceEvent: [Function],
getStudentSectionAttendanceEventsById: [Function],
putStudentSectionAttendanceEvent: [Function],
deleteStudentSectionAttendanceEventById: [Function] },
studentSpecialEducationProgramAssociations:
{ getStudentSpecialEducationProgramAssociations: [Function],
postStudentSpecialEducationProgramAssociation: [Function],
getStudentSpecialEducationProgramAssociationsById: [Function],
putStudentSpecialEducationProgramAssociation: [Function],
deleteStudentSpecialEducationProgramAssociationById: [Function] },
studentTitleIPartAProgramAssociations:
{ getStudentTitleIPartAProgramAssociations: [Function],
postStudentTitleIPartAProgramAssociation: [Function],
getStudentTitleIPartAProgramAssociationsById: [Function],
putStudentTitleIPartAProgramAssociation: [Function],
deleteStudentTitleIPartAProgramAssociationById: [Function] }