### Install StudentVUE.js via npm Source: https://jwmarb.github.io/studentvue.js/index.html Use this command to install the library using the npm package manager. ```bash npm install studentvue ``` -------------------------------- ### Install StudentVUE.js via yarn Source: https://jwmarb.github.io/studentvue.js/index.html Use this command to install the library using the yarn package manager. ```bash yarn add studentvue ``` -------------------------------- ### get() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_File_File.File.html Retrieves a file from Synergy servers and returns it as a base64 object. ```APIDOC ## get() ### Description Retrieves the file from synergy servers. After retrieving the xmlObject, this method calls parseXMLObject which must be defined to parse the xmlObject into a readable, typesafe object. ### Returns - **Promise** - A promise that resolves to a base64 object. ### Example ```javascript const base64 = await document.get(); // { attribute: { nested: {...} }, base64: "base64 code" } ``` ``` -------------------------------- ### get() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_ReportCard_ReportCard.ReportCard.html Retrieves the report card file from Synergy servers. This method fetches the XML object and parses it into a readable, typesafe ReportCardFile object. ```APIDOC ## get() ### Description Retrieves the file from synergy servers. After retrieving the xmlObject, this method calls parseXMLObject which must be defined to parse the xmlObject into a readable, typesafe object. ### Returns - **Promise** - A promise that resolves to a base64 object or undefined. ### Example ```javascript const base64 = await document.get(); // { attribute: { nested: {...} }, base64: "base64 code" } ``` ``` -------------------------------- ### React Component Message Integration Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Message_Message.Message.html Example of using the Message class within a React component to handle user interaction and display read status. ```javascript // In a React project... import React from 'react'; const Message = (props) => { const { message } = props; async function handleOnClick() { await message.markAsRead(); } return ( ) } export default Message; ``` -------------------------------- ### new Client(credentials, hostUrl) Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Initializes a new instance of the StudentVUE Client with the provided credentials and host URL. ```APIDOC ## Constructor: new Client ### Description Initializes a new instance of the Client class to interact with the StudentVUE API. ### Signature `new Client(credentials: LoginCredentials, hostUrl: string): Client` ### Parameters - **credentials** (LoginCredentials) - Required - The login credentials required for authentication. - **hostUrl** (string) - Required - The base URL of the StudentVUE instance. ``` -------------------------------- ### new Icon(path: string, hostUrl: string) Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Icon_Icon.Icon.html Creates a new instance of the Icon class, which represents an icon resource with a specific path and host URL. ```APIDOC ## Constructor ### Description Initializes a new Icon instance with the provided path and host URL. ### Signature `new Icon(path: string, hostUrl: string): Icon` ### Parameters - **path** (string) - The URL path to the icon (e.g., /path/to/icon.png). - **hostUrl** (string) - The host URL (e.g., https://schooldistrict.org/). ``` -------------------------------- ### Authenticate with StudentVUE API Source: https://jwmarb.github.io/studentvue.js/index.html Initialize the client by logging in with the district URL and user credentials. This must be performed before calling other API methods. ```javascript import StudentVue from 'studentvue'; const DISTRICT_URL = 'https://...'; const USERNAME = '...'; const PASSWORD = '...'; const client = await StudentVue.login(DISTRICT_URL, { username: USERNAME, password: PASSWORD }); ``` -------------------------------- ### Document.get() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Document_Document.Document.html Retrieves the document file from Synergy servers as a base64 object. ```APIDOC ## get() ### Description Retrieves the file from synergy servers. After retrieving the xmlObject, this method calls parseXMLObject which must be defined to parse the xmlObject into a readable, typesafe object. ### Returns - **Promise** - Returns a base64 object containing the file data. ### Example ```javascript const base64 = await document.get(); // { attribute: { nested: {...} }, base64: "base64 code" } ``` ``` -------------------------------- ### CalendarOptions Source: https://jwmarb.github.io/studentvue.js/interfaces/StudentVue_Client_Interfaces_Calendar.CalendarOptions.html Configuration options for the Client.calendar() method. ```APIDOC ## CalendarOptions ### Description Options to provide in the `Client.calendar()` method to control how calendar events are fetched. ### Properties #### concurrency (Optional) - **Type**: `null | number` - **Description**: The number of fetches that should occur per asynchronous task. StudentVUE fetches events by month. The default is 7. Setting this to 8 or more will cause a timeout error. #### interval (Optional) - **Type**: `{ start: number | Date, end: number | Date }` - **Description**: The date range interval for the calendar events. - **start**: The start date or timestamp. - **end**: The end date or timestamp. ``` -------------------------------- ### Attachment.get() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Attachment_Attachment.Attachment.html Fetches the attachment content from synergy servers as a base64 encoded string. ```APIDOC ## get() ### Description Fetches the attachment from synergy servers. Returns the file content as a base64 string. ### Returns - **Promise** - A promise that resolves to the base64 string of the attachment. ### Example ```javascript const base64 = await someAttachment.get(); console.log(base64); // -> UEsDBBQABgAIAAAAIQCj77s... ``` ``` -------------------------------- ### Marking Messages as Read Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Message_Message.Message.html Demonstrates how to check the read status of messages and mark them as read using the markAsRead method. ```javascript const messages = await client.messages(); messages.every((msg) => msg.isRead()) // -> false messages.forEach(async (msg) => !msg.isRead() && await msg.markAsRead()); messages.every((msg) => msg.isRead()) // -> true const refetchedMessages = await client.messages(); // See if it updated on the server messages.every((msg) => msg.isRead()) // -> true ``` -------------------------------- ### Fetch Student Information Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves basic student profile information. ```javascript studentInfo().then(console.log) // -> { student: { name: 'Evan Davis', nickname: '', lastName: 'Davis' }, ...} ``` -------------------------------- ### asyncPoolAll(poolLimit, array, iteratorFn) Source: https://jwmarb.github.io/studentvue.js/functions/StudentVue_Client_Client_helpers.asyncPoolAll.html Executes an array of tasks with a controlled concurrency limit, returning the results of each promise. ```APIDOC ## asyncPoolAll(poolLimit, array, iteratorFn) ### Description Use concurrency limits to fulfill promises. This function processes an array of items using an iterator function while ensuring no more than `poolLimit` promises are active at once. ### Parameters - **poolLimit** (number) - The concurrency limit. - **array** (readonly IN[]) - An array of items to process. - **iteratorFn** ((generator: IN) => Promise) - A map function that returns a promise for each item. ### Returns - **Promise[]>** - A promise that resolves to an array containing the results of each operation. ``` -------------------------------- ### Fetch School Information Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves school information, including staff details. ```javascript await client.schoolInfo(); client.schoolInfo().then((schoolInfo) => { console.log(_.uniq(schoolInfo.staff.map((staff) => staff.name))); // List all staff positions using lodash }) ``` -------------------------------- ### login(districtUrl: string, credentials: UserCredentials) Source: https://jwmarb.github.io/studentvue.js/functions/StudentVue_StudentVue.login.html Authenticates the user against the StudentVUE API for a specific district. ```APIDOC ## login(districtUrl: string, credentials: UserCredentials) ### Description Logs the user into the StudentVUE API. Returns a promise that resolves to a Client instance containing student information upon successful authentication. ### Parameters - **districtUrl** (string) - Required - The URL of the district, which can be retrieved using the findDistricts() method. - **credentials** (UserCredentials) - Required - The user credentials of the student. ### Returns - **Promise** - A promise that resolves to the client and student information. ``` -------------------------------- ### login Source: https://jwmarb.github.io/studentvue.js/modules/StudentVue_StudentVue.html Function to authenticate a user session with the StudentVUE system. ```APIDOC ## login ### Description Authenticates the user against the StudentVUE service. ### Signature login() ``` -------------------------------- ### Fetch Student Documents Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves a list of documents and maps them to base64 collections. ```javascript const documents = await client.documents(); const document = documents[0]; const files = await document.get(); const base64collection = files.map((file) => file.base64); ``` -------------------------------- ### documents() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves a list of the student's documents from the server. ```APIDOC ## documents() ### Description Gets the student's documents from synergy servers. ### Returns - **Promise** - A list of student documents. ``` -------------------------------- ### Fetch Student Schedule Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves the student's schedule for a specific term index. ```javascript await schedule(0) // -> { term: { index: 0, name: '1st Qtr Progress' }, ... } ``` -------------------------------- ### calendar(options) Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves the student's calendar events based on provided options. ```APIDOC ## calendar(options) ### Description Returns a Calendar object containing school dates and events. ### Parameters - **options** (CalendarOptions) - Optional - Configuration options for the calendar, including an interval (required). ``` -------------------------------- ### Login to StudentVUE Source: https://jwmarb.github.io/studentvue.js/pages/getting-started.html Authenticate the client using the school district name and user credentials. ```javascript const client = await StudentVue.login(mySchoolDistrict.name, { username: 'USERNAME', password: 'PASSWORD', }); ``` -------------------------------- ### Retrieve Document File Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Document_Document.Document.html Fetches the document file from the server and returns a base64 encoded object. ```typescript const base64 = await document.get(); // { attribute: { nested: {...} }, base64: "base64 code" } ``` -------------------------------- ### Fetch Calendar Events Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves calendar events based on provided interval options. ```javascript client.calendar({ interval: { start: new Date('5/1/2022'), end: new Date('8/1/2021') }, concurrency: null }); // -> Limitless concurrency (not recommended) const calendar = await client.calendar({ interval: { ... }}); console.log(calendar); // -> { schoolDate: {...}, outputRange: {...}, events: [...] } ``` -------------------------------- ### studentInfo() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves the student's personal information. ```APIDOC ## studentInfo() ### Description Gets the info of a student. ``` -------------------------------- ### uri Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Icon_Icon.Icon.html A readonly property representing the full URI of the icon. ```APIDOC ## Property: uri ### Description Returns the full URI string for the icon. ### Type `string` (Readonly) ``` -------------------------------- ### processAnonymousRequest(url, options, preparse) Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_ReportCard_ReportCard.ReportCard.html A static method to perform an anonymous request to a specified URL, with optional request configuration and XML parsing logic. ```APIDOC ## processAnonymousRequest(url, options, preparse) ### Description Performs an anonymous request to the provided URL and returns the parsed result. ### Parameters - **url** (string) - The target URL for the request. - **options** (Partial) - Optional request configuration. - **preparse** ((xml: string) => string) - Optional function to pre-process the XML string before parsing. ### Returns - **Promise** - A promise that resolves to the requested type T. ``` -------------------------------- ### Find school district Source: https://jwmarb.github.io/studentvue.js/pages/getting-started.html Search for school districts by zipcode and filter by name to identify the correct district. ```javascript import StudentVue from 'studentvue'; const schools = await StudentVue.findDistricts('zipcode'); const mySchoolDistrict = schools.find((school) => school.name.includes('my school name')); ``` -------------------------------- ### findDistricts(zipCode: string) Source: https://jwmarb.github.io/studentvue.js/functions/StudentVue_StudentVue.findDistricts.html Finds school districts using a provided zipcode. ```APIDOC ## findDistricts(zipCode: string) ### Description Finds school districts using a zipcode. The returned list of school districts can be used to authenticate with the API. ### Signature `findDistricts(zipCode: string): Promise` ### Parameters - **zipCode** (string) - The zipcode to get a list of schools from. ### Returns - **Promise** - A promise that resolves to a list of school districts. ``` -------------------------------- ### messages() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves a list of messages for the student. ```APIDOC ## messages() ### Description Get a list of messages of the student. ### Returns - **Promise** - An array of messages. ``` -------------------------------- ### attendance() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves the attendance records for the student. ```APIDOC ## attendance() ### Description Returns the attendance of the student. ### Returns - **Promise** - An Attendance object containing school name, absences, and period information. ``` -------------------------------- ### Fetch Student Attendance Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves the student's attendance records as a promise. ```javascript client.attendance() .then(console.log); // -> { type: 'Period', period: {...}, schoolName: 'University High School', absences: [...], periodInfos: [...] } ``` -------------------------------- ### Retrieve Attachment Content Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Attachment_Attachment.Attachment.html Fetches the attachment as a base64 encoded string from the server. ```typescript const base64 = await someAttachment.get(); console.log(base64) // -> UEsDBBQABgAIAAAAIQCj77s... ``` -------------------------------- ### schoolInfo() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves information about the student's school. ```APIDOC ## schoolInfo() ### Description Gets the student's school's information. ``` -------------------------------- ### markAsRead() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Message_Message.Message.html Marks the current message as read on the server. ```APIDOC ## markAsRead() ### Description Marks the message as read. ### Returns - **Promise** - Returns a promise that resolves to true when the operation is complete. ``` -------------------------------- ### validateCredentials() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Validates the user's credentials. ```APIDOC ## validateCredentials() ### Description Validate's the user's credentials. It will throw an error if credentials are incorrect. ``` -------------------------------- ### Configure Calendar Concurrency Source: https://jwmarb.github.io/studentvue.js/interfaces/StudentVue_Client_Interfaces_Calendar.CalendarOptions.html Sets the number of months fetched per asynchronous task. Values of 8 or higher will trigger a timeout error. ```javascript // { concurrency: 1 } ``` ```javascript // { concurrency: 7 } -> this is the default ``` -------------------------------- ### Document.processAnonymousRequest() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Document_Document.Document.html A static method to process anonymous requests to the server. ```APIDOC ## processAnonymousRequest(url, options, preparse) ### Description Processes an anonymous request to a specified URL. ### Parameters - **url** (string) - The target URL. - **options** (Partial) - Optional request configuration. - **preparse** ((xml: string) => string) - Optional function to parse the XML response. ### Returns - **Promise** - The processed response. ``` -------------------------------- ### Fetch Report Cards Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves report cards and maps their contents to base64 arrays. ```javascript const reportCards = await client.reportCards(); const files = await Promise.all(reportCards.map((card) => card.get())); const base64arr = files.map((file) => file.base64); // ["JVBERi0...", "dUIoa1...", ...]; ``` -------------------------------- ### schedule(termIndex) Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves the student's schedule for a specific term. ```APIDOC ## schedule(termIndex) ### Description Gets the schedule of the student. ### Parameters - **termIndex** (number) - Optional - The index of the term. ``` -------------------------------- ### Fetch Gradebook Data Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves gradebook information, optionally filtered by reporting period index. ```javascript const gradebook = await client.gradebook(); console.log(gradebook); // { error: '', type: 'Traditional', reportingPeriod: {...}, courses: [...] }; await client.gradebook(0) // Some schools will have ReportingPeriodIndex 0 as "1st Quarter Progress" await client.gradebook(7) // Some schools will have ReportingPeriodIndex 7 as "4th Quarter" ``` -------------------------------- ### Fetch Student Messages Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves a list of messages associated with the student account. ```javascript await client.messages(); // -> [{ id: 'E972F1BC-99A0-4CD0-8D15-B18968B43E08', type: 'StudentActivity', ... }, { id: '86FDA11D-42C7-4249-B003-94B15EB2C8D4', type: 'StudentActivity', ... }] ``` -------------------------------- ### reportCards() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves a list of report cards. ```APIDOC ## reportCards() ### Description Gets a list of report cards that can fetch a file. ``` -------------------------------- ### gradebook(reportingPeriodIndex) Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Client_Client.Client.html Retrieves the student's gradebook for a specific reporting period. ```APIDOC ## gradebook(reportingPeriodIndex) ### Description Returns the gradebook of the student. ### Parameters - **reportingPeriodIndex** (number) - Optional - The timeframe index that the gradebook should return. ``` -------------------------------- ### Attachment.processAnonymousRequest() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Attachment_Attachment.Attachment.html A static method to process anonymous requests to the server. ```APIDOC ## processAnonymousRequest(url, options, preparse) ### Description Processes an anonymous request to a specified URL. ### Parameters - **url** (string) - The target URL. - **options** (Partial) - Optional request configuration. - **preparse** ((xml: string) => string) - Optional function to parse the XML response. ### Returns - **Promise** - A promise resolving to the requested type. ``` -------------------------------- ### findDistricts Source: https://jwmarb.github.io/studentvue.js/modules/StudentVue_StudentVue.html Function to search for school districts within the StudentVUE system. ```APIDOC ## findDistricts ### Description Searches for available school districts. ### Signature findDistricts() ``` -------------------------------- ### processAnonymousRequest Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_File_File.File.html A static method to process anonymous requests to the server. ```APIDOC ## processAnonymousRequest(url, options, preparse) ### Description Processes an anonymous request to a specified URL with optional request configurations and a custom XML preparser. ### Parameters - **url** (string) - Required - The target URL. - **options** (Partial) - Optional - Request configuration options. - **preparse** ((xml: string) => string) - Optional - A function to pre-process the XML string before parsing. ### Returns - **Promise** - A promise that resolves to the processed result. ``` -------------------------------- ### isRead() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Message_Message.Message.html Checks if the current message has been marked as read. ```APIDOC ## isRead() ### Description Check if a message has been read. ### Returns - **boolean** - Returns true if the message has been previously read, false otherwise. ``` -------------------------------- ### optional(xmlArr?: T[]): T | undefined Source: https://jwmarb.github.io/studentvue.js/functions/StudentVue_Client_Client_helpers.optional.html A utility function that acts as a simplified single-line if-else statement to handle potentially undefined or empty XML-parsed arrays. ```APIDOC ## optional(xmlArr?: T[]): T | undefined ### Description A short and simplified version of the single-line if-else statement used to process values parsed from the XML parser library. ### Parameters - **xmlArr** (T[]) - Optional - The input value parsed from the XML parser library, expected as an array. ### Returns - **T | undefined** - Returns the first value of the XML array if present, otherwise returns undefined. ``` -------------------------------- ### isDeletable() Source: https://jwmarb.github.io/studentvue.js/classes/StudentVue_Message_Message.Message.html Checks if the current message is eligible to be deleted. ```APIDOC ## isDeletable() ### Description Checks if a message is deletable. ### Returns - **boolean** - Returns true if the message can be deleted, false otherwise. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.