diff options
author | Minteck <contact@minteck.org> | 2023-01-10 14:54:04 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-01-10 14:54:04 +0100 |
commit | 99c1d9af689e5325f3cf535c4007b3aeb8325229 (patch) | |
tree | e663b3c2ebdbd67c818ac0c5147f0ce1d2463cda /alarm/node_modules/pronote-api | |
parent | 9871b03912fc28ad38b4037ebf26a78aa937baba (diff) | |
download | pluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.tar.gz pluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.tar.bz2 pluralconnect-99c1d9af689e5325f3cf535c4007b3aeb8325229.zip |
Update - This is an automated commit
Diffstat (limited to 'alarm/node_modules/pronote-api')
151 files changed, 0 insertions, 13234 deletions
diff --git a/alarm/node_modules/pronote-api/LICENSE b/alarm/node_modules/pronote-api/LICENSE deleted file mode 100644 index 4824ff2..0000000 --- a/alarm/node_modules/pronote-api/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2018-2020 Adrien 'Litarvan' Navratil - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/alarm/node_modules/pronote-api/README.md b/alarm/node_modules/pronote-api/README.md deleted file mode 100644 index 94ac860..0000000 --- a/alarm/node_modules/pronote-api/README.md +++ /dev/null @@ -1,204 +0,0 @@ -# Pronote API - LISEZ MOI ABSOLUMENT - -![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/Litarvan/pronote-api/Node.js%20linting%20and%20testing/master?label=tests&logo=github&style=flat-square) -[![MIT license](https://img.shields.io/badge/license-MIT-lightgray?style=flat-square)](LICENSE) -[![Latest release](https://img.shields.io/github/v/release/Litarvan/pronote-api?color=darkgreen&include_prereleases&label=Latest%20release&style=flat-square)](https://github.com/Litarvan/pronote-api/releases) -[![NPM release](https://img.shields.io/npm/v/pronote-api?style=flat-square)](https://npmjs.org/package/pronote-api) - -API Pronote **2020/2021** complète et plutôt stable avec intégration de nombreux CAS (connexion avec comptes spéciaux pour les régions). - -Disponible en tant que : -- Librairie Node.JS [via NPM](https://www.npmjs.com/package/pronote-api) (note : **support TypeScript** complet) -- Serveur GraphQL (donc depuis **n'importe que langage**), [voir instructions](#serveur-graphql) - -**Nouveauté 2020/2021 : [Session conservable](#conserver-la-session)** - -## Données récupérables - -- Infos Pronote, établissement et utilisateur -- Emploi du temps -- Devoirs -- Notes -- Compétences/évaluations -- Absences/punitions/retenues -- Informations -- Menu de la cantine -- Fichiers - -À chaque fois, il est possible de choisir quelle période voire quelle intervalle de jours récupérer précisément. - -## Comptes région supportés - -**Uniquement dans le cas où vous ne pouvez PAS vous connecter directement par Pronote, mais devez passer par une interface régionale spéciale** - -**Si vous pouvez vous connecter directement sur l'interface de Pronote, l'API devrait fonctionner PEU IMPORTE VOTRE ACADÉMIE** - -Sinon, l'API propose de se connecter à Pronote avec des comptes des académies suivantes : - -<details> - <summary>CAS list</summary> - - - Académie d'Orleans-Tours (CAS : ac-orleans-tours, URL : "ent.netocentre.fr") - - Académie de Besançon (CAS : ac-besancon, URL : "cas.eclat-bfc.fr") - - Académie de Bordeaux (CAS : ac-bordeaux, URL : "mon.lyceeconnecte.fr") - - Académie de Bordeaux 2 (CAS : ac-bordeaux2, URL : "ent2d.ac-bordeaux.fr") - - Académie de Caen (CAS : ac-caen, URL : "fip.itslearning.com") - - Académie de Clermont-Ferrand (CAS : ac-clermont, URL : "cas.ent.auvergnerhonealpes.fr") - - Académie de Dijon (CAS : ac-dijon, URL : "cas.eclat-bfc.fr") - - Académie de Grenoble (CAS : ac-grenoble, URL : "cas.ent.auvergnerhonealpes.fr") - - Académie de la Loire (CAS : cybercolleges42, URL : "cas.cybercolleges42.fr") - - Académie de Lille (CAS : ac-lille, URL : "cas.savoirsnumeriques62.fr") - - Académie de Lille (CAS : ac-lille2, URL : "teleservices.ac-lille.fr") - - Académie de Limoges (CAS : ac-limoges, URL : "mon.lyceeconnecte.fr") - - Académie de Lyon (CAS : ac-lyon, URL : "cas.ent.auvergnerhonealpes.fr) - - Académie de Marseille (CAS : atrium-sud, URL : "atrium-sud.fr") - - Académie de Montpellier (CAS : ac-montpellier, URL : "cas.mon-ent-occitanie.fr") - - Académie de Nancy-Metz (CAS : ac-nancy-metz, URL : "cas.monbureaunumerique.fr") - - Académie de Nantes (CAS : ac-nantes, URL : "cas3.e-lyco.fr") - - Académie de Poitiers (CAS : ac-poitiers, URL : "mon.lyceeconnecte.fr") - - Académie de Reims (CAS : ac-reims, URL : "cas.monbureaunumerique.fr") - - Académie de Rouen (Arsene76) (CAS : arsene76, URL : "cas.arsene76.fr") - - Académie de Rouen (CAS : ac-rouen, URL : "nero.l-educdenormandie.fr") - - Académie de Strasbourg (CAS : ac-strasbourg, URL : "cas.monbureaunumerique.fr") - - Académie de Toulouse (CAS : ac-toulouse, URL : "cas.mon-ent-occitanie.fr") - - Académie du Val-d'Oise (CAS : ac-valdoise, URL : "cas.moncollege.valdoise.fr") - - ENT "Agora 06" (Nice) (CAS : agora06, URL : "cas.agora06.fr") - - ENT "Haute-Garonne" (CAS : haute-garonne, URL : "cas.ecollege.haute-garonne.fr") - - ENT "Hauts-de-France" (CAS : hdf, URL : "enthdf.fr") - - ENT "La Classe" (Lyon) (CAS : laclasse, URL : "www.laclasse.com") - - ENT "Lycee Connecte" (Nouvelle-Aquitaine) (CAS : lyceeconnecte, URL : "mon.lyceeconnecte.fr") - - ENT "Seine-et-Marne" (CAS : seine-et-marne, URL : "ent77.seine-et-marne.fr") - - ENT "Somme" (CAS : somme, URL : "college.entsomme.fr") - - ENT "Portail Famille" (Orleans Tours) (CAS : portail-famille, URL : "seshat.ac-orleans-tours.fr:8443") - - ENT "Toutatice" (Rennes) (CAS : toutatice, URL : "www.toutatice.fr") - - ENT "Île de France" (CAS : iledefrance, URL : "ent.iledefrance.fr") - - ENT "Mon collège Essonne" (CAS : moncollege-essonne, URL : "www.moncollege-ent.essonne.fr") - - ENT "Paris Classe Numerique" (CAS : parisclassenumerique, URL : "ent.parisclassenumerique.fr") - - ENT "Lycee Jean Renoir Munich" (CAS : ljr-munich, URL : "cas.kosmoseducation.com") - - ENT "L'Eure en Normandie" (CAS : eure-normandie, URL : "cas.ent27.fr") - - ENT "Mon Bureau Numérique" via EduConnect (CAS: monbureaunumerique-educonnect, URL: "cas.monbureaunumerique.fr") -</details> - - -## Utilisation - -### Librairie - -``` -$ npm i --save pronote-api -``` - -```javascript -const pronote = require('pronote-api'); - -// Exemple -const url = 'https://demo.index-education.net/pronote/'; -const username = 'demonstration'; -const password = 'pronotevs'; - -async function main() -{ - const session = await pronote.login(url, username, password/*, cas*/); - - console.log(session.user.name); // Affiche le nom de l'élève - console.log(session.user.studentClass.name); // Affiche la classe de l'élève - - const timetable = await session.timetable(); // Récupérer l'emploi du temps d'aujourd'hui - const marks = await session.marks(); // Récupérer les notes du trimestre - - console.log(`L'élève a ${timetable.length} cours aujourd'hui`); - console.log(`et a pour l'instant une moyenne de ${marks.averages.student} ce trimestre.`); - - // etc. les fonctions utilisables sont 'timetable', 'marks', 'contents', 'evaluations', 'absences', - // 'homeworks', 'infos', et 'menu', sans oublier les champs 'user' et 'params' qui regorgent d'informations. -} - -main().catch(err => { - if (err.code === pronote.errors.WRONG_CREDENTIALS.code) { - console.error('Mauvais identifiants'); - } else { - console.error(err); - } -}); -``` - -#### TypeScript - -```typescript -import { login } from 'pronote-api'; - -async function main() -{ - const session = await login(url, username, password/*, cas*/); - // ... Voir l'exemple JavaScript -} -``` - -### Serveur GraphQL - -``` -$ npm i -g pronote-api -$ pronote-api-server -``` - -**Note : Toutes les requêtes nécessitent la présence du header `Content-Type: application/json`** - -Pour commencer, il faut se connecter avec une requête `POST` sur `/auth/login` contenant : -```json -{ - "url": "URL de l'instance Pronote", - "username": "Nom d'utilisateur", - "password": "Mot de passe", - "cas": "CAS (facultatif)" -} -``` - -Le serveur renverra alors une réponse de cette forme : -```json -{ - "token": "UN TOKEN DE SESSION" -} -``` - -Retenez le Token, et vous pourrez appeler `POST /auth/logout` et `POST /graphql` **avec en Header `Token: LETOKEN`**, -pour cette dernière le contenu doit être un JSON avec un field `query` contenant votre requête GraphQL. - -Exemple, pour récupérer les salles des cours du Mercredi 2 Septembre : -```graphql -{ - timetable(from: "2020-09-02") { - room - } -} -``` -Le schéma parent des requêtes et mutations se trouve [à cet endroit](https://github.com/Litarvan/pronote-api/blob/master/src/server/schemas/parent.graphql) - -Le schéma élèves des requêtes et mutations se trouve [à cet endroit](https://github.com/Litarvan/pronote-api/blob/master/src/server/schemas/student.graphql) - -Le schéma commun des requêtes et mutations se trouve [à cet endroit](https://github.com/Litarvan/pronote-api/blob/master/src/server/schemas/common.graphql) - -### Au secours je n'arrive pas à m'y connecter - -Par défaut le serveur est ouvert sur `127.0.0.1`, vous ne pouvez donc vous y connecter que depuis la même machine -et avec cette adresse. Pour le lancer le serveur sur une autre adresse ou un autre port, utilisez -`pronote-api-server PORT HOST` - -**ATTENTION : Il n'est pas prévu et probablement peu sécurisé d'ouvrir le serveur sur l'extérieur** - -## Conserver la session - -Une des nouvelles fonctionnalités de l'API est le fait de pouvoir garder la session envie indéfiniment. -Il suffit pour ça d'utiliser la fonction `session.setKeepAlive(true);` (ou la mutation `mutation { setKeepAlive(enabled: true) }`). - -**ATTENTION : Les sessions dureront à l'infini tant que `session.setKeepAlive(false);` ne sera pas appelé ou le programme arrêté -(dans le cas du serveur, `mutation { setKeepAlive(enabled: false) }` appelé, `/auth/logout` exécuté ou le serveur arrêté).** - -## API bas niveau - -Il est très possible que quelque chose dont vous ayez besoin ne soit pas renvoyé par l'API, pas de panique. L'API bas -niveau permet d'accéder à tout : Les fonctions 'fetch' exportées (fetchHomeworks, fetchTimetable, etc.) permettent -de récupérer la réponse complète de Pronote simplement traduite sans traitement supplémentaire. - -Si jamais une requête dont vous avez besoin n'est pas exportée, vous pouvez utiliser la fonction 'request' qui permet -de faire facilement une requête à Pronote. Et si vous voulez outrepasser/modifier la partie authentification, vous -pouvez manuellement créer une session. diff --git a/alarm/node_modules/pronote-api/bin/fetch.js b/alarm/node_modules/pronote-api/bin/fetch.js deleted file mode 100755 index d9e88e7..0000000 --- a/alarm/node_modules/pronote-api/bin/fetch.js +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env node - -/* eslint no-console: off */ - -const fs = require('fs').promises; -const pronote = require('..'); - -if (process.argv.length < 5) { - console.log('Syntax: pronote-fetch <URL> <username> <password> [cas(ex: none)] [AccountType (ex: Student)]'); - return; -} - -const [,, url, username, password, cas = 'none', accountType] = process.argv; - -async function fetch() -{ - let result; - switch (accountType) - { - case 'parent': - result = await parent(); - break; - default: - result = await student(); - break; - } - - await fs.writeFile('result.json', JSON.stringify(result, null, 4)); - - console.log('Wrote \'result.json\''); -} - -async function student() -{ - const session = await pronote.login(url, username, password, cas); - console.log(`Logged as student '${session.user.name}' (${session.user.studentClass.name})`); - - const { from, to } = getFetchDate(session); - - const timetable = await session.timetable(from, to); - const marks = await session.marks(); - const evaluations = await session.evaluations(); - const absences = await session.absences(); - const infos = await session.infos(); - const contents = await session.contents(from, to); - const homeworks = await session.homeworks(from, to); - const menu = await session.menu(from, to); - const files = await session.files(); - - return { - name: session.user.name, - studentClass: session.user.studentClass.name, - avatar: session.user.avatar, - - timetable, marks, evaluations, absences, - infos, contents, homeworks, menu, files - }; -} - -async function parent() -{ - const session = await pronote.loginParent(url, username, password, cas); - console.log(`Logged as parent '${session.user.name}' (${session.user.students.length} students)`); - - const { from, to } = getFetchDate(session); - - const students = []; - for (const student of session.user.students) { - console.log(`Fetching data of user '${student.name}' (${student.studentClass.name})`); - - const timetable = await session.timetable(student, from, to); - const marks = await session.marks(student); - const evaluations = await session.evaluations(student); - const absences = await session.absences(student); - const infos = await session.infos(student); - const contents = await session.contents(student, from, to); - const homeworks = await session.homeworks(student, from, to); - const menu = await session.menu(student, from, to); - const files = await session.files(student); - - students.push({ - name: student.name, - studentClass: student.studentClass.name, - avatar: student.avatar, - - timetable, marks, evaluations, absences, - infos, contents, homeworks, menu, files - }); - } - - return { - name: session.user.name, - students - }; -} - -function getFetchDate(session) -{ - let from = new Date(); - if (from < session.params.firstDay) { - from = session.params.firstDay; - } - - const to = new Date(from.getTime()); - to.setDate(to.getDate() + 15); - - return { from, to }; -} - -fetch().catch(err => { - if (err.code === pronote.errors.WRONG_CREDENTIALS.code) { - return console.error('Invalid credentials, did you chose the right CAS ?'); - } - - if (err.code !== undefined) { - console.error(`ERROR: [${err.code}] ${err.message}`); - } else { - console.error(err); - } -}); diff --git a/alarm/node_modules/pronote-api/bin/server.js b/alarm/node_modules/pronote-api/bin/server.js deleted file mode 100755 index c5d3c5d..0000000 --- a/alarm/node_modules/pronote-api/bin/server.js +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env node - -/* eslint no-console: off */ - -const server = require('../src/server'); - -if (process.argv.length === 2 && process.argv[1] === '--help') { - console.log('Syntax: pronote-api-server [port (default: 21727)] [host (default: 0.0.0.0)]'); - return; -} - -const [,, port = '21727', host = '127.0.0.1'] = process.argv; - -server(host, port).then(() => { - console.log(`--> Listening on ${host}:${port}`); -}).catch(err => { - console.error('Error during server start'); - console.error(err); -}); diff --git a/alarm/node_modules/pronote-api/bin/test.js b/alarm/node_modules/pronote-api/bin/test.js deleted file mode 100644 index 22b43bf..0000000 --- a/alarm/node_modules/pronote-api/bin/test.js +++ /dev/null @@ -1,13 +0,0 @@ -const { fork } = require('child_process'); -const { join } = require('path'); - -const DEMO_URL = 'https://demo.index-education.net/pronote/'; -const DEMO_USERNAME = 'demonstration'; -const DEMO_PASSWORD = 'pronotevs'; - -function test(type) -{ - fork(join(__dirname, 'fetch.js'), [DEMO_URL, DEMO_USERNAME, DEMO_PASSWORD, 'none', type], { stdio: 'inherit' }); -} - -['student', 'parent'].forEach(test); diff --git a/alarm/node_modules/pronote-api/index.d.ts b/alarm/node_modules/pronote-api/index.d.ts deleted file mode 100644 index a373cfa..0000000 --- a/alarm/node_modules/pronote-api/index.d.ts +++ /dev/null @@ -1,2086 +0,0 @@ -import * as forge from 'node-forge'; - -// High-level API - -/** - * Une session Pronote - * - * Peut être ouverte via les fonctions {@link login}, ou {@link loginParent}. - * Ouverte par l'une de ces fonctions, le champ {@link params} est garanti d'être rempli. - * - * La session dure quelques dizaines de minutes, sauf si {@link setKeepAlive}(true) est appelé, - * elle dure alors indéfiniment jusqu'à que {@link setKeepAlive}(false) soit appelé ou le - * programme fermé. - */ -export abstract class PronoteSession -{ - /** - * Créé une nouvelle session. - * - * Ce constructeur doit normalement être appelé par {@link login} plutôt que manuellement, sauf si - * vous savez ce que vous faites. - * - * @param options Les options d'instanciation - */ - constructor(options: PronoteSessionOptions) - - /** - * ID unique de la session donné par Pronote, sous la forme d'une suite de 7 chiffres. - */ - id: number - - /** - * URL de l'instance Pronote depuis laquelle la session a été ouverte. - * Exemple : 'https://demo.index-education.net/pronote/' - */ - server: string - - /** - * Type du compte de la session, défini automatiquement par le constructeur - */ - type: PronoteAccountType - - - /** - * ID de la dernière requête effectuée, augmenté de 2 avant chaque requête. -1 signifiant qu'aucune requête - * n'a été encore envoyée, car 1 sera le premier ID. - */ - request: number - - /** - * Si la session est gardée en vie en permanence ou non. Désactivé par défaut, cette valeur mise à jour - * lors de l'utilisation de {@link setKeepAlive}. - */ - isKeptAlive: boolean - - - /** - * La clé AES utilisée pour le chiffrement. Elle est assignée lors du processus d'authentification - * à la clé donnée par Pronote dans la réponse de la requête 'Authentification', et est utilisée ensuite - * pour toutes les opérations de chiffrement (sauf si une autre clé est donnée dans des cas particuliers). - */ - aesKey?: forge.util.ByteBuffer - - /** - * Vecteur d'initialisation (VI, donc IV en anglais) de chiffrement, généré aléatoirement par la fonction - * {@link login} lors de la création d'une session, et utilisé dans toutes les opérations de chiffrement. - */ - aesIV: forge.util.ByteBuffer - - /** - * Clé publique de l'instance Pronote depuis laquelle la session a été ouverte, construite à partir de - * l'exposant et du modulo donné par Pronote directement dans la page. - */ - publicKey: forge.pki.Key - - - /** - * Si les requêtes doivent être chiffrées ou non. Ce paramètre est activé si l'instance Pronote est en HTTPS. - */ - disableAES: boolean - - /** - * Si les requêtes doivent être compressées ou non. Ce paramètre est visiblement activé avec {@link disableAES}. - */ - disableCompress: boolean - - - /** - * Paramètres de l'instance depuis laquelle la session a été ouverte, correspond au résultat de la requête - * 'FonctionParametres' qui est la première requête envoyée à Pronote. - */ - params?: PronoteParams - - - /** - * Envoi une requête de présence à Pronote, remettant à zero la durée de vie de la session - */ - keepAlive(): Promise<void> - - /* - * Déconnecte la session de Pronote. Après l'appel de cette fonction, toute requête à Pronote sera - * refusée par ce dernier. - */ - logout(): Promise<void> - - /** - * Active le maintien en vie de la session. Dès que ce paramètre est défini à `true`, l'API enverra - * des requêtes de présence à Pronote à l'intervalle défini. Tant que ce paramètre n'est pas défini à `false` - * le programme fermé, ou une erreur renvoyée, les requêtes continueront d'être envoyées et la session - * sera maintenue indéfiniment. - * - * @param enabled Si oui ou non le maintien de la session doit être activé - * @param onError Une action à effectuer en cas d'erreur. Dans tous les cas, une erreur arrêtera le maintien. - * @param rate L'intervalle auquel envoyer les requêtes, par défaut 2 minutes (le même que Pronote). - */ - setKeepAlive(enabled: boolean, onError?: (error: any) => void, rate?: number); -} - -/** - * Une session élève - * - * Peut être ouverte par {@link login} ou instanciée manuellement. - * Ouverte par {@link login}, le champ {@link user} est garanti d'être rempli. - */ -export class PronoteStudentSession extends PronoteSession -{ - /** - * Informations de l'utilisateur connecté via la session, correspond au résultat de la requête - * 'ParametresUtilisateur' envoyée après une authentification réussie. - */ - user?: PronoteStudentUser - - - /** - * Récupère les cours situés dans l'intervalle de temps donnée. - * - * Attention : Par défaut, une Date en JavaScript est initialisée à minuit si l'heure n'est pas donnée, - * mettre par exemple en 'to' le Mercredi 2 Septembre, ne renverra donc aucun des cours de ce jour. - * - * Rappelez-vous aussi que le champ du mois dans les dates est décalé de 1 en arrière, et seulement - * ce champ. Pour initialiser une Date au Mercredi 2 Septembre, il faut donc faire `new Date(2020, 8, 2);`. - * - * @param from La date à partir de laquelle récupérer les cours. Par défaut la Date actuelle - * @param to La date jusqu'à laquelle récupérer les cours. Par défaut 'from' + 1 jour - * - * @return La liste des cours situés entre les deux dates données. Si l'onglet de l'emploi du temps n'est pas - * disponible, `null` sera renvoyé. - */ - timetable(from?: Date, to?: Date): Promise<Array<Lesson> | null> - - /** - * Récupère les notes et, si disponibles, les moyennes générales de l'utilisateur et de sa classe, dans - * la période donnée. - * - * @param period La période depuis laquelle récupérer les notes et les moyennes. Par défaut le trimestre - * dans lequel on est, ou le premier si on est hors période. - * - * @return Toutes les notes de cette période par matière, avec les moyennes de ces dernières, et si disponibles, - * les moyennes générales de l'utilisateur et de sa classe. Si l'onglet des notes n'est pas disponible, - * `null` sera renvoyé. - */ - marks(period?: PronotePeriod | String): Promise<Marks | null> - - /** - * Récupère la liste des évaluations ayant eu lieu dans la période donnée. - * - * @param period La période depuis laquelle récupérer les notes et les moyennes. Par défaut le trimestre - * dans lequel on est, ou le premier si on est hors période. - * - * @return Toutes les évaluations de cette période rangée par matière. Si l'onglet des évaluations n'est pas - * disponible, `null` sera renvoyé. - */ - evaluations(period?: PronotePeriod | String): Promise<Array<EvaluationsSubject> | null> - - /** - * Récupère la liste des évènements tels que les absences, punitions, retenues, ou autre. - * - * Il est possible de mettre 'from' et 'to' de sorte à couvrir toute l'année, tant que 'period' est défini à - * `null` ou au premier trimestre. Cela renverra alors bien les évènements de toute l'année. - * - * @param period La période depuis laquelle récupérer les évènements. Par défaut le trimestre dans lequel on - * est, ou le premier si on est hors période. - * @param from À partir de quand récupérer les évènements - * @param to Jusqu'à quand récupérer les évènements - * - * @return La liste des évènements de cette période rangés par types. Si l'onglet des évènements n'est pas - * disponible, `null` sera renvoyé. - */ - absences(period?: PronotePeriod | String, from?: Date, to?: Date): Promise<Absences | null> - - /** - * Récupère la liste de toutes les informations disponibles. - * - * @return La liste des informations. Si l'onglet des informations n'est pas disponible, `null` sera renvoyé. - */ - infos(): Promise<Array<Info> | null> - - /** - * Récupère les contenus des cours situés dans l'intervalle de temps donnée. - * - * Attention : Par défaut, une Date en JavaScript est initialisée à minuit si l'heure n'est pas donnée, - * mettre par exemple en 'to' le Mercredi 2 Septembre, ne renverra le contenu d'aucun des cours de ce jour. - * - * Rappelez-vous aussi que le champ du mois dans les dates est décalé de 1 en arrière, et seulement - * ce champ. Pour initialiser une Date au Mercredi 2 Septembre, il faut donc faire `new Date(2020, 8, 2);`. - * - * @param from La date à partir de laquelle récupérer le contenu des cours. Par défaut la Date actuelle - * @param to La date jusqu'à laquelle récupérer le contenu des cours. Par défaut 'from' + 1 jour - * - * @return La liste des leçons situés entre les deux dates données. Si l'onglet du contenu des cours n'est - * pas disponible, `null` sera renvoyé. - */ - contents(from?: Date, to?: Date): Promise<Array<LessonContent> | null> - - /** - * Récupère les devoirs situés dans l'intervalle de temps donnée. - * - * Attention : Par défaut, une Date en JavaScript est initialisée à minuit si l'heure n'est pas donnée, - * mettre par exemple en 'to' le Mercredi 2 Septembre, ne renverra donc aucun des devoirs de ce jour. - * - * Rappelez-vous aussi que le champ du mois dans les dates est décalé de 1 en arrière, et seulement - * ce champ. Pour initialiser une Date au Mercredi 2 Septembre, il faut donc faire `new Date(2020, 8, 2);`. - * - * @param from La date à partir de laquelle récupérer les devoirs. Par défaut la Date actuelle - * @param to La date jusqu'à laquelle récupérer les devoirs. Par défaut 'from' + 1 jour - * - * @return La liste des devoirs situés entre les deux dates données. Si l'onglet des devoirs n'est pas - * disponible, `null` sera renvoyé. - */ - homeworks(from?: Date, to?: Date): Promise<Array<Homework> | null> - - /** - * Récupère les menus de la cantine des repas situés dans l'intervalle de temps donnée. - * - * Attention : Par défaut, une Date en JavaScript est initialisée à minuit si l'heure n'est pas donnée, - * donc en sachant que les dates renvoyées par Pronote des menus seront aussi fixées à minuit, cela signifie que - * mettre par exemple en 'to' le Mercredi 2 Septembre renverra aussi le menu de ce jour. - * - * Rappelez-vous aussi que le champ du mois dans les dates est décalé de 1 en arrière, et seulement - * ce champ. Pour initialiser une Date au Mercredi 2 Septembre, il faut donc faire `new Date(2020, 8, 2);`. - * - * @param from La date à partir de laquelle récupérer les menus. Par défaut la Date actuelle - * @param to La date jusqu'à laquelle récupérer les menus. Par défaut 'from' + 23 heures - * - * @return La liste des menus des repas situés entre les deux dates données. Si l'onglet du menu n'est pas - * disponible, `null` sera renvoyé. - */ - menu(from?: Date, to?: Date): Promise<Array<MenuDay> | null> - - /** - * Récupère les fichier publiés sur votre pronote depuis le début de l'années - * du plus récent au ancien. - * - * @return La liste des fichier publiés depuis le début de l'année. Si l'onglet des fichiers n'est pas - * disponible, `null` sera renvoyé. - */ - files(): Promise<Array<File> | null> -} - -/** - * Une session parent - * - * Peut être ouverte par {@link login} ou instanciée manuellement. - * Ouverte par {@link login}, le champ {@link user} est garanti d'être rempli. - */ -export class PronoteParentSession extends PronoteSession -{ - /** - * Informations de l'utilisateur connecté via la session, correspond au résultat de la requête - * 'ParametresUtilisateur' envoyée après une authentification réussie. - */ - user?: PronoteParentUser - - - /** - * Récupère les cours d'un élève situé dans l'intervalle de temps donnée. - * - * Attention : Par défaut, une Date en JavaScript est initialisée à minuit si l'heure n'est pas donnée, - * mettre par exemple en 'to' le Mercredi 2 Septembre, ne renverra donc aucun des cours de ce jour. - * - * Rappelez-vous aussi que le champ du mois dans les dates est décalé de 1 en arrière, et seulement - * ce champ. Pour initialiser une Date au Mercredi 2 Septembre, il faut donc faire `new Date(2020, 8, 2);`. - * - * @param student L'élève dont il faut récupérer les cours - * @param from La date à partir de laquelle récupérer les cours. Par défaut la Date actuelle - * @param to La date jusqu'à laquelle récupérer les cours. Par défaut 'from' + 1 jour - * - * @return La liste des cours situés entre les deux dates données. Si l'onglet de l'emploi du temps n'est pas - * disponible, `null` sera renvoyé. - */ - timetable(student: PronoteStudent, from?: Date, to?: Date): Promise<Array<Lesson> | null> - - /** - * Récupère les notes d'un élève et, si disponibles, les moyennes générales de l'élève et de sa classe, dans - * la période donnée. - * - * @param student L'élève dont il faut récupérer les ,ptes - * @param period La période depuis laquelle récupérer les notes et les moyennes. Par défaut le trimestre - * dans lequel on est, ou le premier si on est hors période. - * - * @return Toutes les notes de cette période par matière, avec les moyennes de ces dernières, et si disponibles, - * les moyennes générales de l'utilisateur et de sa classe. Si l'onglet des notes n'est pas disponible, - * `null` sera renvoyé. - */ - marks(student: PronoteStudent, period?: PronotePeriod | String): Promise<Marks | null> - - /** - * Récupère la liste des évaluations d'un élève ayant eu lieu dans la période donnée. - * - * @param student L'élève dont il faut récupérer les évaluations - * @param period La période depuis laquelle récupérer les notes et les moyennes. Par défaut le trimestre - * dans lequel on est, ou le premier si on est hors période. - * - * @return Toutes les évaluations de cette période rangée par matière. Si l'onglet des évaluations n'est pas - * disponible, `null` sera renvoyé. - */ - evaluations(student: PronoteStudent, period?: PronotePeriod | String): Promise<Array<EvaluationsSubject> | null> - - /** - * Récupère la liste des évènements d'un élève tels que les absences, punitions, retenues, ou autre. - * - * Il est possible de mettre 'from' et 'to' de sorte à couvrir toute l'année, tant que 'period' est défini à - * `null` ou au premier trimestre. Cela renverra alors bien les évènements de toute l'année. - * - * @param student L'élève dont il faut récupérer les évènements - * @param period La période depuis laquelle récupérer les évènements. Par défaut le trimestre dans lequel on - * est, ou le premier si on est hors période. - * @param from À partir de quand récupérer les évènements - * @param to Jusqu'à quand récupérer les évènements - * - * @return La liste des évènements de cette période rangés par types. Si l'onglet des évènements n'est pas - * disponible, `null` sera renvoyé. - */ - absences(student: PronoteStudent, period?: PronotePeriod | String, from?: Date, to?: Date): Promise<Absences | null> - - /** - * Récupère la liste de toutes les informations disponibles destinées à un élève. - * - * @param student L'élève dont il faut récupérer les informations - * - * @return La liste des informations. Si l'onglet des informations n'est pas disponible, `null` sera renvoyé. - */ - infos(student: PronoteStudent): Promise<Array<Info> | null> - - /** - * Récupère les contenus des cours d'un élève situés dans l'intervalle de temps donnée. - * - * Attention : Par défaut, une Date en JavaScript est initialisée à minuit si l'heure n'est pas donnée, - * mettre par exemple en 'to' le Mercredi 2 Septembre, ne renverra le contenu d'aucun des cours de ce jour. - * - * Rappelez-vous aussi que le champ du mois dans les dates est décalé de 1 en arrière, et seulement - * ce champ. Pour initialiser une Date au Mercredi 2 Septembre, il faut donc faire `new Date(2020, 8, 2);`. - * - * @param student L'élève dont il faut récupérer le contenu des cours - * @param from La date à partir de laquelle récupérer le contenu des cours. Par défaut la Date actuelle - * @param to La date jusqu'à laquelle récupérer le contenu des cours. Par défaut 'from' + 1 jour - * - * @return La liste des devoirs situés entre les deux dates données. Si l'onglet du contenu des cours n'est - * pas disponible, `null` sera renvoyé. - */ - contents(student: PronoteStudent, from?: Date, to?: Date): Promise<Array<LessonContent> | null> - - /** - * Récupère les devoirs d'un élève situés dans l'intervalle de temps donnée. - * - * Attention : Par défaut, une Date en JavaScript est initialisée à minuit si l'heure n'est pas donnée, - * mettre par exemple en 'to' le Mercredi 2 Septembre, ne renverra donc aucun des devoirs de ce jour. - * - * Rappelez-vous aussi que le champ du mois dans les dates est décalé de 1 en arrière, et seulement - * ce champ. Pour initialiser une Date au Mercredi 2 Septembre, il faut donc faire `new Date(2020, 8, 2);`. - * - * @param student L'élève dont il faut récupérer les devoirs - * @param from La date à partir de laquelle récupérer les devoirs. Par défaut la Date actuelle - * @param to La date jusqu'à laquelle récupérer les devoirs. Par défaut 'from' + 1 jour - * - * @return La liste des devoirs situés entre les deux dates données. Si l'onglet des devoirs n'est pas - * disponible, `null` sera renvoyé. - */ - homeworks(student: PronoteStudent, from?: Date, to?: Date): Promise<Array<Homework> | null> - - /** - * Récupère les menus de la cantine d'un élève des repas situés dans l'intervalle de temps donnée. - * - * Attention : Par défaut, une Date en JavaScript est initialisée à minuit si l'heure n'est pas donnée, - * donc en sachant que les dates renvoyées par Pronote des menus seront aussi fixées à minuit, cela signifie que - * mettre par exemple en 'to' le Mercredi 2 Septembre renverra aussi le menu de ce jour. - * - * Rappelez-vous aussi que le champ du mois dans les dates est décalé de 1 en arrière, et seulement - * ce champ. Pour initialiser une Date au Mercredi 2 Septembre, il faut donc faire `new Date(2020, 8, 2);`. - * - * @param student L'élève dont il faut récupérer les menus - * @param from La date à partir de laquelle récupérer les menus. Par défaut la Date actuelle - * @param to La date jusqu'à laquelle récupérer les menus. Par défaut 'from' + 23 heures - * - * @return La liste des menus des repas situés entre les deux dates données. Si l'onglet du menu n'est pas - * disponible, `null` sera renvoyé. - */ - menu(student: PronoteStudent, from?: Date, to?: Date): Promise<Array<MenuDay> | null> - - /** - * Récupère les fichier publiés sur votre pronote depuis le début de l'années - * du plus récent au ancien. - * - * @param student L'élève dont il faut récupérer les menus - * - * @return La liste des fichier publiés depuis le début de l'année. Si l'onglet des fichiers n'est pas - * disponible, `null` sera renvoyé. - */ - files(student: PronoteStudent): Promise<Array<File> | null> -} - -/** - * Valeurs acceptées pour désigner un des types de comptes disponibles. Pour l'instant seul 'student' est supporté. - */ -type PronoteAccountTypeName = 'student' | 'parent' | 'teacher' | 'attendant' | 'company' | 'administration'; - -/** - * Type de compte auquel il est possible de se connecter via Pronote. Pour l'instant seul le comptes élèves - * sont supportés. - */ -export interface PronoteAccountType -{ - name: PronoteAccountTypeName, - value: string, - id: number -} - -/** - * Ouvre une nouvelle session élève à l'instance Pronote donnée, et s'y connecte. - * - * Par défaut, ouvrir une session à l'aide de cette fonction ne maintien pas la session en vie. Pour la maintenir - * plus longtemps que le temps par défaut (quelques dizaines de minutes), utilisez {@link PronoteSession.setKeepAlive}. - * - * @param url URL de l'instance Pronote à laquelle se connecter, exemple : https://demo.index-education.net/pronote/ - * @param username Nom d'utilisateur - * @param password Mot de passe de l'utilisateur - * @param cas Nom du CAS à utiliser si besoin. Si vous vous connectez usuellement à Pronote directement par leur - * interface, vous pouvez laisser ce champ vide (ou mettre 'none'). En revanche, si lors de la connexion à Pronote - * vous êtes redirigé vers une interface de votre académie, vous devez alors choisir le CAS qui correspond. La valeur - * de ce champ correspond au nom d'un fichier de src/cas/ sans le .js. Par exemple 'ac-montpellier'. Si votre - * académie n'est pas supportée, vous pouvez ouvrir une issue sur le dépôt GitHub du projet. - * - * @return La session créée et authentifiée. Ses champs 'params' et 'user' sont donc forcément non-vides. - */ -export function login(url: string, username: string, password: string, cas?: string): Promise<PronoteStudentSession>; - -/** - * Ouvre une nouvelle session parent à l'instance Pronote donnée, et s'y connecte. - * - * Par défaut, ouvrir une session à l'aide de cette fonction ne maintien pas la session en vie. Pour la maintenir - * plus longtemps que le temps par défaut (quelques dizaines de minutes), utilisez {@link PronoteSession.setKeepAlive}. - * - * @param url URL de l'instance Pronote à laquelle se connecter, exemple : https://demo.index-education.net/pronote/ - * @param username Nom d'utilisateur - * @param password Mot de passe de l'utilisateur - * @param cas Nom du CAS à utiliser si besoin. Si vous vous connectez usuellement à Pronote directement par leur - * interface, vous pouvez laisser ce champ vide (ou mettre 'none'). En revanche, si lors de la connexion à Pronote - * vous êtes redirigé vers une interface de votre académie, vous devez alors choisir le CAS qui correspond. La valeur - * de ce champ correspond au nom d'un fichier de src/cas/ sans le .js. Par exemple 'ac-montpellier'. Si votre - * académie n'est pas supportée, vous pouvez ouvrir une issue sur le dépôt GitHub du projet. - * - * @return La session créée et authentifiée. Ses champs 'params' et 'user' sont donc forcément non-vides. - */ -export function loginParent(url: string, username: string, password: string, cas?: string): Promise<PronoteParentSession>; - - -/** - * La liste des CAS disponibles, et donc des valeurs acceptées pour le champ 'cas' de la fonction {@link login}. - */ -export const casList: Array<string>; - -/** - * Tente de trouver le nom de CAS associé à l'URL de l'instance Pronote donnée. Renvoie `null` si introuvable. - * - * @param url L'URL de l'instance Pronote dont laquelle trouver le CAS par lequel il faut passer pour s'y connecter. - * - * @return Le nom du CAS à mettre, ou une liste des noms des CAS possibles, ou `null` si introuvable. - */ -export function getCAS(url: string): Promise<string | string[] | null>; - -/* - * Données géographiques concernant un établissement. - */ -export interface EtablissementGeoData { - /** - * URL Pronote de l'établissement - */ - url: string; - /** - * Nom de l'établissement - */ - nomEtab: string; - /** - * Latitude de l'établissement - */ - lat: string; - /** - * Longitude de l'établissement - */ - long: string; - /** - * Code postal de l'établissement - */ - cp: string; -} - -/** - * Trouve les établissements à proximité des coordonnées géographiques données. - * - * @param lat Latitude de la localisation - * @param long Longitude de la localisation - */ -export function geo(lat: number|string, long: number|string): Promise<EtablissementGeoData>; - -/** - * Liste des erreurs pouvant être renvoyées par l'API. - */ -export namespace errors { - /** - * Code : -1 - * Indique une erreur générique renvoyée par Pronote. - */ - const PRONOTE: PronoteErrorType; - - /** - * Code : 1 - * Indique que le CAS demandé n'existe pas. - */ - const UNKNOWN_CAS: PronoteErrorType; - - /** - * Code : 2 - * Indique que votre adresse I.P. a été bannie de l'instance Pronote suite à une requête non autorisée. Si vous - * obtenez cette erreur sans avoir fait de manipulation spéciale, merci d'ouvrir une issue sur la page GitHub - * du projet. - */ - const BANNED: PronoteErrorType; - - /** - * Code : 3 - * Indique que vos identifiants ne sont pas bons. Il est possible que vous ayez besoin d'un CAS. - */ - const WRONG_CREDENTIALS: PronoteErrorType; - - /** - * Code : 4 - * Indique que le type de compte donné n'existe pas. Les valeurs possibles sont 'student', 'parent', - * 'teacher', 'attendant', 'company', et 'administration'. - */ - const UNKNOWN_ACCOUNT: PronoteErrorType; - - /** - * Code : 5 - * Indique que la session a expirée, vous devriez peut-être utiliser {@link PronoteSession.setKeepAlive} ? - */ - const SESSION_EXPIRED: PronoteErrorType; - - /** - * Code : 6 - * Indique que votre adresse I.P. a été bannie de l'instance Pronote en raison d'un nombre trop élevé - * de requêtes erronées. Si vous obtenez cette erreur sans avoir fait de manipulation spéciale ou échoué un trop - * grand nombre de requête d'authentification, merci d'ouvrir une issue sur la page GitHub du projet. - */ - const RATE_LIMITED: PronoteErrorType; - - /** - * Code : 7 - * Indique que l'instance est actuellement fermée, pour maintenance ou car la rentrée n'a pas encore eu - * lieu. - */ - const CLOSED: PronoteErrorType; -} - -/** - * Type d'erreur pouvant être renvoyé par l'API. - */ -export interface PronoteErrorType -{ - /** - * Code unique de l'erreur, voir {@link errors} - */ - code: number - - /** - * Instancie l'erreur. - * - * @param args Arguments demandés par le type d'erreur en question. - */ - drop(...args: any): PronoteError -} - -/** - * Une erreur renvoyée par l'API. - */ -export interface PronoteError -{ - /** - * Code unique du type d'erreur en question - */ - code: number, - - /** - * Message descriptif (en anglais) de l'erreur, ou message donné par Pronote (en français) si c'est une erreur - * générique (erreur 'PRONOTE' : code -1). - */ - message: string -} - -/** - * Dénote la présence d'un identifiant unique 'id' dans un objet. - */ -export interface Identifiable -{ - /** - * Identifiant unique de l'objet généré à partir du hash des informations considérées comme "propre" à l'objet - * (voir la documentation de chaque objet Identifiable pour savoir lesquelles). - * - * Il est sensé pouvoir identifier chaque objet entre les requêtes : il restera toujours le même après chaque essai. - * Cette fonctionnalité ayant été ajoutée récemment, cette affirmation est tout de même à prendre avec précaution. - * - * Dans le cas où deux objets distincts auraient le même identifiant, ce dernier est modifié en fonction de l'ordre - * dans lequel Pronote a renvoyé les objets, pour assurer l'absence d'identifiant en doublon, et sa conservation entre - * les requêtes (on considère que l'ordre renvoyé par Pronote est constant). - */ - id: string -} - -/** - * Leçon de l'emploi du temps. - */ -export interface Lesson extends Identifiable -{ - /** - * Date et horaire précis auquel commence le cours - */ - from: Date, - - /** - * Date et horaire précis auquel se termine le cours - */ - to: Date, - - /** - * Indique si c'est une retenue et non un cours - */ - isDetention: boolean, - - /** - * Dans le cas où un cours en remplace un autre, il arrive souvent que les deux cours soient présents dans - * l'emploi du temps (mais superposés sur le site). Ce paramètre est à true s'il existe un ou plusieurs autre - * cours au même horaire et à la même date que celui-ci. - */ - hasDuplicate: boolean, - - /** - * Si c'est un cours qui se déroulera en distanciel, à la maison. - */ - remoteLesson: boolean; - - /** - * Matière du cours si disponible (pas le cas pour une retenue) - * Peut avoir comme valeur 'Non défini' si l'api reçoit un null - */ - subject?: string, - - /** - * Professeur assigné au cours si disponible (ou surveillant de la retenue) - * Peut avoir comme valeur 'Non défini' si l'api reçoit un null - */ - teacher?: string, - - /** - * Salle du cours si disponible - * Peut avoir comme valeur 'Non défini' si l'api reçoit un null - */ - room?: string, - - /** - * Information supplémentaire sur le cours donnée par Pronote. Exemple de valeurs : "Prof absent", - * "Cours annulé", etc. - * Determine les valeurs 'isAway' et 'isCancelled'. - */ - status?: string, - - /** - * Indique si le professeur est absent. Ne peut pas être à `true` en même temps que `isCancelled`. Est à `null` - * dans le cas d'une retenue. - */ - isAway?: boolean, - - /** - * Indique que le cours est annulé (par exemple parce qu'il est déplacé). Ne peut pas être à `true` en même - * temps que `isAway`. Est à `null` dans le cas d'une retenue. - */ - isCancelled?: boolean, - - /** - * Couleur du cours dans l'emploi du temps. Est à `null` dans le cas d'une retenue. - */ - color?: string -} - -/** - * Réponse à la requête des notes - */ -export interface Marks -{ - /** - * Liste des matières avec ses moyennes et ses notes - */ - subjects: Array<MarksSubject>, - - /** - * Moyennes générales de l'élève et de sa classe si disponibles - */ - averages: MarksAverages -} - -/** - * Notes et moyennes d'une matière - */ -export interface MarksSubject -{ - /** - * Nom de la matière - */ - name: string, - - /** - * Moyennes de la matière dans la période demandé - */ - averages: MarksSubjectAverages, - - /** - * Couleur de la matière - */ - color: string, - - /** - * Notes de la matière pour la période demandée - */ - marks: Array<Mark> -} - -/** - * Moyennes générales - */ -export interface MarksAverages -{ - /** - * Moyenne générale de l'élève. - * N'est pas défini si l'instance Pronote n'en autorise pas la consultation. - */ - student?: number, - - /** - * Moyenne générale de la classe. - * N'est pas défini si l'instance Pronote n'en autorise pas la consultation. - */ - studentClass?: number -} - -/** - * Moyennes d'une matière - */ -export interface MarksSubjectAverages -{ - /** - * Moyenne de l'élève dans la matière - */ - student: number, - - /** - * Moyenne de la classe dans la matière - */ - studentClass: number, - - /** - * Moyenne la plus basse obtenue par un élève dans la classe - */ - min: number, - - /** - * Moyenne la plus haute obtenue par un élève dans la classe - */ - max: number -} - -/** - * Note obtenue par l'élève - */ -export interface Mark extends Identifiable -{ - - /** - * ID de la note - */ - id: string, - - /** - * Description de la note - */ - title: string, - - /** - * La note elle même, ou `null` si l'élève était absent. - */ - value?: number, - - /** - * L'échelle de la note (donc la note maximale possible, exemple '20' si la note est sur 20). - */ - scale: number, - - /** - * Moyenne de la classe. Valeur absente si tout le monde était absent - */ - average?: number, - - /** - * Coefficient de la note - */ - coefficient: number, - - /** - * Note la plus basse obtenue dans la classe. Valeur absente si tout le monde était absent - */ - min?: number, - - /** - * Note la plus haute obtenue dans la classe. Valeur absente si tout le monde était absent - */ - max?: number, - - /** - * Date de l'évaluation qui a entraîné cette note (supposément) - */ - date: Date, - - /** - * Si l'élève est marqué comme absent ou non noté - */ - isAway: boolean -} - -/** - * Liste des évaluations d'une matière - */ -export interface EvaluationsSubject -{ - /** - * Nom de la matière - */ - name: string, - - /** - * Professeur de la matière - */ - teacher: string, - - /** - * Couleur de la matière - */ - color: string, - - /** - * Liste des évaluations de la matière - */ - evaluations: Array<Evaluation> -} - -/** - * Évaluation - */ -export interface Evaluation extends Identifiable -{ - /** - * ID de l'évaluation - */ - id: string, - - /** - * Nom de l'évaluation - */ - name: string, - - /** - * Date à laquelle l'évaluation a eu lieu - */ - date: Date, - - /** - * Coefficient de l'évaluation - */ - coefficient: number, - - /** - * Niveaux d'évaluations notés - */ - levels: Array<EvaluationLevel>, -} - -/** - * Niveau noté lors d'une évaluation - */ -export interface EvaluationLevel -{ - /** - * Nom du niveau - */ - name: string, - - /** - * Évaluation obtenue au niveau - */ - value: EvaluationLevelValue, - - /** - * Préfixes du niveau (ex: 'D1', 'D2.3') - */ - prefixes: Array<string> -} - -/** - * Valeur obtenue à un niveau d'une évaluation - */ -export interface EvaluationLevelValue -{ - /** - * Nom court (ex: 'A') - */ - short: string, - - /** - * Nom long (ex: 'Très bonne maîtrise') - */ - long: string -} - -/** - * Liste des évènements de vie scolaire - */ -export interface Absences -{ - /** - * Absences - */ - absences: Array<Absence>, - - /** - * Retards - */ - delays: Array<Delay>, - - /** - * Punitions - */ - punishments: Array<Punishment>, - - /** - * 'Autre évènements', littéralement - */ - other: Array<OtherEvent>, - - /** - * Total des absences pour chaque matière - */ - totals: Array<SubjectAbsences> -} - -/** - * Absence à un cours - */ -export interface Absence extends Identifiable -{ - /** - * Début du premier cours manqué ou lorsque le cours a été quitté - */ - from: Date, - - /** - * Fin du dernier cours manqué ou lorsque l'élève est revenu en cours - */ - to: Date, - - /** - * Si l'absence a été justifiée - */ - justified: boolean, - - /** - * Si l'absence a été réglée - */ - solved: boolean, - - /** - * Nombre d'heures manquées - */ - hours: number, - - /** - * Raison donnée pour l'absence après justification - */ - reason?: string -} - -/** - * Retard à un cours - */ -export interface Delay extends Identifiable -{ - /** - * Date et horaire du cours où le retard a eu lieu - */ - date: Date, - - /** - * Si le retard a été justifié - */ - justified: boolean, - - /** - * Si le retard a été réglé - */ - solved: boolean, - - /** - * Justification du retard (visiblement tout le temps vide, voir {@link reason} pour la raison donnée) - */ - justification: string, - - /** - * Nombre de minutes de cours manquées - */ - minutesMissed: number, - - /** - * Raison donnée pour le retard avant ou après justification - */ - reason?: string -} - -/** - * Punition donnée à l'élève - */ -export interface Punishment extends Identifiable -{ - /** - * Date et moment auquel la punition a été donnée - */ - date: Date, - - /** - * Si la punition a lieu a une exclusion - */ - isExclusion: boolean, - - /** - * Si la punition a été donnée suite à un évènement ayant eu lieu pendant un cours - */ - isDuringLesson: boolean, - - /** - * Si un devoir a été donné en tant que punition - */ - homework: string, - - /** - * Les circonstances ayant donné lieu à la punition - */ - circumstances: string, - - /** - * Le professeur ou personnel de l'école ayant donné la punition - */ - giver: string, - - /** - * Motif de la punition - */ - reason?: string, - - /** - * Si la punition a donné lieu a une retenue, si oui la retenue en question, sinon le champ est absent. - */ - detention?: Detention -} - -/** - * Une retenue donnée suite à une punition - */ -export interface Detention extends Identifiable -{ - /** - * Date et horaire précis de début de la retenue - */ - from: Date, - - /** - * Date et horaire précis de fin de la retenue - */ - to: Date -} - -/** - * Autre évènement de vie scolaire - */ -export interface OtherEvent extends Identifiable -{ - /** - * Type d'évènement (exemple : 'Leçon non apprise') - */ - kind: string, - - /** - * Date à laquelle a eu lieu l'évènement - */ - date: Date, - - /** - * Le professeur ou personnel de l'école ayant rapporté l'évènement - */ - giver: string, - - /** - * Commentaire fait sur l'évènement - */ - comment: string, - - /** - * Matière liée à l'évènement (peut ne pas exister) - */ - subject?: string -} - -/** - * Nombre d'heures manquées dans une matière - */ -export interface SubjectAbsences -{ - /** - * Nom de la matière - */ - subject: string, - - /** - * Nombre d'heure auquel l'élève a assisté - */ - hoursAssisted: number, - - /** - * Nombre d'heure que l'élève a manqué - */ - hoursMissed: number, - - /** - * Si la matière est un "groupe", les sous-matières du groupe, sinon le champ est absent. - */ - subs?: Array<SubjectAbsences> -} - -/** - * Information - */ -export interface Info extends Identifiable -{ - /** - * Date à laquelle l'information a été annoncée - */ - date: Date, - - /** - * Titre de l'information - */ - title: string, - - /** - * Auteur de l'information - */ - author: string, - - /** - * Contenu de l'information - */ - content: string, - - /** - * Contenu de l'information en HTML - */ - htmlContent: string, - - /** - * Fichiers attachés à l'information - */ - files: Array<File> -} - -/** - * Contenu d'un cours - */ -export interface LessonContent extends Identifiable -{ - /** - * Matière du cours - */ - subject: string, - - /** - * Professeurs liés au cours - */ - teachers: Array<string>, - - /** - * Horaire précise de début du cours - */ - from: Date, - - /** - * Horaire précise de fin du cours - */ - to: Date, - - /** - * Couleur de la matière du cours - */ - color: string, - - /** - * Titre du contenu - */ - title: string, - - /** - * Description du contenu - */ - description: string, - - /** - * Description du contenu en HTML - */ - htmlDescription: string, - - /** - * Fichiers attachés au contenu - */ - files: Array<File>, - - /** - * Catégorie du contenu - */ - category: string -} - -/** - * Contenu d'un devoir - */ -export interface Homework extends Identifiable -{ - /** - * Description du devoir - */ - description: string, - - /** - * Description du devoir en HTML - */ - htmlDescription: string, - - /** - * Matière du cours du devoir - */ - subject: string, - - /** - * Horaire précise à laquelle le devoir a été donné - */ - givenAt: Date, - - /** - * Horaire précise à laquelle le devoir doit être rendu - */ - for: Date, - - /** - * Si le travail a été marqué comme "fait" ou non - */ - done: boolean, - - /** - * Couleur de la matière du devoir - */ - color: string, - - /** - * Fichiers attachés au devoir - */ - files: Array<File> -} - -/** - * Un fichier attaché par exemple à une information, un devoir, ou au contenu d'un cours - */ -export interface File extends Identifiable -{ - /** - * Date à laquelle le fichier a été mis en ligne - */ - time: Date, - /** - * Nom de la matière - */ - subject: string, - /** - * Nom du fichier avec son extension - */ - name: string, - - /** - * URL directe du fichier - */ - url: string -} - -/** - * Menus des repas d'un jour de la semaine - */ -export interface MenuDay -{ - /** - * Date du jour en question - */ - date: Date, - - /** - * Plats des groupes des menus des repas du jour - */ - meals: Array<Array<Array<MenuMealEntry>>> -} - -/** - * Plat d'un menu - */ -export interface MenuMealEntry -{ - /** - * Nom du plat - */ - name: string, - - /** - * Labels du plat (exemple : bio) - */ - labels: Array<MenuMealLabel> -} - -/** - * Label d'un plat (exemple : bio) - */ -export interface MenuMealLabel -{ - /** - * Nom du label - */ - name: string, - - /** - * Couleur du label - */ - color: string -} - -// Low-level API (if you need to use this, you can, but it may mean I've forgotten a use case, please open an issue!) - -export function cipher(session: PronoteSession, data: any, options?: CipherOptions): string; -export function decipher(session: PronoteSession, data: any, options?: DecipherOptions): string | forge.util.ByteBuffer; - -export function getStart(url: string, username: string, password: string, cas: string, type?: PronoteAccountTypeName | PronoteAccountType): Promise<PronoteStartParams>; -export function auth(session: PronoteSession): Promise<void>; - -export function fetchParams(session: PronoteSession, iv: forge.util.ByteBuffer): Promise<PronoteParams>; -export function fetchId(session: PronoteSession, username: string, fromCas: boolean): Promise<PronoteIdResponse>; -export function fetchAuth(session: PronoteSession, challenge: string, key: forge.util.ByteBuffer): Promise<string>; -export function fetchUser(session: PronoteSession): Promise<PronoteUser<any>>; -export function fetchTimetable(session: PronoteSession, date?: Date): Promise<PronoteTimetable>; -export function fetchTimetableDaysAndWeeks(session: PronoteSession): Promise<PronoteTimetableDaysAndWeeks>; -export function fetchMarks(session: PronoteSession, period?: PronotePeriod): Promise<PronoteMarks>; -export function fetchEvaluations(session: PronoteSession, period?: PronotePeriod): Promise<Array<PronoteEvaluation>>; -export function fetchAbsences(session: PronoteSession, period?: PronotePeriod, from?: Date, to?: Date): Promise<PronoteAbsences>; -export function fetchInfos(session: PronoteSession): Promise<PronoteInfos>; -export function fetchContents(session: PronoteSession, fromWeek?: number, toWeek?: number): Promise<PronoteLessonsContents>; -export function fetchHomeworks(session: PronoteSession, fromWeek?: number, toWeek?: number): Promise<Array<PronoteHomework>>; -export function fetchMenu(session: PronoteSession, date?: Date): Promise<PronoteMenu>; -export function fetchFiles(session: PronoteSession); - -export function navigate(session: PronoteSession, page: string, tab: number, data?: any): Promise<any>; -export function keepAlive(session: PronoteSession): Promise<void>; - -export function toPronoteWeek(session: PronoteSession, date: Date): number; -export function toUTCWeek(date: Date): number; -export function toPronoteDay(session: PronoteSession, date: Date): number; -export function fromPronoteDay(session: PronoteSession, date: number): Date; -export function toPronoteDate(date: Date): string; - -export function getFileURL(session: PronoteSession, file: PronoteObject): string; - -export function request(session: PronoteSession, name: string, content: any): Promise<any>; - -export interface PronoteSessionOptions -{ - serverURL: string, - sessionID: number, - type: PronoteAccountTypeName | PronoteAccountType, - - disableAES: boolean, - disableCompress: boolean, - - keyModulus: string, - keyExponent: string -} - -export interface CipherOptions -{ - key?: forge.pki.Key, - compress?: boolean -} - -export interface DecipherOptions extends CipherOptions -{ - scrambled?: boolean, - asBytes?: boolean -} - -export interface PronoteStartParams -{ - h: string, // Session ID (number) - a: number, // Session type (3 = student, ...) - - e: string, // One time use username after CAS auth - f: string, // One time use password after CAS auth - - sCrA: boolean, // Disable AES - sCoA: boolean, // Disable compression - - MR: string, // Public key modulus (as BigInt string) - ER: string, // Public key exponent (as BigInt string) - - // There are more, but undocumented (feel free to open a P.R.!) -} - -export interface PronoteIdResponse -{ - scramble: string, // alea - challenge: string // challenge -} - -export interface PronoteObject -{ - id: string, // N - name: string // L -} - -export interface PronoteParams -{ - navigatorId?: string, // identifiantNav - fonts: Array<string>, // listePolices - withMember: boolean, // avecMembre - forNewCaledonia: boolean, // pourNouvelleCaledonie - loginImageId: number, // genreImageConnexion - loginImageUrl: string, // urlImageConnexion - cssLogo: string, // logoProduitCss - theme: number, // Theme - serverTime: Date, // DateServeurHttp - mobileURL: string, // URLMobile - mobileSupport: boolean, // AvecEspaceMobile - title: string, // Nom - indexEducationWebsite: string, // General.urlSiteIndexEducation - version: string, // General.versionPN - versionFull: string, // General.version - year: number, // General.millesime - language: PronoteLanguage, // General.language - supportedLanguages: Array<PronoteLanguage>, // General.listeLangues - infoPage: string, // General.lienMentions - hasForum: boolean, // General.avecForum - helpURL: string, // General.UrlAide - videosURL: string, // General.urlAccesVideos - twitterURL: string, // General.urlAccesTwitter - withLoginOptions: boolean, // General.AvecChoixConnexion - establishment: string, // General.NomEtablissement - displayWeeks: string, // General.afficherSemainesCalendaires - schoolYear: string, // General.AnneeScolaire - firstCycle: Date, // General.DateDebutPremierCycle - firstDay: Date, // General.PremiereDate - firstMonday: Date, // General.PremierLundi - lastDay: Date, // General.DerniereDate - ticksPerDay: number, // General.PlacesParJour - ticksPerHour: number, // General.PlacesParHeure - sequenceDuration: number, // General.DureeSequence - ticksForHalfDayAbsence: number, // General.PlaceDemiJourneeAbsence - hasLunch: boolean, // General.activationDemiPension - lunchStart: number, // General.debutDemiPension - lunchEnd: number, // General.finDemiPension - withPlainAfternoonHours: boolean, // General.AvecHeuresPleinesApresMidi - firstOrLastWorkingDay: Date, // General.JourOuvre - workingDays: Array<number>, // General.JoursOuvres - lunchDays: Array<number>, // General.JoursDemiPension - parentsChat: boolean, // General.ActivationMessagerieEntreParents - workingDaysPerCycle: number, // General.joursOuvresParCycle - firstDayOfWeek: number, // General.premierJourSemaine - timetableGridsInCycle: number, // General.grillesEDTEnCycle - workingDaysCycle: Array<number>, // General.setOfJoursCycleOuvre - halfWorkingDays: Array<Array<number>>, // General.DemiJourneesOuvrees - frequenciesRanges: Array<Array<number>>, // General.DomainesFrequences - frequenciesLabels: Array<string>, // General.LibellesFrequences - defaultMarkMax: number, // General.BaremeNotation - allowedAnnotations: Array<number>, // General.listeAnnotationsAutorisees - acquisitionLevels: Array<PronoteAcquisitionLevel>, // General.ListeNiveauxDAcquisitions - displayAcquisitionShortLabel: boolean, // General.AfficherAbbreviationNiveauDAcquisition - withEvaluationHistory: boolean, // General.AvecEvaluationHistorique - withoutIntermediaryLevelAutoValidation: boolean, // General.SansValidationNivIntermediairesDsValidAuto - onlySchoolYearEvaluationsInAutoValidation: boolean, // General.NeComptabiliserQueEvalsAnneeScoDsValidAuto - CECRLLevelsSupport?: boolean, // General.AvecGestionNiveauxCECRL - langActivityColor?: string, // General.couleurActiviteLangagiere - minMarkMCQ: number, // General.minBaremeQuestionQCM - maxMarkMCQ: number, // General.maxBaremeQuestionQCM - maxPointsMCQ: number, // General.maxNbPointQCM - skillsGridLabelSize: number, // General.tailleLibelleElementGrilleCompetence - homeworkCommentSize: number, // General.tailleCommentaireDevoir - officeEnabled: boolean, // General.O365_Actif - officeFederatedMode: boolean, // General.O365_ModeFederated - officeTutorial: string, // General.O365_UrlTuto_Office - oneDriveTutorial: string, // General.O365_UrlTuto_OneDrive - connexionInfoRetrieval: boolean, // General.AvecRecuperationInfosConnexion - font: string, // General.Police - fontSize: number, // General.TaillePolice - attachedStudents: boolean, // General.AvecElevesRattaches - phoneMask: string, // General.maskTelephone - maxECTS: number, // General.maxECTS - maxAppreciationSizes: Array<number>, // General.TailleMaxAppreciation - publicHolidays: Array<PronoteHoliday>, // General.listeJoursFeries - displaySequences: boolean, // General.afficherSequences - firstHour: Date, // General.PremiereHeure - hours: Array<PronoteHour>, // General.ListeHeures - endHours: Array<PronoteHour>, // General.ListeHeuresFin - sequences: Array<string>, // General.sequences - periods: Array<PronotePeriod>, // General.ListePeriodes - logo: number, // General.logo - breaks: Array<PronoteBreak>, // General.recreations - appCookieName: string // General.nomCookieAppli -} - -export interface PronoteLanguage -{ - id: number, // langID - name: string // langue -} - -export interface PronoteAcquisitionLevel extends PronoteObject -{ - count: number, // G - positions: Array<PronoteAcquisitionLevelPositions>, // listePositionnements - triggerPosition: number, // positionJauge - activeFor: Array<number>, // actifPour - shortName: string, // abbreviation - shortPath: string, // raccourci - color?: string, // couleur - weighting?: number, // ponderation - brevetPoints?: number, // nombrePointsBrevet - acquired?: boolean, // estAcqui - countsForSuccess?: boolean // estNotantPourTxReussite -} - -export interface PronoteAcquisitionLevelPositions -{ - name: string, // L - count: number, // G - shortName: string, // abbreviation - shortNameWithPrefix?: string // abbreviationAvecPrefixe -} - -export interface PronoteHoliday extends PronoteObject -{ - from: Date, // dateDebut - to: Date // dateFin -} - -export interface PronoteHour -{ - name: string, // L - count: number, // G - round: boolean // A -} - -export interface PronotePeriod extends PronoteObject -{ - type: 'trimester' | 'semester' | 'year' | 'other', // G (1, 2, 3, *) - notationPeriod: number, // periodeNotation - from: Date, // dateDebut - to: Date // dateFin -} - -export interface PronoteBreak -{ - name: string, // L - position: number // place -} - -export interface PronoteUser<A extends PronoteUserAuthorizations> extends PronoteObject -{ - establishmentsInfo: Array<PronoteEstablishmentInfo>, // ressource.listeInformationsEtablissements - userSettings: PronoteUserSettings, // ressource.parametresUtilisateur - sessionAuthorizations: PronoteSessionAuthorizations, // user.autorisationsSession.fonctionnalites - authorizations: A, // autorisations - minPasswordSize: number, // reglesSaisieMDP.min - maxPasswordSize: number, // reglesSaisieMDP.max - passwordRules: Array<number>, // reglesSaisieMDP.regles - kioskAccess: boolean, // autorisationKiosque - tabs: Array<PronoteTab>, // listeOnglets - hiddenTabs: Array<number>, // listeOngletsInvisibles - notifiedTabs: Array<number>, // lisetOngletsNotification -} - -export interface PronoteStudentUser extends PronoteStudent, PronoteUser<PronoteStudentAuthorizations> -{ -} - -export interface PronoteStudent extends PronoteObject -{ - establishment: PronoteObject, // ressource.Etablissement - - /** - * URL de l'avatar de l'utilisateur, si disponible - */ - avatar?: string, // ressource.avecPhoto && photo.jpg (ressource.N) - - /** - * Classe de l'utilisateur - */ - studentClass: PronoteObject, // ressource.classeDEleve - classHistory: Array<PronoteClassHistoryElement>, // ressource.listeClassesHistoriques - groups: Array<PronoteObject>, // ressource.listeGroupes - tabsPillars: Array<PronoteTabPillars>, // ressource.listeOngletsPourPiliers - tabsPeriods: Array<PronoteTabPeriods>, // ressource.listeOngletsPourPeriodes -} - -export interface PronoteStudentAuthorizations extends PronoteUserAuthorizations -{ - maxUserWorkFileSize: number // tailleMaxRenduTafEleve -} - -export interface PronoteParentUser extends PronoteUser<PronoteParentAuthorizations> -{ - isDelegate: boolean, // estDelegue - isBDMember: boolean, // estMembreCA - canDiscussWithManagers: boolean, // avecDiscussionResponsables - absencesReasons: Array<PronoteObject>, // listeMotifsAbsences - delaysReasons: Array<PronoteObject>, // listeMotifsRetards - classDelegates: Array<PronoteObject>, // listeClassesDelegue - students: Array<PronoteStudent> -} - -export interface PronoteParentAuthorizations extends PronoteUserAuthorizations -{ - staffDiscussion: boolean, // AvecDiscussionPersonnels - parentsDiscussion: boolean, // AvecDiscussionParents - editStudentPassword: boolean, // avecSaisieMotDePasseEleve - editCoordinates: boolean, // avecSaisieInfosPersoCoordonnees - editAuthorizations: boolean // avecSaisieInfosPersoAutorisations -} - -export interface PronoteClassHistoryElement extends PronoteObject -{ - hadMarks: boolean, // AvecNote - hadOptions: boolean // AvecFiliere -} - -export interface PronoteTabPillars -{ - tab: number, // G - levels: Array<PronotePillarLevel> // listePaliers -} - -export interface PronotePillarLevel extends PronoteObject -{ - pillars: Array<PronotePillar> // listePiliers -} - -export interface PronotePillar extends PronoteObject -{ - isForeignLanguage: boolean, // estPilierLVE - isCoreSkill: boolean, // estSocleCommun - subject: PronoteObject // Service -} - -export interface PronoteTabPeriods -{ - tab: number, // G - periods: Array<PronoteTabPeriod>, // listePeriodes - defaultPeriod?: PronoteObject // periodeParDefault -} - -export interface PronoteTabPeriod extends PronoteObject -{ - isCorePeriod: boolean // GenreNotation === 1 -} - -export interface PronoteEstablishmentInfo extends PronoteObject -{ - logoID: number, // Logo - address: Array<string>, // Coordonnees.Adresse1, Coordonnees.Adresse2, - postalCode: string, // Coordonnees.CodePostal - postalLabel: string, // Coordonnees.LibellePostal - city: string, // Coordonnees.LibelleVille - province: string, // Coordonnees.Province - country: string, // Coordonnees.Pays - website: string, // Coordonnees.SiteInternet -} - -export interface PronoteUserSettings -{ - version: number, // version - timetable: PronoteUserTimetableSettings, // EDT - theme: number, // theme.theme - unreadDiscussions: boolean, // Communication.DiscussionNonLues -} - -export interface PronoteUserTimetableSettings -{ - displayCanceledLessons: boolean, // afficherCoursAnnules - invertAxis: boolean, // axeInverseEDT - invertWeeklyPlanAxis: boolean, // axeInversePlanningHebdo - invertDayPlanAxis: boolean, // axeInversePlanningJour - invertDay2PlanAxis: boolean, // axeInversePlanningJour2 - dayCount: number, // nbJours - resourceCount: number, // nbRessources - daysInTimetable: number, // nbJoursEDT - sequenceCount: number // nbSequences -} - -export interface PronoteSessionAuthorizations -{ - twitterManagement: boolean, // gestionTwitter - expandedAttestation: boolean // attestationEtendue -} - -export interface PronoteUserAuthorizations -{ - discussions: boolean, // AvecDiscussion - teachersDiscussions: boolean, // AvecDiscussionProfesseurs - timetableVisibleWeeks: Array<number>, // cours.domaineConsultationEDT - canEditLessons: Array<number>, // cours.domaineModificationCours - hideClassParts: boolean, // cours.masquerPartiesDeClasse - maxEstablishmentFileSize: number, // tailleMaxDocJointEtablissement - maxUserWorkFileSize: number, // tailleMaxRenduTafEleve - editPassword: boolean, // compte.avecSaisieMotDePasse - editPersonalInfo: boolean, // compte.avecInformationsPersonnelles - canPrint: boolean // compte.autoriserImpression -} - -export interface PronoteTab -{ - id: number, // G - subs: Array<PronoteTab> // Onglet -} - -export interface PronoteTimetable -{ - hasCancelledLessons: boolean, // avecCoursAnnule - iCalURL: string, // @params.server + ical/Edt.ics?icalsecurise= + ParametreExportiCal + &version= + @params.version - lessons: Array<PronoteLesson>, - breaks: Array<PronoteBreak> -} - -export interface PronoteLesson extends PronoteObject -{ - position: number, // place - duration: number, // duree - date: Date, // DateDuCours - status?: string, // Statut - color?: string, // CouleurFond - content: Array<PronoteObject>, - hasHomework: boolean, // AvecTafPublie - isCancelled: boolean, // estAnnule - isDetention: boolean // estRetenue - remoteLesson: boolean; // dispenseEleve.maison -} - -export interface PronoteTimetableDaysAndWeeks -{ - filledWeeks: Array<number>, // Domaine - filledDays: Array<number> // joursPresence -} - -export interface PronoteMarks -{ - studentAverage?: number, // moyGenerale - studentAverageScale?: number, // baremeMoyGenerale - defaultStudentAvergeScale?: number, // baremeMoyGeneraleParDefaut - studentClassAverage?: number, // moyGeneraleClasse - subjects: Array<PronoteMarksSubject>, // listeServices - marks: Array<PronoteMark> // listeDevoirs -} - -export interface PronoteMarksSubject extends PronoteObject -{ - position: number, // ordre - isGroupSubject: boolean, // estServiceEnGroupe - studentAverage: number, // moyEleve - studentAverageScale: number, // baremeMoyEleve - defaultStudentAverageScale: number, // baremeMoyEleveParDefaut - studentClassAverage: number, // moyClasse - maxAverage: number, // moyMax - minAverage: number, // moyMin - color: string // couleur -} - -export interface PronoteMark extends PronoteObject -{ - subject: PronoteObject, // service - id: string, //Id Notes - title: string, // commentaire - value: number, // note - average: number, // moyenne - scale: number, // bareme - defaultScale: number, // baremeParDefaut - coefficient: number, // coefficient - max: number, // noteMax - min: number, // noteMin - date: number, // date - period: PronoteObject, // periode - isGroupMark: boolean // estEnGroupe -} - -export interface PronoteEvaluation extends PronoteObject -{ - id: string, - title: string, // descriptif - acquisitionLevels: Array<PronoteEvaluationAcquisitionLevel>, // listeNiveauxDAcquisitions - levels: Array<PronoteObject>, // listePaliers - subject: PronoteEvaluationSubject, // matiere - teacher: PronoteObject, // individu - coefficient: number, // coefficient - date: Date, // date - period: PronoteObject // periode -} - -export interface PronoteEvaluationAcquisitionLevel extends PronoteObject -{ - position: number, // order - value: string, // abbreviation - pillar: PronoteEvaluationPillar, // pilier - coefficient: number, // coefficient - domain: PronoteObject, // domaine - item: PronoteObject // item -} - -export interface PronoteEvaluationPillar extends PronoteObject -{ - prefixes: Array<string> // strPrefixes -} - -export interface PronoteEvaluationSubject extends PronoteObject -{ - position: number, // order - service: PronoteObject, // serviceConcerne - color: string // couleur -} - -export interface PronoteAbsences -{ - authorizations: PronoteAbsencesAuthorizations, // autorisations - events: Array<PronoteAbsence | PronoteDelay | PronotePunishment | PronoteOtherEvent | PronoteEvent>, // listeAbsences - subjects: Array<PronoteSubjectAbsences>, // Matieres - recaps: Array<PronoteAbsenceRecap>, // listeRecapitulatifs - sanctions: Array<PronoteObject> // listeSanctionUtilisateur -} - -export interface PronoteAbsencesAuthorizations -{ - absences: boolean, // absence - fillAbsenceReason: boolean, // saisieMotifAbsence - delays: boolean, // retard - fillDelayReason: boolean, // saisieMotifRetard - punishments: boolean, // punition - exclusions: boolean, // exclusion - sanctions: boolean, // sanction - conservatoryMesures: boolean, // mesureConservatoire - infirmary: boolean, // infirmerie - mealAbsences: boolean, // absenceRepas - internshipAbsences: boolean, // absenceInternat - observations: boolean, // observation - incidents: boolean, // incident - totalHoursMissed: boolean // totalHeuresManquees -} - -export interface PronoteEvent extends PronoteObject -{ - type: 'absence' | 'delay' | 'punishment' | 'other' | 'unknown' -} - -export interface PronoteAbsence extends PronoteEvent -{ - from: Date, // dateDebut - to: Date, // dateFin - opened: boolean, // ouverte - solved: boolean, // reglee - justified: boolean, // justifie - hours: number, // NbrHeures - days: number, // NbrJours - reasons: Array<PronoteObject> // listeMotifs -} - -export interface PronoteDelay extends PronoteEvent -{ - date: Date, // date - solved: boolean, // reglee - justified: boolean, // justifie - justification: string, // justification - duration: number, // duree - reasons: Array<PronoteObject> // listeMotifs -} - -export interface PronotePunishment extends PronoteEvent -{ - date: Date, // dateDemande - isExclusion: boolean, // estUneExclusion - giver: PronoteObject, // demandeur - isSchedulable: boolean, // estProgrammable - reasons: Array<PronoteObject>, // listeMotifs - schedule: Array<PronotePunishmentSchedule>, // programmation - nature: PronotePunishmentNature -} - -export interface PronotePunishmentSchedule extends PronoteObject -{ - date: Date, // date, - position: number, // placeExecution - duration: number // duree -} - -export interface PronotePunishmentNature extends PronoteObject -{ - isSchedulable: boolean, // estProgrammable - requiresParentsMetting: boolean // estAvecARParent -} - -export interface PronoteOtherEvent extends PronoteEvent -{ - date: Date, // date - giver: PronoteOtherEventGiver, // demandeur - comment: string, // commentaire - read: boolean, // estLue - subject: PronoteObject // matiere -} - -export interface PronoteOtherEventGiver extends PronoteObject -{ - isHeadTeacher: boolean, // estProfPrincipal - mail: string // mail -} - -export interface PronoteSubjectAbsences extends PronoteObject -{ - position: number, // P - group: number, // regroupement - inGroup: number, // dansRegroupement - hoursAssisted: number, // suivi / 3600 - hoursMissed: number, // absence / 3600 - lessonExclusions: number, // excluCours - establishmentExclusions: number // excluEtab -} - -export interface PronoteAbsenceRecap extends PronoteObject -{ - count: number, // NombreTotal - unjustifiedCount: number, // NombreNonJustifie - hours: number // NbrHeures -} - -export interface PronoteInfos -{ - categories: Array<PronoteInfoCategory>, - infos: Array<PronoteInfo> -} - -export interface PronoteInfoCategory extends PronoteObject -{ - isDefault: boolean // estDefaut -} - -export interface PronoteInfo extends PronoteObject -{ - date: Date, // dateDebut - author: PronoteObject, // elmauteur - content: Array<PronoteInfoContent> // listeQuestions -} - -export interface PronoteInfoContent extends PronoteObject -{ - text: string, // texte - files: Array<PronoteObject> // listePiecesJointes -} - -export interface PronoteLessonsContents -{ - lessons: Array<PronoteLessonContent>, // ListeCahierDeTextes - resources: PronoteLessonsContentsResources, // ListeRessourcesPedagogiques - numericalResources: Array<PronoteObject> // ListeRessourcesNumeriques -} - -export interface PronoteLessonContent extends PronoteObject -{ - lesson: PronoteObject, // cours - locked: boolean, // verrouille - groups: Array<PronoteObject>, // listeGroupes - subject: PronoteObject, // Matiere - color: string, // CouleurFond - teachers: Array<PronoteObject>, // listeProfesseurs - from: Date, // Date - to: Date, // DateFin - content: Array<PronoteLessonContentEntry>, // listeContenus - skills: Array<PronoteObject> // listeElementsProgrammeCDT -} - -export interface PronoteLessonContentEntry extends PronoteObject -{ - description: string, // descriptif - category: PronoteObject, // categorie - path: number, // parcoursEducatif - files: Array<PronoteObject>, // ListePieceJointe - training: Array<PronoteObject> // training.V.ListeExecutionsQCM -} - -export interface PronoteLessonsContentsResources -{ - resources: Array<PronoteObject>, // listeRessources - subjects: Array<PronoteObject> // listeMatieres -} - -export interface PronoteHomework -{ - description: string, // descriptif - lesson: PronoteObject, // cours - subject: PronoteObject, // Matiere - givenAt: Date, // DonneLe - for: Date, // PourLe - done: boolean, // TAFFait - difficultyLevel: number, // niveauDifficulte - duration: number, // duree - color: string, // CouleurFond - files: Array<PronoteObject> // ListePieceJointe -} - -export interface PronoteMenu -{ - hasLunch: boolean, // AvecRepasMidi - hasDiner: boolean, // AvecRepasSoir - filledWeeks: Array<number>, // DomaineDePresence - menus: Array<PronoteMenuDay>, // ListeJours -} - -export interface PronoteMenuDay -{ - date: Date, // Date - meals: Array<PronoteMenuMeal> // ListeRepas -} - -export interface PronoteMenuMeal extends PronoteObject -{ - content: Array<PronoteMenuMealContent> // ListePlats -} - -export interface PronoteMenuMealContent extends PronoteObject -{ - lines: Array<PronoteMenuMealLine> // ListeAliments -} - -export interface PronoteMenuMealLine extends PronoteObject -{ - labels: Array<PronoteMenuLabel> // listeLabelsAlimentaires -} - -export interface PronoteMenuLabel extends PronoteObject -{ - color: string // couleur -} - diff --git a/alarm/node_modules/pronote-api/index.js b/alarm/node_modules/pronote-api/index.js deleted file mode 100644 index 1c0790d..0000000 --- a/alarm/node_modules/pronote-api/index.js +++ /dev/null @@ -1,71 +0,0 @@ -const { loginStudent, loginParent } = require('./src/auth'); -const { list: casList, getCAS } = require('./src/cas'); -const geo = require('./src/geo'); -const errors = require('./src/errors'); - -// ----------------------------------------------------------- - -const PronoteSession = require('./src/session'); -const { cipher, decipher } = require('./src/cipher'); -const { getStart, auth } = require('./src/auth'); - -const getParams = require('./src/fetch/pronote/params'); -const { getId, getAuthKey } = require('./src/fetch/pronote/auth'); -const getUser = require('./src/fetch/pronote/user'); -const { getFilledDaysAndWeeks, getTimetable } = require('./src/fetch/pronote/timetable'); -const getMarks = require('./src/fetch/pronote/marks'); -const getEvaluations = require('./src/fetch/pronote/evaluations'); -const getAbsences = require('./src/fetch/pronote/absences'); -const getInfos = require('./src/fetch/pronote/infos'); -const getContents = require('./src/fetch/pronote/contents'); -const getHomeworks = require('./src/fetch/pronote/homeworks'); -const getMenu = require('./src/fetch/pronote/menu'); -const getFiles = require('./src/fetch/pronote/files') - -const navigate = require('./src/fetch/pronote/navigate'); -const keepAlive = require('./src/fetch/pronote/keepAlive'); - -const { toPronoteWeek, toUTCWeek, toPronoteDay, fromPronoteDay, toPronoteDate } = require('./src/data/dates'); -const { getFileURL } = require('./src/data/files'); - -const http = require('./src/http'); -const request = require('./src/request'); - -module.exports = { - // High-level API - login: loginStudent, - loginParent, - casList, - getCAS, - geo, - errors, - - // Low-level API (you can use this if you need, but it may mean I've forgotten a use case, please open an issue!) - PronoteSession, - cipher, decipher, - getStart, auth, - - fetchParams: getParams, - fetchAuthId: getId, - fetchAuthKey: getAuthKey, - fetchUser: getUser, - fetchTimetableDaysAndWeeks: getFilledDaysAndWeeks, - fetchTimetable: getTimetable, - fetchMarks: getMarks, - fetchEvaluations: getEvaluations, - fetchAbsences: getAbsences, - fetchInfos: getInfos, - fetchContents: getContents, - fetchHomeworks: getHomeworks, - fetchMenu: getMenu, - fetchFiles: getFiles, - - navigate, - keepAlive, - - toPronoteWeek, toUTCWeek, toPronoteDay, fromPronoteDay, toPronoteDate, - getFileURL, - - http, - request -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/CHANGELOG.md b/alarm/node_modules/pronote-api/node_modules/axios/CHANGELOG.md deleted file mode 100644 index 5e2b3d0..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/CHANGELOG.md +++ /dev/null @@ -1,775 +0,0 @@ -# Changelog - -### 0.21.4 (September 6, 2021) - -Fixes and Functionality: -- Fixing JSON transform when data is stringified. Providing backward compatibility and complying to the JSON RFC standard ([#4020](https://github.com/axios/axios/pull/4020)) - -Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: - -- [Jay](mailto:jasonsaayman@gmail.com) -- [Guillaume Fortaine](https://github.com/gfortaine) -- [Yusuke Kawasaki](https://github.com/kawanet) -- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) - -### 0.21.3 (September 4, 2021) - -Fixes and Functionality: -- Fixing response interceptor not being called when request interceptor is attached ([#4013](https://github.com/axios/axios/pull/4013)) - -Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: - -- [Jay](mailto:jasonsaayman@gmail.com) -- [Julian Hollmann](https://github.com/nerdbeere) - -### 0.21.2 (September 4, 2021) - -Fixes and Functionality: - -- Updating axios requests to be delayed by pre-emptive promise creation ([#2702](https://github.com/axios/axios/pull/2702)) -- Adding "synchronous" and "runWhen" options to interceptors api ([#2702](https://github.com/axios/axios/pull/2702)) -- Updating of transformResponse ([#3377](https://github.com/axios/axios/pull/3377)) -- Adding ability to omit User-Agent header ([#3703](https://github.com/axios/axios/pull/3703)) -- Adding multiple JSON improvements ([#3688](https://github.com/axios/axios/pull/3688), [#3763](https://github.com/axios/axios/pull/3763)) -- Fixing quadratic runtime and extra memory usage when setting a maxContentLength ([#3738](https://github.com/axios/axios/pull/3738)) -- Adding parseInt to config.timeout ([#3781](https://github.com/axios/axios/pull/3781)) -- Adding custom return type support to interceptor ([#3783](https://github.com/axios/axios/pull/3783)) -- Adding security fix for ReDoS vulnerability ([#3980](https://github.com/axios/axios/pull/3980)) - -Internal and Tests: - -- Updating build dev dependancies ([#3401](https://github.com/axios/axios/pull/3401)) -- Fixing builds running on Travis CI ([#3538](https://github.com/axios/axios/pull/3538)) -- Updating follow rediect version ([#3694](https://github.com/axios/axios/pull/3694), [#3771](https://github.com/axios/axios/pull/3771)) -- Updating karma sauce launcher to fix failing sauce tests ([#3712](https://github.com/axios/axios/pull/3712), [#3717](https://github.com/axios/axios/pull/3717)) -- Updating content-type header for application/json to not contain charset field, according do RFC 8259 ([#2154](https://github.com/axios/axios/pull/2154)) -- Fixing tests by bumping karma-sauce-launcher version ([#3813](https://github.com/axios/axios/pull/3813)) -- Changing testing process from Travis CI to GitHub Actions ([#3938](https://github.com/axios/axios/pull/3938)) - -Documentation: - -- Updating documentation around the use of `AUTH_TOKEN` with multiple domain endpoints ([#3539](https://github.com/axios/axios/pull/3539)) -- Remove duplication of item in changelog ([#3523](https://github.com/axios/axios/pull/3523)) -- Fixing gramatical errors ([#2642](https://github.com/axios/axios/pull/2642)) -- Fixing spelling error ([#3567](https://github.com/axios/axios/pull/3567)) -- Moving gitpod metion ([#2637](https://github.com/axios/axios/pull/2637)) -- Adding new axios documentation website link ([#3681](https://github.com/axios/axios/pull/3681), [#3707](https://github.com/axios/axios/pull/3707)) -- Updating documentation around dispatching requests ([#3772](https://github.com/axios/axios/pull/3772)) -- Adding documentation for the type guard isAxiosError ([#3767](https://github.com/axios/axios/pull/3767)) -- Adding explanation of cancel token ([#3803](https://github.com/axios/axios/pull/3803)) -- Updating CI status badge ([#3953](https://github.com/axios/axios/pull/3953)) -- Fixing errors with JSON documentation ([#3936](https://github.com/axios/axios/pull/3936)) -- Fixing README typo under Request Config ([#3825](https://github.com/axios/axios/pull/3825)) -- Adding axios-multi-api to the ecosystem file ([#3817](https://github.com/axios/axios/pull/3817)) -- Adding SECURITY.md to properly disclose security vulnerabilities ([#3981](https://github.com/axios/axios/pull/3981)) - -Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: - -- [Jay](mailto:jasonsaayman@gmail.com) -- [Sasha Korotkov](https://github.com/SashaKoro) -- [Daniel Lopretto](https://github.com/timemachine3030) -- [Mike Bishop](https://github.com/MikeBishop) -- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) -- [Mark](https://github.com/bimbiltu) -- [Philipe Gouveia Paixão](https://github.com/piiih) -- [hippo](https://github.com/hippo2cat) -- [ready-research](https://github.com/ready-research) -- [Xianming Zhong](https://github.com/chinesedfan) -- [Christopher Chrapka](https://github.com/OJezu) -- [Brian Anglin](https://github.com/anglinb) -- [Kohta Ito](https://github.com/koh110) -- [Ali Clark](https://github.com/aliclark) -- [caikan](https://github.com/caikan) -- [Elina Gorshkova](https://github.com/elinagorshkova) -- [Ryota Ikezawa](https://github.com/paveg) -- [Nisar Hassan Naqvi](https://github.com/nisarhassan12) -- [Jake](https://github.com/codemaster138) -- [TagawaHirotaka](https://github.com/wafuwafu13) -- [Johannes Jarbratt](https://github.com/johachi) -- [Mo Sattler](https://github.com/MoSattler) -- [Sam Carlton](https://github.com/ThatGuySam) -- [Matt Czapliński](https://github.com/MattCCC) -- [Ziding Zhang](https://github.com/zidingz) - -### 0.21.1 (December 21, 2020) - -Fixes and Functionality: - -- Hotfix: Prevent SSRF ([#3410](https://github.com/axios/axios/pull/3410)) -- Protocol not parsed when setting proxy config from env vars ([#3070](https://github.com/axios/axios/pull/3070)) -- Updating axios in types to be lower case ([#2797](https://github.com/axios/axios/pull/2797)) -- Adding a type guard for `AxiosError` ([#2949](https://github.com/axios/axios/pull/2949)) - -Internal and Tests: - -- Remove the skipping of the `socket` http test ([#3364](https://github.com/axios/axios/pull/3364)) -- Use different socket for Win32 test ([#3375](https://github.com/axios/axios/pull/3375)) - -Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: - -- Daniel Lopretto <timemachine3030@users.noreply.github.com> -- Jason Kwok <JasonHK@users.noreply.github.com> -- Jay <jasonsaayman@gmail.com> -- Jonathan Foster <jonathan@jonathanfoster.io> -- Remco Haszing <remcohaszing@gmail.com> -- Xianming Zhong <chinesedfan@qq.com> - -### 0.21.0 (October 23, 2020) - -Fixes and Functionality: - -- Fixing requestHeaders.Authorization ([#3287](https://github.com/axios/axios/pull/3287)) -- Fixing node types ([#3237](https://github.com/axios/axios/pull/3237)) -- Fixing axios.delete ignores config.data ([#3282](https://github.com/axios/axios/pull/3282)) -- Revert "Fixing overwrite Blob/File type as Content-Type in browser. (#1773)" ([#3289](https://github.com/axios/axios/pull/3289)) -- Fixing an issue that type 'null' and 'undefined' is not assignable to validateStatus when typescript strict option is enabled ([#3200](https://github.com/axios/axios/pull/3200)) - -Internal and Tests: - -- Lock travis to not use node v15 ([#3361](https://github.com/axios/axios/pull/3361)) - -Documentation: - -- Fixing simple typo, existant -> existent ([#3252](https://github.com/axios/axios/pull/3252)) -- Fixing typos ([#3309](https://github.com/axios/axios/pull/3309)) - -Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: - -- Allan Cruz <57270969+Allanbcruz@users.noreply.github.com> -- George Cheng <Gerhut@GMail.com> -- Jay <jasonsaayman@gmail.com> -- Kevin Kirsche <Kev.Kirsche+GitHub@gmail.com> -- Remco Haszing <remcohaszing@gmail.com> -- Taemin Shin <cprayer13@gmail.com> -- Tim Gates <tim.gates@iress.com> -- Xianming Zhong <chinesedfan@qq.com> - -### 0.20.0 (August 20, 2020) - -Release of 0.20.0-pre as a full release with no other changes. - -### 0.20.0-pre (July 15, 2020) - -Fixes and Functionality: - -- Fixing response with utf-8 BOM can not parse to json ([#2419](https://github.com/axios/axios/pull/2419)) - - fix: remove byte order marker (UTF-8 BOM) when transform response - - fix: remove BOM only utf-8 - - test: utf-8 BOM - - fix: incorrect param name -- Refactor mergeConfig without utils.deepMerge ([#2844](https://github.com/axios/axios/pull/2844)) - - Adding failing test - - Fixing #2587 default custom config persisting - - Adding Concat keys and filter duplicates - - Fixed value from CPE - - update for review feedbacks - - no deepMerge - - only merge between plain objects - - fix rename - - always merge config by mergeConfig - - extract function mergeDeepProperties - - refactor mergeConfig with all keys, and add special logic for validateStatus - - add test for resetting headers - - add lots of tests and fix a bug - - should not inherit `data` - - use simple toString -- Fixing overwrite Blob/File type as Content-Type in browser. ([#1773](https://github.com/axios/axios/pull/1773)) -- Fixing an issue that type 'null' is not assignable to validateStatus ([#2773](https://github.com/axios/axios/pull/2773)) -- Fixing special char encoding ([#1671](https://github.com/axios/axios/pull/1671)) - - removing @ character from replacement list since it is a reserved character - - Updating buildURL test to not include the @ character - - Removing console logs -- Fixing password encoding with special characters in basic authentication ([#1492](https://github.com/axios/axios/pull/1492)) - - Fixing password encoding with special characters in basic authentication - - Adding test to check if password with non-Latin1 characters pass -- Fixing 'Network Error' in react native android ([#1487](https://github.com/axios/axios/pull/1487)) - There is a bug in react native Android platform when using get method. It will trigger a 'Network Error' when passing the requestData which is an empty string to request.send function. So if the requestData is an empty string we can set it to null as well to fix the bug. -- Fixing Cookie Helper with Async Components ([#1105](https://github.com/axios/axios/pull/1105)) ([#1107](https://github.com/axios/axios/pull/1107)) -- Fixing 'progressEvent' type ([#2851](https://github.com/axios/axios/pull/2851)) - - Fix 'progressEvent' type - - Update axios.ts -- Fixing getting local files (file://) failed ([#2470](https://github.com/axios/axios/pull/2470)) - - fix issue #2416, #2396 - - fix Eslint warn - - Modify judgment conditions - - add unit test - - update unit test - - update unit test -- Allow PURGE method in typings ([#2191](https://github.com/axios/axios/pull/2191)) -- Adding option to disable automatic decompression ([#2661](https://github.com/axios/axios/pull/2661)) - - Adding ability to disable auto decompression - - Updating decompress documentation in README - - Fixing test\unit\adapters\http.js lint errors - - Adding test for disabling auto decompression - - Removing changes that fixed lint errors in tests - - Removing formatting change to unit test -- Add independent `maxBodyLength` option ([#2781](https://github.com/axios/axios/pull/2781)) - - Add independent option to set the maximum size of the request body - - Remove maxBodyLength check - - Update README - - Assert for error code and message -- Adding responseEncoding to mergeConfig ([#1745](https://github.com/axios/axios/pull/1745)) -- Compatible with follow-redirect aborts the request ([#2689](https://github.com/axios/axios/pull/2689)) - - Compatible with follow-redirect aborts the request - - Use the error code -- Fix merging of params ([#2656](https://github.com/axios/axios/pull/2656)) - - Name function to avoid ESLint func-names warning - - Switch params config to merge list and update tests - - Restore testing of both false and null - - Restore test cases for keys without defaults - - Include test for non-object values that aren't false-y. -- Revert `finally` as `then` ([#2683](https://github.com/axios/axios/pull/2683)) - -Internal and Tests: - -- Fix stale bot config ([#3049](https://github.com/axios/axios/pull/3049)) - - fix stale bot config - - fix multiple lines -- Add days and change name to work ([#3035](https://github.com/axios/axios/pull/3035)) -- Update close-issues.yml ([#3031](https://github.com/axios/axios/pull/3031)) - - Update close-issues.yml - Update close message to read better 😄 - - Fix use of quotations - Use single quotes as per other .yml files - - Remove user name form message -- Add GitHub actions to close stale issues/prs ([#3029](https://github.com/axios/axios/pull/3029)) - - prepare stale actions - - update messages - - Add exempt labels and lighten up comments -- Add GitHub actions to close invalid issues ([#3022](https://github.com/axios/axios/pull/3022)) - - add close actions - - fix with checkout - - update issue templates - - add reminder - - update close message -- Add test with Node.js 12 ([#2860](https://github.com/axios/axios/pull/2860)) - - test with Node.js 12 - - test with latest -- Adding console log on sandbox server startup ([#2210](https://github.com/axios/axios/pull/2210)) - - Adding console log on sandbox server startup - - Update server.js - Add server error handling - - Update server.js - Better error message, remove retry. -- Adding tests for method `options` type definitions ([#1996](https://github.com/axios/axios/pull/1996)) - Update tests. -- Add test for redirecting with too large response ([#2695](https://github.com/axios/axios/pull/2695)) -- Fixing unit test failure in Windows OS ([#2601](https://github.com/axios/axios/pull/2601)) -- Fixing issue for HEAD method and gzipped response ([#2666](https://github.com/axios/axios/pull/2666)) -- Fix tests in browsers ([#2748](https://github.com/axios/axios/pull/2748)) -- chore: add `jsdelivr` and `unpkg` support ([#2443](https://github.com/axios/axios/pull/2443)) - -Documentation: - -- Adding support for URLSearchParams in node ([#1900](https://github.com/axios/axios/pull/1900)) - - Adding support for URLSearchParams in node - - Remove un-needed code - - Update utils.js - - Make changes as suggested -- Adding table of content (preview) ([#3050](https://github.com/axios/axios/pull/3050)) - - add toc (preview) - - remove toc in toc - Signed-off-by: Moni <usmoni@gmail.com> - - fix sublinks - - fix indentation - - remove redundant table links - - update caps and indent - - remove axios -- Replace 'blacklist' with 'blocklist' ([#3006](https://github.com/axios/axios/pull/3006)) -- docs(): Detailed config options environment. ([#2088](https://github.com/axios/axios/pull/2088)) - - docs(): Detailed config options environment. - - Update README.md -- Include axios-data-unpacker in ECOSYSTEM.md ([#2080](https://github.com/axios/axios/pull/2080)) -- Allow opening examples in Gitpod ([#1958](https://github.com/axios/axios/pull/1958)) -- Remove axios.all() and axios.spread() from Readme.md ([#2727](https://github.com/axios/axios/pull/2727)) - - remove axios.all(), axios.spread() - - replace example - - axios.all() -> Promise.all() - - axios.spread(function (acct, perms)) -> function (acct, perms) - - add deprecated mark -- Update README.md ([#2887](https://github.com/axios/axios/pull/2887)) - Small change to the data attribute doc of the config. A request body can also be set for DELETE methods but this wasn't mentioned in the documentation (it only mentioned POST, PUT and PATCH). Took my some 10-20 minutes until I realized that I don't need to manipulate the request body with transformRequest in the case of DELETE. -- Include swagger-taxos-codegen in ECOSYSTEM.md ([#2162](https://github.com/axios/axios/pull/2162)) -- Add CDNJS version badge in README.md ([#878](https://github.com/axios/axios/pull/878)) - This badge will show the version on CDNJS! -- Documentation update to clear up ambiguity in code examples ([#2928](https://github.com/axios/axios/pull/2928)) - - Made an adjustment to the documentation to clear up any ambiguity around the use of "fs". This should help clear up that the code examples with "fs" cannot be used on the client side. -- Update README.md about validateStatus ([#2912](https://github.com/axios/axios/pull/2912)) - Rewrote the comment from "Reject only if the status code is greater than or equal to 500" to "Resolve only if the status code is less than 500" -- Updating documentation for usage form-data ([#2805](https://github.com/axios/axios/pull/2805)) - Closes #2049 -- Fixing CHANGELOG.md issue link ([#2784](https://github.com/axios/axios/pull/2784)) -- Include axios-hooks in ECOSYSTEM.md ([#2003](https://github.com/axios/axios/pull/2003)) -- Added Response header access instructions ([#1901](https://github.com/axios/axios/pull/1901)) - - Added Response header access instructions - - Added note about using bracket notation -- Add `onUploadProgress` and `onDownloadProgress` are browser only ([#2763](https://github.com/axios/axios/pull/2763)) - Saw in #928 and #1966 that `onUploadProgress` and `onDownloadProgress` only work in the browser and was missing that from the README. -- Update ' sign to ` in proxy spec ([#2778](https://github.com/axios/axios/pull/2778)) -- Adding jsDelivr link in README ([#1110](https://github.com/axios/axios/pull/1110)) - - Adding jsDelivr link - - Add SRI - - Remove SRI - -Huge thanks to everyone who contributed to this release via code (authors listed -below) or via reviews and triaging on GitHub: - -- Alan Wang <wp_scut@163.com> -- Alexandru Ungureanu <khakcarot@gmail.com> -- Anubhav Srivastava <anubhav.srivastava00@gmail.com> -- Benny Neugebauer <bn@bennyn.de> -- Cr <631807682@qq.com> -- David <cygnidavid@gmail.com> -- David Ko <david.ko@pvtmethod.com> -- David Tanner <david.tanner@lifeomic.com> -- Emily Morehouse <emilyemorehouse@gmail.com> -- Felipe Martins <felipewmartins@gmail.com> -- Fonger <5862369+Fonger@users.noreply.github.com> -- Frostack <soulburn007@gmail.com> -- George Cheng <Gerhut@GMail.com> -- grumblerchester <grumblerchester@users.noreply.github.com> -- Gustavo López <gualopezb@gmail.com> -- hexaez <45806662+hexaez@users.noreply.github.com> -- huangzuizui <huangzuizui@gmail.com> -- Ian Wijma <ian@wij.ma> -- Jay <jasonsaayman@gmail.com> -- jeffjing <zgayjjf@qq.com> -- jennynju <46782518+jennynju@users.noreply.github.com> -- Jimmy Liao <52391190+jimmy-liao-gogoro@users.noreply.github.com> -- Jonathan Sharpe <j.r.sharpe@gmail.com> -- JounQin <admin@1stg.me> -- Justin Beckwith <justin.beckwith@gmail.com> -- Kamil Posiadała <3dcreator.pl@gmail.com> -- Lukas Drgon <lukas.drgon@gmail.com> -- marcinx <mail@marcinx.com> -- Martti Laine <martti@codeclown.net> -- Michał Zarach <michal.m.zarach@gmail.com> -- Moni <usmoni@gmail.com> -- Motonori Iwata <121048+iwata@users.noreply.github.com> -- Nikita Galkin <nikita@galk.in> -- Petr Mares <petr@mares.tw> -- Philippe Recto <precto1285@gmal.com> -- Remco Haszing <remcohaszing@gmail.com> -- rockcs1992 <chengshi1219@gmail.com> -- Ryan Bown <rbown@niftee.com.au> -- Samina Fu <sufuf3@gmail.com> -- Simone Busoli <simone.busoli@gmail.com> -- Spencer von der Ohe <s.vonderohe40@gmail.com> -- Sven Efftinge <sven.efftinge@typefox.io> -- Taegyeoung Oh <otk1090@naver.com> -- Taemin Shin <cprayer13@gmail.com> -- Thibault Ehrhart <1208424+ehrhart@users.noreply.github.com> -- Xianming Zhong <chinesedfan@qq.com> -- Yasu Flores <carlosyasu91@gmail.com> -- Zac Delventhal <delventhalz@gmail.com> - -### 0.19.2 (Jan 20, 2020) - -- Remove unnecessary XSS check ([#2679](https://github.com/axios/axios/pull/2679)) (see ([#2646](https://github.com/axios/axios/issues/2646)) for discussion) - -### 0.19.1 (Jan 7, 2020) - -Fixes and Functionality: - -- Fixing invalid agent issue ([#1904](https://github.com/axios/axios/pull/1904)) -- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) -- Delete useless default to hash ([#2458](https://github.com/axios/axios/pull/2458)) -- Fix HTTP/HTTPs agents passing to follow-redirect ([#1904](https://github.com/axios/axios/pull/1904)) -- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) -- Fix CI build failure ([#2570](https://github.com/axios/axios/pull/2570)) -- Remove dependency on is-buffer from package.json ([#1816](https://github.com/axios/axios/pull/1816)) -- Adding options typings ([#2341](https://github.com/axios/axios/pull/2341)) -- Adding Typescript HTTP method definition for LINK and UNLINK. ([#2444](https://github.com/axios/axios/pull/2444)) -- Update dist with newest changes, fixes Custom Attributes issue -- Change syntax to see if build passes ([#2488](https://github.com/axios/axios/pull/2488)) -- Update Webpack + deps, remove now unnecessary polyfills ([#2410](https://github.com/axios/axios/pull/2410)) -- Fix to prevent XSS, throw an error when the URL contains a JS script ([#2464](https://github.com/axios/axios/pull/2464)) -- Add custom timeout error copy in config ([#2275](https://github.com/axios/axios/pull/2275)) -- Add error toJSON example ([#2466](https://github.com/axios/axios/pull/2466)) -- Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scrip… ([#2451](https://github.com/axios/axios/pull/2451)) -- Fixing subdomain handling on no_proxy ([#2442](https://github.com/axios/axios/pull/2442)) -- Make redirection from HTTP to HTTPS work ([#2426](https://github.com/axios/axios/pull/2426)) and ([#2547](https://github.com/axios/axios/pull/2547)) -- Add toJSON property to AxiosError type ([#2427](https://github.com/axios/axios/pull/2427)) -- Fixing socket hang up error on node side for slow response. ([#1752](https://github.com/axios/axios/pull/1752)) -- Alternative syntax to send data into the body ([#2317](https://github.com/axios/axios/pull/2317)) -- Fixing custom config options ([#2207](https://github.com/axios/axios/pull/2207)) -- Fixing set `config.method` after mergeConfig for Axios.prototype.request ([#2383](https://github.com/axios/axios/pull/2383)) -- Axios create url bug ([#2290](https://github.com/axios/axios/pull/2290)) -- Do not modify config.url when using a relative baseURL (resolves [#1628](https://github.com/axios/axios/issues/1098)) ([#2391](https://github.com/axios/axios/pull/2391)) - -Internal: - -- Revert "Update Webpack + deps, remove now unnecessary polyfills" ([#2479](https://github.com/axios/axios/pull/2479)) -- Order of if/else blocks is causing unit tests mocking XHR. ([#2201](https://github.com/axios/axios/pull/2201)) -- Add license badge ([#2446](https://github.com/axios/axios/pull/2446)) -- Fix travis CI build [#2386](https://github.com/axios/axios/pull/2386) -- Fix cancellation error on build master. #2290 #2207 ([#2407](https://github.com/axios/axios/pull/2407)) - -Documentation: - -- Fixing typo in CHANGELOG.md: s/Functionallity/Functionality ([#2639](https://github.com/axios/axios/pull/2639)) -- Fix badge, use master branch ([#2538](https://github.com/axios/axios/pull/2538)) -- Fix typo in changelog [#2193](https://github.com/axios/axios/pull/2193) -- Document fix ([#2514](https://github.com/axios/axios/pull/2514)) -- Update docs with no_proxy change, issue #2484 ([#2513](https://github.com/axios/axios/pull/2513)) -- Fixing missing words in docs template ([#2259](https://github.com/axios/axios/pull/2259)) -- 🐛Fix request finally documentation in README ([#2189](https://github.com/axios/axios/pull/2189)) -- updating spelling and adding link to docs ([#2212](https://github.com/axios/axios/pull/2212)) -- docs: minor tweak ([#2404](https://github.com/axios/axios/pull/2404)) -- Update response interceptor docs ([#2399](https://github.com/axios/axios/pull/2399)) -- Update README.md ([#2504](https://github.com/axios/axios/pull/2504)) -- Fix word 'sintaxe' to 'syntax' in README.md ([#2432](https://github.com/axios/axios/pull/2432)) -- updating README: notes on CommonJS autocomplete ([#2256](https://github.com/axios/axios/pull/2256)) -- Fix grammar in README.md ([#2271](https://github.com/axios/axios/pull/2271)) -- Doc fixes, minor examples cleanup ([#2198](https://github.com/axios/axios/pull/2198)) - -### 0.19.0 (May 30, 2019) - -Fixes and Functionality: - -- Added support for no_proxy env variable ([#1693](https://github.com/axios/axios/pull/1693/files)) - Chance Dickson -- Unzip response body only for statuses != 204 ([#1129](https://github.com/axios/axios/pull/1129)) - drawski -- Destroy stream on exceeding maxContentLength (fixes [#1098](https://github.com/axios/axios/issues/1098)) ([#1485](https://github.com/axios/axios/pull/1485)) - Gadzhi Gadzhiev -- Makes Axios error generic to use AxiosResponse ([#1738](https://github.com/axios/axios/pull/1738)) - Suman Lama -- Fixing Mocha tests by locking follow-redirects version to 1.5.10 ([#1993](https://github.com/axios/axios/pull/1993)) - grumblerchester -- Allow uppercase methods in typings. ([#1781](https://github.com/axios/axios/pull/1781)) - Ken Powers -- Fixing building url with hash mark ([#1771](https://github.com/axios/axios/pull/1771)) - Anatoly Ryabov -- This commit fix building url with hash map (fragment identifier) when parameters are present: they must not be added after `#`, because client cut everything after `#` -- Preserve HTTP method when following redirect ([#1758](https://github.com/axios/axios/pull/1758)) - Rikki Gibson -- Add `getUri` signature to TypeScript definition. ([#1736](https://github.com/axios/axios/pull/1736)) - Alexander Trauzzi -- Adding isAxiosError flag to errors thrown by axios ([#1419](https://github.com/axios/axios/pull/1419)) - Ayush Gupta - -Internal: - -- Fixing .eslintrc without extension ([#1789](https://github.com/axios/axios/pull/1789)) - Manoel -- Fix failing SauceLabs tests by updating configuration - Emily Morehouse -- Add issue templates - Emily Morehouse - -Documentation: - -- Consistent coding style in README ([#1787](https://github.com/axios/axios/pull/1787)) - Ali Servet Donmez -- Add information about auth parameter to README ([#2166](https://github.com/axios/axios/pull/2166)) - xlaguna -- Add DELETE to list of methods that allow data as a config option ([#2169](https://github.com/axios/axios/pull/2169)) - Daniela Borges Matos de Carvalho -- Update ECOSYSTEM.md - Add Axios Endpoints ([#2176](https://github.com/axios/axios/pull/2176)) - Renan -- Add r2curl in ECOSYSTEM ([#2141](https://github.com/axios/axios/pull/2141)) - 유용우 / CX -- Update README.md - Add instructions for installing with yarn ([#2036](https://github.com/axios/axios/pull/2036)) - Victor Hermes -- Fixing spacing for README.md ([#2066](https://github.com/axios/axios/pull/2066)) - Josh McCarty -- Update README.md. - Change `.then` to `.finally` in example code ([#2090](https://github.com/axios/axios/pull/2090)) - Omar Cai -- Clarify what values responseType can have in Node ([#2121](https://github.com/axios/axios/pull/2121)) - Tyler Breisacher -- docs(ECOSYSTEM): add axios-api-versioning ([#2020](https://github.com/axios/axios/pull/2020)) - Weffe -- It seems that `responseType: 'blob'` doesn't actually work in Node (when I tried using it, response.data was a string, not a Blob, since Node doesn't have Blobs), so this clarifies that this option should only be used in the browser -- Update README.md. - Add Querystring library note ([#1896](https://github.com/axios/axios/pull/1896)) - Dmitriy Eroshenko -- Add react-hooks-axios to Libraries section of ECOSYSTEM.md ([#1925](https://github.com/axios/axios/pull/1925)) - Cody Chan -- Clarify in README that default timeout is 0 (no timeout) ([#1750](https://github.com/axios/axios/pull/1750)) - Ben Standefer - -### 0.19.0-beta.1 (Aug 9, 2018) - -**NOTE:** This is a beta version of this release. There may be functionality that is broken in -certain browsers, though we suspect that builds are hanging and not erroring. See -https://saucelabs.com/u/axios for the most up-to-date information. - -New Functionality: - -- Add getUri method ([#1712](https://github.com/axios/axios/issues/1712)) -- Add support for no_proxy env variable ([#1693](https://github.com/axios/axios/issues/1693)) -- Add toJSON to decorated Axios errors to facilitate serialization ([#1625](https://github.com/axios/axios/issues/1625)) -- Add second then on axios call ([#1623](https://github.com/axios/axios/issues/1623)) -- Typings: allow custom return types -- Add option to specify character set in responses (with http adapter) - -Fixes: - -- Fix Keep defaults local to instance ([#385](https://github.com/axios/axios/issues/385)) -- Correctly catch exception in http test ([#1475](https://github.com/axios/axios/issues/1475)) -- Fix accept header normalization ([#1698](https://github.com/axios/axios/issues/1698)) -- Fix http adapter to allow HTTPS connections via HTTP ([#959](https://github.com/axios/axios/issues/959)) -- Fix Removes usage of deprecated Buffer constructor. ([#1555](https://github.com/axios/axios/issues/1555), [#1622](https://github.com/axios/axios/issues/1622)) -- Fix defaults to use httpAdapter if available ([#1285](https://github.com/axios/axios/issues/1285)) - - Fixing defaults to use httpAdapter if available - - Use a safer, cross-platform method to detect the Node environment -- Fix Reject promise if request is cancelled by the browser ([#537](https://github.com/axios/axios/issues/537)) -- [Typescript] Fix missing type parameters on delete/head methods -- [NS]: Send `false` flag isStandardBrowserEnv for Nativescript -- Fix missing type parameters on delete/head -- Fix Default method for an instance always overwritten by get -- Fix type error when socketPath option in AxiosRequestConfig -- Capture errors on request data streams -- Decorate resolve and reject to clear timeout in all cases - -Huge thanks to everyone who contributed to this release via code (authors listed -below) or via reviews and triaging on GitHub: - -- Andrew Scott <ascott18@gmail.com> -- Anthony Gauthier <antho325@hotmail.com> -- arpit <arpit2438735@gmail.com> -- ascott18 -- Benedikt Rötsch <axe312ger@users.noreply.github.com> -- Chance Dickson <me@chancedickson.com> -- Dave Stewart <info@davestewart.co.uk> -- Deric Cain <deric.cain@gmail.com> -- Guillaume Briday <guillaumebriday@gmail.com> -- Jacob Wejendorp <jacob@wejendorp.dk> -- Jim Lynch <mrdotjim@gmail.com> -- johntron -- Justin Beckwith <beckwith@google.com> -- Justin Beckwith <justin.beckwith@gmail.com> -- Khaled Garbaya <khaledgarbaya@gmail.com> -- Lim Jing Rong <jjingrong@users.noreply.github.com> -- Mark van den Broek <mvdnbrk@gmail.com> -- Martti Laine <martti@codeclown.net> -- mattridley -- mattridley <matt.r@joinblink.com> -- Nicolas Del Valle <nicolas.delvalle@gmail.com> -- Nilegfx -- pbarbiero -- Rikki Gibson <rikkigibson@gmail.com> -- Sako Hartounian <sakohartounian@yahoo.com> -- Shane Fitzpatrick <fitzpasd@gmail.com> -- Stephan Schneider <stephanschndr@gmail.com> -- Steven <steven@ceriously.com> -- Tim Garthwaite <tim.garthwaite@jibo.com> -- Tim Johns <timjohns@yahoo.com> -- Yutaro Miyazaki <yutaro@studio-rubbish.com> - -### 0.18.0 (Feb 19, 2018) - -- Adding support for UNIX Sockets when running with Node.js ([#1070](https://github.com/axios/axios/pull/1070)) -- Fixing typings ([#1177](https://github.com/axios/axios/pull/1177)): - - AxiosRequestConfig.proxy: allows type false - - AxiosProxyConfig: added auth field -- Adding function signature in AxiosInstance interface so AxiosInstance can be invoked ([#1192](https://github.com/axios/axios/pull/1192), [#1254](https://github.com/axios/axios/pull/1254)) -- Allowing maxContentLength to pass through to redirected calls as maxBodyLength in follow-redirects config ([#1287](https://github.com/axios/axios/pull/1287)) -- Fixing configuration when using an instance - method can now be set ([#1342](https://github.com/axios/axios/pull/1342)) - -### 0.17.1 (Nov 11, 2017) - -- Fixing issue with web workers ([#1160](https://github.com/axios/axios/pull/1160)) -- Allowing overriding transport ([#1080](https://github.com/axios/axios/pull/1080)) -- Updating TypeScript typings ([#1165](https://github.com/axios/axios/pull/1165), [#1125](https://github.com/axios/axios/pull/1125), [#1131](https://github.com/axios/axios/pull/1131)) - -### 0.17.0 (Oct 21, 2017) - -- **BREAKING** Fixing issue with `baseURL` and interceptors ([#950](https://github.com/axios/axios/pull/950)) -- **BREAKING** Improving handing of duplicate headers ([#874](https://github.com/axios/axios/pull/874)) -- Adding support for disabling proxies ([#691](https://github.com/axios/axios/pull/691)) -- Updating TypeScript typings with generic type parameters ([#1061](https://github.com/axios/axios/pull/1061)) - -### 0.16.2 (Jun 3, 2017) - -- Fixing issue with including `buffer` in bundle ([#887](https://github.com/axios/axios/pull/887)) -- Including underlying request in errors ([#830](https://github.com/axios/axios/pull/830)) -- Convert `method` to lowercase ([#930](https://github.com/axios/axios/pull/930)) - -### 0.16.1 (Apr 8, 2017) - -- Improving HTTP adapter to return last request in case of redirects ([#828](https://github.com/axios/axios/pull/828)) -- Updating `follow-redirects` dependency ([#829](https://github.com/axios/axios/pull/829)) -- Adding support for passing `Buffer` in node ([#773](https://github.com/axios/axios/pull/773)) - -### 0.16.0 (Mar 31, 2017) - -- **BREAKING** Removing `Promise` from axios typings in favor of built-in type declarations ([#480](https://github.com/axios/axios/issues/480)) -- Adding `options` shortcut method ([#461](https://github.com/axios/axios/pull/461)) -- Fixing issue with using `responseType: 'json'` in browsers incompatible with XHR Level 2 ([#654](https://github.com/axios/axios/pull/654)) -- Improving React Native detection ([#731](https://github.com/axios/axios/pull/731)) -- Fixing `combineURLs` to support empty `relativeURL` ([#581](https://github.com/axios/axios/pull/581)) -- Removing `PROTECTION_PREFIX` support ([#561](https://github.com/axios/axios/pull/561)) - -### 0.15.3 (Nov 27, 2016) - -- Fixing issue with custom instances and global defaults ([#443](https://github.com/axios/axios/issues/443)) -- Renaming `axios.d.ts` to `index.d.ts` ([#519](https://github.com/axios/axios/issues/519)) -- Adding `get`, `head`, and `delete` to `defaults.headers` ([#509](https://github.com/axios/axios/issues/509)) -- Fixing issue with `btoa` and IE ([#507](https://github.com/axios/axios/issues/507)) -- Adding support for proxy authentication ([#483](https://github.com/axios/axios/pull/483)) -- Improving HTTP adapter to use `http` protocol by default ([#493](https://github.com/axios/axios/pull/493)) -- Fixing proxy issues ([#491](https://github.com/axios/axios/pull/491)) - -### 0.15.2 (Oct 17, 2016) - -- Fixing issue with calling `cancel` after response has been received ([#482](https://github.com/axios/axios/issues/482)) - -### 0.15.1 (Oct 14, 2016) - -- Fixing issue with UMD ([#485](https://github.com/axios/axios/issues/485)) - -### 0.15.0 (Oct 10, 2016) - -- Adding cancellation support ([#452](https://github.com/axios/axios/pull/452)) -- Moving default adapter to global defaults ([#437](https://github.com/axios/axios/pull/437)) -- Fixing issue with `file` URI scheme ([#440](https://github.com/axios/axios/pull/440)) -- Fixing issue with `params` objects that have no prototype ([#445](https://github.com/axios/axios/pull/445)) - -### 0.14.0 (Aug 27, 2016) - -- **BREAKING** Updating TypeScript definitions ([#419](https://github.com/axios/axios/pull/419)) -- **BREAKING** Replacing `agent` option with `httpAgent` and `httpsAgent` ([#387](https://github.com/axios/axios/pull/387)) -- **BREAKING** Splitting `progress` event handlers into `onUploadProgress` and `onDownloadProgress` ([#423](https://github.com/axios/axios/pull/423)) -- Adding support for `http_proxy` and `https_proxy` environment variables ([#366](https://github.com/axios/axios/pull/366)) -- Fixing issue with `auth` config option and `Authorization` header ([#397](https://github.com/axios/axios/pull/397)) -- Don't set XSRF header if `xsrfCookieName` is `null` ([#406](https://github.com/axios/axios/pull/406)) - -### 0.13.1 (Jul 16, 2016) - -- Fixing issue with response data not being transformed on error ([#378](https://github.com/axios/axios/issues/378)) - -### 0.13.0 (Jul 13, 2016) - -- **BREAKING** Improved error handling ([#345](https://github.com/axios/axios/pull/345)) -- **BREAKING** Response transformer now invoked in dispatcher not adapter ([10eb238](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e)) -- **BREAKING** Request adapters now return a `Promise` ([157efd5](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a)) -- Fixing issue with `withCredentials` not being overwritten ([#343](https://github.com/axios/axios/issues/343)) -- Fixing regression with request transformer being called before request interceptor ([#352](https://github.com/axios/axios/issues/352)) -- Fixing custom instance defaults ([#341](https://github.com/axios/axios/issues/341)) -- Fixing instances created from `axios.create` to have same API as default axios ([#217](https://github.com/axios/axios/issues/217)) - -### 0.12.0 (May 31, 2016) - -- Adding support for `URLSearchParams` ([#317](https://github.com/axios/axios/pull/317)) -- Adding `maxRedirects` option ([#307](https://github.com/axios/axios/pull/307)) - -### 0.11.1 (May 17, 2016) - -- Fixing IE CORS support ([#313](https://github.com/axios/axios/pull/313)) -- Fixing detection of `FormData` ([#325](https://github.com/axios/axios/pull/325)) -- Adding `Axios` class to exports ([#321](https://github.com/axios/axios/pull/321)) - -### 0.11.0 (Apr 26, 2016) - -- Adding support for Stream with HTTP adapter ([#296](https://github.com/axios/axios/pull/296)) -- Adding support for custom HTTP status code error ranges ([#308](https://github.com/axios/axios/pull/308)) -- Fixing issue with ArrayBuffer ([#299](https://github.com/axios/axios/pull/299)) - -### 0.10.0 (Apr 20, 2016) - -- Fixing issue with some requests sending `undefined` instead of `null` ([#250](https://github.com/axios/axios/pull/250)) -- Fixing basic auth for HTTP adapter ([#252](https://github.com/axios/axios/pull/252)) -- Fixing request timeout for XHR adapter ([#227](https://github.com/axios/axios/pull/227)) -- Fixing IE8 support by using `onreadystatechange` instead of `onload` ([#249](https://github.com/axios/axios/pull/249)) -- Fixing IE9 cross domain requests ([#251](https://github.com/axios/axios/pull/251)) -- Adding `maxContentLength` option ([#275](https://github.com/axios/axios/pull/275)) -- Fixing XHR support for WebWorker environment ([#279](https://github.com/axios/axios/pull/279)) -- Adding request instance to response ([#200](https://github.com/axios/axios/pull/200)) - -### 0.9.1 (Jan 24, 2016) - -- Improving handling of request timeout in node ([#124](https://github.com/axios/axios/issues/124)) -- Fixing network errors not rejecting ([#205](https://github.com/axios/axios/pull/205)) -- Fixing issue with IE rejecting on HTTP 204 ([#201](https://github.com/axios/axios/issues/201)) -- Fixing host/port when following redirects ([#198](https://github.com/axios/axios/pull/198)) - -### 0.9.0 (Jan 18, 2016) - -- Adding support for custom adapters -- Fixing Content-Type header being removed when data is false ([#195](https://github.com/axios/axios/pull/195)) -- Improving XDomainRequest implementation ([#185](https://github.com/axios/axios/pull/185)) -- Improving config merging and order of precedence ([#183](https://github.com/axios/axios/pull/183)) -- Fixing XDomainRequest support for only <= IE9 ([#182](https://github.com/axios/axios/pull/182)) - -### 0.8.1 (Dec 14, 2015) - -- Adding support for passing XSRF token for cross domain requests when using `withCredentials` ([#168](https://github.com/axios/axios/pull/168)) -- Fixing error with format of basic auth header ([#178](https://github.com/axios/axios/pull/173)) -- Fixing error with JSON payloads throwing `InvalidStateError` in some cases ([#174](https://github.com/axios/axios/pull/174)) - -### 0.8.0 (Dec 11, 2015) - -- Adding support for creating instances of axios ([#123](https://github.com/axios/axios/pull/123)) -- Fixing http adapter to use `Buffer` instead of `String` in case of `responseType === 'arraybuffer'` ([#128](https://github.com/axios/axios/pull/128)) -- Adding support for using custom parameter serializer with `paramsSerializer` option ([#121](https://github.com/axios/axios/pull/121)) -- Fixing issue in IE8 caused by `forEach` on `arguments` ([#127](https://github.com/axios/axios/pull/127)) -- Adding support for following redirects in node ([#146](https://github.com/axios/axios/pull/146)) -- Adding support for transparent decompression if `content-encoding` is set ([#149](https://github.com/axios/axios/pull/149)) -- Adding support for transparent XDomainRequest to handle cross domain requests in IE9 ([#140](https://github.com/axios/axios/pull/140)) -- Adding support for HTTP basic auth via Authorization header ([#167](https://github.com/axios/axios/pull/167)) -- Adding support for baseURL option ([#160](https://github.com/axios/axios/pull/160)) - -### 0.7.0 (Sep 29, 2015) - -- Fixing issue with minified bundle in IE8 ([#87](https://github.com/axios/axios/pull/87)) -- Adding support for passing agent in node ([#102](https://github.com/axios/axios/pull/102)) -- Adding support for returning result from `axios.spread` for chaining ([#106](https://github.com/axios/axios/pull/106)) -- Fixing typescript definition ([#105](https://github.com/axios/axios/pull/105)) -- Fixing default timeout config for node ([#112](https://github.com/axios/axios/pull/112)) -- Adding support for use in web workers, and react-native ([#70](https://github.com/axios/axios/issue/70)), ([#98](https://github.com/axios/axios/pull/98)) -- Adding support for fetch like API `axios(url[, config])` ([#116](https://github.com/axios/axios/issues/116)) - -### 0.6.0 (Sep 21, 2015) - -- Removing deprecated success/error aliases -- Fixing issue with array params not being properly encoded ([#49](https://github.com/axios/axios/pull/49)) -- Fixing issue with User-Agent getting overridden ([#69](https://github.com/axios/axios/issues/69)) -- Adding support for timeout config ([#56](https://github.com/axios/axios/issues/56)) -- Removing es6-promise dependency -- Fixing issue preventing `length` to be used as a parameter ([#91](https://github.com/axios/axios/pull/91)) -- Fixing issue with IE8 ([#85](https://github.com/axios/axios/pull/85)) -- Converting build to UMD - -### 0.5.4 (Apr 08, 2015) - -- Fixing issue with FormData not being sent ([#53](https://github.com/axios/axios/issues/53)) - -### 0.5.3 (Apr 07, 2015) - -- Using JSON.parse unconditionally when transforming response string ([#55](https://github.com/axios/axios/issues/55)) - -### 0.5.2 (Mar 13, 2015) - -- Adding support for `statusText` in response ([#46](https://github.com/axios/axios/issues/46)) - -### 0.5.1 (Mar 10, 2015) - -- Fixing issue using strict mode ([#45](https://github.com/axios/axios/issues/45)) -- Fixing issue with standalone build ([#47](https://github.com/axios/axios/issues/47)) - -### 0.5.0 (Jan 23, 2015) - -- Adding support for intercepetors ([#14](https://github.com/axios/axios/issues/14)) -- Updating es6-promise dependency - -### 0.4.2 (Dec 10, 2014) - -- Fixing issue with `Content-Type` when using `FormData` ([#22](https://github.com/axios/axios/issues/22)) -- Adding support for TypeScript ([#25](https://github.com/axios/axios/issues/25)) -- Fixing issue with standalone build ([#29](https://github.com/axios/axios/issues/29)) -- Fixing issue with verbs needing to be capitalized in some browsers ([#30](https://github.com/axios/axios/issues/30)) - -### 0.4.1 (Oct 15, 2014) - -- Adding error handling to request for node.js ([#18](https://github.com/axios/axios/issues/18)) - -### 0.4.0 (Oct 03, 2014) - -- Adding support for `ArrayBuffer` and `ArrayBufferView` ([#10](https://github.com/axios/axios/issues/10)) -- Adding support for utf-8 for node.js ([#13](https://github.com/axios/axios/issues/13)) -- Adding support for SSL for node.js ([#12](https://github.com/axios/axios/issues/12)) -- Fixing incorrect `Content-Type` header ([#9](https://github.com/axios/axios/issues/9)) -- Adding standalone build without bundled es6-promise ([#11](https://github.com/axios/axios/issues/11)) -- Deprecating `success`/`error` in favor of `then`/`catch` - -### 0.3.1 (Sep 16, 2014) - -- Fixing missing post body when using node.js ([#3](https://github.com/axios/axios/issues/3)) - -### 0.3.0 (Sep 16, 2014) - -- Fixing `success` and `error` to properly receive response data as individual arguments ([#8](https://github.com/axios/axios/issues/8)) -- Updating `then` and `catch` to receive response data as a single object ([#6](https://github.com/axios/axios/issues/6)) -- Fixing issue with `all` not working ([#7](https://github.com/axios/axios/issues/7)) - -### 0.2.2 (Sep 14, 2014) - -- Fixing bundling with browserify ([#4](https://github.com/axios/axios/issues/4)) - -### 0.2.1 (Sep 12, 2014) - -- Fixing build problem causing ridiculous file sizes - -### 0.2.0 (Sep 12, 2014) - -- Adding support for `all` and `spread` -- Adding support for node.js ([#1](https://github.com/axios/axios/issues/1)) - -### 0.1.0 (Aug 29, 2014) - -- Initial release diff --git a/alarm/node_modules/pronote-api/node_modules/axios/LICENSE b/alarm/node_modules/pronote-api/node_modules/axios/LICENSE deleted file mode 100644 index d36c80e..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014-present Matt Zabriskie - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/alarm/node_modules/pronote-api/node_modules/axios/README.md b/alarm/node_modules/pronote-api/node_modules/axios/README.md deleted file mode 100755 index b8c019a..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/README.md +++ /dev/null @@ -1,868 +0,0 @@ -# axios - -[![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) -[![CDNJS](https://img.shields.io/cdnjs/v/axios.svg?style=flat-square)](https://cdnjs.com/libraries/axios) -![Build status](https://github.com/axios/axios/actions/workflows/ci.yml/badge.svg) -[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/axios/axios) -[![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios) -[![install size](https://packagephobia.now.sh/badge?p=axios)](https://packagephobia.now.sh/result?p=axios) -[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](http://npm-stat.com/charts.html?package=axios) -[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) -[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) - -Promise based HTTP client for the browser and node.js - -> New axios docs website: [click here](https://axios-http.com/) - -## Table of Contents - - - [Features](#features) - - [Browser Support](#browser-support) - - [Installing](#installing) - - [Example](#example) - - [Axios API](#axios-api) - - [Request method aliases](#request-method-aliases) - - [Concurrency (Deprecated)](#concurrency-deprecated) - - [Creating an instance](#creating-an-instance) - - [Instance methods](#instance-methods) - - [Request Config](#request-config) - - [Response Schema](#response-schema) - - [Config Defaults](#config-defaults) - - [Global axios defaults](#global-axios-defaults) - - [Custom instance defaults](#custom-instance-defaults) - - [Config order of precedence](#config-order-of-precedence) - - [Interceptors](#interceptors) - - [Handling Errors](#handling-errors) - - [Cancellation](#cancellation) - - [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) - - [Browser](#browser) - - [Node.js](#nodejs) - - [Query string](#query-string) - - [Form data](#form-data) - - [Semver](#semver) - - [Promises](#promises) - - [TypeScript](#typescript) - - [Resources](#resources) - - [Credits](#credits) - - [License](#license) - -## Features - -- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser -- Make [http](http://nodejs.org/api/http.html) requests from node.js -- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API -- Intercept request and response -- Transform request and response data -- Cancel requests -- Automatic transforms for JSON data -- Client side support for protecting against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) - -## Browser Support - -![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | ---- | --- | --- | --- | --- | --- | -Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ | - -[![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) - -## Installing - -Using npm: - -```bash -$ npm install axios -``` - -Using bower: - -```bash -$ bower install axios -``` - -Using yarn: - -```bash -$ yarn add axios -``` - -Using jsDelivr CDN: - -```html -<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script> -``` - -Using unpkg CDN: - -```html -<script src="https://unpkg.com/axios/dist/axios.min.js"></script> -``` - -## Example - -### note: CommonJS usage -In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach: - -```js -const axios = require('axios').default; - -// axios.<method> will now provide autocomplete and parameter typings -``` - -Performing a `GET` request - -```js -const axios = require('axios'); - -// Make a request for a user with a given ID -axios.get('/user?ID=12345') - .then(function (response) { - // handle success - console.log(response); - }) - .catch(function (error) { - // handle error - console.log(error); - }) - .then(function () { - // always executed - }); - -// Optionally the request above could also be done as -axios.get('/user', { - params: { - ID: 12345 - } - }) - .then(function (response) { - console.log(response); - }) - .catch(function (error) { - console.log(error); - }) - .then(function () { - // always executed - }); - -// Want to use async/await? Add the `async` keyword to your outer function/method. -async function getUser() { - try { - const response = await axios.get('/user?ID=12345'); - console.log(response); - } catch (error) { - console.error(error); - } -} -``` - -> **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet -> Explorer and older browsers, so use with caution. - -Performing a `POST` request - -```js -axios.post('/user', { - firstName: 'Fred', - lastName: 'Flintstone' - }) - .then(function (response) { - console.log(response); - }) - .catch(function (error) { - console.log(error); - }); -``` - -Performing multiple concurrent requests - -```js -function getUserAccount() { - return axios.get('/user/12345'); -} - -function getUserPermissions() { - return axios.get('/user/12345/permissions'); -} - -Promise.all([getUserAccount(), getUserPermissions()]) - .then(function (results) { - const acct = results[0]; - const perm = results[1]; - }); -``` - -## axios API - -Requests can be made by passing the relevant config to `axios`. - -##### axios(config) - -```js -// Send a POST request -axios({ - method: 'post', - url: '/user/12345', - data: { - firstName: 'Fred', - lastName: 'Flintstone' - } -}); -``` - -```js -// GET request for remote image in node.js -axios({ - method: 'get', - url: 'http://bit.ly/2mTM3nY', - responseType: 'stream' -}) - .then(function (response) { - response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) - }); -``` - -##### axios(url[, config]) - -```js -// Send a GET request (default method) -axios('/user/12345'); -``` - -### Request method aliases - -For convenience aliases have been provided for all supported request methods. - -##### axios.request(config) -##### axios.get(url[, config]) -##### axios.delete(url[, config]) -##### axios.head(url[, config]) -##### axios.options(url[, config]) -##### axios.post(url[, data[, config]]) -##### axios.put(url[, data[, config]]) -##### axios.patch(url[, data[, config]]) - -###### NOTE -When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. - -### Concurrency (Deprecated) -Please use `Promise.all` to replace the below functions. - -Helper functions for dealing with concurrent requests. - -axios.all(iterable) -axios.spread(callback) - -### Creating an instance - -You can create a new instance of axios with a custom config. - -##### axios.create([config]) - -```js -const instance = axios.create({ - baseURL: 'https://some-domain.com/api/', - timeout: 1000, - headers: {'X-Custom-Header': 'foobar'} -}); -``` - -### Instance methods - -The available instance methods are listed below. The specified config will be merged with the instance config. - -##### axios#request(config) -##### axios#get(url[, config]) -##### axios#delete(url[, config]) -##### axios#head(url[, config]) -##### axios#options(url[, config]) -##### axios#post(url[, data[, config]]) -##### axios#put(url[, data[, config]]) -##### axios#patch(url[, data[, config]]) -##### axios#getUri([config]) - -## Request Config - -These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. - -```js -{ - // `url` is the server URL that will be used for the request - url: '/user', - - // `method` is the request method to be used when making the request - method: 'get', // default - - // `baseURL` will be prepended to `url` unless `url` is absolute. - // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs - // to methods of that instance. - baseURL: 'https://some-domain.com/api/', - - // `transformRequest` allows changes to the request data before it is sent to the server - // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' - // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, - // FormData or Stream - // You may modify the headers object. - transformRequest: [function (data, headers) { - // Do whatever you want to transform the data - - return data; - }], - - // `transformResponse` allows changes to the response data to be made before - // it is passed to then/catch - transformResponse: [function (data) { - // Do whatever you want to transform the data - - return data; - }], - - // `headers` are custom headers to be sent - headers: {'X-Requested-With': 'XMLHttpRequest'}, - - // `params` are the URL parameters to be sent with the request - // Must be a plain object or a URLSearchParams object - params: { - ID: 12345 - }, - - // `paramsSerializer` is an optional function in charge of serializing `params` - // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) - paramsSerializer: function (params) { - return Qs.stringify(params, {arrayFormat: 'brackets'}) - }, - - // `data` is the data to be sent as the request body - // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' - // When no `transformRequest` is set, must be of one of the following types: - // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams - // - Browser only: FormData, File, Blob - // - Node only: Stream, Buffer - data: { - firstName: 'Fred' - }, - - // syntax alternative to send data into the body - // method post - // only the value is sent, not the key - data: 'Country=Brasil&City=Belo Horizonte', - - // `timeout` specifies the number of milliseconds before the request times out. - // If the request takes longer than `timeout`, the request will be aborted. - timeout: 1000, // default is `0` (no timeout) - - // `withCredentials` indicates whether or not cross-site Access-Control requests - // should be made using credentials - withCredentials: false, // default - - // `adapter` allows custom handling of requests which makes testing easier. - // Return a promise and supply a valid response (see lib/adapters/README.md). - adapter: function (config) { - /* ... */ - }, - - // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. - // This will set an `Authorization` header, overwriting any existing - // `Authorization` custom headers you have set using `headers`. - // Please note that only HTTP Basic auth is configurable through this parameter. - // For Bearer tokens and such, use `Authorization` custom headers instead. - auth: { - username: 'janedoe', - password: 's00pers3cret' - }, - - // `responseType` indicates the type of data that the server will respond with - // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' - // browser only: 'blob' - responseType: 'json', // default - - // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) - // Note: Ignored for `responseType` of 'stream' or client-side requests - responseEncoding: 'utf8', // default - - // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token - xsrfCookieName: 'XSRF-TOKEN', // default - - // `xsrfHeaderName` is the name of the http header that carries the xsrf token value - xsrfHeaderName: 'X-XSRF-TOKEN', // default - - // `onUploadProgress` allows handling of progress events for uploads - // browser only - onUploadProgress: function (progressEvent) { - // Do whatever you want with the native progress event - }, - - // `onDownloadProgress` allows handling of progress events for downloads - // browser only - onDownloadProgress: function (progressEvent) { - // Do whatever you want with the native progress event - }, - - // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js - maxContentLength: 2000, - - // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed - maxBodyLength: 2000, - - // `validateStatus` defines whether to resolve or reject the promise for a given - // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` - // or `undefined`), the promise will be resolved; otherwise, the promise will be - // rejected. - validateStatus: function (status) { - return status >= 200 && status < 300; // default - }, - - // `maxRedirects` defines the maximum number of redirects to follow in node.js. - // If set to 0, no redirects will be followed. - maxRedirects: 5, // default - - // `socketPath` defines a UNIX Socket to be used in node.js. - // e.g. '/var/run/docker.sock' to send requests to the docker daemon. - // Only either `socketPath` or `proxy` can be specified. - // If both are specified, `socketPath` is used. - socketPath: null, // default - - // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http - // and https requests, respectively, in node.js. This allows options to be added like - // `keepAlive` that are not enabled by default. - httpAgent: new http.Agent({ keepAlive: true }), - httpsAgent: new https.Agent({ keepAlive: true }), - - // `proxy` defines the hostname, port, and protocol of the proxy server. - // You can also define your proxy using the conventional `http_proxy` and - // `https_proxy` environment variables. If you are using environment variables - // for your proxy configuration, you can also define a `no_proxy` environment - // variable as a comma-separated list of domains that should not be proxied. - // Use `false` to disable proxies, ignoring environment variables. - // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and - // supplies credentials. - // This will set an `Proxy-Authorization` header, overwriting any existing - // `Proxy-Authorization` custom headers you have set using `headers`. - // If the proxy server uses HTTPS, then you must set the protocol to `https`. - proxy: { - protocol: 'https', - host: '127.0.0.1', - port: 9000, - auth: { - username: 'mikeymike', - password: 'rapunz3l' - } - }, - - // `cancelToken` specifies a cancel token that can be used to cancel the request - // (see Cancellation section below for details) - cancelToken: new CancelToken(function (cancel) { - }), - - // `decompress` indicates whether or not the response body should be decompressed - // automatically. If set to `true` will also remove the 'content-encoding' header - // from the responses objects of all decompressed responses - // - Node only (XHR cannot turn off decompression) - decompress: true, // default - - // transitional options for backward compatibility that may be removed in the newer versions - transitional: { - // silent JSON parsing mode - // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) - // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json') - silentJSONParsing: true, // default value for the current Axios version - - // try to parse the response string as JSON even if `responseType` is not 'json' - forcedJSONParsing: true, - - // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts - clarifyTimeoutError: false, - } -} -``` - -## Response Schema - -The response for a request contains the following information. - -```js -{ - // `data` is the response that was provided by the server - data: {}, - - // `status` is the HTTP status code from the server response - status: 200, - - // `statusText` is the HTTP status message from the server response - statusText: 'OK', - - // `headers` the HTTP headers that the server responded with - // All header names are lower cased and can be accessed using the bracket notation. - // Example: `response.headers['content-type']` - headers: {}, - - // `config` is the config that was provided to `axios` for the request - config: {}, - - // `request` is the request that generated this response - // It is the last ClientRequest instance in node.js (in redirects) - // and an XMLHttpRequest instance in the browser - request: {} -} -``` - -When using `then`, you will receive the response as follows: - -```js -axios.get('/user/12345') - .then(function (response) { - console.log(response.data); - console.log(response.status); - console.log(response.statusText); - console.log(response.headers); - console.log(response.config); - }); -``` - -When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. - -## Config Defaults - -You can specify config defaults that will be applied to every request. - -### Global axios defaults - -```js -axios.defaults.baseURL = 'https://api.example.com'; - -// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them. -// See below for an example using Custom instance defaults instead. -axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; - -axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; -``` - -### Custom instance defaults - -```js -// Set config defaults when creating the instance -const instance = axios.create({ - baseURL: 'https://api.example.com' -}); - -// Alter defaults after instance has been created -instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; -``` - -### Config order of precedence - -Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. - -```js -// Create an instance using the config defaults provided by the library -// At this point the timeout config value is `0` as is the default for the library -const instance = axios.create(); - -// Override timeout default for the library -// Now all requests using this instance will wait 2.5 seconds before timing out -instance.defaults.timeout = 2500; - -// Override timeout for this request as it's known to take a long time -instance.get('/longRequest', { - timeout: 5000 -}); -``` - -## Interceptors - -You can intercept requests or responses before they are handled by `then` or `catch`. - -```js -// Add a request interceptor -axios.interceptors.request.use(function (config) { - // Do something before request is sent - return config; - }, function (error) { - // Do something with request error - return Promise.reject(error); - }); - -// Add a response interceptor -axios.interceptors.response.use(function (response) { - // Any status code that lie within the range of 2xx cause this function to trigger - // Do something with response data - return response; - }, function (error) { - // Any status codes that falls outside the range of 2xx cause this function to trigger - // Do something with response error - return Promise.reject(error); - }); -``` - -If you need to remove an interceptor later you can. - -```js -const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); -axios.interceptors.request.eject(myInterceptor); -``` - -You can add interceptors to a custom instance of axios. - -```js -const instance = axios.create(); -instance.interceptors.request.use(function () {/*...*/}); -``` - -When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay -in the execution of your axios request when the main thread is blocked (a promise is created under the hood for -the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag -to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. - -```js -axios.interceptors.request.use(function (config) { - config.headers.test = 'I am only a header!'; - return config; -}, null, { synchronous: true }); -``` - -If you want to execute a particular interceptor based on a runtime check, -you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return -of `runWhen` is `false`. The function will be called with the config -object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an -asynchronous request interceptor that only needs to run at certain times. - -```js -function onGetCall(config) { - return config.method === 'get'; -} -axios.interceptors.request.use(function (config) { - config.headers.test = 'special get headers'; - return config; -}, null, { runWhen: onGetCall }); -``` - -## Handling Errors - -```js -axios.get('/user/12345') - .catch(function (error) { - if (error.response) { - // The request was made and the server responded with a status code - // that falls out of the range of 2xx - console.log(error.response.data); - console.log(error.response.status); - console.log(error.response.headers); - } else if (error.request) { - // The request was made but no response was received - // `error.request` is an instance of XMLHttpRequest in the browser and an instance of - // http.ClientRequest in node.js - console.log(error.request); - } else { - // Something happened in setting up the request that triggered an Error - console.log('Error', error.message); - } - console.log(error.config); - }); -``` - -Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. - -```js -axios.get('/user/12345', { - validateStatus: function (status) { - return status < 500; // Resolve only if the status code is less than 500 - } -}) -``` - -Using `toJSON` you get an object with more information about the HTTP error. - -```js -axios.get('/user/12345') - .catch(function (error) { - console.log(error.toJSON()); - }); -``` - -## Cancellation - -You can cancel a request using a *cancel token*. - -> The axios cancel token API is based on the withdrawn [cancelable promises proposal](https://github.com/tc39/proposal-cancelable-promises). - -You can create a cancel token using the `CancelToken.source` factory as shown below: - -```js -const CancelToken = axios.CancelToken; -const source = CancelToken.source(); - -axios.get('/user/12345', { - cancelToken: source.token -}).catch(function (thrown) { - if (axios.isCancel(thrown)) { - console.log('Request canceled', thrown.message); - } else { - // handle error - } -}); - -axios.post('/user/12345', { - name: 'new name' -}, { - cancelToken: source.token -}) - -// cancel the request (the message parameter is optional) -source.cancel('Operation canceled by the user.'); -``` - -You can also create a cancel token by passing an executor function to the `CancelToken` constructor: - -```js -const CancelToken = axios.CancelToken; -let cancel; - -axios.get('/user/12345', { - cancelToken: new CancelToken(function executor(c) { - // An executor function receives a cancel function as a parameter - cancel = c; - }) -}); - -// cancel the request -cancel(); -``` - -> Note: you can cancel several requests with the same cancel token. -> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make real request. - -## Using application/x-www-form-urlencoded format - -By default, axios serializes JavaScript objects to `JSON`. To send data in the `application/x-www-form-urlencoded` format instead, you can use one of the following options. - -### Browser - -In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows: - -```js -const params = new URLSearchParams(); -params.append('param1', 'value1'); -params.append('param2', 'value2'); -axios.post('/foo', params); -``` - -> Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). - -Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: - -```js -const qs = require('qs'); -axios.post('/foo', qs.stringify({ 'bar': 123 })); -``` - -Or in another way (ES6), - -```js -import qs from 'qs'; -const data = { 'bar': 123 }; -const options = { - method: 'POST', - headers: { 'content-type': 'application/x-www-form-urlencoded' }, - data: qs.stringify(data), - url, -}; -axios(options); -``` - -### Node.js - -#### Query string - -In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: - -```js -const querystring = require('querystring'); -axios.post('http://something.com/', querystring.stringify({ foo: 'bar' })); -``` - -or ['URLSearchParams'](https://nodejs.org/api/url.html#url_class_urlsearchparams) from ['url module'](https://nodejs.org/api/url.html) as follows: - -```js -const url = require('url'); -const params = new url.URLSearchParams({ foo: 'bar' }); -axios.post('http://something.com/', params.toString()); -``` - -You can also use the [`qs`](https://github.com/ljharb/qs) library. - -###### NOTE -The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has known issues with that use case (https://github.com/nodejs/node-v0.x-archive/issues/1665). - -#### Form data - -In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: - -```js -const FormData = require('form-data'); - -const form = new FormData(); -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_file', fs.createReadStream('/foo/bar.jpg')); - -axios.post('https://example.com', form, { headers: form.getHeaders() }) -``` - -Alternatively, use an interceptor: - -```js -axios.interceptors.request.use(config => { - if (config.data instanceof FormData) { - Object.assign(config.headers, config.data.getHeaders()); - } - return config; -}); -``` - -## Semver - -Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. - -## Promises - -axios depends on a native ES6 Promise implementation to be [supported](http://caniuse.com/promises). -If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). - -## TypeScript - -axios includes [TypeScript](http://typescriptlang.org) definitions and a type guard for axios errors. - -```typescript -let user: User = null; -try { - const { data } = await axios.get('/user?ID=12345'); - user = data.userDetails; -} catch (error) { - if (axios.isAxiosError(error)) { - handleAxiosError(error); - } else { - handleUnexpectedError(error); - } -} -``` - -## Online one-click setup - -You can use Gitpod an online IDE(which is free for Open Source) for contributing or running the examples online. - -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/master/examples/server.js) - - -## Resources - -* [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) -* [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md) -* [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md) -* [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md) -* [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) - -## Credits - -axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [Angular](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of Angular. - -## License - -[MIT](LICENSE) diff --git a/alarm/node_modules/pronote-api/node_modules/axios/SECURITY.md b/alarm/node_modules/pronote-api/node_modules/axios/SECURITY.md deleted file mode 100644 index 353df9a..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security Policy - -## Reporting a Vulnerability - -Please report security issues to jasonsaayman@gmail.com diff --git a/alarm/node_modules/pronote-api/node_modules/axios/UPGRADE_GUIDE.md b/alarm/node_modules/pronote-api/node_modules/axios/UPGRADE_GUIDE.md deleted file mode 100644 index 745e804..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/UPGRADE_GUIDE.md +++ /dev/null @@ -1,162 +0,0 @@ -# Upgrade Guide - -### 0.15.x -> 0.16.0 - -#### `Promise` Type Declarations - -The `Promise` type declarations have been removed from the axios typings in favor of the built-in type declarations. If you use axios in a TypeScript project that targets `ES5`, please make sure to include the `es2015.promise` lib. Please see [this post](https://blog.mariusschulz.com/2016/11/25/typescript-2-0-built-in-type-declarations) for details. - -### 0.13.x -> 0.14.0 - -#### TypeScript Definitions - -The axios TypeScript definitions have been updated to match the axios API and use the ES2015 module syntax. - -Please use the following `import` statement to import axios in TypeScript: - -```typescript -import axios from 'axios'; - -axios.get('/foo') - .then(response => console.log(response)) - .catch(error => console.log(error)); -``` - -#### `agent` Config Option - -The `agent` config option has been replaced with two new options: `httpAgent` and `httpsAgent`. Please use them instead. - -```js -{ - // Define a custom agent for HTTP - httpAgent: new http.Agent({ keepAlive: true }), - // Define a custom agent for HTTPS - httpsAgent: new https.Agent({ keepAlive: true }) -} -``` - -#### `progress` Config Option - -The `progress` config option has been replaced with the `onUploadProgress` and `onDownloadProgress` options. - -```js -{ - // Define a handler for upload progress events - onUploadProgress: function (progressEvent) { - // ... - }, - - // Define a handler for download progress events - onDownloadProgress: function (progressEvent) { - // ... - } -} -``` - -### 0.12.x -> 0.13.0 - -The `0.13.0` release contains several changes to custom adapters and error handling. - -#### Error Handling - -Previous to this release an error could either be a server response with bad status code or an actual `Error`. With this release Promise will always reject with an `Error`. In the case that a response was received, the `Error` will also include the response. - -```js -axios.get('/user/12345') - .catch((error) => { - console.log(error.message); - console.log(error.code); // Not always specified - console.log(error.config); // The config that was used to make the request - console.log(error.response); // Only available if response was received from the server - }); -``` - -#### Request Adapters - -This release changes a few things about how request adapters work. Please take note if you are using your own custom adapter. - -1. Response transformer is now called outside of adapter. -2. Request adapter returns a `Promise`. - -This means that you no longer need to invoke `transformData` on response data. You will also no longer receive `resolve` and `reject` as arguments in your adapter. - -Previous code: - -```js -function myAdapter(resolve, reject, config) { - var response = { - data: transformData( - responseData, - responseHeaders, - config.transformResponse - ), - status: request.status, - statusText: request.statusText, - headers: responseHeaders - }; - settle(resolve, reject, response); -} -``` - -New code: - -```js -function myAdapter(config) { - return new Promise(function (resolve, reject) { - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders - }; - settle(resolve, reject, response); - }); -} -``` - -See the related commits for more details: -- [Response transformers](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e) -- [Request adapter Promise](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a) - -### 0.5.x -> 0.6.0 - -The `0.6.0` release contains mostly bug fixes, but there are a couple things to be aware of when upgrading. - -#### ES6 Promise Polyfill - -Up until the `0.6.0` release ES6 `Promise` was being polyfilled using [es6-promise](https://github.com/jakearchibald/es6-promise). With this release, the polyfill has been removed, and you will need to supply it yourself if your environment needs it. - -```js -require('es6-promise').polyfill(); -var axios = require('axios'); -``` - -This will polyfill the global environment, and only needs to be done once. - -#### `axios.success`/`axios.error` - -The `success`, and `error` aliases were deprecated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively. - -```js -axios.get('some/url') - .then(function (res) { - /* ... */ - }) - .catch(function (err) { - /* ... */ - }); -``` - -#### UMD - -Previous versions of axios shipped with an AMD, CommonJS, and Global build. This has all been rolled into a single UMD build. - -```js -// AMD -require(['bower_components/axios/dist/axios'], function (axios) { - /* ... */ -}); - -// CommonJS -var axios = require('axios/dist/axios'); -``` diff --git a/alarm/node_modules/pronote-api/node_modules/axios/dist/axios.js b/alarm/node_modules/pronote-api/node_modules/axios/dist/axios.js deleted file mode 100644 index f253910..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/dist/axios.js +++ /dev/null @@ -1,2193 +0,0 @@ -/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["axios"] = factory(); - else - root["axios"] = factory(); -})(window, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./index.js"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./index.js": -/*!******************!*\ - !*** ./index.js ***! - \******************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(/*! ./lib/axios */ "./lib/axios.js"); - -/***/ }), - -/***/ "./lib/adapters/xhr.js": -/*!*****************************!*\ - !*** ./lib/adapters/xhr.js ***! - \*****************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); -var settle = __webpack_require__(/*! ./../core/settle */ "./lib/core/settle.js"); -var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./lib/helpers/cookies.js"); -var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./lib/helpers/buildURL.js"); -var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./lib/core/buildFullPath.js"); -var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./lib/helpers/parseHeaders.js"); -var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./lib/helpers/isURLSameOrigin.js"); -var createError = __webpack_require__(/*! ../core/createError */ "./lib/core/createError.js"); - -module.exports = function xhrAdapter(config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - var requestData = config.data; - var requestHeaders = config.headers; - var responseType = config.responseType; - - if (utils.isFormData(requestData)) { - delete requestHeaders['Content-Type']; // Let the browser set it - } - - var request = new XMLHttpRequest(); - - // HTTP basic authentication - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; - requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); - } - - var fullPath = buildFullPath(config.baseURL, config.url); - request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); - - // Set the request timeout in MS - request.timeout = config.timeout; - - function onloadend() { - if (!request) { - return; - } - // Prepare the response - var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; - var responseData = !responseType || responseType === 'text' || responseType === 'json' ? - request.responseText : request.response; - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request - }; - - settle(resolve, reject, response); - - // Clean up request - request = null; - } - - if ('onloadend' in request) { - // Use onloadend if available - request.onloadend = onloadend; - } else { - // Listen for ready state to emulate onloadend - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { - return; - } - // readystate handler is calling before onerror or ontimeout handlers, - // so we should call onloadend on the next 'tick' - setTimeout(onloadend); - }; - } - - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } - - reject(createError('Request aborted', config, 'ECONNABORTED', request)); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError() { - // Real errors are hidden from us by the browser - // onerror should only fire if it's a network error - reject(createError('Network Error', config, null, request)); - - // Clean up request - request = null; - }; - - // Handle timeout - request.ontimeout = function handleTimeout() { - var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - reject(createError( - timeoutErrorMessage, - config, - config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', - request)); - - // Clean up request - request = null; - }; - - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - if (utils.isStandardBrowserEnv()) { - // Add xsrf header - var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? - cookies.read(config.xsrfCookieName) : - undefined; - - if (xsrfValue) { - requestHeaders[config.xsrfHeaderName] = xsrfValue; - } - } - - // Add headers to the request - if ('setRequestHeader' in request) { - utils.forEach(requestHeaders, function setRequestHeader(val, key) { - if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { - // Remove Content-Type if data is undefined - delete requestHeaders[key]; - } else { - // Otherwise add header to the request - request.setRequestHeader(key, val); - } - }); - } - - // Add withCredentials to request if needed - if (!utils.isUndefined(config.withCredentials)) { - request.withCredentials = !!config.withCredentials; - } - - // Add responseType to request if needed - if (responseType && responseType !== 'json') { - request.responseType = config.responseType; - } - - // Handle progress if needed - if (typeof config.onDownloadProgress === 'function') { - request.addEventListener('progress', config.onDownloadProgress); - } - - // Not all browsers support upload events - if (typeof config.onUploadProgress === 'function' && request.upload) { - request.upload.addEventListener('progress', config.onUploadProgress); - } - - if (config.cancelToken) { - // Handle cancellation - config.cancelToken.promise.then(function onCanceled(cancel) { - if (!request) { - return; - } - - request.abort(); - reject(cancel); - // Clean up request - request = null; - }); - } - - if (!requestData) { - requestData = null; - } - - // Send the request - request.send(requestData); - }); -}; - - -/***/ }), - -/***/ "./lib/axios.js": -/*!**********************!*\ - !*** ./lib/axios.js ***! - \**********************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); -var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); -var Axios = __webpack_require__(/*! ./core/Axios */ "./lib/core/Axios.js"); -var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./lib/core/mergeConfig.js"); -var defaults = __webpack_require__(/*! ./defaults */ "./lib/defaults.js"); - -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * @return {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - var context = new Axios(defaultConfig); - var instance = bind(Axios.prototype.request, context); - - // Copy axios.prototype to instance - utils.extend(instance, Axios.prototype, context); - - // Copy context to instance - utils.extend(instance, context); - - return instance; -} - -// Create the default instance to be exported -var axios = createInstance(defaults); - -// Expose Axios class to allow class inheritance -axios.Axios = Axios; - -// Factory for creating new instances -axios.create = function create(instanceConfig) { - return createInstance(mergeConfig(axios.defaults, instanceConfig)); -}; - -// Expose Cancel & CancelToken -axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./lib/cancel/Cancel.js"); -axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./lib/cancel/CancelToken.js"); -axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./lib/cancel/isCancel.js"); - -// Expose all/spread -axios.all = function all(promises) { - return Promise.all(promises); -}; -axios.spread = __webpack_require__(/*! ./helpers/spread */ "./lib/helpers/spread.js"); - -// Expose isAxiosError -axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./lib/helpers/isAxiosError.js"); - -module.exports = axios; - -// Allow use of default import syntax in TypeScript -module.exports.default = axios; - - -/***/ }), - -/***/ "./lib/cancel/Cancel.js": -/*!******************************!*\ - !*** ./lib/cancel/Cancel.js ***! - \******************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * A `Cancel` is an object that is thrown when an operation is canceled. - * - * @class - * @param {string=} message The message. - */ -function Cancel(message) { - this.message = message; -} - -Cancel.prototype.toString = function toString() { - return 'Cancel' + (this.message ? ': ' + this.message : ''); -}; - -Cancel.prototype.__CANCEL__ = true; - -module.exports = Cancel; - - -/***/ }), - -/***/ "./lib/cancel/CancelToken.js": -/*!***********************************!*\ - !*** ./lib/cancel/CancelToken.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Cancel = __webpack_require__(/*! ./Cancel */ "./lib/cancel/Cancel.js"); - -/** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @class - * @param {Function} executor The executor function. - */ -function CancelToken(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } - - var resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - - var token = this; - executor(function cancel(message) { - if (token.reason) { - // Cancellation has already been requested - return; - } - - token.reason = new Cancel(message); - resolvePromise(token.reason); - }); -} - -/** - * Throws a `Cancel` if cancellation has been requested. - */ -CancelToken.prototype.throwIfRequested = function throwIfRequested() { - if (this.reason) { - throw this.reason; - } -}; - -/** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ -CancelToken.source = function source() { - var cancel; - var token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token: token, - cancel: cancel - }; -}; - -module.exports = CancelToken; - - -/***/ }), - -/***/ "./lib/cancel/isCancel.js": -/*!********************************!*\ - !*** ./lib/cancel/isCancel.js ***! - \********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = function isCancel(value) { - return !!(value && value.__CANCEL__); -}; - - -/***/ }), - -/***/ "./lib/core/Axios.js": -/*!***************************!*\ - !*** ./lib/core/Axios.js ***! - \***************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); -var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./lib/helpers/buildURL.js"); -var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./lib/core/InterceptorManager.js"); -var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./lib/core/dispatchRequest.js"); -var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./lib/core/mergeConfig.js"); -var validator = __webpack_require__(/*! ../helpers/validator */ "./lib/helpers/validator.js"); - -var validators = validator.validators; -/** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - */ -function Axios(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; -} - -/** - * Dispatch a request - * - * @param {Object} config The config specific for this request (merged with this.defaults) - */ -Axios.prototype.request = function request(config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof config === 'string') { - config = arguments[1] || {}; - config.url = arguments[0]; - } else { - config = config || {}; - } - - config = mergeConfig(this.defaults, config); - - // Set config.method - if (config.method) { - config.method = config.method.toLowerCase(); - } else if (this.defaults.method) { - config.method = this.defaults.method.toLowerCase(); - } else { - config.method = 'get'; - } - - var transitional = config.transitional; - - if (transitional !== undefined) { - validator.assertOptions(transitional, { - silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), - forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), - clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') - }, false); - } - - // filter out skipped interceptors - var requestInterceptorChain = []; - var synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { - return; - } - - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - }); - - var responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - - var promise; - - if (!synchronousRequestInterceptors) { - var chain = [dispatchRequest, undefined]; - - Array.prototype.unshift.apply(chain, requestInterceptorChain); - chain = chain.concat(responseInterceptorChain); - - promise = Promise.resolve(config); - while (chain.length) { - promise = promise.then(chain.shift(), chain.shift()); - } - - return promise; - } - - - var newConfig = config; - while (requestInterceptorChain.length) { - var onFulfilled = requestInterceptorChain.shift(); - var onRejected = requestInterceptorChain.shift(); - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected(error); - break; - } - } - - try { - promise = dispatchRequest(newConfig); - } catch (error) { - return Promise.reject(error); - } - - while (responseInterceptorChain.length) { - promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); - } - - return promise; -}; - -Axios.prototype.getUri = function getUri(config) { - config = mergeConfig(this.defaults, config); - return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); -}; - -// Provide aliases for supported request methods -utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: (config || {}).data - })); - }; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, data, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: data - })); - }; -}); - -module.exports = Axios; - - -/***/ }), - -/***/ "./lib/core/InterceptorManager.js": -/*!****************************************!*\ - !*** ./lib/core/InterceptorManager.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); - -function InterceptorManager() { - this.handlers = []; -} - -/** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ -InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled: fulfilled, - rejected: rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; -}; - -/** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - */ -InterceptorManager.prototype.eject = function eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } -}; - -/** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - */ -InterceptorManager.prototype.forEach = function forEach(fn) { - utils.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); -}; - -module.exports = InterceptorManager; - - -/***/ }), - -/***/ "./lib/core/buildFullPath.js": -/*!***********************************!*\ - !*** ./lib/core/buildFullPath.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./lib/helpers/isAbsoluteURL.js"); -var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./lib/helpers/combineURLs.js"); - -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * @returns {string} The combined full path - */ -module.exports = function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -}; - - -/***/ }), - -/***/ "./lib/core/createError.js": -/*!*********************************!*\ - !*** ./lib/core/createError.js ***! - \*********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var enhanceError = __webpack_require__(/*! ./enhanceError */ "./lib/core/enhanceError.js"); - -/** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The created error. - */ -module.exports = function createError(message, config, code, request, response) { - var error = new Error(message); - return enhanceError(error, config, code, request, response); -}; - - -/***/ }), - -/***/ "./lib/core/dispatchRequest.js": -/*!*************************************!*\ - !*** ./lib/core/dispatchRequest.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); -var transformData = __webpack_require__(/*! ./transformData */ "./lib/core/transformData.js"); -var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./lib/cancel/isCancel.js"); -var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults.js"); - -/** - * Throws a `Cancel` if cancellation has been requested. - */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } -} - -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * @returns {Promise} The Promise to be fulfilled - */ -module.exports = function dispatchRequest(config) { - throwIfCancellationRequested(config); - - // Ensure headers exist - config.headers = config.headers || {}; - - // Transform request data - config.data = transformData.call( - config, - config.data, - config.headers, - config.transformRequest - ); - - // Flatten headers - config.headers = utils.merge( - config.headers.common || {}, - config.headers[config.method] || {}, - config.headers - ); - - utils.forEach( - ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], - function cleanHeaderConfig(method) { - delete config.headers[method]; - } - ); - - var adapter = config.adapter || defaults.adapter; - - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - - // Transform response data - response.data = transformData.call( - config, - response.data, - response.headers, - config.transformResponse - ); - - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - - // Transform response data - if (reason && reason.response) { - reason.response.data = transformData.call( - config, - reason.response.data, - reason.response.headers, - config.transformResponse - ); - } - } - - return Promise.reject(reason); - }); -}; - - -/***/ }), - -/***/ "./lib/core/enhanceError.js": -/*!**********************************!*\ - !*** ./lib/core/enhanceError.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Update an Error with the specified config, error code, and response. - * - * @param {Error} error The error to update. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The error. - */ -module.exports = function enhanceError(error, config, code, request, response) { - error.config = config; - if (code) { - error.code = code; - } - - error.request = request; - error.response = response; - error.isAxiosError = true; - - error.toJSON = function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: this.config, - code: this.code - }; - }; - return error; -}; - - -/***/ }), - -/***/ "./lib/core/mergeConfig.js": -/*!*********************************!*\ - !*** ./lib/core/mergeConfig.js ***! - \*********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); - -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * @returns {Object} New object resulting from merging config2 to config1 - */ -module.exports = function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config2 = config2 || {}; - var config = {}; - - var valueFromConfig2Keys = ['url', 'method', 'data']; - var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; - var defaultToConfig2Keys = [ - 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', - 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', - 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', - 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', - 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' - ]; - var directMergeKeys = ['validateStatus']; - - function getMergedValue(target, source) { - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { - return utils.merge(target, source); - } else if (utils.isPlainObject(source)) { - return utils.merge({}, source); - } else if (utils.isArray(source)) { - return source.slice(); - } - return source; - } - - function mergeDeepProperties(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - } - - utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } - }); - - utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); - - utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - }); - - utils.forEach(directMergeKeys, function merge(prop) { - if (prop in config2) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (prop in config1) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - }); - - var axiosKeys = valueFromConfig2Keys - .concat(mergeDeepPropertiesKeys) - .concat(defaultToConfig2Keys) - .concat(directMergeKeys); - - var otherKeys = Object - .keys(config1) - .concat(Object.keys(config2)) - .filter(function filterAxiosKeys(key) { - return axiosKeys.indexOf(key) === -1; - }); - - utils.forEach(otherKeys, mergeDeepProperties); - - return config; -}; - - -/***/ }), - -/***/ "./lib/core/settle.js": -/*!****************************!*\ - !*** ./lib/core/settle.js ***! - \****************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var createError = __webpack_require__(/*! ./createError */ "./lib/core/createError.js"); - -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - */ -module.exports = function settle(resolve, reject, response) { - var validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(createError( - 'Request failed with status code ' + response.status, - response.config, - null, - response.request, - response - )); - } -}; - - -/***/ }), - -/***/ "./lib/core/transformData.js": -/*!***********************************!*\ - !*** ./lib/core/transformData.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); -var defaults = __webpack_require__(/*! ./../defaults */ "./lib/defaults.js"); - -/** - * Transform the data for a request or a response - * - * @param {Object|String} data The data to be transformed - * @param {Array} headers The headers for the request or response - * @param {Array|Function} fns A single function or Array of functions - * @returns {*} The resulting transformed data - */ -module.exports = function transformData(data, headers, fns) { - var context = this || defaults; - /*eslint no-param-reassign:0*/ - utils.forEach(fns, function transform(fn) { - data = fn.call(context, data, headers); - }); - - return data; -}; - - -/***/ }), - -/***/ "./lib/defaults.js": -/*!*************************!*\ - !*** ./lib/defaults.js ***! - \*************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); -var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./lib/helpers/normalizeHeaderName.js"); -var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./lib/core/enhanceError.js"); - -var DEFAULT_CONTENT_TYPE = { - 'Content-Type': 'application/x-www-form-urlencoded' -}; - -function setContentTypeIfUnset(headers, value) { - if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { - headers['Content-Type'] = value; - } -} - -function getDefaultAdapter() { - var adapter; - if (typeof XMLHttpRequest !== 'undefined') { - // For browsers use XHR adapter - adapter = __webpack_require__(/*! ./adapters/xhr */ "./lib/adapters/xhr.js"); - } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { - // For node use HTTP adapter - adapter = __webpack_require__(/*! ./adapters/http */ "./lib/adapters/xhr.js"); - } - return adapter; -} - -function stringifySafely(rawValue, parser, encoder) { - if (utils.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils.trim(rawValue); - } catch (e) { - if (e.name !== 'SyntaxError') { - throw e; - } - } - } - - return (encoder || JSON.stringify)(rawValue); -} - -var defaults = { - - transitional: { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false - }, - - adapter: getDefaultAdapter(), - - transformRequest: [function transformRequest(data, headers) { - normalizeHeaderName(headers, 'Accept'); - normalizeHeaderName(headers, 'Content-Type'); - - if (utils.isFormData(data) || - utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) - ) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); - return data.toString(); - } - if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { - setContentTypeIfUnset(headers, 'application/json'); - return stringifySafely(data); - } - return data; - }], - - transformResponse: [function transformResponse(data) { - var transitional = this.transitional; - var silentJSONParsing = transitional && transitional.silentJSONParsing; - var forcedJSONParsing = transitional && transitional.forcedJSONParsing; - var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; - - if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { - try { - return JSON.parse(data); - } catch (e) { - if (strictJSONParsing) { - if (e.name === 'SyntaxError') { - throw enhanceError(e, this, 'E_JSON_PARSE'); - } - throw e; - } - } - } - - return data; - }], - - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - maxContentLength: -1, - maxBodyLength: -1, - - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - } -}; - -defaults.headers = { - common: { - 'Accept': 'application/json, text/plain, */*' - } -}; - -utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { - defaults.headers[method] = {}; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); -}); - -module.exports = defaults; - - -/***/ }), - -/***/ "./lib/helpers/bind.js": -/*!*****************************!*\ - !*** ./lib/helpers/bind.js ***! - \*****************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = function bind(fn, thisArg) { - return function wrap() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - return fn.apply(thisArg, args); - }; -}; - - -/***/ }), - -/***/ "./lib/helpers/buildURL.js": -/*!*********************************!*\ - !*** ./lib/helpers/buildURL.js ***! - \*********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); - -function encode(val) { - return encodeURIComponent(val). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%20/g, '+'). - replace(/%5B/gi, '['). - replace(/%5D/gi, ']'); -} - -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @returns {string} The formatted url - */ -module.exports = function buildURL(url, params, paramsSerializer) { - /*eslint no-param-reassign:0*/ - if (!params) { - return url; - } - - var serializedParams; - if (paramsSerializer) { - serializedParams = paramsSerializer(params); - } else if (utils.isURLSearchParams(params)) { - serializedParams = params.toString(); - } else { - var parts = []; - - utils.forEach(params, function serialize(val, key) { - if (val === null || typeof val === 'undefined') { - return; - } - - if (utils.isArray(val)) { - key = key + '[]'; - } else { - val = [val]; - } - - utils.forEach(val, function parseValue(v) { - if (utils.isDate(v)) { - v = v.toISOString(); - } else if (utils.isObject(v)) { - v = JSON.stringify(v); - } - parts.push(encode(key) + '=' + encode(v)); - }); - }); - - serializedParams = parts.join('&'); - } - - if (serializedParams) { - var hashmarkIndex = url.indexOf('#'); - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; - } - - return url; -}; - - -/***/ }), - -/***/ "./lib/helpers/combineURLs.js": -/*!************************************!*\ - !*** ./lib/helpers/combineURLs.js ***! - \************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * @returns {string} The combined URL - */ -module.exports = function combineURLs(baseURL, relativeURL) { - return relativeURL - ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') - : baseURL; -}; - - -/***/ }), - -/***/ "./lib/helpers/cookies.js": -/*!********************************!*\ - !*** ./lib/helpers/cookies.js ***! - \********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); - -module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs support document.cookie - (function standardBrowserEnv() { - return { - write: function write(name, value, expires, path, domain, secure) { - var cookie = []; - cookie.push(name + '=' + encodeURIComponent(value)); - - if (utils.isNumber(expires)) { - cookie.push('expires=' + new Date(expires).toGMTString()); - } - - if (utils.isString(path)) { - cookie.push('path=' + path); - } - - if (utils.isString(domain)) { - cookie.push('domain=' + domain); - } - - if (secure === true) { - cookie.push('secure'); - } - - document.cookie = cookie.join('; '); - }, - - read: function read(name) { - var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); - return (match ? decodeURIComponent(match[3]) : null); - }, - - remove: function remove(name) { - this.write(name, '', Date.now() - 86400000); - } - }; - })() : - - // Non standard browser env (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return { - write: function write() {}, - read: function read() { return null; }, - remove: function remove() {} - }; - })() -); - - -/***/ }), - -/***/ "./lib/helpers/isAbsoluteURL.js": -/*!**************************************!*\ - !*** ./lib/helpers/isAbsoluteURL.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ -module.exports = function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); -}; - - -/***/ }), - -/***/ "./lib/helpers/isAxiosError.js": -/*!*************************************!*\ - !*** ./lib/helpers/isAxiosError.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ -module.exports = function isAxiosError(payload) { - return (typeof payload === 'object') && (payload.isAxiosError === true); -}; - - -/***/ }), - -/***/ "./lib/helpers/isURLSameOrigin.js": -/*!****************************************!*\ - !*** ./lib/helpers/isURLSameOrigin.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); - -module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs have full support of the APIs needed to test - // whether the request URL is of the same origin as current location. - (function standardBrowserEnv() { - var msie = /(msie|trident)/i.test(navigator.userAgent); - var urlParsingNode = document.createElement('a'); - var originURL; - - /** - * Parse a URL to discover it's components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ - function resolveURL(url) { - var href = url; - - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } - - urlParsingNode.setAttribute('href', href); - - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; - } - - originURL = resolveURL(window.location.href); - - /** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestURL The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ - return function isURLSameOrigin(requestURL) { - var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; - return (parsed.protocol === originURL.protocol && - parsed.host === originURL.host); - }; - })() : - - // Non standard browser envs (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return function isURLSameOrigin() { - return true; - }; - })() -); - - -/***/ }), - -/***/ "./lib/helpers/normalizeHeaderName.js": -/*!********************************************!*\ - !*** ./lib/helpers/normalizeHeaderName.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); - -module.exports = function normalizeHeaderName(headers, normalizedName) { - utils.forEach(headers, function processHeader(value, name) { - if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { - headers[normalizedName] = value; - delete headers[name]; - } - }); -}; - - -/***/ }), - -/***/ "./lib/helpers/parseHeaders.js": -/*!*************************************!*\ - !*** ./lib/helpers/parseHeaders.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); - -// Headers whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -var ignoreDuplicateOf = [ - 'age', 'authorization', 'content-length', 'content-type', 'etag', - 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', - 'last-modified', 'location', 'max-forwards', 'proxy-authorization', - 'referer', 'retry-after', 'user-agent' -]; - -/** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} headers Headers needing to be parsed - * @returns {Object} Headers parsed into an object - */ -module.exports = function parseHeaders(headers) { - var parsed = {}; - var key; - var val; - var i; - - if (!headers) { return parsed; } - - utils.forEach(headers.split('\n'), function parser(line) { - i = line.indexOf(':'); - key = utils.trim(line.substr(0, i)).toLowerCase(); - val = utils.trim(line.substr(i + 1)); - - if (key) { - if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { - return; - } - if (key === 'set-cookie') { - parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); - } else { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; - } - } - }); - - return parsed; -}; - - -/***/ }), - -/***/ "./lib/helpers/spread.js": -/*!*******************************!*\ - !*** ./lib/helpers/spread.js ***! - \*******************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * var args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * @returns {Function} - */ -module.exports = function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -}; - - -/***/ }), - -/***/ "./lib/helpers/validator.js": -/*!**********************************!*\ - !*** ./lib/helpers/validator.js ***! - \**********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var pkg = __webpack_require__(/*! ./../../package.json */ "./package.json"); - -var validators = {}; - -// eslint-disable-next-line func-names -['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { - validators[type] = function validator(thing) { - return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; - }; -}); - -var deprecatedWarnings = {}; -var currentVerArr = pkg.version.split('.'); - -/** - * Compare package versions - * @param {string} version - * @param {string?} thanVersion - * @returns {boolean} - */ -function isOlderVersion(version, thanVersion) { - var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; - var destVer = version.split('.'); - for (var i = 0; i < 3; i++) { - if (pkgVersionArr[i] > destVer[i]) { - return true; - } else if (pkgVersionArr[i] < destVer[i]) { - return false; - } - } - return false; -} - -/** - * Transitional option validator - * @param {function|boolean?} validator - * @param {string?} version - * @param {string} message - * @returns {function} - */ -validators.transitional = function transitional(validator, version, message) { - var isDeprecated = version && isOlderVersion(version); - - function formatMessage(opt, desc) { - return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); - } - - // eslint-disable-next-line func-names - return function(value, opt, opts) { - if (validator === false) { - throw new Error(formatMessage(opt, ' has been removed in ' + version)); - } - - if (isDeprecated && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - // eslint-disable-next-line no-console - console.warn( - formatMessage( - opt, - ' has been deprecated since v' + version + ' and will be removed in the near future' - ) - ); - } - - return validator ? validator(value, opt, opts) : true; - }; -}; - -/** - * Assert object's properties type - * @param {object} options - * @param {object} schema - * @param {boolean?} allowUnknown - */ - -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== 'object') { - throw new TypeError('options must be an object'); - } - var keys = Object.keys(options); - var i = keys.length; - while (i-- > 0) { - var opt = keys[i]; - var validator = schema[opt]; - if (validator) { - var value = options[opt]; - var result = value === undefined || validator(value, opt, options); - if (result !== true) { - throw new TypeError('option ' + opt + ' must be ' + result); - } - continue; - } - if (allowUnknown !== true) { - throw Error('Unknown option ' + opt); - } - } -} - -module.exports = { - isOlderVersion: isOlderVersion, - assertOptions: assertOptions, - validators: validators -}; - - -/***/ }), - -/***/ "./lib/utils.js": -/*!**********************!*\ - !*** ./lib/utils.js ***! - \**********************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); - -// utils is a library of generic helper functions non-specific to axios - -var toString = Object.prototype.toString; - -/** - * Determine if a value is an Array - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Array, otherwise false - */ -function isArray(val) { - return toString.call(val) === '[object Array]'; -} - -/** - * Determine if a value is undefined - * - * @param {Object} val The value to test - * @returns {boolean} True if the value is undefined, otherwise false - */ -function isUndefined(val) { - return typeof val === 'undefined'; -} - -/** - * Determine if a value is a Buffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Buffer, otherwise false - */ -function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) - && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); -} - -/** - * Determine if a value is an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ -function isArrayBuffer(val) { - return toString.call(val) === '[object ArrayBuffer]'; -} - -/** - * Determine if a value is a FormData - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an FormData, otherwise false - */ -function isFormData(val) { - return (typeof FormData !== 'undefined') && (val instanceof FormData); -} - -/** - * Determine if a value is a view on an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ -function isArrayBufferView(val) { - var result; - if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { - result = ArrayBuffer.isView(val); - } else { - result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); - } - return result; -} - -/** - * Determine if a value is a String - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a String, otherwise false - */ -function isString(val) { - return typeof val === 'string'; -} - -/** - * Determine if a value is a Number - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Number, otherwise false - */ -function isNumber(val) { - return typeof val === 'number'; -} - -/** - * Determine if a value is an Object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Object, otherwise false - */ -function isObject(val) { - return val !== null && typeof val === 'object'; -} - -/** - * Determine if a value is a plain Object - * - * @param {Object} val The value to test - * @return {boolean} True if value is a plain Object, otherwise false - */ -function isPlainObject(val) { - if (toString.call(val) !== '[object Object]') { - return false; - } - - var prototype = Object.getPrototypeOf(val); - return prototype === null || prototype === Object.prototype; -} - -/** - * Determine if a value is a Date - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Date, otherwise false - */ -function isDate(val) { - return toString.call(val) === '[object Date]'; -} - -/** - * Determine if a value is a File - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a File, otherwise false - */ -function isFile(val) { - return toString.call(val) === '[object File]'; -} - -/** - * Determine if a value is a Blob - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Blob, otherwise false - */ -function isBlob(val) { - return toString.call(val) === '[object Blob]'; -} - -/** - * Determine if a value is a Function - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ -function isFunction(val) { - return toString.call(val) === '[object Function]'; -} - -/** - * Determine if a value is a Stream - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Stream, otherwise false - */ -function isStream(val) { - return isObject(val) && isFunction(val.pipe); -} - -/** - * Determine if a value is a URLSearchParams object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ -function isURLSearchParams(val) { - return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; -} - -/** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * @returns {String} The String freed of excess whitespace - */ -function trim(str) { - return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); -} - -/** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - */ -function isStandardBrowserEnv() { - if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || - navigator.product === 'NativeScript' || - navigator.product === 'NS')) { - return false; - } - return ( - typeof window !== 'undefined' && - typeof document !== 'undefined' - ); -} - -/** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - */ -function forEach(obj, fn) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } - - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } - - if (isArray(obj)) { - // Iterate over array values - for (var i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Iterate over object keys - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - fn.call(null, obj[key], key, obj); - } - } - } -} - -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * var result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * @returns {Object} Result of all merge properties - */ -function merge(/* obj1, obj2, obj3, ... */) { - var result = {}; - function assignValue(val, key) { - if (isPlainObject(result[key]) && isPlainObject(val)) { - result[key] = merge(result[key], val); - } else if (isPlainObject(val)) { - result[key] = merge({}, val); - } else if (isArray(val)) { - result[key] = val.slice(); - } else { - result[key] = val; - } - } - - for (var i = 0, l = arguments.length; i < l; i++) { - forEach(arguments[i], assignValue); - } - return result; -} - -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * @return {Object} The resulting value of object a - */ -function extend(a, b, thisArg) { - forEach(b, function assignValue(val, key) { - if (thisArg && typeof val === 'function') { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }); - return a; -} - -/** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * @return {string} content value without BOM - */ -function stripBOM(content) { - if (content.charCodeAt(0) === 0xFEFF) { - content = content.slice(1); - } - return content; -} - -module.exports = { - isArray: isArray, - isArrayBuffer: isArrayBuffer, - isBuffer: isBuffer, - isFormData: isFormData, - isArrayBufferView: isArrayBufferView, - isString: isString, - isNumber: isNumber, - isObject: isObject, - isPlainObject: isPlainObject, - isUndefined: isUndefined, - isDate: isDate, - isFile: isFile, - isBlob: isBlob, - isFunction: isFunction, - isStream: isStream, - isURLSearchParams: isURLSearchParams, - isStandardBrowserEnv: isStandardBrowserEnv, - forEach: forEach, - merge: merge, - extend: extend, - trim: trim, - stripBOM: stripBOM -}; - - -/***/ }), - -/***/ "./package.json": -/*!**********************!*\ - !*** ./package.json ***! - \**********************/ -/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, browser, jsdelivr, unpkg, typings, dependencies, bundlesize, default */ -/***/ (function(module) { - -module.exports = JSON.parse("{\"name\":\"axios\",\"version\":\"0.21.4\",\"description\":\"Promise based HTTP client for the browser and node.js\",\"main\":\"index.js\",\"scripts\":{\"test\":\"grunt test\",\"start\":\"node ./sandbox/server.js\",\"build\":\"NODE_ENV=production grunt build\",\"preversion\":\"npm test\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\"postversion\":\"git push && git push --tags\",\"examples\":\"node ./examples/server.js\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"fix\":\"eslint --fix lib/**/*.js\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/axios/axios.git\"},\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"author\":\"Matt Zabriskie\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"homepage\":\"https://axios-http.com\",\"devDependencies\":{\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.3.0\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^23.0.0\",\"grunt-karma\":\"^4.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^4.0.2\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^6.3.2\",\"karma-chrome-launcher\":\"^3.1.0\",\"karma-firefox-launcher\":\"^2.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^4.3.6\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.8\",\"karma-webpack\":\"^4.0.2\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^8.2.1\",\"sinon\":\"^4.5.0\",\"terser-webpack-plugin\":\"^4.2.3\",\"typescript\":\"^4.0.5\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^4.44.2\",\"webpack-dev-server\":\"^3.11.0\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"jsdelivr\":\"dist/axios.min.js\",\"unpkg\":\"dist/axios.min.js\",\"typings\":\"./index.d.ts\",\"dependencies\":{\"follow-redirects\":\"^1.14.0\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}]}"); - -/***/ }) - -/******/ }); -}); -//# sourceMappingURL=axios.map
\ No newline at end of file diff --git a/alarm/node_modules/pronote-api/node_modules/axios/dist/axios.map b/alarm/node_modules/pronote-api/node_modules/axios/dist/axios.map deleted file mode 100644 index 4aadb21..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/dist/axios.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./index.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/isAxiosError.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/utils.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,iBAAiB,mBAAO,CAAC,mCAAa,E;;;;;;;;;;;;ACAzB;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,aAAa,mBAAO,CAAC,8CAAkB;AACvC,cAAc,mBAAO,CAAC,sDAAsB;AAC5C,eAAe,mBAAO,CAAC,wDAAuB;AAC9C,oBAAoB,mBAAO,CAAC,0DAAuB;AACnD,mBAAmB,mBAAO,CAAC,gEAA2B;AACtD,sBAAsB,mBAAO,CAAC,sEAA8B;AAC5D,kBAAkB,mBAAO,CAAC,sDAAqB;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;AC5La;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,WAAW,mBAAO,CAAC,6CAAgB;AACnC,YAAY,mBAAO,CAAC,yCAAc;AAClC,kBAAkB,mBAAO,CAAC,qDAAoB;AAC9C,eAAe,mBAAO,CAAC,qCAAY;;AAEnC;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,+CAAiB;AACxC,oBAAoB,mBAAO,CAAC,yDAAsB;AAClD,iBAAiB,mBAAO,CAAC,mDAAmB;;AAE5C;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,iDAAkB;;AAEzC;AACA,qBAAqB,mBAAO,CAAC,6DAAwB;;AAErD;;AAEA;AACA;;;;;;;;;;;;;ACvDa;;AAEb;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;;AClBa;;AAEb,aAAa,mBAAO,CAAC,wCAAU;;AAE/B;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACxDa;;AAEb;AACA;AACA;;;;;;;;;;;;;ACJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,sDAAqB;AAC5C,yBAAyB,mBAAO,CAAC,8DAAsB;AACvD,sBAAsB,mBAAO,CAAC,wDAAmB;AACjD,kBAAkB,mBAAO,CAAC,gDAAe;AACzC,gBAAgB,mBAAO,CAAC,wDAAsB;;AAE9C;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,yBAAyB;AACzB,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;;ACnJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;ACrDa;;AAEb,oBAAoB,mBAAO,CAAC,gEAA0B;AACtD,kBAAkB,mBAAO,CAAC,4DAAwB;;AAElD;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBa;;AAEb,mBAAmB,mBAAO,CAAC,kDAAgB;;AAE3C;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,oBAAoB,mBAAO,CAAC,oDAAiB;AAC7C,eAAe,mBAAO,CAAC,oDAAoB;AAC3C,eAAe,mBAAO,CAAC,sCAAa;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;ACjFa;;AAEb;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzCa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,2BAA2B;AAC3B,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;;;;;;;;;;;;ACtFa;;AAEb,kBAAkB,mBAAO,CAAC,gDAAe;;AAEzC;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,wCAAe;;AAEtC;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,MAAM;AACjB,WAAW,eAAe;AAC1B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACrBa;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,0BAA0B,mBAAO,CAAC,2EAA+B;AACjE,mBAAmB,mBAAO,CAAC,uDAAqB;;AAEhD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,6CAAgB;AACtC,GAAG;AACH;AACA,cAAc,mBAAO,CAAC,8CAAiB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;ACrIa;;AAEb;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACrEa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0CAA0C;AAC1C,SAAS;;AAET;AACA,4DAA4D,wBAAwB;AACpF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,kCAAkC;AAClC,+BAA+B,aAAa,EAAE;AAC9C;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACnEa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACXa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ba;;AAEb,UAAU,mBAAO,CAAC,4CAAsB;;AAExC;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,kBAAkB;AAC7B,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxGa;;AAEb,WAAW,mBAAO,CAAC,6CAAgB;;AAEnC;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,2BAA2B;AAC3B;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,4BAA4B;AAC5B,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"axios.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./index.js\");\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n"],"sourceRoot":""}
\ No newline at end of file diff --git a/alarm/node_modules/pronote-api/node_modules/axios/dist/axios.min.js b/alarm/node_modules/pronote-api/node_modules/axios/dist/axios.min.js deleted file mode 100644 index d5b138a..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/dist/axios.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=10)}([function(e,t,r){"use strict";var n=r(2),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:u,isUndefined:s,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:c,isStream:function(e){return a(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:f,merge:function e(){var t={};function r(r,n){u(t[n])&&u(r)?t[n]=e(t[n],r):u(r)?t[n]=e({},r):i(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)f(arguments[n],r);return t},extend:function(e,t,r){return f(t,(function(t,o){e[o]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t,r){"use strict";var n=r(0),o=r(16),i=r(4),s={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=r(5)),u),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(a(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,r=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||o&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(s)})),e.exports=c},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(0);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))})))})),i=s.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,r){"use strict";var n=r(0),o=r(17),i=r(18),s=r(3),a=r(19),u=r(22),c=r(23),f=r(6);e.exports=function(e){return new Promise((function(t,r){var p=e.data,l=e.headers,d=e.responseType;n.isFormData(p)&&delete l["Content-Type"];var h=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";l.Authorization="Basic "+btoa(m+":"+g)}var v=a(e.baseURL,e.url);function y(){if(h){var n="getAllResponseHeaders"in h?u(h.getAllResponseHeaders()):null,i={data:d&&"text"!==d&&"json"!==d?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h};o(t,r,i),h=null}}if(h.open(e.method.toUpperCase(),s(v,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,"onloadend"in h?h.onloadend=y:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(y)},h.onabort=function(){h&&(r(f("Request aborted",e,"ECONNABORTED",h)),h=null)},h.onerror=function(){r(f("Network Error",e,null,h)),h=null},h.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(f(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var b=(e.withCredentials||c(v))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;b&&(l[e.xsrfHeaderName]=b)}"setRequestHeader"in h&&n.forEach(l,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete l[t]:h.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),d&&"json"!==d&&(h.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){h&&(h.abort(),r(e),h=null)})),p||(p=null),h.send(p)}))}},function(e,t,r){"use strict";var n=r(4);e.exports=function(e,t,r,o,i){var s=new Error(e);return n(s,t,r,o,i)}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){t=t||{};var r={},o=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function u(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function c(o){n.isUndefined(t[o])?n.isUndefined(e[o])||(r[o]=u(void 0,e[o])):r[o]=u(e[o],t[o])}n.forEach(o,(function(e){n.isUndefined(t[e])||(r[e]=u(void 0,t[e]))})),n.forEach(i,c),n.forEach(s,(function(o){n.isUndefined(t[o])?n.isUndefined(e[o])||(r[o]=u(void 0,e[o])):r[o]=u(void 0,t[o])})),n.forEach(a,(function(n){n in t?r[n]=u(e[n],t[n]):n in e&&(r[n]=u(void 0,e[n]))}));var f=o.concat(i).concat(s).concat(a),p=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===f.indexOf(e)}));return n.forEach(p,c),r}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,r){e.exports=r(11)},function(e,t,r){"use strict";var n=r(0),o=r(2),i=r(12),s=r(8);function a(e){var t=new i(e),r=o(i.prototype.request,t);return n.extend(r,i.prototype,t),n.extend(r,t),r}var u=a(r(1));u.Axios=i,u.create=function(e){return a(s(u.defaults,e))},u.Cancel=r(9),u.CancelToken=r(26),u.isCancel=r(7),u.all=function(e){return Promise.all(e)},u.spread=r(27),u.isAxiosError=r(28),e.exports=u,e.exports.default=u},function(e,t,r){"use strict";var n=r(0),o=r(3),i=r(13),s=r(14),a=r(8),u=r(24),c=u.validators;function f(e){this.defaults=e,this.interceptors={request:new i,response:new i}}f.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!n){var f=[s,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(i),o=Promise.resolve(e);f.length;)o=o.then(f.shift(),f.shift());return o}for(var p=e;r.length;){var l=r.shift(),d=r.shift();try{p=l(p)}catch(e){d(e);break}}try{o=s(p)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},f.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){f.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){f.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=f},function(e,t,r){"use strict";var n=r(0);function o(){this.handlers=[]}o.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,r){"use strict";var n=r(0),o=r(15),i=r(7),s=r(1);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(a(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(0),o=r(1);e.exports=function(e,t,r){var i=this||o;return n.forEach(r,(function(r){e=r.call(i,e,t)})),e}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(6);e.exports=function(e,t,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";var n=r(20),o=r(21);e.exports=function(e,t){return e&&!n(t)?o(e,t):t}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,s={};return e?(n.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(25),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={},s=n.version.split(".");function a(e,t){for(var r=t?t.split("."):s,n=e.split("."),o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]<n[o])return!1}return!1}o.transitional=function(e,t,r){var o=t&&a(t);function s(e,t){return"[Axios v"+n.version+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,a){if(!1===e)throw new Error(s(n," has been removed in "+t));return o&&!i[n]&&(i[n]=!0,console.warn(s(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,a)}},e.exports={isOlderVersion:a,assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:o}},function(e){e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(e,t,r){"use strict";var n=r(9);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}}])})); -//# sourceMappingURL=axios.min.map
\ No newline at end of file diff --git a/alarm/node_modules/pronote-api/node_modules/axios/dist/axios.min.map b/alarm/node_modules/pronote-api/node_modules/axios/dist/axios.min.map deleted file mode 100644 index 468a5ba..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/dist/axios.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./lib/utils.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./index.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/isAxiosError.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","toString","isArray","val","isUndefined","isObject","isPlainObject","getPrototypeOf","isFunction","forEach","obj","fn","length","isArrayBuffer","isBuffer","constructor","isFormData","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isString","isNumber","isDate","isFile","isBlob","isStream","pipe","isURLSearchParams","URLSearchParams","isStandardBrowserEnv","navigator","product","document","merge","result","assignValue","slice","arguments","extend","a","b","thisArg","trim","str","replace","stripBOM","content","charCodeAt","utils","normalizeHeaderName","enhanceError","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","headers","adapter","defaults","transitional","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","XMLHttpRequest","process","transformRequest","data","rawValue","parser","encoder","JSON","parse","e","stringify","stringifySafely","transformResponse","this","strictJSONParsing","responseType","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","status","common","method","args","Array","apply","encode","encodeURIComponent","url","params","paramsSerializer","serializedParams","parts","v","toISOString","push","join","hashmarkIndex","indexOf","error","config","code","request","response","isAxiosError","toJSON","message","description","number","fileName","lineNumber","columnNumber","stack","settle","cookies","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","createError","Promise","resolve","reject","requestData","requestHeaders","auth","username","password","unescape","Authorization","btoa","fullPath","baseURL","onloadend","responseHeaders","getAllResponseHeaders","responseText","statusText","open","toUpperCase","onreadystatechange","readyState","responseURL","setTimeout","onabort","onerror","ontimeout","timeoutErrorMessage","xsrfValue","withCredentials","read","undefined","toLowerCase","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","cancelToken","promise","then","cancel","abort","send","Error","__CANCEL__","config1","config2","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","getMergedValue","target","source","mergeDeepProperties","prop","axiosKeys","concat","otherKeys","keys","filter","Cancel","Axios","mergeConfig","createInstance","defaultConfig","context","instance","axios","instanceConfig","CancelToken","isCancel","all","promises","spread","default","InterceptorManager","dispatchRequest","validator","validators","interceptors","assertOptions","boolean","requestInterceptorChain","synchronousRequestInterceptors","interceptor","runWhen","synchronous","unshift","fulfilled","rejected","responseInterceptorChain","chain","shift","newConfig","onFulfilled","onRejected","getUri","handlers","use","options","eject","id","h","transformData","throwIfCancellationRequested","throwIfRequested","reason","fns","normalizedName","write","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","isAbsoluteURL","combineURLs","requestedURL","test","relativeURL","ignoreDuplicateOf","parsed","split","line","substr","originURL","msie","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","requestURL","pkg","type","thing","deprecatedWarnings","currentVerArr","version","isOlderVersion","thanVersion","pkgVersionArr","destVer","isDeprecated","formatMessage","opt","desc","opts","console","warn","schema","allowUnknown","TypeError","executor","resolvePromise","token","callback","arr","payload"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAe,MAAID,IAEnBD,EAAY,MAAIC,IARlB,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,IAClCG,OAAOC,eAAenB,EAASe,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAStB,GACX,oBAAXuB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAenB,EAASuB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAenB,EAAS,aAAc,CAAEyB,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFAxB,EAAoBgB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOnB,EAAoBQ,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRvB,EAAoB2B,EAAI,SAAShC,GAChC,IAAIe,EAASf,GAAUA,EAAO2B,WAC7B,WAAwB,OAAO3B,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAK,EAAoBQ,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRV,EAAoBW,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG7B,EAAoBgC,EAAI,GAIjBhC,EAAoBA,EAAoBiC,EAAI,I,+BChFrD,IAAIP,EAAO,EAAQ,GAIfQ,EAAWtB,OAAOkB,UAAUI,SAQhC,SAASC,EAAQC,GACf,MAA8B,mBAAvBF,EAAS7B,KAAK+B,GASvB,SAASC,EAAYD,GACnB,YAAsB,IAARA,EA4EhB,SAASE,EAASF,GAChB,OAAe,OAARA,GAA+B,iBAARA,EAShC,SAASG,EAAcH,GACrB,GAA2B,oBAAvBF,EAAS7B,KAAK+B,GAChB,OAAO,EAGT,IAAIN,EAAYlB,OAAO4B,eAAeJ,GACtC,OAAqB,OAAdN,GAAsBA,IAAclB,OAAOkB,UAuCpD,SAASW,EAAWL,GAClB,MAA8B,sBAAvBF,EAAS7B,KAAK+B,GAwEvB,SAASM,EAAQC,EAAKC,GAEpB,GAAID,QAUJ,GALmB,iBAARA,IAETA,EAAM,CAACA,IAGLR,EAAQQ,GAEV,IAAK,IAAIzC,EAAI,EAAGC,EAAIwC,EAAIE,OAAQ3C,EAAIC,EAAGD,IACrC0C,EAAGvC,KAAK,KAAMsC,EAAIzC,GAAIA,EAAGyC,QAI3B,IAAK,IAAIlB,KAAOkB,EACV/B,OAAOkB,UAAUC,eAAe1B,KAAKsC,EAAKlB,IAC5CmB,EAAGvC,KAAK,KAAMsC,EAAIlB,GAAMA,EAAKkB,GA2ErChD,EAAOD,QAAU,CACfyC,QAASA,EACTW,cA1RF,SAAuBV,GACrB,MAA8B,yBAAvBF,EAAS7B,KAAK+B,IA0RrBW,SAtSF,SAAkBX,GAChB,OAAe,OAARA,IAAiBC,EAAYD,IAA4B,OAApBA,EAAIY,cAAyBX,EAAYD,EAAIY,cAChD,mBAA7BZ,EAAIY,YAAYD,UAA2BX,EAAIY,YAAYD,SAASX,IAqShFa,WAlRF,SAAoBb,GAClB,MAA4B,oBAAbc,UAA8Bd,aAAec,UAkR5DC,kBAzQF,SAA2Bf,GAOzB,MAL4B,oBAAhBgB,aAAiCA,YAAkB,OACpDA,YAAYC,OAAOjB,GAEnB,GAAUA,EAAU,QAAMA,EAAIkB,kBAAkBF,aAqQ3DG,SA1PF,SAAkBnB,GAChB,MAAsB,iBAARA,GA0PdoB,SAjPF,SAAkBpB,GAChB,MAAsB,iBAARA,GAiPdE,SAAUA,EACVC,cAAeA,EACfF,YAAaA,EACboB,OAlNF,SAAgBrB,GACd,MAA8B,kBAAvBF,EAAS7B,KAAK+B,IAkNrBsB,OAzMF,SAAgBtB,GACd,MAA8B,kBAAvBF,EAAS7B,KAAK+B,IAyMrBuB,OAhMF,SAAgBvB,GACd,MAA8B,kBAAvBF,EAAS7B,KAAK+B,IAgMrBK,WAAYA,EACZmB,SA9KF,SAAkBxB,GAChB,OAAOE,EAASF,IAAQK,EAAWL,EAAIyB,OA8KvCC,kBArKF,SAA2B1B,GACzB,MAAkC,oBAApB2B,iBAAmC3B,aAAe2B,iBAqKhEC,qBAzIF,WACE,OAAyB,oBAAdC,WAAoD,gBAAtBA,UAAUC,SACY,iBAAtBD,UAAUC,SACY,OAAtBD,UAAUC,WAI/B,oBAAXpE,QACa,oBAAbqE,WAkITzB,QAASA,EACT0B,MAvEF,SAASA,IACP,IAAIC,EAAS,GACb,SAASC,EAAYlC,EAAKX,GACpBc,EAAc8B,EAAO5C,KAASc,EAAcH,GAC9CiC,EAAO5C,GAAO2C,EAAMC,EAAO5C,GAAMW,GACxBG,EAAcH,GACvBiC,EAAO5C,GAAO2C,EAAM,GAAIhC,GACfD,EAAQC,GACjBiC,EAAO5C,GAAOW,EAAImC,QAElBF,EAAO5C,GAAOW,EAIlB,IAAK,IAAIlC,EAAI,EAAGC,EAAIqE,UAAU3B,OAAQ3C,EAAIC,EAAGD,IAC3CwC,EAAQ8B,UAAUtE,GAAIoE,GAExB,OAAOD,GAuDPI,OA5CF,SAAgBC,EAAGC,EAAGC,GAQpB,OAPAlC,EAAQiC,GAAG,SAAqBvC,EAAKX,GAEjCiD,EAAEjD,GADAmD,GAA0B,mBAARxC,EACXV,EAAKU,EAAKwC,GAEVxC,KAGNsC,GAqCPG,KAhKF,SAAcC,GACZ,OAAOA,EAAID,KAAOC,EAAID,OAASC,EAAIC,QAAQ,aAAc,KAgKzDC,SA7BF,SAAkBC,GAIhB,OAH8B,QAA1BA,EAAQC,WAAW,KACrBD,EAAUA,EAAQV,MAAM,IAEnBU,K,6BChUT,IAAIE,EAAQ,EAAQ,GAChBC,EAAsB,EAAQ,IAC9BC,EAAe,EAAQ,GAEvBC,EAAuB,CACzB,eAAgB,qCAGlB,SAASC,EAAsBC,EAASrE,IACjCgE,EAAM9C,YAAYmD,IAAYL,EAAM9C,YAAYmD,EAAQ,mBAC3DA,EAAQ,gBAAkBrE,GA+B9B,IA1BMsE,EA0BFC,EAAW,CAEbC,aAAc,CACZC,mBAAmB,EACnBC,mBAAmB,EACnBC,qBAAqB,GAGvBL,UAjC8B,oBAAnBM,gBAGmB,oBAAZC,SAAuE,qBAA5CpF,OAAOkB,UAAUI,SAAS7B,KAAK2F,YAD1EP,EAAU,EAAQ,IAKbA,GA4BPQ,iBAAkB,CAAC,SAA0BC,EAAMV,GAIjD,OAHAJ,EAAoBI,EAAS,UAC7BJ,EAAoBI,EAAS,gBAEzBL,EAAMlC,WAAWiD,IACnBf,EAAMrC,cAAcoD,IACpBf,EAAMpC,SAASmD,IACff,EAAMvB,SAASsC,IACff,EAAMzB,OAAOwC,IACbf,EAAMxB,OAAOuC,GAENA,EAELf,EAAMhC,kBAAkB+C,GACnBA,EAAK5C,OAEV6B,EAAMrB,kBAAkBoC,IAC1BX,EAAsBC,EAAS,mDACxBU,EAAKhE,YAEViD,EAAM7C,SAAS4D,IAAUV,GAAuC,qBAA5BA,EAAQ,iBAC9CD,EAAsBC,EAAS,oBA9CrC,SAAyBW,EAAUC,EAAQC,GACzC,GAAIlB,EAAM5B,SAAS4C,GACjB,IAEE,OADCC,GAAUE,KAAKC,OAAOJ,GAChBhB,EAAMN,KAAKsB,GAClB,MAAOK,GACP,GAAe,gBAAXA,EAAE/F,KACJ,MAAM+F,EAKZ,OAAQH,GAAWC,KAAKG,WAAWN,GAmCxBO,CAAgBR,IAElBA,IAGTS,kBAAmB,CAAC,SAA2BT,GAC7C,IAAIP,EAAeiB,KAAKjB,aACpBC,EAAoBD,GAAgBA,EAAaC,kBACjDC,EAAoBF,GAAgBA,EAAaE,kBACjDgB,GAAqBjB,GAA2C,SAAtBgB,KAAKE,aAEnD,GAAID,GAAsBhB,GAAqBV,EAAM5B,SAAS2C,IAASA,EAAKrD,OAC1E,IACE,OAAOyD,KAAKC,MAAML,GAClB,MAAOM,GACP,GAAIK,EAAmB,CACrB,GAAe,gBAAXL,EAAE/F,KACJ,MAAM4E,EAAamB,EAAGI,KAAM,gBAE9B,MAAMJ,GAKZ,OAAON,IAOTa,QAAS,EAETC,eAAgB,aAChBC,eAAgB,eAEhBC,kBAAmB,EACnBC,eAAgB,EAEhBC,eAAgB,SAAwBC,GACtC,OAAOA,GAAU,KAAOA,EAAS,MAIrC3B,EAASF,QAAU,CACjB8B,OAAQ,CACN,OAAU,sCAIdnC,EAAMzC,QAAQ,CAAC,SAAU,MAAO,SAAS,SAA6B6E,GACpE7B,EAASF,QAAQ+B,GAAU,MAG7BpC,EAAMzC,QAAQ,CAAC,OAAQ,MAAO,UAAU,SAA+B6E,GACrE7B,EAASF,QAAQ+B,GAAUpC,EAAMf,MAAMkB,MAGzC3F,EAAOD,QAAUgG,G,6BCnIjB/F,EAAOD,QAAU,SAAckD,EAAIgC,GACjC,OAAO,WAEL,IADA,IAAI4C,EAAO,IAAIC,MAAMjD,UAAU3B,QACtB3C,EAAI,EAAGA,EAAIsH,EAAK3E,OAAQ3C,IAC/BsH,EAAKtH,GAAKsE,UAAUtE,GAEtB,OAAO0C,EAAG8E,MAAM9C,EAAS4C,M,6BCN7B,IAAIrC,EAAQ,EAAQ,GAEpB,SAASwC,EAAOvF,GACd,OAAOwF,mBAAmBxF,GACxB2C,QAAQ,QAAS,KACjBA,QAAQ,OAAQ,KAChBA,QAAQ,QAAS,KACjBA,QAAQ,OAAQ,KAChBA,QAAQ,QAAS,KACjBA,QAAQ,QAAS,KAUrBpF,EAAOD,QAAU,SAAkBmI,EAAKC,EAAQC,GAE9C,IAAKD,EACH,OAAOD,EAGT,IAAIG,EACJ,GAAID,EACFC,EAAmBD,EAAiBD,QAC/B,GAAI3C,EAAMrB,kBAAkBgE,GACjCE,EAAmBF,EAAO5F,eACrB,CACL,IAAI+F,EAAQ,GAEZ9C,EAAMzC,QAAQoF,GAAQ,SAAmB1F,EAAKX,GACxCW,UAIA+C,EAAMhD,QAAQC,GAChBX,GAAY,KAEZW,EAAM,CAACA,GAGT+C,EAAMzC,QAAQN,GAAK,SAAoB8F,GACjC/C,EAAM1B,OAAOyE,GACfA,EAAIA,EAAEC,cACGhD,EAAM7C,SAAS4F,KACxBA,EAAI5B,KAAKG,UAAUyB,IAErBD,EAAMG,KAAKT,EAAOlG,GAAO,IAAMkG,EAAOO,WAI1CF,EAAmBC,EAAMI,KAAK,KAGhC,GAAIL,EAAkB,CACpB,IAAIM,EAAgBT,EAAIU,QAAQ,MACT,IAAnBD,IACFT,EAAMA,EAAItD,MAAM,EAAG+D,IAGrBT,KAA8B,IAAtBA,EAAIU,QAAQ,KAAc,IAAM,KAAOP,EAGjD,OAAOH,I,6BCxDTlI,EAAOD,QAAU,SAAsB8I,EAAOC,EAAQC,EAAMC,EAASC,GA4BnE,OA3BAJ,EAAMC,OAASA,EACXC,IACFF,EAAME,KAAOA,GAGfF,EAAMG,QAAUA,EAChBH,EAAMI,SAAWA,EACjBJ,EAAMK,cAAe,EAErBL,EAAMM,OAAS,WACb,MAAO,CAELC,QAASnC,KAAKmC,QACdtI,KAAMmG,KAAKnG,KAEXuI,YAAapC,KAAKoC,YAClBC,OAAQrC,KAAKqC,OAEbC,SAAUtC,KAAKsC,SACfC,WAAYvC,KAAKuC,WACjBC,aAAcxC,KAAKwC,aACnBC,MAAOzC,KAAKyC,MAEZZ,OAAQ7B,KAAK6B,OACbC,KAAM9B,KAAK8B,OAGRF,I,6BCtCT,IAAIrD,EAAQ,EAAQ,GAChBmE,EAAS,EAAQ,IACjBC,EAAU,EAAQ,IAClBC,EAAW,EAAQ,GACnBC,EAAgB,EAAQ,IACxBC,EAAe,EAAQ,IACvBC,EAAkB,EAAQ,IAC1BC,EAAc,EAAQ,GAE1BjK,EAAOD,QAAU,SAAoB+I,GACnC,OAAO,IAAIoB,SAAQ,SAA4BC,EAASC,GACtD,IAAIC,EAAcvB,EAAOvC,KACrB+D,EAAiBxB,EAAOjD,QACxBsB,EAAe2B,EAAO3B,aAEtB3B,EAAMlC,WAAW+G,WACZC,EAAe,gBAGxB,IAAItB,EAAU,IAAI5C,eAGlB,GAAI0C,EAAOyB,KAAM,CACf,IAAIC,EAAW1B,EAAOyB,KAAKC,UAAY,GACnCC,EAAW3B,EAAOyB,KAAKE,SAAWC,SAASzC,mBAAmBa,EAAOyB,KAAKE,WAAa,GAC3FH,EAAeK,cAAgB,SAAWC,KAAKJ,EAAW,IAAMC,GAGlE,IAAII,EAAWf,EAAchB,EAAOgC,QAAShC,EAAOZ,KAMpD,SAAS6C,IACP,GAAK/B,EAAL,CAIA,IAAIgC,EAAkB,0BAA2BhC,EAAUe,EAAaf,EAAQiC,yBAA2B,KAGvGhC,EAAW,CACb1C,KAHkBY,GAAiC,SAAjBA,GAA6C,SAAjBA,EACvC6B,EAAQC,SAA/BD,EAAQkC,aAGRxD,OAAQsB,EAAQtB,OAChByD,WAAYnC,EAAQmC,WACpBtF,QAASmF,EACTlC,OAAQA,EACRE,QAASA,GAGXW,EAAOQ,EAASC,EAAQnB,GAGxBD,EAAU,MAmEZ,GA5FAA,EAAQoC,KAAKtC,EAAOlB,OAAOyD,cAAexB,EAASgB,EAAU/B,EAAOX,OAAQW,EAAOV,mBAAmB,GAGtGY,EAAQ5B,QAAU0B,EAAO1B,QAyBrB,cAAe4B,EAEjBA,EAAQ+B,UAAYA,EAGpB/B,EAAQsC,mBAAqB,WACtBtC,GAAkC,IAAvBA,EAAQuC,aAQD,IAAnBvC,EAAQtB,QAAkBsB,EAAQwC,aAAwD,IAAzCxC,EAAQwC,YAAY5C,QAAQ,WAKjF6C,WAAWV,IAKf/B,EAAQ0C,QAAU,WACX1C,IAILoB,EAAOH,EAAY,kBAAmBnB,EAAQ,eAAgBE,IAG9DA,EAAU,OAIZA,EAAQ2C,QAAU,WAGhBvB,EAAOH,EAAY,gBAAiBnB,EAAQ,KAAME,IAGlDA,EAAU,MAIZA,EAAQ4C,UAAY,WAClB,IAAIC,EAAsB,cAAgB/C,EAAO1B,QAAU,cACvD0B,EAAO+C,sBACTA,EAAsB/C,EAAO+C,qBAE/BzB,EAAOH,EACL4B,EACA/C,EACAA,EAAO9C,cAAgB8C,EAAO9C,aAAaG,oBAAsB,YAAc,eAC/E6C,IAGFA,EAAU,MAMRxD,EAAMnB,uBAAwB,CAEhC,IAAIyH,GAAahD,EAAOiD,iBAAmB/B,EAAgBa,KAAc/B,EAAOzB,eAC9EuC,EAAQoC,KAAKlD,EAAOzB,qBACpB4E,EAEEH,IACFxB,EAAexB,EAAOxB,gBAAkBwE,GAKxC,qBAAsB9C,GACxBxD,EAAMzC,QAAQuH,GAAgB,SAA0B7H,EAAKX,QAChC,IAAhBuI,GAAqD,iBAAtBvI,EAAIoK,qBAErC5B,EAAexI,GAGtBkH,EAAQmD,iBAAiBrK,EAAKW,MAM/B+C,EAAM9C,YAAYoG,EAAOiD,mBAC5B/C,EAAQ+C,kBAAoBjD,EAAOiD,iBAIjC5E,GAAiC,SAAjBA,IAClB6B,EAAQ7B,aAAe2B,EAAO3B,cAIS,mBAA9B2B,EAAOsD,oBAChBpD,EAAQqD,iBAAiB,WAAYvD,EAAOsD,oBAIP,mBAA5BtD,EAAOwD,kBAAmCtD,EAAQuD,QAC3DvD,EAAQuD,OAAOF,iBAAiB,WAAYvD,EAAOwD,kBAGjDxD,EAAO0D,aAET1D,EAAO0D,YAAYC,QAAQC,MAAK,SAAoBC,GAC7C3D,IAILA,EAAQ4D,QACRxC,EAAOuC,GAEP3D,EAAU,SAITqB,IACHA,EAAc,MAIhBrB,EAAQ6D,KAAKxC,Q,6BCxLjB,IAAI3E,EAAe,EAAQ,GAY3B1F,EAAOD,QAAU,SAAqBqJ,EAASN,EAAQC,EAAMC,EAASC,GACpE,IAAIJ,EAAQ,IAAIiE,MAAM1D,GACtB,OAAO1D,EAAamD,EAAOC,EAAQC,EAAMC,EAASC,K,6BCdpDjJ,EAAOD,QAAU,SAAkByB,GACjC,SAAUA,IAASA,EAAMuL,c,6BCD3B,IAAIvH,EAAQ,EAAQ,GAUpBxF,EAAOD,QAAU,SAAqBiN,EAASC,GAE7CA,EAAUA,GAAW,GACrB,IAAInE,EAAS,GAEToE,EAAuB,CAAC,MAAO,SAAU,QACzCC,EAA0B,CAAC,UAAW,OAAQ,QAAS,UACvDC,EAAuB,CACzB,UAAW,mBAAoB,oBAAqB,mBACpD,UAAW,iBAAkB,kBAAmB,UAAW,eAAgB,iBAC3E,iBAAkB,mBAAoB,qBAAsB,aAC5D,mBAAoB,gBAAiB,eAAgB,YAAa,YAClE,aAAc,cAAe,aAAc,oBAEzCC,EAAkB,CAAC,kBAEvB,SAASC,EAAeC,EAAQC,GAC9B,OAAIhI,EAAM5C,cAAc2K,IAAW/H,EAAM5C,cAAc4K,GAC9ChI,EAAMf,MAAM8I,EAAQC,GAClBhI,EAAM5C,cAAc4K,GACtBhI,EAAMf,MAAM,GAAI+I,GACdhI,EAAMhD,QAAQgL,GAChBA,EAAO5I,QAET4I,EAGT,SAASC,EAAoBC,GACtBlI,EAAM9C,YAAYuK,EAAQS,IAEnBlI,EAAM9C,YAAYsK,EAAQU,MACpC5E,EAAO4E,GAAQJ,OAAerB,EAAWe,EAAQU,KAFjD5E,EAAO4E,GAAQJ,EAAeN,EAAQU,GAAOT,EAAQS,IAMzDlI,EAAMzC,QAAQmK,GAAsB,SAA0BQ,GACvDlI,EAAM9C,YAAYuK,EAAQS,MAC7B5E,EAAO4E,GAAQJ,OAAerB,EAAWgB,EAAQS,QAIrDlI,EAAMzC,QAAQoK,EAAyBM,GAEvCjI,EAAMzC,QAAQqK,GAAsB,SAA0BM,GACvDlI,EAAM9C,YAAYuK,EAAQS,IAEnBlI,EAAM9C,YAAYsK,EAAQU,MACpC5E,EAAO4E,GAAQJ,OAAerB,EAAWe,EAAQU,KAFjD5E,EAAO4E,GAAQJ,OAAerB,EAAWgB,EAAQS,OAMrDlI,EAAMzC,QAAQsK,GAAiB,SAAeK,GACxCA,KAAQT,EACVnE,EAAO4E,GAAQJ,EAAeN,EAAQU,GAAOT,EAAQS,IAC5CA,KAAQV,IACjBlE,EAAO4E,GAAQJ,OAAerB,EAAWe,EAAQU,QAIrD,IAAIC,EAAYT,EACbU,OAAOT,GACPS,OAAOR,GACPQ,OAAOP,GAENQ,EAAY5M,OACb6M,KAAKd,GACLY,OAAO3M,OAAO6M,KAAKb,IACnBc,QAAO,SAAyBjM,GAC/B,OAAmC,IAA5B6L,EAAU/E,QAAQ9G,MAK7B,OAFA0D,EAAMzC,QAAQ8K,EAAWJ,GAElB3E,I,6BC7ET,SAASkF,EAAO5E,GACdnC,KAAKmC,QAAUA,EAGjB4E,EAAO7L,UAAUI,SAAW,WAC1B,MAAO,UAAY0E,KAAKmC,QAAU,KAAOnC,KAAKmC,QAAU,KAG1D4E,EAAO7L,UAAU4K,YAAa,EAE9B/M,EAAOD,QAAUiO,G,gBClBjBhO,EAAOD,QAAU,EAAQ,K,6BCEzB,IAAIyF,EAAQ,EAAQ,GAChBzD,EAAO,EAAQ,GACfkM,EAAQ,EAAQ,IAChBC,EAAc,EAAQ,GAS1B,SAASC,EAAeC,GACtB,IAAIC,EAAU,IAAIJ,EAAMG,GACpBE,EAAWvM,EAAKkM,EAAM9L,UAAU6G,QAASqF,GAQ7C,OALA7I,EAAMV,OAAOwJ,EAAUL,EAAM9L,UAAWkM,GAGxC7I,EAAMV,OAAOwJ,EAAUD,GAEhBC,EAIT,IAAIC,EAAQJ,EAtBG,EAAQ,IAyBvBI,EAAMN,MAAQA,EAGdM,EAAM1M,OAAS,SAAgB2M,GAC7B,OAAOL,EAAeD,EAAYK,EAAMxI,SAAUyI,KAIpDD,EAAMP,OAAS,EAAQ,GACvBO,EAAME,YAAc,EAAQ,IAC5BF,EAAMG,SAAW,EAAQ,GAGzBH,EAAMI,IAAM,SAAaC,GACvB,OAAO1E,QAAQyE,IAAIC,IAErBL,EAAMM,OAAS,EAAQ,IAGvBN,EAAMrF,aAAe,EAAQ,IAE7BlJ,EAAOD,QAAUwO,EAGjBvO,EAAOD,QAAQ+O,QAAUP,G,6BCrDzB,IAAI/I,EAAQ,EAAQ,GAChBqE,EAAW,EAAQ,GACnBkF,EAAqB,EAAQ,IAC7BC,EAAkB,EAAQ,IAC1Bd,EAAc,EAAQ,GACtBe,EAAY,EAAQ,IAEpBC,EAAaD,EAAUC,WAM3B,SAASjB,EAAMO,GACbvH,KAAKlB,SAAWyI,EAChBvH,KAAKkI,aAAe,CAClBnG,QAAS,IAAI+F,EACb9F,SAAU,IAAI8F,GASlBd,EAAM9L,UAAU6G,QAAU,SAAiBF,GAGnB,iBAAXA,GACTA,EAASjE,UAAU,IAAM,IAClBqD,IAAMrD,UAAU,GAEvBiE,EAASA,GAAU,IAGrBA,EAASoF,EAAYjH,KAAKlB,SAAU+C,IAGzBlB,OACTkB,EAAOlB,OAASkB,EAAOlB,OAAOsE,cACrBjF,KAAKlB,SAAS6B,OACvBkB,EAAOlB,OAASX,KAAKlB,SAAS6B,OAAOsE,cAErCpD,EAAOlB,OAAS,MAGlB,IAAI5B,EAAe8C,EAAO9C,kBAELiG,IAAjBjG,GACFiJ,EAAUG,cAAcpJ,EAAc,CACpCC,kBAAmBiJ,EAAWlJ,aAAakJ,EAAWG,QAAS,SAC/DnJ,kBAAmBgJ,EAAWlJ,aAAakJ,EAAWG,QAAS,SAC/DlJ,oBAAqB+I,EAAWlJ,aAAakJ,EAAWG,QAAS,WAChE,GAIL,IAAIC,EAA0B,GAC1BC,GAAiC,EACrCtI,KAAKkI,aAAanG,QAAQjG,SAAQ,SAAoCyM,GACjC,mBAAxBA,EAAYC,UAA0D,IAAhCD,EAAYC,QAAQ3G,KAIrEyG,EAAiCA,GAAkCC,EAAYE,YAE/EJ,EAAwBK,QAAQH,EAAYI,UAAWJ,EAAYK,cAGrE,IAKIpD,EALAqD,EAA2B,GAO/B,GANA7I,KAAKkI,aAAalG,SAASlG,SAAQ,SAAkCyM,GACnEM,EAAyBrH,KAAK+G,EAAYI,UAAWJ,EAAYK,cAK9DN,EAAgC,CACnC,IAAIQ,EAAQ,CAACf,OAAiB/C,GAM9B,IAJAnE,MAAM3F,UAAUwN,QAAQ5H,MAAMgI,EAAOT,GACrCS,EAAQA,EAAMnC,OAAOkC,GAErBrD,EAAUvC,QAAQC,QAAQrB,GACnBiH,EAAM7M,QACXuJ,EAAUA,EAAQC,KAAKqD,EAAMC,QAASD,EAAMC,SAG9C,OAAOvD,EAKT,IADA,IAAIwD,EAAYnH,EACTwG,EAAwBpM,QAAQ,CACrC,IAAIgN,EAAcZ,EAAwBU,QACtCG,EAAab,EAAwBU,QACzC,IACEC,EAAYC,EAAYD,GACxB,MAAOpH,GACPsH,EAAWtH,GACX,OAIJ,IACE4D,EAAUuC,EAAgBiB,GAC1B,MAAOpH,GACP,OAAOqB,QAAQE,OAAOvB,GAGxB,KAAOiH,EAAyB5M,QAC9BuJ,EAAUA,EAAQC,KAAKoD,EAAyBE,QAASF,EAAyBE,SAGpF,OAAOvD,GAGTwB,EAAM9L,UAAUiO,OAAS,SAAgBtH,GAEvC,OADAA,EAASoF,EAAYjH,KAAKlB,SAAU+C,GAC7Be,EAASf,EAAOZ,IAAKY,EAAOX,OAAQW,EAAOV,kBAAkBhD,QAAQ,MAAO,KAIrFI,EAAMzC,QAAQ,CAAC,SAAU,MAAO,OAAQ,YAAY,SAA6B6E,GAE/EqG,EAAM9L,UAAUyF,GAAU,SAASM,EAAKY,GACtC,OAAO7B,KAAK+B,QAAQkF,EAAYpF,GAAU,GAAI,CAC5ClB,OAAQA,EACRM,IAAKA,EACL3B,MAAOuC,GAAU,IAAIvC,YAK3Bf,EAAMzC,QAAQ,CAAC,OAAQ,MAAO,UAAU,SAA+B6E,GAErEqG,EAAM9L,UAAUyF,GAAU,SAASM,EAAK3B,EAAMuC,GAC5C,OAAO7B,KAAK+B,QAAQkF,EAAYpF,GAAU,GAAI,CAC5ClB,OAAQA,EACRM,IAAKA,EACL3B,KAAMA,SAKZvG,EAAOD,QAAUkO,G,6BCjJjB,IAAIzI,EAAQ,EAAQ,GAEpB,SAASuJ,IACP9H,KAAKoJ,SAAW,GAWlBtB,EAAmB5M,UAAUmO,IAAM,SAAaV,EAAWC,EAAUU,GAOnE,OANAtJ,KAAKoJ,SAAS5H,KAAK,CACjBmH,UAAWA,EACXC,SAAUA,EACVH,cAAaa,GAAUA,EAAQb,YAC/BD,QAASc,EAAUA,EAAQd,QAAU,OAEhCxI,KAAKoJ,SAASnN,OAAS,GAQhC6L,EAAmB5M,UAAUqO,MAAQ,SAAeC,GAC9CxJ,KAAKoJ,SAASI,KAChBxJ,KAAKoJ,SAASI,GAAM,OAYxB1B,EAAmB5M,UAAUY,QAAU,SAAiBE,GACtDuC,EAAMzC,QAAQkE,KAAKoJ,UAAU,SAAwBK,GACzC,OAANA,GACFzN,EAAGyN,OAKT1Q,EAAOD,QAAUgP,G,6BCnDjB,IAAIvJ,EAAQ,EAAQ,GAChBmL,EAAgB,EAAQ,IACxBjC,EAAW,EAAQ,GACnB3I,EAAW,EAAQ,GAKvB,SAAS6K,EAA6B9H,GAChCA,EAAO0D,aACT1D,EAAO0D,YAAYqE,mBAUvB7Q,EAAOD,QAAU,SAAyB+I,GA8BxC,OA7BA8H,EAA6B9H,GAG7BA,EAAOjD,QAAUiD,EAAOjD,SAAW,GAGnCiD,EAAOvC,KAAOoK,EAAcjQ,KAC1BoI,EACAA,EAAOvC,KACPuC,EAAOjD,QACPiD,EAAOxC,kBAITwC,EAAOjD,QAAUL,EAAMf,MACrBqE,EAAOjD,QAAQ8B,QAAU,GACzBmB,EAAOjD,QAAQiD,EAAOlB,SAAW,GACjCkB,EAAOjD,SAGTL,EAAMzC,QACJ,CAAC,SAAU,MAAO,OAAQ,OAAQ,MAAO,QAAS,WAClD,SAA2B6E,UAClBkB,EAAOjD,QAAQ+B,OAIZkB,EAAOhD,SAAWC,EAASD,SAE1BgD,GAAQ4D,MAAK,SAA6BzD,GAWvD,OAVA2H,EAA6B9H,GAG7BG,EAAS1C,KAAOoK,EAAcjQ,KAC5BoI,EACAG,EAAS1C,KACT0C,EAASpD,QACTiD,EAAO9B,mBAGFiC,KACN,SAA4B6H,GAe7B,OAdKpC,EAASoC,KACZF,EAA6B9H,GAGzBgI,GAAUA,EAAO7H,WACnB6H,EAAO7H,SAAS1C,KAAOoK,EAAcjQ,KACnCoI,EACAgI,EAAO7H,SAAS1C,KAChBuK,EAAO7H,SAASpD,QAChBiD,EAAO9B,qBAKNkD,QAAQE,OAAO0G,Q,6BC7E1B,IAAItL,EAAQ,EAAQ,GAChBO,EAAW,EAAQ,GAUvB/F,EAAOD,QAAU,SAAuBwG,EAAMV,EAASkL,GACrD,IAAI1C,EAAUpH,MAAQlB,EAMtB,OAJAP,EAAMzC,QAAQgO,GAAK,SAAmB9N,GACpCsD,EAAOtD,EAAGvC,KAAK2N,EAAS9H,EAAMV,MAGzBU,I,6BClBT,IAAIf,EAAQ,EAAQ,GAEpBxF,EAAOD,QAAU,SAA6B8F,EAASmL,GACrDxL,EAAMzC,QAAQ8C,GAAS,SAAuBrE,EAAOV,GAC/CA,IAASkQ,GAAkBlQ,EAAKuK,gBAAkB2F,EAAe3F,gBACnExF,EAAQmL,GAAkBxP,SACnBqE,EAAQ/E,S,6BCNrB,IAAImJ,EAAc,EAAQ,GAS1BjK,EAAOD,QAAU,SAAgBoK,EAASC,EAAQnB,GAChD,IAAIxB,EAAiBwB,EAASH,OAAOrB,eAChCwB,EAASvB,QAAWD,IAAkBA,EAAewB,EAASvB,QAGjE0C,EAAOH,EACL,mCAAqChB,EAASvB,OAC9CuB,EAASH,OACT,KACAG,EAASD,QACTC,IAPFkB,EAAQlB,K,6BCZZ,IAAIzD,EAAQ,EAAQ,GAEpBxF,EAAOD,QACLyF,EAAMnB,uBAIK,CACL4M,MAAO,SAAenQ,EAAMU,EAAO0P,EAASC,EAAMC,EAAQC,GACxD,IAAIC,EAAS,GACbA,EAAO7I,KAAK3H,EAAO,IAAMmH,mBAAmBzG,IAExCgE,EAAM3B,SAASqN,IACjBI,EAAO7I,KAAK,WAAa,IAAI8I,KAAKL,GAASM,eAGzChM,EAAM5B,SAASuN,IACjBG,EAAO7I,KAAK,QAAU0I,GAGpB3L,EAAM5B,SAASwN,IACjBE,EAAO7I,KAAK,UAAY2I,IAGX,IAAXC,GACFC,EAAO7I,KAAK,UAGdjE,SAAS8M,OAASA,EAAO5I,KAAK,OAGhCsD,KAAM,SAAclL,GAClB,IAAI2Q,EAAQjN,SAAS8M,OAAOG,MAAM,IAAIC,OAAO,aAAe5Q,EAAO,cACnE,OAAQ2Q,EAAQE,mBAAmBF,EAAM,IAAM,MAGjDG,OAAQ,SAAgB9Q,GACtBmG,KAAKgK,MAAMnQ,EAAM,GAAIyQ,KAAKM,MAAQ,SAO/B,CACLZ,MAAO,aACPjF,KAAM,WAAkB,OAAO,MAC/B4F,OAAQ,e,6BC/ChB,IAAIE,EAAgB,EAAQ,IACxBC,EAAc,EAAQ,IAW1B/R,EAAOD,QAAU,SAAuB+K,EAASkH,GAC/C,OAAIlH,IAAYgH,EAAcE,GACrBD,EAAYjH,EAASkH,GAEvBA,I,6BCVThS,EAAOD,QAAU,SAAuBmI,GAItC,MAAO,gCAAgC+J,KAAK/J,K,6BCH9ClI,EAAOD,QAAU,SAAqB+K,EAASoH,GAC7C,OAAOA,EACHpH,EAAQ1F,QAAQ,OAAQ,IAAM,IAAM8M,EAAY9M,QAAQ,OAAQ,IAChE0F,I,6BCVN,IAAItF,EAAQ,EAAQ,GAIhB2M,EAAoB,CACtB,MAAO,gBAAiB,iBAAkB,eAAgB,OAC1D,UAAW,OAAQ,OAAQ,oBAAqB,sBAChD,gBAAiB,WAAY,eAAgB,sBAC7C,UAAW,cAAe,cAgB5BnS,EAAOD,QAAU,SAAsB8F,GACrC,IACI/D,EACAW,EACAlC,EAHA6R,EAAS,GAKb,OAAKvM,GAELL,EAAMzC,QAAQ8C,EAAQwM,MAAM,OAAO,SAAgBC,GAKjD,GAJA/R,EAAI+R,EAAK1J,QAAQ,KACjB9G,EAAM0D,EAAMN,KAAKoN,EAAKC,OAAO,EAAGhS,IAAI2L,cACpCzJ,EAAM+C,EAAMN,KAAKoN,EAAKC,OAAOhS,EAAI,IAE7BuB,EAAK,CACP,GAAIsQ,EAAOtQ,IAAQqQ,EAAkBvJ,QAAQ9G,IAAQ,EACnD,OAGAsQ,EAAOtQ,GADG,eAARA,GACasQ,EAAOtQ,GAAOsQ,EAAOtQ,GAAO,IAAI8L,OAAO,CAACnL,IAEzC2P,EAAOtQ,GAAOsQ,EAAOtQ,GAAO,KAAOW,EAAMA,MAKtD2P,GAnBgBA,I,6BC9BzB,IAAI5M,EAAQ,EAAQ,GAEpBxF,EAAOD,QACLyF,EAAMnB,uBAIJ,WACE,IAEImO,EAFAC,EAAO,kBAAkBR,KAAK3N,UAAUoO,WACxCC,EAAiBnO,SAASoO,cAAc,KAS5C,SAASC,EAAW3K,GAClB,IAAI4K,EAAO5K,EAWX,OATIuK,IAEFE,EAAeI,aAAa,OAAQD,GACpCA,EAAOH,EAAeG,MAGxBH,EAAeI,aAAa,OAAQD,GAG7B,CACLA,KAAMH,EAAeG,KACrBE,SAAUL,EAAeK,SAAWL,EAAeK,SAAS5N,QAAQ,KAAM,IAAM,GAChF6N,KAAMN,EAAeM,KACrBC,OAAQP,EAAeO,OAASP,EAAeO,OAAO9N,QAAQ,MAAO,IAAM,GAC3E+N,KAAMR,EAAeQ,KAAOR,EAAeQ,KAAK/N,QAAQ,KAAM,IAAM,GACpEgO,SAAUT,EAAeS,SACzBC,KAAMV,EAAeU,KACrBC,SAAiD,MAAtCX,EAAeW,SAASC,OAAO,GACxCZ,EAAeW,SACf,IAAMX,EAAeW,UAY3B,OARAd,EAAYK,EAAW1S,OAAOqT,SAASV,MAQhC,SAAyBW,GAC9B,IAAIrB,EAAU5M,EAAM5B,SAAS6P,GAAeZ,EAAWY,GAAcA,EACrE,OAAQrB,EAAOY,WAAaR,EAAUQ,UAClCZ,EAAOa,OAAST,EAAUS,MAhDlC,GAsDS,WACL,OAAO,I,6BC9Df,IAAIS,EAAM,EAAQ,IAEdxE,EAAa,GAGjB,CAAC,SAAU,UAAW,SAAU,WAAY,SAAU,UAAUnM,SAAQ,SAAS4Q,EAAMpT,GACrF2O,EAAWyE,GAAQ,SAAmBC,GACpC,cAAcA,IAAUD,GAAQ,KAAOpT,EAAI,EAAI,KAAO,KAAOoT,MAIjE,IAAIE,EAAqB,GACrBC,EAAgBJ,EAAIK,QAAQ1B,MAAM,KAQtC,SAAS2B,EAAeD,EAASE,GAG/B,IAFA,IAAIC,EAAgBD,EAAcA,EAAY5B,MAAM,KAAOyB,EACvDK,EAAUJ,EAAQ1B,MAAM,KACnB9R,EAAI,EAAGA,EAAI,EAAGA,IAAK,CAC1B,GAAI2T,EAAc3T,GAAK4T,EAAQ5T,GAC7B,OAAO,EACF,GAAI2T,EAAc3T,GAAK4T,EAAQ5T,GACpC,OAAO,EAGX,OAAO,EAUT2O,EAAWlJ,aAAe,SAAsBiJ,EAAW8E,EAAS3K,GAClE,IAAIgL,EAAeL,GAAWC,EAAeD,GAE7C,SAASM,EAAcC,EAAKC,GAC1B,MAAO,WAAab,EAAIK,QAAU,0BAA6BO,EAAM,IAAOC,GAAQnL,EAAU,KAAOA,EAAU,IAIjH,OAAO,SAAS5H,EAAO8S,EAAKE,GAC1B,IAAkB,IAAdvF,EACF,MAAM,IAAInC,MAAMuH,EAAcC,EAAK,wBAA0BP,IAc/D,OAXIK,IAAiBP,EAAmBS,KACtCT,EAAmBS,IAAO,EAE1BG,QAAQC,KACNL,EACEC,EACA,+BAAiCP,EAAU,8CAK1C9E,GAAYA,EAAUzN,EAAO8S,EAAKE,KAkC7CxU,EAAOD,QAAU,CACfiU,eAAgBA,EAChB5E,cAzBF,SAAuBmB,EAASoE,EAAQC,GACtC,GAAuB,iBAAZrE,EACT,MAAM,IAAIsE,UAAU,6BAItB,IAFA,IAAI/G,EAAO7M,OAAO6M,KAAKyC,GACnBhQ,EAAIuN,EAAK5K,OACN3C,KAAM,GAAG,CACd,IAAI+T,EAAMxG,EAAKvN,GACX0O,EAAY0F,EAAOL,GACvB,GAAIrF,EAAJ,CACE,IAAIzN,EAAQ+O,EAAQ+D,GAChB5P,OAAmBuH,IAAVzK,GAAuByN,EAAUzN,EAAO8S,EAAK/D,GAC1D,IAAe,IAAX7L,EACF,MAAM,IAAImQ,UAAU,UAAYP,EAAM,YAAc5P,QAIxD,IAAqB,IAAjBkQ,EACF,MAAM9H,MAAM,kBAAoBwH,KAQpCpF,WAAYA,I,0+DCrGd,IAAIlB,EAAS,EAAQ,GAQrB,SAASS,EAAYqG,GACnB,GAAwB,mBAAbA,EACT,MAAM,IAAID,UAAU,gCAGtB,IAAIE,EACJ9N,KAAKwF,QAAU,IAAIvC,SAAQ,SAAyBC,GAClD4K,EAAiB5K,KAGnB,IAAI6K,EAAQ/N,KACZ6N,GAAS,SAAgB1L,GACnB4L,EAAMlE,SAKVkE,EAAMlE,OAAS,IAAI9C,EAAO5E,GAC1B2L,EAAeC,EAAMlE,YAOzBrC,EAAYtM,UAAU0O,iBAAmB,WACvC,GAAI5J,KAAK6J,OACP,MAAM7J,KAAK6J,QAQfrC,EAAYjB,OAAS,WACnB,IAAIb,EAIJ,MAAO,CACLqI,MAJU,IAAIvG,GAAY,SAAkB7N,GAC5C+L,EAAS/L,KAIT+L,OAAQA,IAIZ3M,EAAOD,QAAU0O,G,6BClCjBzO,EAAOD,QAAU,SAAgBkV,GAC/B,OAAO,SAAcC,GACnB,OAAOD,EAASlN,MAAM,KAAMmN,M,6BChBhClV,EAAOD,QAAU,SAAsBoV,GACrC,MAA2B,iBAAZA,IAAmD,IAAzBA,EAAQjM","file":"axios.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n"],"sourceRoot":""}
\ No newline at end of file diff --git a/alarm/node_modules/pronote-api/node_modules/axios/index.d.ts b/alarm/node_modules/pronote-api/node_modules/axios/index.d.ts deleted file mode 100644 index 78f733f..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/index.d.ts +++ /dev/null @@ -1,168 +0,0 @@ -export interface AxiosTransformer { - (data: any, headers?: any): any; -} - -export interface AxiosAdapter { - (config: AxiosRequestConfig): AxiosPromise<any>; -} - -export interface AxiosBasicCredentials { - username: string; - password: string; -} - -export interface AxiosProxyConfig { - host: string; - port: number; - auth?: { - username: string; - password:string; - }; - protocol?: string; -} - -export type Method = - | 'get' | 'GET' - | 'delete' | 'DELETE' - | 'head' | 'HEAD' - | 'options' | 'OPTIONS' - | 'post' | 'POST' - | 'put' | 'PUT' - | 'patch' | 'PATCH' - | 'purge' | 'PURGE' - | 'link' | 'LINK' - | 'unlink' | 'UNLINK' - -export type ResponseType = - | 'arraybuffer' - | 'blob' - | 'document' - | 'json' - | 'text' - | 'stream' - -export interface TransitionalOptions{ - silentJSONParsing: boolean; - forcedJSONParsing: boolean; - clarifyTimeoutError: boolean; -} - -export interface AxiosRequestConfig { - url?: string; - method?: Method; - baseURL?: string; - transformRequest?: AxiosTransformer | AxiosTransformer[]; - transformResponse?: AxiosTransformer | AxiosTransformer[]; - headers?: any; - params?: any; - paramsSerializer?: (params: any) => string; - data?: any; - timeout?: number; - timeoutErrorMessage?: string; - withCredentials?: boolean; - adapter?: AxiosAdapter; - auth?: AxiosBasicCredentials; - responseType?: ResponseType; - xsrfCookieName?: string; - xsrfHeaderName?: string; - onUploadProgress?: (progressEvent: any) => void; - onDownloadProgress?: (progressEvent: any) => void; - maxContentLength?: number; - validateStatus?: ((status: number) => boolean) | null; - maxBodyLength?: number; - maxRedirects?: number; - socketPath?: string | null; - httpAgent?: any; - httpsAgent?: any; - proxy?: AxiosProxyConfig | false; - cancelToken?: CancelToken; - decompress?: boolean; - transitional?: TransitionalOptions -} - -export interface AxiosResponse<T = any> { - data: T; - status: number; - statusText: string; - headers: any; - config: AxiosRequestConfig; - request?: any; -} - -export interface AxiosError<T = any> extends Error { - config: AxiosRequestConfig; - code?: string; - request?: any; - response?: AxiosResponse<T>; - isAxiosError: boolean; - toJSON: () => object; -} - -export interface AxiosPromise<T = any> extends Promise<AxiosResponse<T>> { -} - -export interface CancelStatic { - new (message?: string): Cancel; -} - -export interface Cancel { - message: string; -} - -export interface Canceler { - (message?: string): void; -} - -export interface CancelTokenStatic { - new (executor: (cancel: Canceler) => void): CancelToken; - source(): CancelTokenSource; -} - -export interface CancelToken { - promise: Promise<Cancel>; - reason?: Cancel; - throwIfRequested(): void; -} - -export interface CancelTokenSource { - token: CancelToken; - cancel: Canceler; -} - -export interface AxiosInterceptorManager<V> { - use<T = V>(onFulfilled?: (value: V) => T | Promise<T>, onRejected?: (error: any) => any): number; - eject(id: number): void; -} - -export interface AxiosInstance { - (config: AxiosRequestConfig): AxiosPromise; - (url: string, config?: AxiosRequestConfig): AxiosPromise; - defaults: AxiosRequestConfig; - interceptors: { - request: AxiosInterceptorManager<AxiosRequestConfig>; - response: AxiosInterceptorManager<AxiosResponse>; - }; - getUri(config?: AxiosRequestConfig): string; - request<T = any, R = AxiosResponse<T>> (config: AxiosRequestConfig): Promise<R>; - get<T = any, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>; - delete<T = any, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>; - head<T = any, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>; - options<T = any, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>; - post<T = any, R = AxiosResponse<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>; - put<T = any, R = AxiosResponse<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>; - patch<T = any, R = AxiosResponse<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>; -} - -export interface AxiosStatic extends AxiosInstance { - create(config?: AxiosRequestConfig): AxiosInstance; - Cancel: CancelStatic; - CancelToken: CancelTokenStatic; - isCancel(value: any): boolean; - all<T>(values: (T | Promise<T>)[]): Promise<T[]>; - spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R; - isAxiosError(payload: any): payload is AxiosError; -} - -declare const axios: AxiosStatic; - -export default axios; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/index.js b/alarm/node_modules/pronote-api/node_modules/axios/index.js deleted file mode 100644 index 79dfd09..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/axios');
\ No newline at end of file diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/adapters/README.md b/alarm/node_modules/pronote-api/node_modules/axios/lib/adapters/README.md deleted file mode 100644 index 68f1118..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/adapters/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# axios // adapters - -The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. - -## Example - -```js -var settle = require('./../core/settle'); - -module.exports = function myAdapter(config) { - // At this point: - // - config has been merged with defaults - // - request transformers have already run - // - request interceptors have already run - - // Make the request using config provided - // Upon response settle the Promise - - return new Promise(function(resolve, reject) { - - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request - }; - - settle(resolve, reject, response); - - // From here: - // - response transformers will run - // - response interceptors will run - }); -} -``` diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/adapters/http.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/adapters/http.js deleted file mode 100755 index 0cca3bd..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/adapters/http.js +++ /dev/null @@ -1,331 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); -var settle = require('./../core/settle'); -var buildFullPath = require('../core/buildFullPath'); -var buildURL = require('./../helpers/buildURL'); -var http = require('http'); -var https = require('https'); -var httpFollow = require('follow-redirects').http; -var httpsFollow = require('follow-redirects').https; -var url = require('url'); -var zlib = require('zlib'); -var pkg = require('./../../package.json'); -var createError = require('../core/createError'); -var enhanceError = require('../core/enhanceError'); - -var isHttps = /https:?/; - -/** - * - * @param {http.ClientRequestArgs} options - * @param {AxiosProxyConfig} proxy - * @param {string} location - */ -function setProxy(options, proxy, location) { - options.hostname = proxy.host; - options.host = proxy.host; - options.port = proxy.port; - options.path = location; - - // Basic proxy authorization - if (proxy.auth) { - var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); - options.headers['Proxy-Authorization'] = 'Basic ' + base64; - } - - // If a proxy is used, any redirects must also pass through the proxy - options.beforeRedirect = function beforeRedirect(redirection) { - redirection.headers.host = redirection.host; - setProxy(redirection, proxy, redirection.href); - }; -} - -/*eslint consistent-return:0*/ -module.exports = function httpAdapter(config) { - return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { - var resolve = function resolve(value) { - resolvePromise(value); - }; - var reject = function reject(value) { - rejectPromise(value); - }; - var data = config.data; - var headers = config.headers; - - // Set User-Agent (required by some servers) - // See https://github.com/axios/axios/issues/69 - if ('User-Agent' in headers || 'user-agent' in headers) { - // User-Agent is specified; handle case where no UA header is desired - if (!headers['User-Agent'] && !headers['user-agent']) { - delete headers['User-Agent']; - delete headers['user-agent']; - } - // Otherwise, use specified value - } else { - // Only set header if it hasn't been set in config - headers['User-Agent'] = 'axios/' + pkg.version; - } - - if (data && !utils.isStream(data)) { - if (Buffer.isBuffer(data)) { - // Nothing to do... - } else if (utils.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils.isString(data)) { - data = Buffer.from(data, 'utf-8'); - } else { - return reject(createError( - 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', - config - )); - } - - // Add Content-Length header if data exists - headers['Content-Length'] = data.length; - } - - // HTTP basic authentication - var auth = undefined; - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password || ''; - auth = username + ':' + password; - } - - // Parse url - var fullPath = buildFullPath(config.baseURL, config.url); - var parsed = url.parse(fullPath); - var protocol = parsed.protocol || 'http:'; - - if (!auth && parsed.auth) { - var urlAuth = parsed.auth.split(':'); - var urlUsername = urlAuth[0] || ''; - var urlPassword = urlAuth[1] || ''; - auth = urlUsername + ':' + urlPassword; - } - - if (auth) { - delete headers.Authorization; - } - - var isHttpsRequest = isHttps.test(protocol); - var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; - - var options = { - path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), - method: config.method.toUpperCase(), - headers: headers, - agent: agent, - agents: { http: config.httpAgent, https: config.httpsAgent }, - auth: auth - }; - - if (config.socketPath) { - options.socketPath = config.socketPath; - } else { - options.hostname = parsed.hostname; - options.port = parsed.port; - } - - var proxy = config.proxy; - if (!proxy && proxy !== false) { - var proxyEnv = protocol.slice(0, -1) + '_proxy'; - var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; - if (proxyUrl) { - var parsedProxyUrl = url.parse(proxyUrl); - var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; - var shouldProxy = true; - - if (noProxyEnv) { - var noProxy = noProxyEnv.split(',').map(function trim(s) { - return s.trim(); - }); - - shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { - if (!proxyElement) { - return false; - } - if (proxyElement === '*') { - return true; - } - if (proxyElement[0] === '.' && - parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { - return true; - } - - return parsed.hostname === proxyElement; - }); - } - - if (shouldProxy) { - proxy = { - host: parsedProxyUrl.hostname, - port: parsedProxyUrl.port, - protocol: parsedProxyUrl.protocol - }; - - if (parsedProxyUrl.auth) { - var proxyUrlAuth = parsedProxyUrl.auth.split(':'); - proxy.auth = { - username: proxyUrlAuth[0], - password: proxyUrlAuth[1] - }; - } - } - } - } - - if (proxy) { - options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); - setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); - } - - var transport; - var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); - if (config.transport) { - transport = config.transport; - } else if (config.maxRedirects === 0) { - transport = isHttpsProxy ? https : http; - } else { - if (config.maxRedirects) { - options.maxRedirects = config.maxRedirects; - } - transport = isHttpsProxy ? httpsFollow : httpFollow; - } - - if (config.maxBodyLength > -1) { - options.maxBodyLength = config.maxBodyLength; - } - - // Create the request - var req = transport.request(options, function handleResponse(res) { - if (req.aborted) return; - - // uncompress the response body transparently if required - var stream = res; - - // return the last request in case of redirects - var lastRequest = res.req || req; - - - // if no content, is HEAD request or decompress disabled we should not decompress - if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { - switch (res.headers['content-encoding']) { - /*eslint default-case:0*/ - case 'gzip': - case 'compress': - case 'deflate': - // add the unzipper to the body stream processing pipeline - stream = stream.pipe(zlib.createUnzip()); - - // remove the content-encoding in order to not confuse downstream operations - delete res.headers['content-encoding']; - break; - } - } - - var response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: res.headers, - config: config, - request: lastRequest - }; - - if (config.responseType === 'stream') { - response.data = stream; - settle(resolve, reject, response); - } else { - var responseBuffer = []; - var totalResponseBytes = 0; - stream.on('data', function handleStreamData(chunk) { - responseBuffer.push(chunk); - totalResponseBytes += chunk.length; - - // make sure the content length is not over the maxContentLength if specified - if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { - stream.destroy(); - reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded', - config, null, lastRequest)); - } - }); - - stream.on('error', function handleStreamError(err) { - if (req.aborted) return; - reject(enhanceError(err, config, null, lastRequest)); - }); - - stream.on('end', function handleStreamEnd() { - var responseData = Buffer.concat(responseBuffer); - if (config.responseType !== 'arraybuffer') { - responseData = responseData.toString(config.responseEncoding); - if (!config.responseEncoding || config.responseEncoding === 'utf8') { - responseData = utils.stripBOM(responseData); - } - } - - response.data = responseData; - settle(resolve, reject, response); - }); - } - }); - - // Handle errors - req.on('error', function handleRequestError(err) { - if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return; - reject(enhanceError(err, config, null, req)); - }); - - // Handle request timeout - if (config.timeout) { - // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. - var timeout = parseInt(config.timeout, 10); - - if (isNaN(timeout)) { - reject(createError( - 'error trying to parse `config.timeout` to int', - config, - 'ERR_PARSE_TIMEOUT', - req - )); - - return; - } - - // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. - // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. - // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. - // And then these socket which be hang up will devoring CPU little by little. - // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. - req.setTimeout(timeout, function handleRequestTimeout() { - req.abort(); - reject(createError( - 'timeout of ' + timeout + 'ms exceeded', - config, - config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', - req - )); - }); - } - - if (config.cancelToken) { - // Handle cancellation - config.cancelToken.promise.then(function onCanceled(cancel) { - if (req.aborted) return; - - req.abort(); - reject(cancel); - }); - } - - // Send the request - if (utils.isStream(data)) { - data.on('error', function handleStreamError(err) { - reject(enhanceError(err, config, null, req)); - }).pipe(req); - } else { - req.end(data); - } - }); -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/adapters/xhr.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/adapters/xhr.js deleted file mode 100644 index a386dd2..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/adapters/xhr.js +++ /dev/null @@ -1,189 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); -var settle = require('./../core/settle'); -var cookies = require('./../helpers/cookies'); -var buildURL = require('./../helpers/buildURL'); -var buildFullPath = require('../core/buildFullPath'); -var parseHeaders = require('./../helpers/parseHeaders'); -var isURLSameOrigin = require('./../helpers/isURLSameOrigin'); -var createError = require('../core/createError'); - -module.exports = function xhrAdapter(config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - var requestData = config.data; - var requestHeaders = config.headers; - var responseType = config.responseType; - - if (utils.isFormData(requestData)) { - delete requestHeaders['Content-Type']; // Let the browser set it - } - - var request = new XMLHttpRequest(); - - // HTTP basic authentication - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; - requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); - } - - var fullPath = buildFullPath(config.baseURL, config.url); - request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); - - // Set the request timeout in MS - request.timeout = config.timeout; - - function onloadend() { - if (!request) { - return; - } - // Prepare the response - var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; - var responseData = !responseType || responseType === 'text' || responseType === 'json' ? - request.responseText : request.response; - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request - }; - - settle(resolve, reject, response); - - // Clean up request - request = null; - } - - if ('onloadend' in request) { - // Use onloadend if available - request.onloadend = onloadend; - } else { - // Listen for ready state to emulate onloadend - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { - return; - } - // readystate handler is calling before onerror or ontimeout handlers, - // so we should call onloadend on the next 'tick' - setTimeout(onloadend); - }; - } - - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } - - reject(createError('Request aborted', config, 'ECONNABORTED', request)); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError() { - // Real errors are hidden from us by the browser - // onerror should only fire if it's a network error - reject(createError('Network Error', config, null, request)); - - // Clean up request - request = null; - }; - - // Handle timeout - request.ontimeout = function handleTimeout() { - var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - reject(createError( - timeoutErrorMessage, - config, - config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', - request)); - - // Clean up request - request = null; - }; - - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - if (utils.isStandardBrowserEnv()) { - // Add xsrf header - var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? - cookies.read(config.xsrfCookieName) : - undefined; - - if (xsrfValue) { - requestHeaders[config.xsrfHeaderName] = xsrfValue; - } - } - - // Add headers to the request - if ('setRequestHeader' in request) { - utils.forEach(requestHeaders, function setRequestHeader(val, key) { - if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { - // Remove Content-Type if data is undefined - delete requestHeaders[key]; - } else { - // Otherwise add header to the request - request.setRequestHeader(key, val); - } - }); - } - - // Add withCredentials to request if needed - if (!utils.isUndefined(config.withCredentials)) { - request.withCredentials = !!config.withCredentials; - } - - // Add responseType to request if needed - if (responseType && responseType !== 'json') { - request.responseType = config.responseType; - } - - // Handle progress if needed - if (typeof config.onDownloadProgress === 'function') { - request.addEventListener('progress', config.onDownloadProgress); - } - - // Not all browsers support upload events - if (typeof config.onUploadProgress === 'function' && request.upload) { - request.upload.addEventListener('progress', config.onUploadProgress); - } - - if (config.cancelToken) { - // Handle cancellation - config.cancelToken.promise.then(function onCanceled(cancel) { - if (!request) { - return; - } - - request.abort(); - reject(cancel); - // Clean up request - request = null; - }); - } - - if (!requestData) { - requestData = null; - } - - // Send the request - request.send(requestData); - }); -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/axios.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/axios.js deleted file mode 100644 index c6357b0..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/axios.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -var utils = require('./utils'); -var bind = require('./helpers/bind'); -var Axios = require('./core/Axios'); -var mergeConfig = require('./core/mergeConfig'); -var defaults = require('./defaults'); - -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * @return {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - var context = new Axios(defaultConfig); - var instance = bind(Axios.prototype.request, context); - - // Copy axios.prototype to instance - utils.extend(instance, Axios.prototype, context); - - // Copy context to instance - utils.extend(instance, context); - - return instance; -} - -// Create the default instance to be exported -var axios = createInstance(defaults); - -// Expose Axios class to allow class inheritance -axios.Axios = Axios; - -// Factory for creating new instances -axios.create = function create(instanceConfig) { - return createInstance(mergeConfig(axios.defaults, instanceConfig)); -}; - -// Expose Cancel & CancelToken -axios.Cancel = require('./cancel/Cancel'); -axios.CancelToken = require('./cancel/CancelToken'); -axios.isCancel = require('./cancel/isCancel'); - -// Expose all/spread -axios.all = function all(promises) { - return Promise.all(promises); -}; -axios.spread = require('./helpers/spread'); - -// Expose isAxiosError -axios.isAxiosError = require('./helpers/isAxiosError'); - -module.exports = axios; - -// Allow use of default import syntax in TypeScript -module.exports.default = axios; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/cancel/Cancel.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/cancel/Cancel.js deleted file mode 100644 index e0de400..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/cancel/Cancel.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -/** - * A `Cancel` is an object that is thrown when an operation is canceled. - * - * @class - * @param {string=} message The message. - */ -function Cancel(message) { - this.message = message; -} - -Cancel.prototype.toString = function toString() { - return 'Cancel' + (this.message ? ': ' + this.message : ''); -}; - -Cancel.prototype.__CANCEL__ = true; - -module.exports = Cancel; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/cancel/CancelToken.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/cancel/CancelToken.js deleted file mode 100644 index 6b46e66..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/cancel/CancelToken.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -var Cancel = require('./Cancel'); - -/** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @class - * @param {Function} executor The executor function. - */ -function CancelToken(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } - - var resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - - var token = this; - executor(function cancel(message) { - if (token.reason) { - // Cancellation has already been requested - return; - } - - token.reason = new Cancel(message); - resolvePromise(token.reason); - }); -} - -/** - * Throws a `Cancel` if cancellation has been requested. - */ -CancelToken.prototype.throwIfRequested = function throwIfRequested() { - if (this.reason) { - throw this.reason; - } -}; - -/** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ -CancelToken.source = function source() { - var cancel; - var token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token: token, - cancel: cancel - }; -}; - -module.exports = CancelToken; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/cancel/isCancel.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/cancel/isCancel.js deleted file mode 100644 index 051f3ae..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/cancel/isCancel.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function isCancel(value) { - return !!(value && value.__CANCEL__); -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/Axios.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/core/Axios.js deleted file mode 100644 index 42ea75e..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/Axios.js +++ /dev/null @@ -1,148 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); -var buildURL = require('../helpers/buildURL'); -var InterceptorManager = require('./InterceptorManager'); -var dispatchRequest = require('./dispatchRequest'); -var mergeConfig = require('./mergeConfig'); -var validator = require('../helpers/validator'); - -var validators = validator.validators; -/** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - */ -function Axios(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; -} - -/** - * Dispatch a request - * - * @param {Object} config The config specific for this request (merged with this.defaults) - */ -Axios.prototype.request = function request(config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof config === 'string') { - config = arguments[1] || {}; - config.url = arguments[0]; - } else { - config = config || {}; - } - - config = mergeConfig(this.defaults, config); - - // Set config.method - if (config.method) { - config.method = config.method.toLowerCase(); - } else if (this.defaults.method) { - config.method = this.defaults.method.toLowerCase(); - } else { - config.method = 'get'; - } - - var transitional = config.transitional; - - if (transitional !== undefined) { - validator.assertOptions(transitional, { - silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), - forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), - clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') - }, false); - } - - // filter out skipped interceptors - var requestInterceptorChain = []; - var synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { - return; - } - - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - }); - - var responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - - var promise; - - if (!synchronousRequestInterceptors) { - var chain = [dispatchRequest, undefined]; - - Array.prototype.unshift.apply(chain, requestInterceptorChain); - chain = chain.concat(responseInterceptorChain); - - promise = Promise.resolve(config); - while (chain.length) { - promise = promise.then(chain.shift(), chain.shift()); - } - - return promise; - } - - - var newConfig = config; - while (requestInterceptorChain.length) { - var onFulfilled = requestInterceptorChain.shift(); - var onRejected = requestInterceptorChain.shift(); - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected(error); - break; - } - } - - try { - promise = dispatchRequest(newConfig); - } catch (error) { - return Promise.reject(error); - } - - while (responseInterceptorChain.length) { - promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); - } - - return promise; -}; - -Axios.prototype.getUri = function getUri(config) { - config = mergeConfig(this.defaults, config); - return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); -}; - -// Provide aliases for supported request methods -utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: (config || {}).data - })); - }; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, data, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: data - })); - }; -}); - -module.exports = Axios; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/InterceptorManager.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/core/InterceptorManager.js deleted file mode 100644 index 900f448..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/InterceptorManager.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -function InterceptorManager() { - this.handlers = []; -} - -/** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ -InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled: fulfilled, - rejected: rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; -}; - -/** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - */ -InterceptorManager.prototype.eject = function eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } -}; - -/** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - */ -InterceptorManager.prototype.forEach = function forEach(fn) { - utils.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); -}; - -module.exports = InterceptorManager; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/README.md b/alarm/node_modules/pronote-api/node_modules/axios/lib/core/README.md deleted file mode 100644 index 84559ce..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# axios // core - -The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: - -- Dispatching requests - - Requests sent via `adapters/` (see lib/adapters/README.md) -- Managing interceptors -- Handling config diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/buildFullPath.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/core/buildFullPath.js deleted file mode 100644 index 00b2b05..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/buildFullPath.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var isAbsoluteURL = require('../helpers/isAbsoluteURL'); -var combineURLs = require('../helpers/combineURLs'); - -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * @returns {string} The combined full path - */ -module.exports = function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/createError.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/core/createError.js deleted file mode 100644 index 933680f..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/createError.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -var enhanceError = require('./enhanceError'); - -/** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The created error. - */ -module.exports = function createError(message, config, code, request, response) { - var error = new Error(message); - return enhanceError(error, config, code, request, response); -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/dispatchRequest.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/core/dispatchRequest.js deleted file mode 100644 index 9ce3b96..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/dispatchRequest.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); -var transformData = require('./transformData'); -var isCancel = require('../cancel/isCancel'); -var defaults = require('../defaults'); - -/** - * Throws a `Cancel` if cancellation has been requested. - */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } -} - -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * @returns {Promise} The Promise to be fulfilled - */ -module.exports = function dispatchRequest(config) { - throwIfCancellationRequested(config); - - // Ensure headers exist - config.headers = config.headers || {}; - - // Transform request data - config.data = transformData.call( - config, - config.data, - config.headers, - config.transformRequest - ); - - // Flatten headers - config.headers = utils.merge( - config.headers.common || {}, - config.headers[config.method] || {}, - config.headers - ); - - utils.forEach( - ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], - function cleanHeaderConfig(method) { - delete config.headers[method]; - } - ); - - var adapter = config.adapter || defaults.adapter; - - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - - // Transform response data - response.data = transformData.call( - config, - response.data, - response.headers, - config.transformResponse - ); - - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - - // Transform response data - if (reason && reason.response) { - reason.response.data = transformData.call( - config, - reason.response.data, - reason.response.headers, - config.transformResponse - ); - } - } - - return Promise.reject(reason); - }); -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/enhanceError.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/core/enhanceError.js deleted file mode 100644 index b6bc444..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/enhanceError.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -/** - * Update an Error with the specified config, error code, and response. - * - * @param {Error} error The error to update. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The error. - */ -module.exports = function enhanceError(error, config, code, request, response) { - error.config = config; - if (code) { - error.code = code; - } - - error.request = request; - error.response = response; - error.isAxiosError = true; - - error.toJSON = function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: this.config, - code: this.code - }; - }; - return error; -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/mergeConfig.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/core/mergeConfig.js deleted file mode 100644 index 5a2c10c..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/mergeConfig.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -var utils = require('../utils'); - -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * @returns {Object} New object resulting from merging config2 to config1 - */ -module.exports = function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config2 = config2 || {}; - var config = {}; - - var valueFromConfig2Keys = ['url', 'method', 'data']; - var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; - var defaultToConfig2Keys = [ - 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', - 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', - 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', - 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', - 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' - ]; - var directMergeKeys = ['validateStatus']; - - function getMergedValue(target, source) { - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { - return utils.merge(target, source); - } else if (utils.isPlainObject(source)) { - return utils.merge({}, source); - } else if (utils.isArray(source)) { - return source.slice(); - } - return source; - } - - function mergeDeepProperties(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - } - - utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } - }); - - utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); - - utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - }); - - utils.forEach(directMergeKeys, function merge(prop) { - if (prop in config2) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (prop in config1) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - }); - - var axiosKeys = valueFromConfig2Keys - .concat(mergeDeepPropertiesKeys) - .concat(defaultToConfig2Keys) - .concat(directMergeKeys); - - var otherKeys = Object - .keys(config1) - .concat(Object.keys(config2)) - .filter(function filterAxiosKeys(key) { - return axiosKeys.indexOf(key) === -1; - }); - - utils.forEach(otherKeys, mergeDeepProperties); - - return config; -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/settle.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/core/settle.js deleted file mode 100644 index 886adb0..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/settle.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -var createError = require('./createError'); - -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - */ -module.exports = function settle(resolve, reject, response) { - var validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(createError( - 'Request failed with status code ' + response.status, - response.config, - null, - response.request, - response - )); - } -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/transformData.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/core/transformData.js deleted file mode 100644 index c584d12..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/core/transformData.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); -var defaults = require('./../defaults'); - -/** - * Transform the data for a request or a response - * - * @param {Object|String} data The data to be transformed - * @param {Array} headers The headers for the request or response - * @param {Array|Function} fns A single function or Array of functions - * @returns {*} The resulting transformed data - */ -module.exports = function transformData(data, headers, fns) { - var context = this || defaults; - /*eslint no-param-reassign:0*/ - utils.forEach(fns, function transform(fn) { - data = fn.call(context, data, headers); - }); - - return data; -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/defaults.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/defaults.js deleted file mode 100644 index 55e69d9..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/defaults.js +++ /dev/null @@ -1,134 +0,0 @@ -'use strict'; - -var utils = require('./utils'); -var normalizeHeaderName = require('./helpers/normalizeHeaderName'); -var enhanceError = require('./core/enhanceError'); - -var DEFAULT_CONTENT_TYPE = { - 'Content-Type': 'application/x-www-form-urlencoded' -}; - -function setContentTypeIfUnset(headers, value) { - if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { - headers['Content-Type'] = value; - } -} - -function getDefaultAdapter() { - var adapter; - if (typeof XMLHttpRequest !== 'undefined') { - // For browsers use XHR adapter - adapter = require('./adapters/xhr'); - } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { - // For node use HTTP adapter - adapter = require('./adapters/http'); - } - return adapter; -} - -function stringifySafely(rawValue, parser, encoder) { - if (utils.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils.trim(rawValue); - } catch (e) { - if (e.name !== 'SyntaxError') { - throw e; - } - } - } - - return (encoder || JSON.stringify)(rawValue); -} - -var defaults = { - - transitional: { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false - }, - - adapter: getDefaultAdapter(), - - transformRequest: [function transformRequest(data, headers) { - normalizeHeaderName(headers, 'Accept'); - normalizeHeaderName(headers, 'Content-Type'); - - if (utils.isFormData(data) || - utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) - ) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); - return data.toString(); - } - if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { - setContentTypeIfUnset(headers, 'application/json'); - return stringifySafely(data); - } - return data; - }], - - transformResponse: [function transformResponse(data) { - var transitional = this.transitional; - var silentJSONParsing = transitional && transitional.silentJSONParsing; - var forcedJSONParsing = transitional && transitional.forcedJSONParsing; - var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; - - if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { - try { - return JSON.parse(data); - } catch (e) { - if (strictJSONParsing) { - if (e.name === 'SyntaxError') { - throw enhanceError(e, this, 'E_JSON_PARSE'); - } - throw e; - } - } - } - - return data; - }], - - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - maxContentLength: -1, - maxBodyLength: -1, - - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - } -}; - -defaults.headers = { - common: { - 'Accept': 'application/json, text/plain, */*' - } -}; - -utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { - defaults.headers[method] = {}; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); -}); - -module.exports = defaults; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/README.md b/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/README.md deleted file mode 100644 index 4ae3419..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# axios // helpers - -The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: - -- Browser polyfills -- Managing cookies -- Parsing HTTP headers diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/bind.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/bind.js deleted file mode 100644 index 6147c60..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/bind.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = function bind(fn, thisArg) { - return function wrap() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - return fn.apply(thisArg, args); - }; -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/buildURL.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/buildURL.js deleted file mode 100644 index 31595c3..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/buildURL.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -function encode(val) { - return encodeURIComponent(val). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%20/g, '+'). - replace(/%5B/gi, '['). - replace(/%5D/gi, ']'); -} - -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @returns {string} The formatted url - */ -module.exports = function buildURL(url, params, paramsSerializer) { - /*eslint no-param-reassign:0*/ - if (!params) { - return url; - } - - var serializedParams; - if (paramsSerializer) { - serializedParams = paramsSerializer(params); - } else if (utils.isURLSearchParams(params)) { - serializedParams = params.toString(); - } else { - var parts = []; - - utils.forEach(params, function serialize(val, key) { - if (val === null || typeof val === 'undefined') { - return; - } - - if (utils.isArray(val)) { - key = key + '[]'; - } else { - val = [val]; - } - - utils.forEach(val, function parseValue(v) { - if (utils.isDate(v)) { - v = v.toISOString(); - } else if (utils.isObject(v)) { - v = JSON.stringify(v); - } - parts.push(encode(key) + '=' + encode(v)); - }); - }); - - serializedParams = parts.join('&'); - } - - if (serializedParams) { - var hashmarkIndex = url.indexOf('#'); - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; - } - - return url; -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/combineURLs.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/combineURLs.js deleted file mode 100644 index f1b58a5..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/combineURLs.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * @returns {string} The combined URL - */ -module.exports = function combineURLs(baseURL, relativeURL) { - return relativeURL - ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') - : baseURL; -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/cookies.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/cookies.js deleted file mode 100644 index 5a8a666..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/cookies.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs support document.cookie - (function standardBrowserEnv() { - return { - write: function write(name, value, expires, path, domain, secure) { - var cookie = []; - cookie.push(name + '=' + encodeURIComponent(value)); - - if (utils.isNumber(expires)) { - cookie.push('expires=' + new Date(expires).toGMTString()); - } - - if (utils.isString(path)) { - cookie.push('path=' + path); - } - - if (utils.isString(domain)) { - cookie.push('domain=' + domain); - } - - if (secure === true) { - cookie.push('secure'); - } - - document.cookie = cookie.join('; '); - }, - - read: function read(name) { - var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); - return (match ? decodeURIComponent(match[3]) : null); - }, - - remove: function remove(name) { - this.write(name, '', Date.now() - 86400000); - } - }; - })() : - - // Non standard browser env (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return { - write: function write() {}, - read: function read() { return null; }, - remove: function remove() {} - }; - })() -); diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/deprecatedMethod.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/deprecatedMethod.js deleted file mode 100644 index ed40965..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/deprecatedMethod.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -/*eslint no-console:0*/ - -/** - * Supply a warning to the developer that a method they are using - * has been deprecated. - * - * @param {string} method The name of the deprecated method - * @param {string} [instead] The alternate method to use if applicable - * @param {string} [docs] The documentation URL to get further details - */ -module.exports = function deprecatedMethod(method, instead, docs) { - try { - console.warn( - 'DEPRECATED method `' + method + '`.' + - (instead ? ' Use `' + instead + '` instead.' : '') + - ' This method will be removed in a future release.'); - - if (docs) { - console.warn('For more information about usage see ' + docs); - } - } catch (e) { /* Ignore */ } -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/isAbsoluteURL.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/isAbsoluteURL.js deleted file mode 100644 index d33e992..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/isAbsoluteURL.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -/** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ -module.exports = function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/isAxiosError.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/isAxiosError.js deleted file mode 100644 index 29ff41a..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/isAxiosError.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ -module.exports = function isAxiosError(payload) { - return (typeof payload === 'object') && (payload.isAxiosError === true); -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/isURLSameOrigin.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/isURLSameOrigin.js deleted file mode 100644 index f1d89ad..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/isURLSameOrigin.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs have full support of the APIs needed to test - // whether the request URL is of the same origin as current location. - (function standardBrowserEnv() { - var msie = /(msie|trident)/i.test(navigator.userAgent); - var urlParsingNode = document.createElement('a'); - var originURL; - - /** - * Parse a URL to discover it's components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ - function resolveURL(url) { - var href = url; - - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } - - urlParsingNode.setAttribute('href', href); - - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; - } - - originURL = resolveURL(window.location.href); - - /** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestURL The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ - return function isURLSameOrigin(requestURL) { - var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; - return (parsed.protocol === originURL.protocol && - parsed.host === originURL.host); - }; - })() : - - // Non standard browser envs (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return function isURLSameOrigin() { - return true; - }; - })() -); diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/normalizeHeaderName.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/normalizeHeaderName.js deleted file mode 100644 index 738c9fe..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/normalizeHeaderName.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var utils = require('../utils'); - -module.exports = function normalizeHeaderName(headers, normalizedName) { - utils.forEach(headers, function processHeader(value, name) { - if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { - headers[normalizedName] = value; - delete headers[name]; - } - }); -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/parseHeaders.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/parseHeaders.js deleted file mode 100644 index 8af2cc7..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/parseHeaders.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -var utils = require('./../utils'); - -// Headers whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -var ignoreDuplicateOf = [ - 'age', 'authorization', 'content-length', 'content-type', 'etag', - 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', - 'last-modified', 'location', 'max-forwards', 'proxy-authorization', - 'referer', 'retry-after', 'user-agent' -]; - -/** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} headers Headers needing to be parsed - * @returns {Object} Headers parsed into an object - */ -module.exports = function parseHeaders(headers) { - var parsed = {}; - var key; - var val; - var i; - - if (!headers) { return parsed; } - - utils.forEach(headers.split('\n'), function parser(line) { - i = line.indexOf(':'); - key = utils.trim(line.substr(0, i)).toLowerCase(); - val = utils.trim(line.substr(i + 1)); - - if (key) { - if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { - return; - } - if (key === 'set-cookie') { - parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); - } else { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; - } - } - }); - - return parsed; -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/spread.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/spread.js deleted file mode 100644 index 25e3cdd..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/spread.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -/** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * var args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * @returns {Function} - */ -module.exports = function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/validator.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/validator.js deleted file mode 100644 index 7f1bc7d..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/helpers/validator.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; - -var pkg = require('./../../package.json'); - -var validators = {}; - -// eslint-disable-next-line func-names -['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { - validators[type] = function validator(thing) { - return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; - }; -}); - -var deprecatedWarnings = {}; -var currentVerArr = pkg.version.split('.'); - -/** - * Compare package versions - * @param {string} version - * @param {string?} thanVersion - * @returns {boolean} - */ -function isOlderVersion(version, thanVersion) { - var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; - var destVer = version.split('.'); - for (var i = 0; i < 3; i++) { - if (pkgVersionArr[i] > destVer[i]) { - return true; - } else if (pkgVersionArr[i] < destVer[i]) { - return false; - } - } - return false; -} - -/** - * Transitional option validator - * @param {function|boolean?} validator - * @param {string?} version - * @param {string} message - * @returns {function} - */ -validators.transitional = function transitional(validator, version, message) { - var isDeprecated = version && isOlderVersion(version); - - function formatMessage(opt, desc) { - return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); - } - - // eslint-disable-next-line func-names - return function(value, opt, opts) { - if (validator === false) { - throw new Error(formatMessage(opt, ' has been removed in ' + version)); - } - - if (isDeprecated && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - // eslint-disable-next-line no-console - console.warn( - formatMessage( - opt, - ' has been deprecated since v' + version + ' and will be removed in the near future' - ) - ); - } - - return validator ? validator(value, opt, opts) : true; - }; -}; - -/** - * Assert object's properties type - * @param {object} options - * @param {object} schema - * @param {boolean?} allowUnknown - */ - -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== 'object') { - throw new TypeError('options must be an object'); - } - var keys = Object.keys(options); - var i = keys.length; - while (i-- > 0) { - var opt = keys[i]; - var validator = schema[opt]; - if (validator) { - var value = options[opt]; - var result = value === undefined || validator(value, opt, options); - if (result !== true) { - throw new TypeError('option ' + opt + ' must be ' + result); - } - continue; - } - if (allowUnknown !== true) { - throw Error('Unknown option ' + opt); - } - } -} - -module.exports = { - isOlderVersion: isOlderVersion, - assertOptions: assertOptions, - validators: validators -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/lib/utils.js b/alarm/node_modules/pronote-api/node_modules/axios/lib/utils.js deleted file mode 100644 index 5d966f4..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/lib/utils.js +++ /dev/null @@ -1,349 +0,0 @@ -'use strict'; - -var bind = require('./helpers/bind'); - -// utils is a library of generic helper functions non-specific to axios - -var toString = Object.prototype.toString; - -/** - * Determine if a value is an Array - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Array, otherwise false - */ -function isArray(val) { - return toString.call(val) === '[object Array]'; -} - -/** - * Determine if a value is undefined - * - * @param {Object} val The value to test - * @returns {boolean} True if the value is undefined, otherwise false - */ -function isUndefined(val) { - return typeof val === 'undefined'; -} - -/** - * Determine if a value is a Buffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Buffer, otherwise false - */ -function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) - && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); -} - -/** - * Determine if a value is an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ -function isArrayBuffer(val) { - return toString.call(val) === '[object ArrayBuffer]'; -} - -/** - * Determine if a value is a FormData - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an FormData, otherwise false - */ -function isFormData(val) { - return (typeof FormData !== 'undefined') && (val instanceof FormData); -} - -/** - * Determine if a value is a view on an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ -function isArrayBufferView(val) { - var result; - if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { - result = ArrayBuffer.isView(val); - } else { - result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); - } - return result; -} - -/** - * Determine if a value is a String - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a String, otherwise false - */ -function isString(val) { - return typeof val === 'string'; -} - -/** - * Determine if a value is a Number - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Number, otherwise false - */ -function isNumber(val) { - return typeof val === 'number'; -} - -/** - * Determine if a value is an Object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Object, otherwise false - */ -function isObject(val) { - return val !== null && typeof val === 'object'; -} - -/** - * Determine if a value is a plain Object - * - * @param {Object} val The value to test - * @return {boolean} True if value is a plain Object, otherwise false - */ -function isPlainObject(val) { - if (toString.call(val) !== '[object Object]') { - return false; - } - - var prototype = Object.getPrototypeOf(val); - return prototype === null || prototype === Object.prototype; -} - -/** - * Determine if a value is a Date - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Date, otherwise false - */ -function isDate(val) { - return toString.call(val) === '[object Date]'; -} - -/** - * Determine if a value is a File - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a File, otherwise false - */ -function isFile(val) { - return toString.call(val) === '[object File]'; -} - -/** - * Determine if a value is a Blob - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Blob, otherwise false - */ -function isBlob(val) { - return toString.call(val) === '[object Blob]'; -} - -/** - * Determine if a value is a Function - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ -function isFunction(val) { - return toString.call(val) === '[object Function]'; -} - -/** - * Determine if a value is a Stream - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Stream, otherwise false - */ -function isStream(val) { - return isObject(val) && isFunction(val.pipe); -} - -/** - * Determine if a value is a URLSearchParams object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ -function isURLSearchParams(val) { - return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; -} - -/** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * @returns {String} The String freed of excess whitespace - */ -function trim(str) { - return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); -} - -/** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - */ -function isStandardBrowserEnv() { - if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || - navigator.product === 'NativeScript' || - navigator.product === 'NS')) { - return false; - } - return ( - typeof window !== 'undefined' && - typeof document !== 'undefined' - ); -} - -/** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - */ -function forEach(obj, fn) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } - - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } - - if (isArray(obj)) { - // Iterate over array values - for (var i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Iterate over object keys - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - fn.call(null, obj[key], key, obj); - } - } - } -} - -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * var result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * @returns {Object} Result of all merge properties - */ -function merge(/* obj1, obj2, obj3, ... */) { - var result = {}; - function assignValue(val, key) { - if (isPlainObject(result[key]) && isPlainObject(val)) { - result[key] = merge(result[key], val); - } else if (isPlainObject(val)) { - result[key] = merge({}, val); - } else if (isArray(val)) { - result[key] = val.slice(); - } else { - result[key] = val; - } - } - - for (var i = 0, l = arguments.length; i < l; i++) { - forEach(arguments[i], assignValue); - } - return result; -} - -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * @return {Object} The resulting value of object a - */ -function extend(a, b, thisArg) { - forEach(b, function assignValue(val, key) { - if (thisArg && typeof val === 'function') { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }); - return a; -} - -/** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * @return {string} content value without BOM - */ -function stripBOM(content) { - if (content.charCodeAt(0) === 0xFEFF) { - content = content.slice(1); - } - return content; -} - -module.exports = { - isArray: isArray, - isArrayBuffer: isArrayBuffer, - isBuffer: isBuffer, - isFormData: isFormData, - isArrayBufferView: isArrayBufferView, - isString: isString, - isNumber: isNumber, - isObject: isObject, - isPlainObject: isPlainObject, - isUndefined: isUndefined, - isDate: isDate, - isFile: isFile, - isBlob: isBlob, - isFunction: isFunction, - isStream: isStream, - isURLSearchParams: isURLSearchParams, - isStandardBrowserEnv: isStandardBrowserEnv, - forEach: forEach, - merge: merge, - extend: extend, - trim: trim, - stripBOM: stripBOM -}; diff --git a/alarm/node_modules/pronote-api/node_modules/axios/package.json b/alarm/node_modules/pronote-api/node_modules/axios/package.json deleted file mode 100644 index 7c895b3..0000000 --- a/alarm/node_modules/pronote-api/node_modules/axios/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "axios", - "version": "0.21.4", - "description": "Promise based HTTP client for the browser and node.js", - "main": "index.js", - "scripts": { - "test": "grunt test", - "start": "node ./sandbox/server.js", - "build": "NODE_ENV=production grunt build", - "preversion": "npm test", - "version": "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json", - "postversion": "git push && git push --tags", - "examples": "node ./examples/server.js", - "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", - "fix": "eslint --fix lib/**/*.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/axios/axios.git" - }, - "keywords": [ - "xhr", - "http", - "ajax", - "promise", - "node" - ], - "author": "Matt Zabriskie", - "license": "MIT", - "bugs": { - "url": "https://github.com/axios/axios/issues" - }, - "homepage": "https://axios-http.com", - "devDependencies": { - "coveralls": "^3.0.0", - "es6-promise": "^4.2.4", - "grunt": "^1.3.0", - "grunt-banner": "^0.6.0", - "grunt-cli": "^1.2.0", - "grunt-contrib-clean": "^1.1.0", - "grunt-contrib-watch": "^1.0.0", - "grunt-eslint": "^23.0.0", - "grunt-karma": "^4.0.0", - "grunt-mocha-test": "^0.13.3", - "grunt-ts": "^6.0.0-beta.19", - "grunt-webpack": "^4.0.2", - "istanbul-instrumenter-loader": "^1.0.0", - "jasmine-core": "^2.4.1", - "karma": "^6.3.2", - "karma-chrome-launcher": "^3.1.0", - "karma-firefox-launcher": "^2.1.0", - "karma-jasmine": "^1.1.1", - "karma-jasmine-ajax": "^0.1.13", - "karma-safari-launcher": "^1.0.0", - "karma-sauce-launcher": "^4.3.6", - "karma-sinon": "^1.0.5", - "karma-sourcemap-loader": "^0.3.8", - "karma-webpack": "^4.0.2", - "load-grunt-tasks": "^3.5.2", - "minimist": "^1.2.0", - "mocha": "^8.2.1", - "sinon": "^4.5.0", - "terser-webpack-plugin": "^4.2.3", - "typescript": "^4.0.5", - "url-search-params": "^0.10.0", - "webpack": "^4.44.2", - "webpack-dev-server": "^3.11.0" - }, - "browser": { - "./lib/adapters/http.js": "./lib/adapters/xhr.js" - }, - "jsdelivr": "dist/axios.min.js", - "unpkg": "dist/axios.min.js", - "typings": "./index.d.ts", - "dependencies": { - "follow-redirects": "^1.14.0" - }, - "bundlesize": [ - { - "path": "./dist/axios.min.js", - "threshold": "5kB" - } - ] -} diff --git a/alarm/node_modules/pronote-api/package.json b/alarm/node_modules/pronote-api/package.json deleted file mode 100644 index 0aadf0b..0000000 --- a/alarm/node_modules/pronote-api/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "pronote-api", - "version": "2.3.4", - "description": "Pronote 2020/2021 API (Node.JS/TS library, and GraphQL server)", - "main": "index.js", - "types": "index.d.ts", - "type": "commonjs", - "engines": { - "node": ">=11.14.0" - }, - "scripts": { - "start": "node ./bin/server.js", - "lint": "eslint src/* bin/* index.js", - "check": "eslint --fix src/* bin/* index.js", - "test": "eslint src/* bin* index.js && node ./bin/test.js" - }, - "keywords": [ - "pronote", - "api", - "http", - "2020" - ], - "author": "Adrien 'Litarvan' Navratil <adrien1975@live.fr>", - "license": "MIT", - "repository": { - "url": "https://github.com/Litarvan/pronote-api.git", - "type": "git" - }, - "bin": { - "pronote-api-server": "./bin/server.js", - "pronote-fetch": "./bin/fetch.js" - }, - "dependencies": { - "axios": "^0.21.1", - "body-parser": "^1.19.0", - "graphql": "^15.3.0", - "jsdom": "^16.5.2", - "node-forge": "0.6.33", - "pako": "^1.0.11", - "polka": "^0.5.2", - "string-strip-html": "^8.2.9", - "uuid": "^8.3.0", - "xxhashjs": "^0.2.2" - }, - "devDependencies": { - "@types/node-forge": "^0.6", - "@types/pako": "^1.0", - "eslint": "^7.22.0", - "eslint-plugin-node": "^11.1.0" - } -} diff --git a/alarm/node_modules/pronote-api/src/accounts.js b/alarm/node_modules/pronote-api/src/accounts.js deleted file mode 100644 index 0db0472..0000000 --- a/alarm/node_modules/pronote-api/src/accounts.js +++ /dev/null @@ -1,23 +0,0 @@ -const errors = require('./errors'); - -const ACCOUNTS = [ - { name: 'student', value: 'eleve', id: 3 }, - { name: 'parent', value: 'parent', id: 2 }, - { name: 'teacher', value: 'professeur', id: 1 }, - { name: 'attendant', value: 'accompagnant', id: 25 }, - { name: 'company', value: 'entreprise', id: 4 }, - { name: 'administration', value: 'viescolaire', id: 13 } -]; - -function getAccountType(type) -{ - for (const account of ACCOUNTS) { - if (account.name === type) { - return account; - } - } - - throw errors.UNKNOWN_ACCOUNT.drop(type); -} - -module.exports = getAccountType; diff --git a/alarm/node_modules/pronote-api/src/auth.js b/alarm/node_modules/pronote-api/src/auth.js deleted file mode 100644 index b19b97e..0000000 --- a/alarm/node_modules/pronote-api/src/auth.js +++ /dev/null @@ -1,96 +0,0 @@ -const errors = require('./errors'); -const cas = require('./cas'); -const { decipher, getLoginKey } = require('./cipher'); -const getAccountType = require('./accounts'); -const PronoteSession = require('./session'); - -const getParams = require('./fetch/pronote/params'); -const { getId, getAuthKey } = require('./fetch/pronote/auth'); -const getUser = require('./fetch/pronote/user'); - -function loginFor(type) -{ - return (url, username, password, cas = 'none') => login(url, username, password, cas, getAccountType(type)); -} - -async function login(url, username, password, cas, account) -{ - const server = getServer(url); - const start = await getStart(server, username, password, cas, account); - const session = new PronoteSession({ - serverURL: server, - sessionID: start.h, - - type: account, - - disableAES: !!start.sCrA, - disableCompress: !!start.sCoA, - - keyModulus: start.MR, - keyExponent: start.ER - }) - - session.params = await getParams(session); - if (!session.params) { - throw errors.WRONG_CREDENTIALS.drop(); - } - if (cas === 'none') { - await auth(session, username, password, false); - } else { - await auth(session, start.e, start.f, true); - } - session.user = await getUser(session); - - return session; -} - -function getServer(url) -{ - if (url.endsWith('.html')) { - return url.substring(0, url.lastIndexOf('/') + 1); - } - - if (!url.endsWith('/')) { - url += '/'; - } - - return url; -} - -async function getStart(url, username, password, casName, type) -{ - if (casName === 'names' || casName === 'getCAS' || !cas[casName]) { - throw errors.UNKNOWN_CAS.drop(casName); - } - - const account = typeof type === 'string' ? getAccountType(type) : type; - return await cas[casName](url, account, username, password); -} - -async function auth(session, username, password, fromCas) -{ - const id = await getId(session, username, fromCas); - const key = getLoginKey(username, password, id.scramble, fromCas); - - let challenge; - try { - challenge = decipher(session, id.challenge, { scrambled: true, key }); - } catch (e) { - throw errors.WRONG_CREDENTIALS.drop(); - } - - const userKey = await getAuthKey(session, challenge, key); - if (!userKey) { - throw errors.WRONG_CREDENTIALS.drop(); - } - - session.aesKey = decipher(session, userKey, { key, asBytes: true }); -} - -module.exports = { - loginStudent: loginFor('student'), - loginParent: loginFor('parent'), - - getStart, - auth -}; diff --git a/alarm/node_modules/pronote-api/src/axioRequest.js b/alarm/node_modules/pronote-api/src/axioRequest.js deleted file mode 100644 index 3e625c2..0000000 --- a/alarm/node_modules/pronote-api/src/axioRequest.js +++ /dev/null @@ -1,86 +0,0 @@ -const axios = require('axios'); - -async function axioRequest({ url, body, data, method = 'GET', binary, jar = null }) { - let userAgent = 'Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0'; - if (url.includes('teleservices.ac-nancy-metz.fr')) { - userAgent = 'FuckTheUselessProtection/1.0'; - } - - const params = encodeParams(data); - const content = { - url, - method: method.toLowerCase(), - headers: { - 'User-Agent': userAgent, - 'Content-Type': body !== undefined - ? 'application/json' - : (params !== '' && method !== 'GET' ? 'application/x-www-form-urlencoded' : ''), - 'Cookie': encodeCookies(jar) - }, - maxRedirects: 0, - validateStatus(status) { - return status === 401 || (status >= 200 && status <= 302) - } - }; - - if (binary) { - content.responseType = 'arraybuffer'; - } - - if (params) { - if (method.toUpperCase() === 'GET') { - content.url += '?' + params; - } else { - content.data = params; - } - } else if (body) { - content.data = body; - } - const response = await axios(content) - - if (response.headers['set-cookie'] && jar !== null) { - await updateCookies(response, jar, url); - } - - return response; -} - -function updateCookies(response, jar, url) { - return new Promise((accept, reject) => { - response.headers['set-cookie'].forEach(cookie => { - jar.setCookie(cookie, url, err => (err ? reject(err) : accept())); - }); - }); -} - -function encodeCookies(jar) { - if (!jar) { - return ''; - } - - let cookies = ''; - jar.toJSON().cookies.forEach(cookie => cookies += cookie.key + '=' + cookie.value + '; '); - - if (cookies.length !== 0) { - cookies = cookies.substring(0, cookies.length - 2); - } - - return cookies; -} - -function encodeParams(data) { - if (!data) { - return ''; - } - - let params = ''; - for (const k of Object.keys(data)) { - const v = data[k]; - params += `${k}=${encodeURIComponent(v)}&` - } - - return params.substring(0, params.length - 1) -} - - -module.exports = axioRequest diff --git a/alarm/node_modules/pronote-api/src/cas/ac-besancon.js b/alarm/node_modules/pronote-api/src/cas/ac-besancon.js deleted file mode 100644 index 9a6fe7d..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-besancon.js +++ /dev/null @@ -1,12 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.eclat-bfc.fr', - idp: 'BESANC-ATS_parent_eleve_2D', - atenURL: 'teleservices.ac-besancon.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-bordeaux.js b/alarm/node_modules/pronote-api/src/cas/ac-bordeaux.js deleted file mode 100644 index 938ab83..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-bordeaux.js +++ /dev/null @@ -1,11 +0,0 @@ -const aten = require('./generics/aten'); - -module.exports = (url, account, username, password) => aten.login({ - url, - account, - username, - password, - - startURL: '/sso/SSO?SPEntityID=https%3A%2F%2Fmon.lyceeconnecte.fr%2Fauth%2Fsaml%2Fmetadata%2Fidp.xml', - atenURL: 'bv.ac-bordeaux.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-bordeaux2.js b/alarm/node_modules/pronote-api/src/cas/ac-bordeaux2.js deleted file mode 100644 index 4fc68c3..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-bordeaux2.js +++ /dev/null @@ -1,11 +0,0 @@ -const aten = require('./generics/aten'); - -module.exports = (url, account, username, password) => aten.login({ - url, - account, - username, - password, - - startURL: '/sso/SSO?SPEntityID=https://ent2d.ac-bordeaux.fr/shibboleth', - atenURL: 'idp-fim-ts.ac-bordeaux.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-caen.js b/alarm/node_modules/pronote-api/src/cas/ac-caen.js deleted file mode 100644 index 1565539..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-caen.js +++ /dev/null @@ -1,15 +0,0 @@ -const wayf = require('./generics/wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - username, - password, - - startURL: 'https://fip.itslearning.com/SP/bn/', - wayfURL: 'https://fip.itslearning.com/ds-bn/', - atenURL: 'teleservices.ac-caen.fr', - - extraParams: { - origin: 'urn:fi:ac-caen:ts:1.0' - } -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-clermont.js b/alarm/node_modules/pronote-api/src/cas/ac-clermont.js deleted file mode 100644 index 6819637..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-clermont.js +++ /dev/null @@ -1,11 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.ent.auvergnerhonealpes.fr', - idp: 'CLERMONT-ATS' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-dijon.js b/alarm/node_modules/pronote-api/src/cas/ac-dijon.js deleted file mode 100644 index 4aded11..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-dijon.js +++ /dev/null @@ -1,12 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.eclat-bfc.fr', - idp: 'DIJON-ATS_parent_eleve_2D', - atenURL: 'teleservices.ac-dijon.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-grenoble.js b/alarm/node_modules/pronote-api/src/cas/ac-grenoble.js deleted file mode 100644 index aaf83c8..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-grenoble.js +++ /dev/null @@ -1,11 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.ent.auvergnerhonealpes.fr', - idp: 'GRE-ATS' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-lille.js b/alarm/node_modules/pronote-api/src/cas/ac-lille.js deleted file mode 100644 index 8ffb82f..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-lille.js +++ /dev/null @@ -1,12 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.savoirsnumeriques62.fr', - idp: 'ATS_parent_eleve', - atenURL: 'teleservices.ac-lille.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-lille2.js b/alarm/node_modules/pronote-api/src/cas/ac-lille2.js deleted file mode 100644 index ec3a45d..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-lille2.js +++ /dev/null @@ -1,12 +0,0 @@ -const aten = require('./generics/aten'); - -module.exports = (url, account, username, password) => aten.login({ - url, - account, - username, - password, - - // eslint-disable-next-line max-len - startURL: '/login/ct_logon_vk.jsp?CT_ORIG_URL=%2Fsso%2FSSO%3FSPEntityID%3Durn%3Afi%3Aent%3Alille-hdf-ts%3A1.0%26TARGET%3Dhttps%3A%2F%2Fwww.enthdf.fr%2F&ct_orig_uri=%2Fsso%2FSSO%3FSPEntityID%3Durn%3Afi%3Aent%3Alille-hdf-ts%3A1.0%26TARGET%3Dhttps%3A%2F%2Fwww.enthdf.fr%2F', - atenURL: 'teleservices.ac-lille.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-limoges.js b/alarm/node_modules/pronote-api/src/cas/ac-limoges.js deleted file mode 100644 index db6377e..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-limoges.js +++ /dev/null @@ -1,11 +0,0 @@ -const aten = require('./generics/aten'); - -module.exports = (url, account, username, password) => aten.login({ - url, - account, - username, - password, - - startURL: '/sso/SSO?SPEntityID=https%3A%2F%2Fmon.lyceeconnecte.fr%2Fauth%2Fsaml%2Fmetadata%2Fidp.xml', - atenURL: 'teleservices.ac-limoges.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-lyon.js b/alarm/node_modules/pronote-api/src/cas/ac-lyon.js deleted file mode 100644 index 3f8abd5..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-lyon.js +++ /dev/null @@ -1,11 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.ent.auvergnerhonealpes.fr', - idp: 'LYON-ATS' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-montpellier.js b/alarm/node_modules/pronote-api/src/cas/ac-montpellier.js deleted file mode 100644 index d7424ae..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-montpellier.js +++ /dev/null @@ -1,12 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.mon-ent-occitanie.fr', - idp: 'MONTP-ATS', - atenURL: 'famille.ac-montpellier.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-nancy-metz.js b/alarm/node_modules/pronote-api/src/cas/ac-nancy-metz.js deleted file mode 100644 index e8623a8..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-nancy-metz.js +++ /dev/null @@ -1,12 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.monbureaunumerique.fr', - idp: 'NAN-ME-ATS', - atenURL: 'teleservices.ac-nancy-metz.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-nantes.js b/alarm/node_modules/pronote-api/src/cas/ac-nantes.js deleted file mode 100644 index c628370..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-nantes.js +++ /dev/null @@ -1,16 +0,0 @@ -const wayf = require('./generics/wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - username, - password, - - startURL: 'https://cas3.e-lyco.fr/access/', - wayfURL: 'https://cas3.e-lyco.fr/discovery/', - atenURL: 'ats-idp.ac-nantes.fr', - - extraParams: { - origin: 'https://ats-idp.ac-nantes.fr/SAML/FIM', - action: 'selection' - } -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-orleans-tours.js b/alarm/node_modules/pronote-api/src/cas/ac-orleans-tours.js deleted file mode 100644 index d0c876a..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-orleans-tours.js +++ /dev/null @@ -1,22 +0,0 @@ -const jsdom = require('jsdom'); - -const { getDOM } = require('./api'); -const educonnect = require('./generics/educonnect'); - -async function login(url, account, username, password) -{ - const jar = new jsdom.CookieJar(); - let dom = await getDOM({ - url: 'https://lycees.netocentre.fr/portail/f/welcome/normal/render.uP', - jar - }); - - dom = await getDOM({ - url: dom.window.document.getElementById('portalCASLoginLink').href + '&idpId=parentEleveEN-IdP', - jar - }); - - return educonnect({ dom, jar, url, account, username, password }); -} - -module.exports = login; diff --git a/alarm/node_modules/pronote-api/src/cas/ac-poitiers.js b/alarm/node_modules/pronote-api/src/cas/ac-poitiers.js deleted file mode 100644 index d4c02d9..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-poitiers.js +++ /dev/null @@ -1,11 +0,0 @@ -const aten = require('./generics/aten'); - -module.exports = (url, account, username, password) => aten.login({ - url, - account, - username, - password, - - startURL: '/sso/SSO?SPEntityID=https%3A%2F%2Fmon.lyceeconnecte.fr%2Fauth%2Fsaml%2Fmetadata%2Fidp.xml', - atenURL: 'teleservices.ac-poitiers.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-reims.js b/alarm/node_modules/pronote-api/src/cas/ac-reims.js deleted file mode 100644 index 87fe262..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-reims.js +++ /dev/null @@ -1,12 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.monbureaunumerique.fr', - idp: 'REIMS-ATS', - atenURL: 'services-familles.ac-reims.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-rouen.js b/alarm/node_modules/pronote-api/src/cas/ac-rouen.js deleted file mode 100644 index b202810..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-rouen.js +++ /dev/null @@ -1,18 +0,0 @@ -const aten = require('./generics/aten'); -const { getDOM } = require('./api'); - -module.exports = (url, account, username, password) => aten.login({ - url, - account, - username, - password, - - // eslint-disable-next-line max-len - startURL: 'https://nero.l-educdenormandie.fr/Shibboleth.sso/Login?entityID=urn:fi:ac-rouen:ts-EDUC-Normandie:1:0&target=', - atenURL: 'sso-ent.ac-rouen.fr', - - postSubmit: ({ jar }) => getDOM({ - url: 'https://nero.l-educdenormandie.fr/c/portal/nero/access', - jar - }) -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-strasbourg.js b/alarm/node_modules/pronote-api/src/cas/ac-strasbourg.js deleted file mode 100644 index c064866..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-strasbourg.js +++ /dev/null @@ -1,12 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.monbureaunumerique.fr', - idp: 'STRAS-ATS', - atenURL: 'teleservices.ac-strasbourg.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-toulouse.js b/alarm/node_modules/pronote-api/src/cas/ac-toulouse.js deleted file mode 100644 index 1c3ea76..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-toulouse.js +++ /dev/null @@ -1,11 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.mon-ent-occitanie.fr', - idp: 'TOULO-ENT' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/ac-valdoise.js b/alarm/node_modules/pronote-api/src/cas/ac-valdoise.js deleted file mode 100644 index 739379d..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ac-valdoise.js +++ /dev/null @@ -1,10 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.moncollege.valdoise.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/agora06.js b/alarm/node_modules/pronote-api/src/cas/agora06.js deleted file mode 100644 index d0f8c64..0000000 --- a/alarm/node_modules/pronote-api/src/cas/agora06.js +++ /dev/null @@ -1,10 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.agora06.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/api.js b/alarm/node_modules/pronote-api/src/cas/api.js deleted file mode 100644 index 604faf4..0000000 --- a/alarm/node_modules/pronote-api/src/cas/api.js +++ /dev/null @@ -1,113 +0,0 @@ -const { JSDOM } = require('jsdom'); - -const errors = require('../errors'); -const http = require('../http'); - -// eslint-disable-next-line max-len -function submitForm({ dom, jar, asIs, runScripts, hook, method = 'POST', actionRoot, extraParams, followRedirects = true }) { - let url = dom.window.document.getElementsByTagName('form')[0].action; - - if (url.startsWith('/')) - { - url = url.substring(1); - } - - if (url.indexOf('http') === -1) - { - url = actionRoot + url; - } - - const params = getParams(dom, extraParams); - - const data = { - url, - jar, - asIs, - followRedirects, - runScripts, - hook, - data: params, - method - }; - - return getDOM(data); -} - -function getParams(dom, extra = {}) -{ - const params = {}; - - Array.prototype.forEach.call( - dom.window.document.getElementsByTagName('input'), - input => (input.name !== '' ? params[input.name] = input.value : '') - ); - - return { ...params, ...extra }; -} - -async function getDOM({ url, jar, method = 'GET', data = '', runScripts, hook, followRedirects, asIs }) -{ - let result = await http({ - url, - method, - data, - jar, - followRedirects - }); - - if (asIs) - { - return result; - } - - if (result.indexOf('<script>$(function() { startup() });</script>') !== -1) - { - result = result - .replace('<script>$(function() { startup() });</script>', '') - .replace('console.log(user+" "+pwd);', ''); - } - - return new JSDOM(result, { - runScripts: runScripts ? 'dangerously' : 'outside-only', - beforeParse(window) { - if (hook) { - hook(window) - } - }, - cookieJar: jar - }); -} - - -function extractStart(html) { - if (html.includes('Votre adresse IP est provisoirement suspendue')) { // Top 10 anime betrayals - throw errors.BANNED.drop(); - } - - if (html.includes('Le site n\'est pas disponible')) { - throw errors.CLOSED.drop(); - } - - if (!html.includes('PRONOTE')) { - throw errors.WRONG_CREDENTIALS.drop(); - } - - html = html.replace(/ /ug, '').replace(/\n/ug, ''); - - const from = 'Start('; - const to = ')}catch'; - - const start = html.substring(html.indexOf(from) + from.length, html.indexOf(to)); - const json = start. - replace(/(['"])?([a-z0-9A-Z_]+)(['"])?:/gu, '"$2": '). - replace(/'/gu, '"'); - - return JSON.parse(json); -} - -module.exports = { - submitForm, - getDOM, - getParams, - extractStart -}; diff --git a/alarm/node_modules/pronote-api/src/cas/arsene76.js b/alarm/node_modules/pronote-api/src/cas/arsene76.js deleted file mode 100644 index 862f588..0000000 --- a/alarm/node_modules/pronote-api/src/cas/arsene76.js +++ /dev/null @@ -1,11 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.arsene76.fr', - idp: 'ATS_parent_eleve' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/atrium-sud.js b/alarm/node_modules/pronote-api/src/cas/atrium-sud.js deleted file mode 100644 index c508a3d..0000000 --- a/alarm/node_modules/pronote-api/src/cas/atrium-sud.js +++ /dev/null @@ -1,43 +0,0 @@ -const jsdom = require('jsdom'); -const { getDOM, extractStart } = require('./api'); - -async function login(url, account, username, password) -{ - const jar = new jsdom.CookieJar(); - let dom = await getDOM({ - url: 'https://www.atrium-sud.fr/connexion/login?service=' + url, - jar - }); - - let lt = dom.window.document.getElementsByName('lt'); - let execution = dom.window.document.getElementsByName('execution'); - lt = lt[0].value; - execution = execution[0].value; - - dom = await getDOM({ - url: 'https://www.atrium-sud.fr/connexion/login?service=' + url, - jar, - method: 'POST', - data: { - username, - password, - lt, - execution, - _eventId: 'submit', - submit: '' - }, - asIs: true - }) - - dom = await getDOM({ - url, - jar, - method: 'GET', - asIs: true, - followRedirects: true - }); - - return extractStart(dom); -} - -module.exports = login; diff --git a/alarm/node_modules/pronote-api/src/cas/cybercolleges42.js b/alarm/node_modules/pronote-api/src/cas/cybercolleges42.js deleted file mode 100644 index 303c119..0000000 --- a/alarm/node_modules/pronote-api/src/cas/cybercolleges42.js +++ /dev/null @@ -1,11 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.cybercolleges42.fr', - idp: 'ATS' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/eure-normandie.js b/alarm/node_modules/pronote-api/src/cas/eure-normandie.js deleted file mode 100644 index 541d41c..0000000 --- a/alarm/node_modules/pronote-api/src/cas/eure-normandie.js +++ /dev/null @@ -1,11 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.ent27.fr', - idp: 'ATS' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/find.js b/alarm/node_modules/pronote-api/src/cas/find.js deleted file mode 100644 index 020c8fa..0000000 --- a/alarm/node_modules/pronote-api/src/cas/find.js +++ /dev/null @@ -1,80 +0,0 @@ -const http = require('../http'); - -const URLS = { - 'ac-besancon': 'cas.eclat-bfc.fr', - 'ac-bordeaux': 'mon.lyceeconnecte.fr', - 'ac-bordeaux2': 'ent2d.ac-bordeaux.fr', - 'ac-caen': 'fip.itslearning.com', - 'ac-clermont': 'cas.ent.auvergnerhonealpes.fr', - 'ac-dijon': 'cas.eclat-bfc.fr', - 'ac-grenoble': 'cas.ent.auvergnerhonealpes.fr', - 'ac-lille': 'cas.savoirsnumeriques62.fr', - 'ac-lille2': 'teleservices.ac-lille.fr', - 'ac-limoges': 'mon.lyceeconnecte.fr', - 'ac-lyon': 'cas.ent.auvergnerhonealpes.fr', - 'ac-montpellier': 'cas.mon-ent-occitanie.fr', - 'ac-nancy-metz': 'cas.monbureaunumerique.fr', - 'ac-nantes': 'cas3.e-lyco.fr', - 'ac-orleans-tours': 'ent.netocentre.fr', - 'ac-poitiers': 'mon.lyceeconnecte.fr', - 'ac-reims': 'cas.monbureaunumerique.fr', - 'ac-rouen': 'nero.l-educdenormandie.fr', - 'ac-strasbourg': 'cas.monbureaunumerique.fr', - 'ac-toulouse': 'cas.mon-ent-occitanie.fr', - 'ac-valdoise': 'cas.moncollege.valdoise.fr', - 'agora06': 'cas.agora06.fr', - 'arsene76': 'cas.arsene76.fr', - 'atrium-sud': 'www.atrium-sud.fr', - 'cybercolleges42': 'cas.cybercolleges42.fr', - 'eure-normandie': 'cas.ent27.fr', - 'haute-garonne': 'cas.ecollege.haute-garonne.fr', - 'hdf': 'enthdf.fr', - 'iledefrance': 'ent.iledefrance.fr', - 'moncollege-essonne': 'www.moncollege-ent.essonne.fr', - 'laclasse': 'www.laclasse.com', - 'ljr-munich': 'cas.kosmoseducation.com', - 'lyceeconnecte': 'mon.lyceeconnecte.fr', - 'parisclassenumerique': 'ent.parisclassenumerique.fr', - 'portail-famille': 'seshat.ac-orleans-tours.fr:8443', - 'seine-et-marne': 'ent77.seine-et-marne.fr', - 'somme': 'college.entsomme.fr', - 'toutatice': 'www.toutatice.fr', - 'monbureaunumerique-educonnect': 'cas.monbureaunumerique.fr' -}; - -async function find(url) -{ - if (!url.endsWith('/')) { - url += '/'; - } - - let location = await http({ url: url + 'eleve.html', followRedirects: 'get' }); - if (location.includes('<head>')) { - return 'none'; - } - - if (location.startsWith('http://') || location.startsWith('https://')) { - location = location.substring(location.indexOf('/') + 2); - } - - const host = location.substring(0, location.indexOf('/')); - - const result = []; - for (const [name, casHost] of Object.entries(URLS)) { - if (host === casHost) { - result.push(name); - } - } - - if (result.length === 0) { - return null; - } - - if (result.length === 1) { - return result[0]; - } - - return result; -} - -module.exports = find; diff --git a/alarm/node_modules/pronote-api/src/cas/generics/aten.js b/alarm/node_modules/pronote-api/src/cas/generics/aten.js deleted file mode 100644 index 44cfa83..0000000 --- a/alarm/node_modules/pronote-api/src/cas/generics/aten.js +++ /dev/null @@ -1,76 +0,0 @@ -const fs = require('fs'); -const path = require('path'); - -const jsdom = require('jsdom'); - -const errors = require('../../errors'); -const { getDOM, submitForm, extractStart } = require('../api'); - -// eslint-disable-next-line no-sync -const jsEncrypt = fs.readFileSync(path.join(__dirname, 'jsencrypt.min.js')); - -async function login({ url, account, username, password, startURL, atenURL, postSubmit }) -{ - if (!startURL.startsWith('http')) { - if (startURL.startsWith('/')) { - startURL = startURL.substring(1); - } - - startURL = `https://${atenURL}/${startURL}`; - } - - const jar = new jsdom.CookieJar(); - const dom = await getDOM({ - url: startURL, - jar, - runScripts: true, - hook - }); - - await submit({ dom, jar, username, password, atenURL }); - - if (postSubmit) { - await postSubmit({ dom, jar }); - } - - return extractStart(await getDOM({ - url: url + account.value + '.html', - jar, - asIs: true - })); -} - -async function submit({ dom, jar, username, password, atenURL }) -{ - dom.window.document.getElementById('user').value = username; - dom.window.document.getElementById('password').value = password; - - dom.window.eval('creerCookie(document.getElementById(\'user\'), document.getElementById(\'password\'));'); - - const result = await submitForm({ - dom, - jar, - actionRoot: `https://${atenURL}/login/` - }); - - if (result.window.document.getElementById('aten-auth')) { - throw errors.WRONG_CREDENTIALS.drop(); - } - - return submitForm({ - dom: result, - jar, - asIs: true - }); -} - -function hook(window) -{ - window.eval(jsEncrypt + '; window.JSEncrypt = JSEncrypt;'); -} - -module.exports = { - login, - submit, - hook -}; diff --git a/alarm/node_modules/pronote-api/src/cas/generics/educonnect.js b/alarm/node_modules/pronote-api/src/cas/generics/educonnect.js deleted file mode 100644 index cd8e42e..0000000 --- a/alarm/node_modules/pronote-api/src/cas/generics/educonnect.js +++ /dev/null @@ -1,24 +0,0 @@ -const errors = require('../../errors'); -const { submitForm } = require('../api'); - -async function login({ dom, jar, username, password }) { - dom.window.document.getElementById('username').value = username; - dom.window.document.getElementById('password').value = password; - - dom = await submitForm({ - dom, - jar, - actionRoot: 'https://educonnect.education.gouv.fr/', - extraParams: { - '_eventId_proceed': '' - } - }); - - if (!dom.window.document.querySelector('input[name=SAMLResponse]')) { - throw errors.WRONG_CREDENTIALS.drop(); - } - - return await submitForm({ dom, jar, followRedirects: false }); -} - -module.exports = login; diff --git a/alarm/node_modules/pronote-api/src/cas/generics/jsencrypt.min.js b/alarm/node_modules/pronote-api/src/cas/generics/jsencrypt.min.js deleted file mode 100644 index a7f4b24..0000000 --- a/alarm/node_modules/pronote-api/src/cas/generics/jsencrypt.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/* eslint-disable */ - -var JSEncryptExports = {}; -(function(exports) { - function BigInteger(a,b,c){null!=a&&("number"==typeof a?this.fromNumber(a,b,c):null==b&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))}function nbi(){return new BigInteger(null)}function am1(a,b,c,d,e,f){for(;--f>=0;){var g=b*this[a++]+c[d]+e;e=Math.floor(g/67108864),c[d++]=67108863&g}return e}function am2(a,b,c,d,e,f){for(var g=32767&b,h=b>>15;--f>=0;){var i=32767&this[a],j=this[a++]>>15,k=h*i+j*g;i=g*i+((32767&k)<<15)+c[d]+(1073741823&e),e=(i>>>30)+(k>>>15)+h*j+(e>>>30),c[d++]=1073741823&i}return e}function am3(a,b,c,d,e,f){for(var g=16383&b,h=b>>14;--f>=0;){var i=16383&this[a],j=this[a++]>>14,k=h*i+j*g;i=g*i+((16383&k)<<14)+c[d]+e,e=(i>>28)+(k>>14)+h*j,c[d++]=268435455&i}return e}function int2char(a){return BI_RM.charAt(a)}function intAt(a,b){var c=BI_RC[a.charCodeAt(b)];return null==c?-1:c}function bnpCopyTo(a){for(var b=this.t-1;b>=0;--b)a[b]=this[b];a.t=this.t,a.s=this.s}function bnpFromInt(a){this.t=1,this.s=0>a?-1:0,a>0?this[0]=a:-1>a?this[0]=a+DV:this.t=0}function nbv(a){var b=nbi();return b.fromInt(a),b}function bnpFromString(a,b){var c;if(16==b)c=4;else if(8==b)c=3;else if(256==b)c=8;else if(2==b)c=1;else if(32==b)c=5;else{if(4!=b)return void this.fromRadix(a,b);c=2}this.t=0,this.s=0;for(var d=a.length,e=!1,f=0;--d>=0;){var g=8==c?255&a[d]:intAt(a,d);0>g?"-"==a.charAt(d)&&(e=!0):(e=!1,0==f?this[this.t++]=g:f+c>this.DB?(this[this.t-1]|=(g&(1<<this.DB-f)-1)<<f,this[this.t++]=g>>this.DB-f):this[this.t-1]|=g<<f,f+=c,f>=this.DB&&(f-=this.DB))}8==c&&0!=(128&a[0])&&(this.s=-1,f>0&&(this[this.t-1]|=(1<<this.DB-f)-1<<f)),this.clamp(),e&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var a=this.s&this.DM;this.t>0&&this[this.t-1]==a;)--this.t}function bnToString(a){if(this.s<0)return"-"+this.negate().toString(a);var b;if(16==a)b=4;else if(8==a)b=3;else if(2==a)b=1;else if(32==a)b=5;else{if(4!=a)return this.toRadix(a);b=2}var c,d=(1<<b)-1,e=!1,f="",g=this.t,h=this.DB-g*this.DB%b;if(g-->0)for(h<this.DB&&(c=this[g]>>h)>0&&(e=!0,f=int2char(c));g>=0;)b>h?(c=(this[g]&(1<<h)-1)<<b-h,c|=this[--g]>>(h+=this.DB-b)):(c=this[g]>>(h-=b)&d,0>=h&&(h+=this.DB,--g)),c>0&&(e=!0),e&&(f+=int2char(c));return e?f:"0"}function bnNegate(){var a=nbi();return BigInteger.ZERO.subTo(this,a),a}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t;if(b=c-a.t,0!=b)return this.s<0?-b:b;for(;--c>=0;)if(0!=(b=this[c]-a[c]))return b;return 0}function nbits(a){var b,c=1;return 0!=(b=a>>>16)&&(a=b,c+=16),0!=(b=a>>8)&&(a=b,c+=8),0!=(b=a>>4)&&(a=b,c+=4),0!=(b=a>>2)&&(a=b,c+=2),0!=(b=a>>1)&&(a=b,c+=1),c}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(a,b){var c;for(c=this.t-1;c>=0;--c)b[c+a]=this[c];for(c=a-1;c>=0;--c)b[c]=0;b.t=this.t+a,b.s=this.s}function bnpDRShiftTo(a,b){for(var c=a;c<this.t;++c)b[c-a]=this[c];b.t=Math.max(this.t-a,0),b.s=this.s}function bnpLShiftTo(a,b){var c,d=a%this.DB,e=this.DB-d,f=(1<<e)-1,g=Math.floor(a/this.DB),h=this.s<<d&this.DM;for(c=this.t-1;c>=0;--c)b[c+g+1]=this[c]>>e|h,h=(this[c]&f)<<d;for(c=g-1;c>=0;--c)b[c]=0;b[g]=h,b.t=this.t+g+1,b.s=this.s,b.clamp()}function bnpRShiftTo(a,b){b.s=this.s;var c=Math.floor(a/this.DB);if(c>=this.t)return void(b.t=0);var d=a%this.DB,e=this.DB-d,f=(1<<d)-1;b[0]=this[c]>>d;for(var g=c+1;g<this.t;++g)b[g-c-1]|=(this[g]&f)<<e,b[g-c]=this[g]>>d;d>0&&(b[this.t-c-1]|=(this.s&f)<<e),b.t=this.t-c,b.clamp()}function bnpSubTo(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);e>c;)d+=this[c]-a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d-=a.s;c<this.t;)d+=this[c],b[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d-=a[c],b[c++]=d&this.DM,d>>=this.DB;d-=a.s}b.s=0>d?-1:0,-1>d?b[c++]=this.DV+d:d>0&&(b[c++]=d),b.t=c,b.clamp()}function bnpMultiplyTo(a,b){var c=this.abs(),d=a.abs(),e=c.t;for(b.t=e+d.t;--e>=0;)b[e]=0;for(e=0;e<d.t;++e)b[e+c.t]=c.am(0,d[e],b,e,0,c.t);b.s=0,b.clamp(),this.s!=a.s&&BigInteger.ZERO.subTo(b,b)}function bnpSquareTo(a){for(var b=this.abs(),c=a.t=2*b.t;--c>=0;)a[c]=0;for(c=0;c<b.t-1;++c){var d=b.am(c,b[c],a,2*c,0,1);(a[c+b.t]+=b.am(c+1,2*b[c],a,2*c+1,d,b.t-c-1))>=b.DV&&(a[c+b.t]-=b.DV,a[c+b.t+1]=1)}a.t>0&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1)),a.s=0,a.clamp()}function bnpDivRemTo(a,b,c){var d=a.abs();if(!(d.t<=0)){var e=this.abs();if(e.t<d.t)return null!=b&&b.fromInt(0),void(null!=c&&this.copyTo(c));null==c&&(c=nbi());var f=nbi(),g=this.s,h=a.s,i=this.DB-nbits(d[d.t-1]);i>0?(d.lShiftTo(i,f),e.lShiftTo(i,c)):(d.copyTo(f),e.copyTo(c));var j=f.t,k=f[j-1];if(0!=k){var l=k*(1<<this.F1)+(j>1?f[j-2]>>this.F2:0),m=this.FV/l,n=(1<<this.F1)/l,o=1<<this.F2,p=c.t,q=p-j,r=null==b?nbi():b;for(f.dlShiftTo(q,r),c.compareTo(r)>=0&&(c[c.t++]=1,c.subTo(r,c)),BigInteger.ONE.dlShiftTo(j,r),r.subTo(f,f);f.t<j;)f[f.t++]=0;for(;--q>=0;){var s=c[--p]==k?this.DM:Math.floor(c[p]*m+(c[p-1]+o)*n);if((c[p]+=f.am(0,s,c,q,0,j))<s)for(f.dlShiftTo(q,r),c.subTo(r,c);c[p]<--s;)c.subTo(r,c)}null!=b&&(c.drShiftTo(j,b),g!=h&&BigInteger.ZERO.subTo(b,b)),c.t=j,c.clamp(),i>0&&c.rShiftTo(i,c),0>g&&BigInteger.ZERO.subTo(c,c)}}}function bnMod(a){var b=nbi();return this.abs().divRemTo(a,null,b),this.s<0&&b.compareTo(BigInteger.ZERO)>0&&a.subTo(b,b),b}function Classic(a){this.m=a}function cConvert(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a}function cRevert(a){return a}function cReduce(a){a.divRemTo(this.m,null,a)}function cMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function cSqrTo(a,b){a.squareTo(b),this.reduce(b)}function bnpInvDigit(){if(this.t<1)return 0;var a=this[0];if(0==(1&a))return 0;var b=3&a;return b=b*(2-(15&a)*b)&15,b=b*(2-(255&a)*b)&255,b=b*(2-((65535&a)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV,b>0?this.DV-b:-b}function Montgomery(a){this.m=a,this.mp=a.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<a.DB-15)-1,this.mt2=2*a.t}function montConvert(a){var b=nbi();return a.abs().dlShiftTo(this.m.t,b),b.divRemTo(this.m,null,b),a.s<0&&b.compareTo(BigInteger.ZERO)>0&&this.m.subTo(b,b),b}function montRevert(a){var b=nbi();return a.copyTo(b),this.reduce(b),b}function montReduce(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b<this.m.t;++b){var c=32767&a[b],d=c*this.mpl+((c*this.mph+(a[b]>>15)*this.mpl&this.um)<<15)&a.DM;for(c=b+this.m.t,a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp(),a.drShiftTo(this.m.t,a),a.compareTo(this.m)>=0&&a.subTo(this.m,a)}function montSqrTo(a,b){a.squareTo(b),this.reduce(b)}function montMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(a,b){if(a>4294967295||1>a)return BigInteger.ONE;var c=nbi(),d=nbi(),e=b.convert(this),f=nbits(a)-1;for(e.copyTo(c);--f>=0;)if(b.sqrTo(c,d),(a&1<<f)>0)b.mulTo(d,e,c);else{var g=c;c=d,d=g}return b.revert(c)}function bnModPowInt(a,b){var c;return c=256>a||b.isEven()?new Classic(b):new Montgomery(b),this.exp(a,c)}function bnClone(){var a=nbi();return this.copyTo(a),a}function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function bnByteValue(){return 0==this.t?this.s:this[0]<<24>>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(a){if(null==a&&(a=10),0==this.signum()||2>a||a>36)return"0";var b=this.chunkSize(a),c=Math.pow(a,b),d=nbv(c),e=nbi(),f=nbi(),g="";for(this.divRemTo(d,e,f);e.signum()>0;)g=(c+f.intValue()).toString(a).substr(1)+g,e.divRemTo(d,e,f);return f.intValue().toString(a)+g}function bnpFromRadix(a,b){this.fromInt(0),null==b&&(b=10);for(var c=this.chunkSize(b),d=Math.pow(b,c),e=!1,f=0,g=0,h=0;h<a.length;++h){var i=intAt(a,h);0>i?"-"==a.charAt(h)&&0==this.signum()&&(e=!0):(g=b*g+i,++f>=c&&(this.dMultiply(d),this.dAddOffset(g,0),f=0,g=0))}f>0&&(this.dMultiply(Math.pow(b,f)),this.dAddOffset(g,0)),e&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(a,b,c){if("number"==typeof b)if(2>a)this.fromInt(1);else for(this.fromNumber(a,c),this.testBit(a-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(BigInteger.ONE.shiftLeft(a-1),this);else{var d=new Array,e=7&a;d.length=(a>>3)+1,b.nextBytes(d),e>0?d[0]&=(1<<e)-1:d[0]=0,this.fromString(d,256)}}function bnToByteArray(){var a=this.t,b=new Array;b[0]=this.s;var c,d=this.DB-a*this.DB%8,e=0;if(a-->0)for(d<this.DB&&(c=this[a]>>d)!=(this.s&this.DM)>>d&&(b[e++]=c|this.s<<this.DB-d);a>=0;)8>d?(c=(this[a]&(1<<d)-1)<<8-d,c|=this[--a]>>(d+=this.DB-8)):(c=this[a]>>(d-=8)&255,0>=d&&(d+=this.DB,--a)),0!=(128&c)&&(c|=-256),0==e&&(128&this.s)!=(128&c)&&++e,(e>0||c!=this.s)&&(b[e++]=c);return b}function bnEquals(a){return 0==this.compareTo(a)}function bnMin(a){return this.compareTo(a)<0?this:a}function bnMax(a){return this.compareTo(a)>0?this:a}function bnpBitwiseTo(a,b,c){var d,e,f=Math.min(a.t,this.t);for(d=0;f>d;++d)c[d]=b(this[d],a[d]);if(a.t<this.t){for(e=a.s&this.DM,d=f;d<this.t;++d)c[d]=b(this[d],e);c.t=this.t}else{for(e=this.s&this.DM,d=f;d<a.t;++d)c[d]=b(e,a[d]);c.t=a.t}c.s=b(this.s,a.s),c.clamp()}function op_and(a,b){return a&b}function bnAnd(a){var b=nbi();return this.bitwiseTo(a,op_and,b),b}function op_or(a,b){return a|b}function bnOr(a){var b=nbi();return this.bitwiseTo(a,op_or,b),b}function op_xor(a,b){return a^b}function bnXor(a){var b=nbi();return this.bitwiseTo(a,op_xor,b),b}function op_andnot(a,b){return a&~b}function bnAndNot(a){var b=nbi();return this.bitwiseTo(a,op_andnot,b),b}function bnNot(){for(var a=nbi(),b=0;b<this.t;++b)a[b]=this.DM&~this[b];return a.t=this.t,a.s=~this.s,a}function bnShiftLeft(a){var b=nbi();return 0>a?this.rShiftTo(-a,b):this.lShiftTo(a,b),b}function bnShiftRight(a){var b=nbi();return 0>a?this.lShiftTo(-a,b):this.rShiftTo(a,b),b}function lbit(a){if(0==a)return-1;var b=0;return 0==(65535&a)&&(a>>=16,b+=16),0==(255&a)&&(a>>=8,b+=8),0==(15&a)&&(a>>=4,b+=4),0==(3&a)&&(a>>=2,b+=2),0==(1&a)&&++b,b}function bnGetLowestSetBit(){for(var a=0;a<this.t;++a)if(0!=this[a])return a*this.DB+lbit(this[a]);return this.s<0?this.t*this.DB:-1}function cbit(a){for(var b=0;0!=a;)a&=a-1,++b;return b}function bnBitCount(){for(var a=0,b=this.s&this.DM,c=0;c<this.t;++c)a+=cbit(this[c]^b);return a}function bnTestBit(a){var b=Math.floor(a/this.DB);return b>=this.t?0!=this.s:0!=(this[b]&1<<a%this.DB)}function bnpChangeBit(a,b){var c=BigInteger.ONE.shiftLeft(a);return this.bitwiseTo(c,b,c),c}function bnSetBit(a){return this.changeBit(a,op_or)}function bnClearBit(a){return this.changeBit(a,op_andnot)}function bnFlipBit(a){return this.changeBit(a,op_xor)}function bnpAddTo(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);e>c;)d+=this[c]+a[c],b[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d+=a.s;c<this.t;)d+=this[c],b[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d+=a[c],b[c++]=d&this.DM,d>>=this.DB;d+=a.s}b.s=0>d?-1:0,d>0?b[c++]=d:-1>d&&(b[c++]=this.DV+d),b.t=c,b.clamp()}function bnAdd(a){var b=nbi();return this.addTo(a,b),b}function bnSubtract(a){var b=nbi();return this.subTo(a,b),b}function bnMultiply(a){var b=nbi();return this.multiplyTo(a,b),b}function bnSquare(){var a=nbi();return this.squareTo(a),a}function bnDivide(a){var b=nbi();return this.divRemTo(a,b,null),b}function bnRemainder(a){var b=nbi();return this.divRemTo(a,null,b),b}function bnDivideAndRemainder(a){var b=nbi(),c=nbi();return this.divRemTo(a,b,c),new Array(b,c)}function bnpDMultiply(a){this[this.t]=this.am(0,a-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(a,b){if(0!=a){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.DV;)this[b]-=this.DV,++b>=this.t&&(this[this.t++]=0),++this[b]}}function NullExp(){}function nNop(a){return a}function nMulTo(a,b,c){a.multiplyTo(b,c)}function nSqrTo(a,b){a.squareTo(b)}function bnPow(a){return this.exp(a,new NullExp)}function bnpMultiplyLowerTo(a,b,c){var d=Math.min(this.t+a.t,b);for(c.s=0,c.t=d;d>0;)c[--d]=0;var e;for(e=c.t-this.t;e>d;++d)c[d+this.t]=this.am(0,a[d],c,d,0,this.t);for(e=Math.min(a.t,b);e>d;++d)this.am(0,a[d],c,d,0,b-d);c.clamp()}function bnpMultiplyUpperTo(a,b,c){--b;var d=c.t=this.t+a.t-b;for(c.s=0;--d>=0;)c[d]=0;for(d=Math.max(b-this.t,0);d<a.t;++d)c[this.t+d-b]=this.am(b-d,a[d],c,0,0,this.t+d-b);c.clamp(),c.drShiftTo(1,c)}function Barrett(a){this.r2=nbi(),this.q3=nbi(),BigInteger.ONE.dlShiftTo(2*a.t,this.r2),this.mu=this.r2.divide(a),this.m=a}function barrettConvert(a){if(a.s<0||a.t>2*this.m.t)return a.mod(this.m);if(a.compareTo(this.m)<0)return a;var b=nbi();return a.copyTo(b),this.reduce(b),b}function barrettRevert(a){return a}function barrettReduce(a){for(a.drShiftTo(this.m.t-1,this.r2),a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);a.compareTo(this.r2)<0;)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);a.compareTo(this.m)>=0;)a.subTo(this.m,a)}function barrettSqrTo(a,b){a.squareTo(b),this.reduce(b)}function barrettMulTo(a,b,c){a.multiplyTo(b,c),this.reduce(c)}function bnModPow(a,b){var c,d,e=a.bitLength(),f=nbv(1);if(0>=e)return f;c=18>e?1:48>e?3:144>e?4:768>e?5:6,d=8>e?new Classic(b):b.isEven()?new Barrett(b):new Montgomery(b);var g=new Array,h=3,i=c-1,j=(1<<c)-1;if(g[1]=d.convert(this),c>1){var k=nbi();for(d.sqrTo(g[1],k);j>=h;)g[h]=nbi(),d.mulTo(k,g[h-2],g[h]),h+=2}var l,m,n=a.t-1,o=!0,p=nbi();for(e=nbits(a[n])-1;n>=0;){for(e>=i?l=a[n]>>e-i&j:(l=(a[n]&(1<<e+1)-1)<<i-e,n>0&&(l|=a[n-1]>>this.DB+e-i)),h=c;0==(1&l);)l>>=1,--h;if((e-=h)<0&&(e+=this.DB,--n),o)g[l].copyTo(f),o=!1;else{for(;h>1;)d.sqrTo(f,p),d.sqrTo(p,f),h-=2;h>0?d.sqrTo(f,p):(m=f,f=p,p=m),d.mulTo(p,g[l],f)}for(;n>=0&&0==(a[n]&1<<e);)d.sqrTo(f,p),m=f,f=p,p=m,--e<0&&(e=this.DB-1,--n)}return d.revert(f)}function bnGCD(a){var b=this.s<0?this.negate():this.clone(),c=a.s<0?a.negate():a.clone();if(b.compareTo(c)<0){var d=b;b=c,c=d}var e=b.getLowestSetBit(),f=c.getLowestSetBit();if(0>f)return b;for(f>e&&(f=e),f>0&&(b.rShiftTo(f,b),c.rShiftTo(f,c));b.signum()>0;)(e=b.getLowestSetBit())>0&&b.rShiftTo(e,b),(e=c.getLowestSetBit())>0&&c.rShiftTo(e,c),b.compareTo(c)>=0?(b.subTo(c,b),b.rShiftTo(1,b)):(c.subTo(b,c),c.rShiftTo(1,c));return f>0&&c.lShiftTo(f,c),c}function bnpModInt(a){if(0>=a)return 0;var b=this.DV%a,c=this.s<0?a-1:0;if(this.t>0)if(0==b)c=this[0]%a;else for(var d=this.t-1;d>=0;--d)c=(b*c+this[d])%a;return c}function bnModInverse(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return BigInteger.ZERO;for(var c=a.clone(),d=this.clone(),e=nbv(1),f=nbv(0),g=nbv(0),h=nbv(1);0!=c.signum();){for(;c.isEven();)c.rShiftTo(1,c),b?(e.isEven()&&f.isEven()||(e.addTo(this,e),f.subTo(a,f)),e.rShiftTo(1,e)):f.isEven()||f.subTo(a,f),f.rShiftTo(1,f);for(;d.isEven();)d.rShiftTo(1,d),b?(g.isEven()&&h.isEven()||(g.addTo(this,g),h.subTo(a,h)),g.rShiftTo(1,g)):h.isEven()||h.subTo(a,h),h.rShiftTo(1,h);c.compareTo(d)>=0?(c.subTo(d,c),b&&e.subTo(g,e),f.subTo(h,f)):(d.subTo(c,d),b&&g.subTo(e,g),h.subTo(f,h))}return 0!=d.compareTo(BigInteger.ONE)?BigInteger.ZERO:h.compareTo(a)>=0?h.subtract(a):h.signum()<0?(h.addTo(a,h),h.signum()<0?h.add(a):h):h}function bnIsProbablePrime(a){var b,c=this.abs();if(1==c.t&&c[0]<=lowprimes[lowprimes.length-1]){for(b=0;b<lowprimes.length;++b)if(c[0]==lowprimes[b])return!0;return!1}if(c.isEven())return!1;for(b=1;b<lowprimes.length;){for(var d=lowprimes[b],e=b+1;e<lowprimes.length&&lplim>d;)d*=lowprimes[e++];for(d=c.modInt(d);e>b;)if(d%lowprimes[b++]==0)return!1}return c.millerRabin(a)}function bnpMillerRabin(a){var b=this.subtract(BigInteger.ONE),c=b.getLowestSetBit();if(0>=c)return!1;var d=b.shiftRight(c);a=a+1>>1,a>lowprimes.length&&(a=lowprimes.length);for(var e=nbi(),f=0;a>f;++f){e.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var g=e.modPow(d,this);if(0!=g.compareTo(BigInteger.ONE)&&0!=g.compareTo(b)){for(var h=1;h++<c&&0!=g.compareTo(b);)if(g=g.modPowInt(2,this),0==g.compareTo(BigInteger.ONE))return!1;if(0!=g.compareTo(b))return!1}}return!0}function Arcfour(){this.i=0,this.j=0,this.S=new Array}function ARC4init(a){var b,c,d;for(b=0;256>b;++b)this.S[b]=b;for(c=0,b=0;256>b;++b)c=c+this.S[b]+a[b%a.length]&255,d=this.S[b],this.S[b]=this.S[c],this.S[c]=d;this.i=0,this.j=0}function ARC4next(){var a;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,a=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=a,this.S[a+this.S[this.i]&255]}function prng_newstate(){return new Arcfour}function rng_get_byte(){if(null==rng_state){for(rng_state=prng_newstate();rng_psize>rng_pptr;){var a=Math.floor(65536*Math.random());rng_pool[rng_pptr++]=255&a}for(rng_state.init(rng_pool),rng_pptr=0;rng_pptr<rng_pool.length;++rng_pptr)rng_pool[rng_pptr]=0;rng_pptr=0}return rng_state.next()}function rng_get_bytes(a){var b;for(b=0;b<a.length;++b)a[b]=rng_get_byte()}function SecureRandom(){}function parseBigInt(a,b){return new BigInteger(a,b)}function linebrk(a,b){for(var c="",d=0;d+b<a.length;)c+=a.substring(d,d+b)+"\n",d+=b;return c+a.substring(d,a.length)}function byte2Hex(a){return 16>a?"0"+a.toString(16):a.toString(16)}function pkcs1pad2(a,b){if(b<a.length+11)return console.error("Message too long for RSA"),null;for(var c=new Array,d=a.length-1;d>=0&&b>0;){var e=a.charCodeAt(d--);128>e?c[--b]=e:e>127&&2048>e?(c[--b]=63&e|128,c[--b]=e>>6|192):(c[--b]=63&e|128,c[--b]=e>>6&63|128,c[--b]=e>>12|224)}c[--b]=0;for(var f=new SecureRandom,g=new Array;b>2;){for(g[0]=0;0==g[0];)f.nextBytes(g);c[--b]=g[0]}return c[--b]=2,c[--b]=0,new BigInteger(c)}function RSAKey(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function RSASetPublic(a,b){null!=a&&null!=b&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16)):console.error("Invalid RSA public key")}function RSADoPublic(a){return a.modPowInt(this.e,this.n)}function RSAEncrypt(a){var b=pkcs1pad2(a,this.n.bitLength()+7>>3);if(null==b)return null;var c=this.doPublic(b);if(null==c)return null;var d=c.toString(16);return 0==(1&d.length)?d:"0"+d}function pkcs1unpad2(a,b){for(var c=a.toByteArray(),d=0;d<c.length&&0==c[d];)++d;if(c.length-d!=b-1||2!=c[d])return null;for(++d;0!=c[d];)if(++d>=c.length)return null;for(var e="";++d<c.length;){var f=255&c[d];128>f?e+=String.fromCharCode(f):f>191&&224>f?(e+=String.fromCharCode((31&f)<<6|63&c[d+1]),++d):(e+=String.fromCharCode((15&f)<<12|(63&c[d+1])<<6|63&c[d+2]),d+=2)}return e}function RSASetPrivate(a,b,c){null!=a&&null!=b&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16),this.d=parseBigInt(c,16)):console.error("Invalid RSA private key")}function RSASetPrivateEx(a,b,c,d,e,f,g,h){null!=a&&null!=b&&a.length>0&&b.length>0?(this.n=parseBigInt(a,16),this.e=parseInt(b,16),this.d=parseBigInt(c,16),this.p=parseBigInt(d,16),this.q=parseBigInt(e,16),this.dmp1=parseBigInt(f,16),this.dmq1=parseBigInt(g,16),this.coeff=parseBigInt(h,16)):console.error("Invalid RSA private key")}function RSAGenerate(a,b){var c=new SecureRandom,d=a>>1;this.e=parseInt(b,16);for(var e=new BigInteger(b,16);;){for(;this.p=new BigInteger(a-d,1,c),0!=this.p.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE)||!this.p.isProbablePrime(10););for(;this.q=new BigInteger(d,1,c),0!=this.q.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var f=this.p;this.p=this.q,this.q=f}var g=this.p.subtract(BigInteger.ONE),h=this.q.subtract(BigInteger.ONE),i=g.multiply(h);if(0==i.gcd(e).compareTo(BigInteger.ONE)){this.n=this.p.multiply(this.q),this.d=e.modInverse(i),this.dmp1=this.d.mod(g),this.dmq1=this.d.mod(h),this.coeff=this.q.modInverse(this.p);break}}}function RSADoPrivate(a){if(null==this.p||null==this.q)return a.modPow(this.d,this.n);for(var b=a.mod(this.p).modPow(this.dmp1,this.p),c=a.mod(this.q).modPow(this.dmq1,this.q);b.compareTo(c)<0;)b=b.add(this.p);return b.subtract(c).multiply(this.coeff).mod(this.p).multiply(this.q).add(c)}function RSADecrypt(a){var b=parseBigInt(a,16),c=this.doPrivate(b);return null==c?null:pkcs1unpad2(c,this.n.bitLength()+7>>3)}function hex2b64(a){var b,c,d="";for(b=0;b+3<=a.length;b+=3)c=parseInt(a.substring(b,b+3),16),d+=b64map.charAt(c>>6)+b64map.charAt(63&c);for(b+1==a.length?(c=parseInt(a.substring(b,b+1),16),d+=b64map.charAt(c<<2)):b+2==a.length&&(c=parseInt(a.substring(b,b+2),16),d+=b64map.charAt(c>>2)+b64map.charAt((3&c)<<4));(3&d.length)>0;)d+=b64pad;return d}function b64tohex(a){var b,c,d="",e=0;for(b=0;b<a.length&&a.charAt(b)!=b64pad;++b)v=b64map.indexOf(a.charAt(b)),0>v||(0==e?(d+=int2char(v>>2),c=3&v,e=1):1==e?(d+=int2char(c<<2|v>>4),c=15&v,e=2):2==e?(d+=int2char(c),d+=int2char(v>>2),c=3&v,e=3):(d+=int2char(c<<2|v>>4),d+=int2char(15&v),e=0));return 1==e&&(d+=int2char(c<<2)),d}function b64toBA(a){var b,c=b64tohex(a),d=new Array;for(b=0;2*b<c.length;++b)d[b]=parseInt(c.substring(2*b,2*b+2),16);return d}var dbits,canary=0xdeadbeefcafe,j_lm=15715070==(16777215&canary);j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<<dbits)-1,BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array,rr,vv;for(rr="0".charCodeAt(0),vv=0;9>=vv;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.fromRadix=bnpFromRadix,BigInteger.prototype.fromNumber=bnpFromNumber,BigInteger.prototype.bitwiseTo=bnpBitwiseTo,BigInteger.prototype.changeBit=bnpChangeBit,BigInteger.prototype.addTo=bnpAddTo,BigInteger.prototype.dMultiply=bnpDMultiply,BigInteger.prototype.dAddOffset=bnpDAddOffset,BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo,BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo,BigInteger.prototype.modInt=bnpModInt,BigInteger.prototype.millerRabin=bnpMillerRabin,BigInteger.prototype.clone=bnClone,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.byteValue=bnByteValue,BigInteger.prototype.shortValue=bnShortValue,BigInteger.prototype.signum=bnSigNum,BigInteger.prototype.toByteArray=bnToByteArray,BigInteger.prototype.equals=bnEquals,BigInteger.prototype.min=bnMin,BigInteger.prototype.max=bnMax,BigInteger.prototype.and=bnAnd,BigInteger.prototype.or=bnOr,BigInteger.prototype.xor=bnXor,BigInteger.prototype.andNot=bnAndNot,BigInteger.prototype.not=bnNot,BigInteger.prototype.shiftLeft=bnShiftLeft,BigInteger.prototype.shiftRight=bnShiftRight,BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit,BigInteger.prototype.bitCount=bnBitCount,BigInteger.prototype.testBit=bnTestBit,BigInteger.prototype.setBit=bnSetBit,BigInteger.prototype.clearBit=bnClearBit,BigInteger.prototype.flipBit=bnFlipBit,BigInteger.prototype.add=bnAdd,BigInteger.prototype.subtract=bnSubtract,BigInteger.prototype.multiply=bnMultiply,BigInteger.prototype.divide=bnDivide,BigInteger.prototype.remainder=bnRemainder,BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder,BigInteger.prototype.modPow=bnModPow,BigInteger.prototype.modInverse=bnModInverse,BigInteger.prototype.pow=bnPow,BigInteger.prototype.gcd=bnGCD,BigInteger.prototype.isProbablePrime=bnIsProbablePrime,BigInteger.prototype.square=bnSquare,Arcfour.prototype.init=ARC4init,Arcfour.prototype.next=ARC4next;var rng_psize=256,rng_state,rng_pool,rng_pptr;if(null==rng_pool){rng_pool=new Array,rng_pptr=0;var t;if(window.crypto&&window.crypto.getRandomValues){var z=new Uint32Array(256);for(window.crypto.getRandomValues(z),t=0;t<z.length;++t)rng_pool[rng_pptr++]=255&z[t]}var onMouseMoveListener=function(a){if(this.count=this.count||0,this.count>=256||rng_pptr>=rng_psize)return void(window.removeEventListener?window.removeEventListener("mousemove",onMouseMoveListener):window.detachEvent&&window.detachEvent("onmousemove",onMouseMoveListener));this.count+=1;var b=a.x+a.y;rng_pool[rng_pptr++]=255&b};window.addEventListener?window.addEventListener("mousemove",onMouseMoveListener):window.attachEvent&&window.attachEvent("onmousemove",onMouseMoveListener)}SecureRandom.prototype.nextBytes=rng_get_bytes,RSAKey.prototype.doPublic=RSADoPublic,RSAKey.prototype.setPublic=RSASetPublic,RSAKey.prototype.encrypt=RSAEncrypt,RSAKey.prototype.doPrivate=RSADoPrivate,RSAKey.prototype.setPrivate=RSASetPrivate,RSAKey.prototype.setPrivateEx=RSASetPrivateEx,RSAKey.prototype.generate=RSAGenerate,RSAKey.prototype.decrypt=RSADecrypt,function(){var a=function(a,b,c){var d=new SecureRandom,e=a>>1;this.e=parseInt(b,16);var f=new BigInteger(b,16),g=this,h=function(){var b=function(){if(g.p.compareTo(g.q)<=0){var a=g.p;g.p=g.q,g.q=a}var b=g.p.subtract(BigInteger.ONE),d=g.q.subtract(BigInteger.ONE),e=b.multiply(d);0==e.gcd(f).compareTo(BigInteger.ONE)?(g.n=g.p.multiply(g.q),g.d=f.modInverse(e),g.dmp1=g.d.mod(b),g.dmq1=g.d.mod(d),g.coeff=g.q.modInverse(g.p),setTimeout(function(){c()},0)):setTimeout(h,0)},i=function(){g.q=nbi(),g.q.fromNumberAsync(e,1,d,function(){g.q.subtract(BigInteger.ONE).gcda(f,function(a){0==a.compareTo(BigInteger.ONE)&&g.q.isProbablePrime(10)?setTimeout(b,0):setTimeout(i,0)})})},j=function(){g.p=nbi(),g.p.fromNumberAsync(a-e,1,d,function(){g.p.subtract(BigInteger.ONE).gcda(f,function(a){0==a.compareTo(BigInteger.ONE)&&g.p.isProbablePrime(10)?setTimeout(i,0):setTimeout(j,0)})})};setTimeout(j,0)};setTimeout(h,0)};RSAKey.prototype.generateAsync=a;var b=function(a,b){var c=this.s<0?this.negate():this.clone(),d=a.s<0?a.negate():a.clone();if(c.compareTo(d)<0){var e=c;c=d,d=e}var f=c.getLowestSetBit(),g=d.getLowestSetBit();if(0>g)return void b(c);g>f&&(g=f),g>0&&(c.rShiftTo(g,c),d.rShiftTo(g,d));var h=function(){(f=c.getLowestSetBit())>0&&c.rShiftTo(f,c),(f=d.getLowestSetBit())>0&&d.rShiftTo(f,d),c.compareTo(d)>=0?(c.subTo(d,c),c.rShiftTo(1,c)):(d.subTo(c,d),d.rShiftTo(1,d)),c.signum()>0?setTimeout(h,0):(g>0&&d.lShiftTo(g,d),setTimeout(function(){b(d)},0))};setTimeout(h,10)};BigInteger.prototype.gcda=b;var c=function(a,b,c,d){if("number"==typeof b)if(2>a)this.fromInt(1);else{this.fromNumber(a,c),this.testBit(a-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);var e=this,f=function(){e.dAddOffset(2,0),e.bitLength()>a&&e.subTo(BigInteger.ONE.shiftLeft(a-1),e),e.isProbablePrime(b)?setTimeout(function(){d()},0):setTimeout(f,0)};setTimeout(f,0)}else{var g=new Array,h=7&a;g.length=(a>>3)+1,b.nextBytes(g),h>0?g[0]&=(1<<h)-1:g[0]=0,this.fromString(g,256)}};BigInteger.prototype.fromNumberAsync=c}();var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64pad="=",JSX=JSX||{};JSX.env=JSX.env||{};var L=JSX,OP=Object.prototype,FUNCTION_TOSTRING="[object Function]",ADD=["toString","valueOf"];JSX.env.parseUA=function(a){var b,c=function(a){var b=0;return parseFloat(a.replace(/\./g,function(){return 1==b++?"":"."}))},d=navigator,e={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,webos:0,caja:d&&d.cajaVersion,secure:!1,os:null},f=a||navigator&&navigator.userAgent,g=window&&window.location,h=g&&g.href;return e.secure=h&&0===h.toLowerCase().indexOf("https"),f&&(/windows|win32/i.test(f)?e.os="windows":/macintosh/i.test(f)?e.os="macintosh":/rhino/i.test(f)&&(e.os="rhino"),/KHTML/.test(f)&&(e.webkit=1),b=f.match(/AppleWebKit\/([^\s]*)/),b&&b[1]&&(e.webkit=c(b[1]),/ Mobile\//.test(f)?(e.mobile="Apple",b=f.match(/OS ([^\s]*)/),b&&b[1]&&(b=c(b[1].replace("_","."))),e.ios=b,e.ipad=e.ipod=e.iphone=0,b=f.match(/iPad|iPod|iPhone/),b&&b[0]&&(e[b[0].toLowerCase()]=e.ios)):(b=f.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/),b&&(e.mobile=b[0]),/webOS/.test(f)&&(e.mobile="WebOS",b=f.match(/webOS\/([^\s]*);/),b&&b[1]&&(e.webos=c(b[1]))),/ Android/.test(f)&&(e.mobile="Android",b=f.match(/Android ([^\s]*);/),b&&b[1]&&(e.android=c(b[1])))),b=f.match(/Chrome\/([^\s]*)/),b&&b[1]?e.chrome=c(b[1]):(b=f.match(/AdobeAIR\/([^\s]*)/),b&&(e.air=b[0]))),e.webkit||(b=f.match(/Opera[\s\/]([^\s]*)/),b&&b[1]?(e.opera=c(b[1]),b=f.match(/Version\/([^\s]*)/),b&&b[1]&&(e.opera=c(b[1])),b=f.match(/Opera Mini[^;]*/),b&&(e.mobile=b[0])):(b=f.match(/MSIE\s([^;]*)/),b&&b[1]?e.ie=c(b[1]):(b=f.match(/Gecko\/([^\s]*)/),b&&(e.gecko=1,b=f.match(/rv:([^\s\)]*)/),b&&b[1]&&(e.gecko=c(b[1]))))))),e},JSX.env.ua=JSX.env.parseUA(),JSX.isFunction=function(a){return"function"==typeof a||OP.toString.apply(a)===FUNCTION_TOSTRING},JSX._IEEnumFix=JSX.env.ua.ie?function(a,b){var c,d,e;for(c=0;c<ADD.length;c+=1)d=ADD[c],e=b[d],L.isFunction(e)&&e!=OP[d]&&(a[d]=e)}:function(){},JSX.extend=function(a,b,c){if(!b||!a)throw new Error("extend failed, please check that all dependencies are included.");var d,e=function(){};if(e.prototype=b.prototype,a.prototype=new e,a.prototype.constructor=a,a.superclass=b.prototype,b.prototype.constructor==OP.constructor&&(b.prototype.constructor=b),c){for(d in c)L.hasOwnProperty(c,d)&&(a.prototype[d]=c[d]);L._IEEnumFix(a.prototype,c)}},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(a){var b=a.toString(16);return b.length%2==1&&(b="0"+b),b},this.bigIntToMinTwosComplementsHex=function(a){var b=a.toString(16);if("-"!=b.substr(0,1))b.length%2==1?b="0"+b:b.match(/^[0-7]/)||(b="00"+b); - else{var c=b.substr(1),d=c.length;d%2==1?d+=1:b.match(/^[0-7]/)||(d+=2);for(var e="",f=0;d>f;f++)e+="f";var g=new BigInteger(e,16),h=g.xor(a).add(BigInteger.ONE);b=h.toString(16).replace(/^-/,"")}return b},this.getPEMStringFromHex=function(a,b){var c=CryptoJS.enc.Hex.parse(a),d=CryptoJS.enc.Base64.stringify(c),e=d.replace(/(.{64})/g,"$1\r\n");return e=e.replace(/\r\n$/,""),"-----BEGIN "+b+"-----\r\n"+e+"\r\n-----END "+b+"-----\r\n"}},KJUR.asn1.ASN1Object=function(){var a="";this.getLengthHexFromValue=function(){if("undefined"==typeof this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+a.length+",v="+this.hV;var b=this.hV.length/2,c=b.toString(16);if(c.length%2==1&&(c="0"+c),128>b)return c;var d=c.length/2;if(d>15)throw"ASN.1 length too long to represent by 8x: n = "+b.toString(16);var e=128+d;return e.toString(16)+c},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},KJUR.asn1.DERAbstractString=function(a){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(a){this.hTLV=null,this.isModified=!0,this.s=a,this.hV=stohex(this.s)},this.setStringHex=function(a){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=a},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof a&&("undefined"!=typeof a.str?this.setString(a.str):"undefined"!=typeof a.hex&&this.setStringHex(a.hex))},JSX.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractTime=function(){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(a){utc=a.getTime()+6e4*a.getTimezoneOffset();var b=new Date(utc);return b},this.formatDate=function(a,b){var c=this.zeroPadding,d=this.localDateToUTC(a),e=String(d.getFullYear());"utc"==b&&(e=e.substr(2,2));var f=c(String(d.getMonth()+1),2),g=c(String(d.getDate()),2),h=c(String(d.getHours()),2),i=c(String(d.getMinutes()),2),j=c(String(d.getSeconds()),2);return e+f+g+h+i+j+"Z"},this.zeroPadding=function(a,b){return a.length>=b?a:new Array(b-a.length+1).join("0")+a},this.getString=function(){return this.s},this.setString=function(a){this.hTLV=null,this.isModified=!0,this.s=a,this.hV=stohex(this.s)},this.setByDateValue=function(a,b,c,d,e,f){var g=new Date(Date.UTC(a,b-1,c,d,e,f,0));this.setByDate(g)},this.getFreshValueHex=function(){return this.hV}},JSX.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractStructured=function(a){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(a){this.hTLV=null,this.isModified=!0,this.asn1Array=a},this.appendASN1Object=function(a){this.hTLV=null,this.isModified=!0,this.asn1Array.push(a)},this.asn1Array=new Array,"undefined"!=typeof a&&"undefined"!=typeof a.array&&(this.asn1Array=a.array)},JSX.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object),KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},JSX.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object),KJUR.asn1.DERInteger=function(a){KJUR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(a){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(a)},this.setByInteger=function(a){var b=new BigInteger(String(a),10);this.setByBigInteger(b)},this.setValueHex=function(a){this.hV=a},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof a&&("undefined"!=typeof a.bigint?this.setByBigInteger(a.bigint):"undefined"!=typeof a["int"]?this.setByInteger(a["int"]):"undefined"!=typeof a.hex&&this.setValueHex(a.hex))},JSX.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object),KJUR.asn1.DERBitString=function(a){KJUR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(a){this.hTLV=null,this.isModified=!0,this.hV=a},this.setUnusedBitsAndHexValue=function(a,b){if(0>a||a>7)throw"unused bits shall be from 0 to 7: u = "+a;var c="0"+a;this.hTLV=null,this.isModified=!0,this.hV=c+b},this.setByBinaryString=function(a){a=a.replace(/0+$/,"");var b=8-a.length%8;8==b&&(b=0);for(var c=0;b>=c;c++)a+="0";for(var d="",c=0;c<a.length-1;c+=8){var e=a.substr(c,8),f=parseInt(e,2).toString(16);1==f.length&&(f="0"+f),d+=f}this.hTLV=null,this.isModified=!0,this.hV="0"+b+d},this.setByBooleanArray=function(a){for(var b="",c=0;c<a.length;c++)b+=1==a[c]?"1":"0";this.setByBinaryString(b)},this.newFalseArray=function(a){for(var b=new Array(a),c=0;a>c;c++)b[c]=!1;return b},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof a&&("undefined"!=typeof a.hex?this.setHexValueIncludingUnusedBits(a.hex):"undefined"!=typeof a.bin?this.setByBinaryString(a.bin):"undefined"!=typeof a.array&&this.setByBooleanArray(a.array))},JSX.extend(KJUR.asn1.DERBitString,KJUR.asn1.ASN1Object),KJUR.asn1.DEROctetString=function(a){KJUR.asn1.DEROctetString.superclass.constructor.call(this,a),this.hT="04"},JSX.extend(KJUR.asn1.DEROctetString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNull=function(){KJUR.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},JSX.extend(KJUR.asn1.DERNull,KJUR.asn1.ASN1Object),KJUR.asn1.DERObjectIdentifier=function(a){var b=function(a){var b=a.toString(16);return 1==b.length&&(b="0"+b),b},c=function(a){var c="",d=new BigInteger(a,10),e=d.toString(2),f=7-e.length%7;7==f&&(f=0);for(var g="",h=0;f>h;h++)g+="0";e=g+e;for(var h=0;h<e.length-1;h+=7){var i=e.substr(h,7);h!=e.length-7&&(i="1"+i),c+=b(parseInt(i,2))}return c};KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(a){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=a},this.setValueOidString=function(a){if(!a.match(/^[0-9.]+$/))throw"malformed oid string: "+a;var d="",e=a.split("."),f=40*parseInt(e[0])+parseInt(e[1]);d+=b(f),e.splice(0,2);for(var g=0;g<e.length;g++)d+=c(e[g]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=d},this.setValueName=function(a){if("undefined"==typeof KJUR.asn1.x509.OID.name2oidList[a])throw"DERObjectIdentifier oidName undefined: "+a;var b=KJUR.asn1.x509.OID.name2oidList[a];this.setValueOidString(b)},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof a&&("undefined"!=typeof a.oid?this.setValueOidString(a.oid):"undefined"!=typeof a.hex?this.setValueHex(a.hex):"undefined"!=typeof a.name&&this.setValueName(a.name))},JSX.extend(KJUR.asn1.DERObjectIdentifier,KJUR.asn1.ASN1Object),KJUR.asn1.DERUTF8String=function(a){KJUR.asn1.DERUTF8String.superclass.constructor.call(this,a),this.hT="0c"},JSX.extend(KJUR.asn1.DERUTF8String,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNumericString=function(a){KJUR.asn1.DERNumericString.superclass.constructor.call(this,a),this.hT="12"},JSX.extend(KJUR.asn1.DERNumericString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERPrintableString=function(a){KJUR.asn1.DERPrintableString.superclass.constructor.call(this,a),this.hT="13"},JSX.extend(KJUR.asn1.DERPrintableString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERTeletexString=function(a){KJUR.asn1.DERTeletexString.superclass.constructor.call(this,a),this.hT="14"},JSX.extend(KJUR.asn1.DERTeletexString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERIA5String=function(a){KJUR.asn1.DERIA5String.superclass.constructor.call(this,a),this.hT="16"},JSX.extend(KJUR.asn1.DERIA5String,KJUR.asn1.DERAbstractString),KJUR.asn1.DERUTCTime=function(a){KJUR.asn1.DERUTCTime.superclass.constructor.call(this,a),this.hT="17",this.setByDate=function(a){this.hTLV=null,this.isModified=!0,this.date=a,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},"undefined"!=typeof a&&("undefined"!=typeof a.str?this.setString(a.str):"undefined"!=typeof a.hex?this.setStringHex(a.hex):"undefined"!=typeof a.date&&this.setByDate(a.date))},JSX.extend(KJUR.asn1.DERUTCTime,KJUR.asn1.DERAbstractTime),KJUR.asn1.DERGeneralizedTime=function(a){KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this,a),this.hT="18",this.setByDate=function(a){this.hTLV=null,this.isModified=!0,this.date=a,this.s=this.formatDate(this.date,"gen"),this.hV=stohex(this.s)},"undefined"!=typeof a&&("undefined"!=typeof a.str?this.setString(a.str):"undefined"!=typeof a.hex?this.setStringHex(a.hex):"undefined"!=typeof a.date&&this.setByDate(a.date))},JSX.extend(KJUR.asn1.DERGeneralizedTime,KJUR.asn1.DERAbstractTime),KJUR.asn1.DERSequence=function(a){KJUR.asn1.DERSequence.superclass.constructor.call(this,a),this.hT="30",this.getFreshValueHex=function(){for(var a="",b=0;b<this.asn1Array.length;b++){var c=this.asn1Array[b];a+=c.getEncodedHex()}return this.hV=a,this.hV}},JSX.extend(KJUR.asn1.DERSequence,KJUR.asn1.DERAbstractStructured),KJUR.asn1.DERSet=function(a){KJUR.asn1.DERSet.superclass.constructor.call(this,a),this.hT="31",this.getFreshValueHex=function(){for(var a=new Array,b=0;b<this.asn1Array.length;b++){var c=this.asn1Array[b];a.push(c.getEncodedHex())}return a.sort(),this.hV=a.join(""),this.hV}},JSX.extend(KJUR.asn1.DERSet,KJUR.asn1.DERAbstractStructured),KJUR.asn1.DERTaggedObject=function(a){KJUR.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(a,b,c){this.hT=b,this.isExplicit=a,this.asn1Object=c,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=c.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,b),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof a&&("undefined"!=typeof a.tag&&(this.hT=a.tag),"undefined"!=typeof a.explicit&&(this.isExplicit=a.explicit),"undefined"!=typeof a.obj&&(this.asn1Object=a.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},JSX.extend(KJUR.asn1.DERTaggedObject,KJUR.asn1.ASN1Object),function(a){"use strict";var b,c={};c.decode=function(c){var d;if(b===a){var e="0123456789ABCDEF",f=" \f\n\r  \u2028\u2029";for(b=[],d=0;16>d;++d)b[e.charAt(d)]=d;for(e=e.toLowerCase(),d=10;16>d;++d)b[e.charAt(d)]=d;for(d=0;d<f.length;++d)b[f.charAt(d)]=-1}var g=[],h=0,i=0;for(d=0;d<c.length;++d){var j=c.charAt(d);if("="==j)break;if(j=b[j],-1!=j){if(j===a)throw"Illegal character at offset "+d;h|=j,++i>=2?(g[g.length]=h,h=0,i=0):h<<=4}}if(i)throw"Hex encoding incomplete: 4 bits missing";return g},window.Hex=c}(),function(a){"use strict";var b,c={};c.decode=function(c){var d;if(b===a){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="= \f\n\r  \u2028\u2029";for(b=[],d=0;64>d;++d)b[e.charAt(d)]=d;for(d=0;d<f.length;++d)b[f.charAt(d)]=-1}var g=[],h=0,i=0;for(d=0;d<c.length;++d){var j=c.charAt(d);if("="==j)break;if(j=b[j],-1!=j){if(j===a)throw"Illegal character at offset "+d;h|=j,++i>=4?(g[g.length]=h>>16,g[g.length]=h>>8&255,g[g.length]=255&h,h=0,i=0):h<<=6}}switch(i){case 1:throw"Base64 encoding incomplete: at least 2 bits missing";case 2:g[g.length]=h>>10;break;case 3:g[g.length]=h>>16,g[g.length]=h>>8&255}return g},c.re=/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,c.unarmor=function(a){var b=c.re.exec(a);if(b)if(b[1])a=b[1];else{if(!b[2])throw"RegExp out of sync";a=b[2]}return c.decode(a)},window.Base64=c}(),function(a){"use strict";function b(a,c){a instanceof b?(this.enc=a.enc,this.pos=a.pos):(this.enc=a,this.pos=c)}function c(a,b,c,d,e){this.stream=a,this.header=b,this.length=c,this.tag=d,this.sub=e}var d=100,e="…",f={tag:function(a,b){var c=document.createElement(a);return c.className=b,c},text:function(a){return document.createTextNode(a)}};b.prototype.get=function(b){if(b===a&&(b=this.pos++),b>=this.enc.length)throw"Requesting byte offset "+b+" on a stream of length "+this.enc.length;return this.enc[b]},b.prototype.hexDigits="0123456789ABCDEF",b.prototype.hexByte=function(a){return this.hexDigits.charAt(a>>4&15)+this.hexDigits.charAt(15&a)},b.prototype.hexDump=function(a,b,c){for(var d="",e=a;b>e;++e)if(d+=this.hexByte(this.get(e)),c!==!0)switch(15&e){case 7:d+=" ";break;case 15:d+="\n";break;default:d+=" "}return d},b.prototype.parseStringISO=function(a,b){for(var c="",d=a;b>d;++d)c+=String.fromCharCode(this.get(d));return c},b.prototype.parseStringUTF=function(a,b){for(var c="",d=a;b>d;){var e=this.get(d++);c+=String.fromCharCode(128>e?e:e>191&&224>e?(31&e)<<6|63&this.get(d++):(15&e)<<12|(63&this.get(d++))<<6|63&this.get(d++))}return c},b.prototype.parseStringBMP=function(a,b){for(var c="",d=a;b>d;d+=2){var e=this.get(d),f=this.get(d+1);c+=String.fromCharCode((e<<8)+f)}return c},b.prototype.reTime=/^((?:1[89]|2\d)?\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,b.prototype.parseTime=function(a,b){var c=this.parseStringISO(a,b),d=this.reTime.exec(c);return d?(c=d[1]+"-"+d[2]+"-"+d[3]+" "+d[4],d[5]&&(c+=":"+d[5],d[6]&&(c+=":"+d[6],d[7]&&(c+="."+d[7]))),d[8]&&(c+=" UTC","Z"!=d[8]&&(c+=d[8],d[9]&&(c+=":"+d[9]))),c):"Unrecognized time: "+c},b.prototype.parseInteger=function(a,b){var c=b-a;if(c>4){c<<=3;var d=this.get(a);if(0===d)c-=8;else for(;128>d;)d<<=1,--c;return"("+c+" bit)"}for(var e=0,f=a;b>f;++f)e=e<<8|this.get(f);return e},b.prototype.parseBitString=function(a,b){var c=this.get(a),d=(b-a-1<<3)-c,e="("+d+" bit)";if(20>=d){var f=c;e+=" ";for(var g=b-1;g>a;--g){for(var h=this.get(g),i=f;8>i;++i)e+=h>>i&1?"1":"0";f=0}}return e},b.prototype.parseOctetString=function(a,b){var c=b-a,f="("+c+" byte) ";c>d&&(b=a+d);for(var g=a;b>g;++g)f+=this.hexByte(this.get(g));return c>d&&(f+=e),f},b.prototype.parseOID=function(a,b){for(var c="",d=0,e=0,f=a;b>f;++f){var g=this.get(f);if(d=d<<7|127&g,e+=7,!(128&g)){if(""===c){var h=80>d?40>d?0:1:2;c=h+"."+(d-40*h)}else c+="."+(e>=31?"bigint":d);d=e=0}}return c},c.prototype.typeName=function(){if(this.tag===a)return"unknown";var b=this.tag>>6,c=(this.tag>>5&1,31&this.tag);switch(b){case 0:switch(c){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString";default:return"Universal_"+c.toString(16)}case 1:return"Application_"+c.toString(16);case 2:return"["+c+"]";case 3:return"Private_"+c.toString(16)}},c.prototype.reSeemsASCII=/^[ -~]+$/,c.prototype.content=function(){if(this.tag===a)return null;var b=this.tag>>6,c=31&this.tag,f=this.posContent(),g=Math.abs(this.length);if(0!==b){if(null!==this.sub)return"("+this.sub.length+" elem)";var h=this.stream.parseStringISO(f,f+Math.min(g,d));return this.reSeemsASCII.test(h)?h.substring(0,2*d)+(h.length>2*d?e:""):this.stream.parseOctetString(f,f+g)}switch(c){case 1:return 0===this.stream.get(f)?"false":"true";case 2:return this.stream.parseInteger(f,f+g);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(f,f+g);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(f,f+g);case 6:return this.stream.parseOID(f,f+g);case 16:case 17:return"("+this.sub.length+" elem)";case 12:return this.stream.parseStringUTF(f,f+g);case 18:case 19:case 20:case 21:case 22:case 26:return this.stream.parseStringISO(f,f+g);case 30:return this.stream.parseStringBMP(f,f+g);case 23:case 24:return this.stream.parseTime(f,f+g)}return null},c.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},c.prototype.print=function(b){if(b===a&&(b=""),document.writeln(b+this),null!==this.sub){b+=" ";for(var c=0,d=this.sub.length;d>c;++c)this.sub[c].print(b)}},c.prototype.toPrettyString=function(b){b===a&&(b="");var c=b+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(c+="+"),c+=this.length,32&this.tag?c+=" (constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(c+=" (encapsulates)"),c+="\n",null!==this.sub){b+=" ";for(var d=0,e=this.sub.length;e>d;++d)c+=this.sub[d].toPrettyString(b)}return c},c.prototype.toDOM=function(){var a=f.tag("div","node");a.asn1=this;var b=f.tag("div","head"),c=this.typeName().replace(/_/g," ");b.innerHTML=c;var d=this.content();if(null!==d){d=String(d).replace(/</g,"<");var e=f.tag("span","preview");e.appendChild(f.text(d)),b.appendChild(e)}a.appendChild(b),this.node=a,this.head=b;var g=f.tag("div","value");if(c="Offset: "+this.stream.pos+"<br/>",c+="Length: "+this.header+"+",c+=this.length>=0?this.length:-this.length+" (undefined)",32&this.tag?c+="<br/>(constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(c+="<br/>(encapsulates)"),null!==d&&(c+="<br/>Value:<br/><b>"+d+"</b>","object"==typeof oids&&6==this.tag)){var h=oids[d];h&&(h.d&&(c+="<br/>"+h.d),h.c&&(c+="<br/>"+h.c),h.w&&(c+="<br/>(warning!)"))}g.innerHTML=c,a.appendChild(g);var i=f.tag("div","sub");if(null!==this.sub)for(var j=0,k=this.sub.length;k>j;++j)i.appendChild(this.sub[j].toDOM());return a.appendChild(i),b.onclick=function(){a.className="node collapsed"==a.className?"node":"node collapsed"},a},c.prototype.posStart=function(){return this.stream.pos},c.prototype.posContent=function(){return this.stream.pos+this.header},c.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},c.prototype.fakeHover=function(a){this.node.className+=" hover",a&&(this.head.className+=" hover")},c.prototype.fakeOut=function(a){var b=/ ?hover/;this.node.className=this.node.className.replace(b,""),a&&(this.head.className=this.head.className.replace(b,""))},c.prototype.toHexDOM_sub=function(a,b,c,d,e){if(!(d>=e)){var g=f.tag("span",b);g.appendChild(f.text(c.hexDump(d,e))),a.appendChild(g)}},c.prototype.toHexDOM=function(b){var c=f.tag("span","hex");if(b===a&&(b=c),this.head.hexNode=c,this.head.onmouseover=function(){this.hexNode.className="hexCurrent"},this.head.onmouseout=function(){this.hexNode.className="hex"},c.asn1=this,c.onmouseover=function(){var a=!b.selected;a&&(b.selected=this.asn1,this.className="hexCurrent"),this.asn1.fakeHover(a)},c.onmouseout=function(){var a=b.selected==this.asn1;this.asn1.fakeOut(a),a&&(b.selected=null,this.className="hex")},this.toHexDOM_sub(c,"tag",this.stream,this.posStart(),this.posStart()+1),this.toHexDOM_sub(c,this.length>=0?"dlen":"ulen",this.stream,this.posStart()+1,this.posContent()),null===this.sub)c.appendChild(f.text(this.stream.hexDump(this.posContent(),this.posEnd())));else if(this.sub.length>0){var d=this.sub[0],e=this.sub[this.sub.length-1];this.toHexDOM_sub(c,"intro",this.stream,this.posContent(),d.posStart());for(var g=0,h=this.sub.length;h>g;++g)c.appendChild(this.sub[g].toHexDOM(b));this.toHexDOM_sub(c,"outro",this.stream,e.posEnd(),this.posEnd())}return c},c.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},c.decodeLength=function(a){var b=a.get(),c=127&b;if(c==b)return c;if(c>3)throw"Length over 24 bits not supported at position "+(a.pos-1);if(0===c)return-1;b=0;for(var d=0;c>d;++d)b=b<<8|a.get();return b},c.hasContent=function(a,d,e){if(32&a)return!0;if(3>a||a>4)return!1;var f=new b(e);3==a&&f.get();var g=f.get();if(g>>6&1)return!1;try{var h=c.decodeLength(f);return f.pos-e.pos+h==d}catch(i){return!1}},c.decode=function(a){a instanceof b||(a=new b(a,0));var d=new b(a),e=a.get(),f=c.decodeLength(a),g=a.pos-d.pos,h=null;if(c.hasContent(e,f,a)){var i=a.pos;if(3==e&&a.get(),h=[],f>=0){for(var j=i+f;a.pos<j;)h[h.length]=c.decode(a);if(a.pos!=j)throw"Content size is not correct for container starting at offset "+i}else try{for(;;){var k=c.decode(a);if(0===k.tag)break;h[h.length]=k}f=i-a.pos}catch(l){throw"Exception while decoding undefined length content: "+l}}else a.pos+=f;return new c(d,g,f,e,h)},c.test=function(){for(var a=[{value:[39],expected:39},{value:[129,201],expected:201},{value:[131,254,220,186],expected:16702650}],d=0,e=a.length;e>d;++d){var f=new b(a[d].value,0),g=c.decodeLength(f);g!=a[d].expected&&document.write("In test["+d+"] expected "+a[d].expected+" got "+g+"\n")}},window.ASN1=c}(),ASN1.prototype.getHexStringValue=function(){var a=this.toHexString(),b=2*this.header,c=2*this.length;return a.substr(b,c)},RSAKey.prototype.parseKey=function(a){try{var b=0,c=0,d=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,e=d.test(a)?Hex.decode(a):Base64.unarmor(a),f=ASN1.decode(e);if(9===f.sub.length){b=f.sub[1].getHexStringValue(),this.n=parseBigInt(b,16),c=f.sub[2].getHexStringValue(),this.e=parseInt(c,16);var g=f.sub[3].getHexStringValue();this.d=parseBigInt(g,16);var h=f.sub[4].getHexStringValue();this.p=parseBigInt(h,16);var i=f.sub[5].getHexStringValue();this.q=parseBigInt(i,16);var j=f.sub[6].getHexStringValue();this.dmp1=parseBigInt(j,16);var k=f.sub[7].getHexStringValue();this.dmq1=parseBigInt(k,16);var l=f.sub[8].getHexStringValue();this.coeff=parseBigInt(l,16)}else{if(2!==f.sub.length)return!1;var m=f.sub[1],n=m.sub[0];b=n.sub[0].getHexStringValue(),this.n=parseBigInt(b,16),c=n.sub[1].getHexStringValue(),this.e=parseInt(c,16)}return!0}catch(o){return!1}},RSAKey.prototype.getPrivateBaseKey=function(){var a={array:[new KJUR.asn1.DERInteger({"int":0}),new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({"int":this.e}),new KJUR.asn1.DERInteger({bigint:this.d}),new KJUR.asn1.DERInteger({bigint:this.p}),new KJUR.asn1.DERInteger({bigint:this.q}),new KJUR.asn1.DERInteger({bigint:this.dmp1}),new KJUR.asn1.DERInteger({bigint:this.dmq1}),new KJUR.asn1.DERInteger({bigint:this.coeff})]},b=new KJUR.asn1.DERSequence(a);return b.getEncodedHex()},RSAKey.prototype.getPrivateBaseKeyB64=function(){return hex2b64(this.getPrivateBaseKey())},RSAKey.prototype.getPublicBaseKey=function(){var a={array:[new KJUR.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new KJUR.asn1.DERNull]},b=new KJUR.asn1.DERSequence(a);a={array:[new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({"int":this.e})]};var c=new KJUR.asn1.DERSequence(a);a={hex:"00"+c.getEncodedHex()};var d=new KJUR.asn1.DERBitString(a);a={array:[b,d]};var e=new KJUR.asn1.DERSequence(a);return e.getEncodedHex()},RSAKey.prototype.getPublicBaseKeyB64=function(){return hex2b64(this.getPublicBaseKey())},RSAKey.prototype.wordwrap=function(a,b){if(b=b||64,!a)return a;var c="(.{1,"+b+"})( +|$\n?)|(.{1,"+b+"})";return a.match(RegExp(c,"g")).join("\n")},RSAKey.prototype.getPrivateKey=function(){var a="-----BEGIN RSA PRIVATE KEY-----\n";return a+=this.wordwrap(this.getPrivateBaseKeyB64())+"\n",a+="-----END RSA PRIVATE KEY-----"},RSAKey.prototype.getPublicKey=function(){var a="-----BEGIN PUBLIC KEY-----\n";return a+=this.wordwrap(this.getPublicBaseKeyB64())+"\n",a+="-----END PUBLIC KEY-----"},RSAKey.prototype.hasPublicKeyProperty=function(a){return a=a||{},a.hasOwnProperty("n")&&a.hasOwnProperty("e")},RSAKey.prototype.hasPrivateKeyProperty=function(a){return a=a||{},a.hasOwnProperty("n")&&a.hasOwnProperty("e")&&a.hasOwnProperty("d")&&a.hasOwnProperty("p")&&a.hasOwnProperty("q")&&a.hasOwnProperty("dmp1")&&a.hasOwnProperty("dmq1")&&a.hasOwnProperty("coeff")},RSAKey.prototype.parsePropertiesFrom=function(a){this.n=a.n,this.e=a.e,a.hasOwnProperty("d")&&(this.d=a.d,this.p=a.p,this.q=a.q,this.dmp1=a.dmp1,this.dmq1=a.dmq1,this.coeff=a.coeff)};var JSEncryptRSAKey=function(a){RSAKey.call(this),a&&("string"==typeof a?this.parseKey(a):(this.hasPrivateKeyProperty(a)||this.hasPublicKeyProperty(a))&&this.parsePropertiesFrom(a))};JSEncryptRSAKey.prototype=new RSAKey,JSEncryptRSAKey.prototype.constructor=JSEncryptRSAKey;var JSEncrypt=function(a){a=a||{},this.default_key_size=parseInt(a.default_key_size)||1024,this.default_public_exponent=a.default_public_exponent||"010001",this.log=a.log||!1,this.key=null};JSEncrypt.prototype.setKey=function(a){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new JSEncryptRSAKey(a)},JSEncrypt.prototype.setPrivateKey=function(a){this.setKey(a)},JSEncrypt.prototype.setPublicKey=function(a){this.setKey(a)},JSEncrypt.prototype.decrypt=function(a){try{return this.getKey().decrypt(b64tohex(a))}catch(b){return!1}},JSEncrypt.prototype.encrypt=function(a){try{return hex2b64(this.getKey().encrypt(a))}catch(b){return!1}},JSEncrypt.prototype.getKey=function(a){if(!this.key){if(this.key=new JSEncryptRSAKey,a&&"[object Function]"==={}.toString.call(a))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,a);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},JSEncrypt.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},JSEncrypt.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},JSEncrypt.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},JSEncrypt.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()};exports.JSEncrypt = JSEncrypt; -})(JSEncryptExports); -var JSEncrypt = JSEncryptExports.JSEncrypt; diff --git a/alarm/node_modules/pronote-api/src/cas/generics/kdecole-educonnect.js b/alarm/node_modules/pronote-api/src/cas/generics/kdecole-educonnect.js deleted file mode 100644 index 28db408..0000000 --- a/alarm/node_modules/pronote-api/src/cas/generics/kdecole-educonnect.js +++ /dev/null @@ -1,30 +0,0 @@ -const jsdom = require('jsdom'); - -const { getDOM, submitForm, extractStart } = require('../api'); -const edu = require('./educonnect'); - -async function login({ url, account, username, password, casUrl, idp }) -{ - - const jar = new jsdom.CookieJar(); - - // Select EduConnect - let dom = await getDOM({ - url: `https://${casUrl}/login?&selection=${idp}&service=${url}&submit=Valider`, - jar, - followRedirects: true - }); - - - // Send SAML Request to EduConnect - dom = await submitForm({ - dom, - jar - }); - - await edu({ dom, jar, username, password }); - - return extractStart(await getDOM({ url: url + account.value + '.html', jar, asIs: true })); -} - -module.exports = login; diff --git a/alarm/node_modules/pronote-api/src/cas/generics/kdecole-wayf.js b/alarm/node_modules/pronote-api/src/cas/generics/kdecole-wayf.js deleted file mode 100644 index 7d20163..0000000 --- a/alarm/node_modules/pronote-api/src/cas/generics/kdecole-wayf.js +++ /dev/null @@ -1,45 +0,0 @@ -const jsdom = require('jsdom'); - -const { getDOM, submitForm, extractStart } = require('../api'); -const aten = require('./aten'); - -async function login({ url, account, username, password, casUrl, idp, atenURL }) -{ - if (idp && !idp.includes('parent_eleve')) { - idp += '_parent_eleve'; - } - - casUrl = `https://${casUrl}/`; - - const jar = new jsdom.CookieJar(); - let dom = await getDOM({ - url: `${casUrl}login?${idp ? `selection=${idp}&` : ''}service=${encodeURIComponent(url)}`, - jar - }); - - if (atenURL) { - dom = await submitForm({ - dom, - jar, - runScripts: !!atenURL, - hook: atenURL && aten.hook, - actionRoot: casUrl - }); - - await aten.submit({ dom, jar, username, password, atenURL }); - } else { - dom.window.document.getElementById('username').value = username; - dom.window.document.getElementById('password').value = password; - - await submitForm({ - actionRoot: casUrl, - dom, - jar, - asIs: true - }); - } - - return extractStart(await getDOM({ url: url + account.value + '.html', jar, asIs: true })); -} - -module.exports = login; diff --git a/alarm/node_modules/pronote-api/src/cas/generics/openent.js b/alarm/node_modules/pronote-api/src/cas/generics/openent.js deleted file mode 100644 index 7e3fa29..0000000 --- a/alarm/node_modules/pronote-api/src/cas/generics/openent.js +++ /dev/null @@ -1,31 +0,0 @@ -const jsdom = require('jsdom'); - -const http = require('../../http'); -const { getDOM, extractStart } = require('../api'); - -async function login({ url, account, username, password, target }) -{ - const location = await http({ url, followRedirects: 'get' }); - - let service = encodeURIComponent(url); - if (location.startsWith('http') && location.includes('service=')) { - service = location.substring(location.indexOf('=') + 1); - } - - const jar = new jsdom.CookieJar(); - - await getDOM({ - url: `https://${target}/auth/login`, - jar, - method: 'POST', - data: { - email: username, - password, - callback: `/cas/login?service=${service}` - } - }); - - return extractStart(await getDOM({ url: url + account.value + '.html', jar, asIs: true })); -} - -module.exports = login; diff --git a/alarm/node_modules/pronote-api/src/cas/generics/wayf.js b/alarm/node_modules/pronote-api/src/cas/generics/wayf.js deleted file mode 100644 index cca79c7..0000000 --- a/alarm/node_modules/pronote-api/src/cas/generics/wayf.js +++ /dev/null @@ -1,34 +0,0 @@ -const jsdom = require('jsdom'); - -const { getParams, getDOM, extractStart } = require('../api'); -const aten = require('./aten'); - -async function login({ url, username, password, startURL, wayfURL, atenURL, extraParams }) -{ - const jar = new jsdom.CookieJar(); - - let dom = await getDOM({ - url: `${startURL}login?service=${encodeURIComponent(url)}`, - jar - }); - - dom = await getDOM({ - url: `${wayfURL}WAYF`, - jar, - data: { ...getParams(dom), ...extraParams }, - runScripts: true, - hook: aten.hook - }); - - dom = await aten.submit({ - dom, - jar, - username, - password, - atenURL - }); - - return extractStart(dom); -} - -module.exports = login; diff --git a/alarm/node_modules/pronote-api/src/cas/haute-garonne.js b/alarm/node_modules/pronote-api/src/cas/haute-garonne.js deleted file mode 100644 index 4db97dc..0000000 --- a/alarm/node_modules/pronote-api/src/cas/haute-garonne.js +++ /dev/null @@ -1,11 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.ecollege.haute-garonne.fr', - idp: 'ATS_parent_eleve' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/hdf.js b/alarm/node_modules/pronote-api/src/cas/hdf.js deleted file mode 100644 index 6b03118..0000000 --- a/alarm/node_modules/pronote-api/src/cas/hdf.js +++ /dev/null @@ -1,10 +0,0 @@ -const openent = require('./generics/openent'); - -module.exports = (url, account, username, password) => openent({ - url, - account, - username, - password, - - target: 'enthdf.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/iledefrance.js b/alarm/node_modules/pronote-api/src/cas/iledefrance.js deleted file mode 100644 index e32dfa5..0000000 --- a/alarm/node_modules/pronote-api/src/cas/iledefrance.js +++ /dev/null @@ -1,10 +0,0 @@ -const openent = require('./generics/openent'); - -module.exports = (url, account, username, password) => openent({ - url, - account, - username, - password, - - target: 'ent.iledefrance.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/index.js b/alarm/node_modules/pronote-api/src/cas/index.js deleted file mode 100644 index e893f3a..0000000 --- a/alarm/node_modules/pronote-api/src/cas/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable array-element-newline */ - -const find = require('./find'); - -const CAS = [ - 'ac-besancon', 'ac-bordeaux', 'ac-bordeaux2', 'ac-caen', 'ac-clermont', 'ac-dijon', - 'ac-grenoble', 'ac-lille', 'ac-limoges', 'ac-lyon', 'ac-montpellier', - 'ac-nancy-metz', 'ac-nantes', 'ac-orleans-tours', 'ac-poitiers', - 'ac-reims', 'ac-rouen', 'ac-strasbourg', 'ac-toulouse', - - 'agora06', 'arsene76', 'atrium-sud', - - 'haute-garonne', 'hdf', 'iledefrance', 'seine-et-marne', 'somme', 'eure-normandie', - 'parisclassenumerique', 'ljr-munich', - - 'toutatice', 'laclasse', 'lyceeconnecte', 'portail-famille', 'cybercolleges42', - 'ac-valdoise', 'ac-lille2', 'moncollege-essonne', 'monbureaunumerique-educonnect', - - 'none' -]; - -module.exports = { - getCAS: find, - list: CAS -}; - -for (const cas of CAS) { - // eslint-disable-next-line node/global-require - module.exports[cas] = require('./' + cas); -} - diff --git a/alarm/node_modules/pronote-api/src/cas/laclasse.js b/alarm/node_modules/pronote-api/src/cas/laclasse.js deleted file mode 100644 index ea1d5d3..0000000 --- a/alarm/node_modules/pronote-api/src/cas/laclasse.js +++ /dev/null @@ -1,22 +0,0 @@ -const { getDOM, getParams, extractStart } = require('./api'); - -const LOGIN_URL = 'https://www.laclasse.com/sso/login'; - -async function login(url, account, username, password) -{ - const service = encodeURIComponent(url); - - return extractStart(await getDOM({ - url: LOGIN_URL, - method: 'POST', - data: { - service, - state: getParams(await getDOM({ url: `${LOGIN_URL}?service=${service}` })).state, - username, - password - }, - asIs: true - })); -} - -module.exports = login; diff --git a/alarm/node_modules/pronote-api/src/cas/ljr-munich.js b/alarm/node_modules/pronote-api/src/cas/ljr-munich.js deleted file mode 100644 index b500139..0000000 --- a/alarm/node_modules/pronote-api/src/cas/ljr-munich.js +++ /dev/null @@ -1,11 +0,0 @@ -const wayf = require('./generics/kdecole-wayf'); - -module.exports = (url, account, username, password) => wayf({ - url, - account, - username, - password, - - casUrl: 'cas.kosmoseducation.com', - idp: 'MUNICH-SKO' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/lyceeconnecte.js b/alarm/node_modules/pronote-api/src/cas/lyceeconnecte.js deleted file mode 100644 index 5cb3cce..0000000 --- a/alarm/node_modules/pronote-api/src/cas/lyceeconnecte.js +++ /dev/null @@ -1,10 +0,0 @@ -const openent = require('./generics/openent'); - -module.exports = (url, account, username, password) => openent({ - url, - account, - username, - password, - - target: 'mon.lyceeconnecte.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/monbureaunumerique-educonnect.js b/alarm/node_modules/pronote-api/src/cas/monbureaunumerique-educonnect.js deleted file mode 100644 index 1b74ef0..0000000 --- a/alarm/node_modules/pronote-api/src/cas/monbureaunumerique-educonnect.js +++ /dev/null @@ -1,11 +0,0 @@ -const educonnect = require('./generics/kdecole-educonnect'); - -module.exports = (url, account, username, password) => educonnect({ - url, - account, - username, - password, - - casUrl: 'cas.monbureaunumerique.fr', - idp: 'EDU' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/moncollege-essonne.js b/alarm/node_modules/pronote-api/src/cas/moncollege-essonne.js deleted file mode 100644 index 800a8ce..0000000 --- a/alarm/node_modules/pronote-api/src/cas/moncollege-essonne.js +++ /dev/null @@ -1,10 +0,0 @@ -const openent = require('./generics/openent'); - -module.exports = (url, account, username, password) => openent({ - url, - account, - username, - password, - - target: 'www.moncollege-ent.essonne.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/none.js b/alarm/node_modules/pronote-api/src/cas/none.js deleted file mode 100644 index 2fa72cf..0000000 --- a/alarm/node_modules/pronote-api/src/cas/none.js +++ /dev/null @@ -1,9 +0,0 @@ -const http = require('../http'); -const { extractStart } = require('./api'); - -async function login(url, account) -{ - return extractStart(await http({ url: url + account.value + '.html?login=true' })); -} - -module.exports = login; diff --git a/alarm/node_modules/pronote-api/src/cas/parisclassenumerique.js b/alarm/node_modules/pronote-api/src/cas/parisclassenumerique.js deleted file mode 100644 index 4512a28..0000000 --- a/alarm/node_modules/pronote-api/src/cas/parisclassenumerique.js +++ /dev/null @@ -1,10 +0,0 @@ -const openent = require('./generics/openent'); - -module.exports = (url, account, username, password) => openent({ - url, - account, - username, - password, - - target: 'ent.parisclassenumerique.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/portail-famille.js b/alarm/node_modules/pronote-api/src/cas/portail-famille.js deleted file mode 100644 index 49fed2a..0000000 --- a/alarm/node_modules/pronote-api/src/cas/portail-famille.js +++ /dev/null @@ -1,11 +0,0 @@ -const aten = require('./generics/aten'); - -module.exports = (url, account, username, password) => aten.login({ - url, - account, - username, - password, - - startURL: 'https://seshat.ac-orleans-tours.fr:8443/identite/discovery?idp_ident=urn:fi:ac-orleans_EXT:ts:1.0', - atenURL: 'portail-famille.ac-orleans-tours.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/seine-et-marne.js b/alarm/node_modules/pronote-api/src/cas/seine-et-marne.js deleted file mode 100644 index 9111fd4..0000000 --- a/alarm/node_modules/pronote-api/src/cas/seine-et-marne.js +++ /dev/null @@ -1,10 +0,0 @@ -const openent = require('./generics/openent'); - -module.exports = (url, account, username, password) => openent({ - url, - account, - username, - password, - - target: 'ent77.seine-et-marne.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/somme.js b/alarm/node_modules/pronote-api/src/cas/somme.js deleted file mode 100644 index 8aca523..0000000 --- a/alarm/node_modules/pronote-api/src/cas/somme.js +++ /dev/null @@ -1,10 +0,0 @@ -const openent = require('./generics/openent'); - -module.exports = (url, account, username, password) => openent({ - url, - account, - username, - password, - - target: 'college.entsomme.fr' -}); diff --git a/alarm/node_modules/pronote-api/src/cas/toutatice.js b/alarm/node_modules/pronote-api/src/cas/toutatice.js deleted file mode 100644 index 84c10b0..0000000 --- a/alarm/node_modules/pronote-api/src/cas/toutatice.js +++ /dev/null @@ -1,74 +0,0 @@ -const jsdom = require('jsdom'); -const axioRequest = require('../axioRequest') - -const { getDOM, submitForm, extractStart } = require('./api'); -const educonnect = require('./generics/educonnect'); -const querystring = require('querystring'); -const http = require('../http'); - -async function login(url, account, username, password) { - const jar = new jsdom.CookieJar(); - let dom = await getDOM({ - url: 'https://www.toutatice.fr/portail/auth/pagemarker/2/MonEspace', - jar - }); - - dom = await submitForm({ - dom, - jar, - actionRoot: 'https://www.toutatice.fr/wayf/', - extraParams: { - // eslint-disable-next-line camelcase - _saml_idp: 'educonnect' - } - }); - dom = await educonnect({ dom, jar, url, account, username, password }); - - let redirectURL = dom.window.document.getElementsByTagName('a')[0].href - - let response = await axioRequest({ - url: redirectURL, - jar - }) - - redirectURL = getOrigin(redirectURL) + response.headers.location - - const parsed = querystring.parse(redirectURL.split('?')[1]) - const conversation = parsed.conversation - const sessionid = parsed.sessionid - - // eslint-disable-next-line max-len - redirectURL = `${getOrigin(redirectURL)}/idp/Authn/RemoteUser?conversation=${conversation}&redirectToLoaderRemoteUser=0&sessionid=${sessionid}` - - response = await axioRequest({ - url: redirectURL, - jar - }) - // eslint-disable-next-line max-len - const remoteUserParsed = response.data.match(/<conversation>(.+)<\/conversation><uidInSession>(.+)<\/uidInSession>/u) - - const remoteUserConversation = remoteUserParsed[1] - const uidInSession = remoteUserParsed[2] - - // eslint-disable-next-line max-len - redirectURL = `${getOrigin(redirectURL)}/idp/Authn/RemoteUser?conversation=${remoteUserConversation}&uidInSession=${uidInSession}&sessionid=${sessionid}` - - response = await http({ - url: redirectURL, - jar, - followRedirects: true - }) - - return extractStart(await getDOM({ - url: `${url}${account.value}.html`, - jar, - asIs: true - })) -} - -function getOrigin(url) { - const noProtocol = url.substring(url.indexOf('/') + 2); - return url.substring(0, url.indexOf('/')) + '//' + noProtocol.substring(0, noProtocol.indexOf('/')); -} - -module.exports = login; diff --git a/alarm/node_modules/pronote-api/src/cipher.js b/alarm/node_modules/pronote-api/src/cipher.js deleted file mode 100644 index 350de5b..0000000 --- a/alarm/node_modules/pronote-api/src/cipher.js +++ /dev/null @@ -1,118 +0,0 @@ -const forge = require('node-forge'); -const pako = require('pako'); - -function initCipher(session, keyModulus, keyExponent) -{ - session.aesIV = generateIV(); - - session.publicKey = forge.pki.rsa.setPublicKey( - new forge.jsbn.BigInteger(keyModulus, 16), - new forge.jsbn.BigInteger(keyExponent, 16) - ); -} - -function cipher(session, data, { key, compress, disableIV } = {}) -{ - data = forge.util.encodeUtf8('' + data); - if (compress && !session.disableCompress) { - data = deflate(data); - } - - const cipher = createCipher(session, key, false, disableIV); - cipher.update(new forge.util.ByteBuffer(data)); - - return cipher.finish() && cipher.output.toHex(); -} - -function decipher(session, data, { compress, scrambled, key, asBytes } = {}) -{ - const cipher = createCipher(session, key, true); - cipher.update(new forge.util.ByteBuffer(forge.util.hexToBytes(data))); - - let result = cipher.finish() && cipher.output.bytes(); - if (compress && !session.disableCompress) { - result = inflate(result); - } - - result = forge.util.decodeUtf8(result); - - if (scrambled) { - const unscrambled = new Array(result.length); - for (let i = 0; i < result.length; i += 1) { - if (i % 2 === 0) { - unscrambled.push(result.charAt(i)); - } - } - - return unscrambled.join(''); - } - - if (asBytes) { - const buffer = new forge.util.ByteBuffer(); - const split = result.split(','); - - for (let i = 0; i < split.length; i++) { - buffer.putInt(parseInt(split[i])); - } - - return buffer; - } - - return result; -} - -function createCipher(session, key, decipher, disableIV = false) -{ - if (!key) { - key = session.aesKey || new forge.util.ByteBuffer(); - } - - const cipher = forge.cipher[decipher ? 'createDecipher' : 'createCipher']('AES-CBC', md5(key)); - const iv = disableIV ? new forge.util.ByteBuffer() : md5(session.aesIV); - - cipher.start({ iv }); - - return cipher; -} - -function md5(buffer) -{ - return forge.md.md5.create().update(buffer.bytes()).digest(); -} - -function deflate(data) -{ - return pako.deflateRaw(new forge.util.ByteBuffer(data).toHex(), { level: 6, to: 'string' }); -} - -function inflate(data) -{ - return pako.inflateRaw(data, { to: 'string' }); -} - -function generateIV() -{ - return new forge.util.ByteBuffer(forge.random.generate(16)); -} - -function getUUID(session, iv) -{ - return forge.util.encode64(session.publicKey.encrypt(iv.bytes()), 64); -} - -function getLoginKey(username, password, scramble, fromCas) -{ - const hash = forge.md.sha256.create().update(scramble || '').update(forge.util.encodeUtf8(password)).digest(); - const key = (fromCas ? '' : username.toLowerCase()) + hash.toHex().toUpperCase(); - - return new forge.util.ByteBuffer(forge.util.encodeUtf8(key)); -} - -module.exports = { - initCipher, - - cipher, - decipher, - getUUID, - getLoginKey -}; diff --git a/alarm/node_modules/pronote-api/src/data/dates.js b/alarm/node_modules/pronote-api/src/data/dates.js deleted file mode 100644 index 52377ba..0000000 --- a/alarm/node_modules/pronote-api/src/data/dates.js +++ /dev/null @@ -1,82 +0,0 @@ -function toPronoteWeek(session, date) -{ - const firstWeek = toUTCWeek(session.params.firstDay); - const week = toUTCWeek(date); - - if (week >= firstWeek) { - return week - firstWeek + 1; - } - - return 52 - (firstWeek - week) + 1; // Trust me this works -} - -function toUTCWeek(date) -{ - const firstDay = new Date((new Date()).getFullYear(), 0, 1); - return Math.ceil((((date - firstDay) / 86400000) + firstDay.getDay() + 1) / 7); -} - -function toPronoteDay(session, date) -{ - return Math.ceil((date - session.params.firstDay) / 86400000); -} - -function fromPronoteDay(session, day) -{ - const date = new Date(session.params.firstDay.getTime()); - date.setDate(date.getDate() + day - 1); - - return date; -} - -function toPronoteDate(date) -{ - return `${date.getDate()}/${date.getMonth() + 1}/${date.getFullYear()} ` + - `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`; -} - -function fromPronoteHours(hours) -{ - return ~~hours[0] + ~~hours.substring(2) / 60; -} - -function parseDate(string) -{ - const date = new Date(); - const split = string.split(' '); - - const day = split[0].split('/'); - - date.setFullYear(~~day[2], (~~day[1]) - 1, ~~day[0]); - date.setMilliseconds(0); - - if (split.length > 1) - { - const time = split[1].split(':'); - - date.setHours(~~time[0]); - date.setMinutes(~~time[1]); - date.setSeconds(~~time[2]); - } - else - { - date.setHours(0); - date.setMinutes(0); - date.setSeconds(0); - } - - return date; -} - -module.exports = { - toPronoteWeek, - toUTCWeek, - - toPronoteDay, - fromPronoteDay, - - toPronoteDate, - parseDate, - - fromPronoteHours -}; diff --git a/alarm/node_modules/pronote-api/src/data/files.js b/alarm/node_modules/pronote-api/src/data/files.js deleted file mode 100644 index aea0e8e..0000000 --- a/alarm/node_modules/pronote-api/src/data/files.js +++ /dev/null @@ -1,14 +0,0 @@ -const { toPronote } = require('./objects'); -const { cipher } = require('../cipher'); - -const EXTERNAL_FILES_FOLDER = 'FichiersExternes/'; - -function getFileURL(session, { id, name, type }) -{ - const fileID = cipher(session, JSON.stringify(toPronote({ id, type }))); - const fileName = encodeURIComponent(encodeURIComponent(name)); // *Clown emoji* - - return session.server + EXTERNAL_FILES_FOLDER + fileID + '/' + fileName + '?Session=' + session.id; -} - -module.exports = { getFileURL }; diff --git a/alarm/node_modules/pronote-api/src/data/html.js b/alarm/node_modules/pronote-api/src/data/html.js deleted file mode 100644 index 33a4f0d..0000000 --- a/alarm/node_modules/pronote-api/src/data/html.js +++ /dev/null @@ -1,16 +0,0 @@ -const { stripHtml } = require('string-strip-html'); - -function fromHTML(text) -{ - if (!text) { - if (text === undefined) { - return null; - } - - return text; - } - - return stripHtml(text).result; -} - -module.exports = fromHTML; diff --git a/alarm/node_modules/pronote-api/src/data/id.js b/alarm/node_modules/pronote-api/src/data/id.js deleted file mode 100644 index 2c3c2d3..0000000 --- a/alarm/node_modules/pronote-api/src/data/id.js +++ /dev/null @@ -1,33 +0,0 @@ -const { h64 } = require('xxhashjs'); - -function withId(obj, fields, extraData) -{ - const result = {}; - for (const field of fields) { - result[field] = obj[field]; - } - - if (extraData) { - result.__extraData = extraData; - } - - return { - id: h64(JSON.stringify(result), 0).toString(16), - ...obj - }; -} - -function checkDuplicates(objs) -{ - for (const obj of objs) { - const duplicates = objs.filter(o => o.id === obj.id); - - if (duplicates.length > 1) { - duplicates.forEach((d, i) => d.id = d.id.substring(0, d.id.length - 1) + i); - } - } - - return objs; -} - -module.exports = { withId, checkDuplicates }; diff --git a/alarm/node_modules/pronote-api/src/data/objects.js b/alarm/node_modules/pronote-api/src/data/objects.js deleted file mode 100644 index 5cc985e..0000000 --- a/alarm/node_modules/pronote-api/src/data/objects.js +++ /dev/null @@ -1,44 +0,0 @@ -function fromPronote({ N, L, G, ...obj } = {}, fn = null, gName = 'type') { - const result = {}; - - if (typeof fn === 'string') { - gName = fn; - fn = null; - } - - if (N) { - result.id = N; - } - if (L) { - result.name = L; - } - if (G !== undefined && gName) { - result[gName] = G; - } - - return { - ...result, - ...(fn ? fn(G && gName ? obj : { G, ...obj }) : {}) - }; -} - -function toPronote({ id, name, type } = {}) { - const result = {}; - - if (id) { - result.N = id; - } - if (name) { - result.L = name; - } - if (type) { - result.G = type; - } - - return result; -} - -module.exports = { - fromPronote, - toPronote -}; diff --git a/alarm/node_modules/pronote-api/src/data/periods.js b/alarm/node_modules/pronote-api/src/data/periods.js deleted file mode 100644 index a13039d..0000000 --- a/alarm/node_modules/pronote-api/src/data/periods.js +++ /dev/null @@ -1,24 +0,0 @@ -function getPeriodBy(session, period, type = null) -{ - const Type = ['trimester', 'semester', 'year']; - const periods = session.params.periods; - if (!type || Type.indexOf(type) === -1) { - type = 'trimester' - } - if (!period) { - const now = Date.now(); - return periods.find(p => now >= p.from && now <= p.to && p.kind === type) || periods[5]; - } else if (typeof period === 'string') { - for (const p of periods) { - if (p.name === period) { - return p; - } - } - } - - return period; -} - -module.exports = { - getPeriodBy -}; diff --git a/alarm/node_modules/pronote-api/src/data/types.js b/alarm/node_modules/pronote-api/src/data/types.js deleted file mode 100644 index a77e35f..0000000 --- a/alarm/node_modules/pronote-api/src/data/types.js +++ /dev/null @@ -1,87 +0,0 @@ -const { fromPronote } = require('./objects'); - -function parseDate(str) -{ - const date = new Date(); - const split = str.split(' '); - - const day = split[0].split('/'); - - date.setFullYear(~~day[2], (~~day[1]) - 1, ~~day[0]); - date.setMilliseconds(0); - - if (split.length > 1) { - const time = split[1].split(':'); - - date.setHours(~~time[0]); - date.setMinutes(~~time[1]); - date.setSeconds(~~time[2]); - } else { - date.setHours(0); - date.setMinutes(0); - date.setSeconds(0); - } - - return date; -} - -function parseRange(str) -{ - const content = str.substring(1, str.length - 1).split(','); - const result = []; - - for (const val of content) { - if (val.includes('..')) { - const index = val.indexOf('..'); - for (let i = ~~val.substring(0, index); i <= ~~val.substring(index + 2); i++) { - result.push(i); - } - } else { - result.push(~~val); - } - } - - return result; -} - -function parse({ _T: type, V: value } = {}, f = null, g = 'type') -{ - if (!value) { - if (value === undefined) { - return null; - } - - return value; - } - - switch (type) { - case 7: // Date - return parseDate(value); - case 8: // ? (Range) - case 11: // ? (Range) - case 26: // ? (Range) - return parseRange(value); - case 10: // Mark / Number - value = value.replace('|', '-'); - - if (value.indexOf(',') !== -1) { - return parseFloat(value.replace(',', '.')); - } - - return ~~value; - case 21: // HTML content - case 23: // URL - case 24: // Object (includes Array) - case 25: // Resource - default: - if (f !== false && value.map) { - return value.map(o => fromPronote(o, f, g)); - } else if (f !== false && (value.N || value.L)) { - return fromPronote(value, f, g); - } - - return value; - } -} - -module.exports = parse; diff --git a/alarm/node_modules/pronote-api/src/errors.js b/alarm/node_modules/pronote-api/src/errors.js deleted file mode 100644 index 5bb6e17..0000000 --- a/alarm/node_modules/pronote-api/src/errors.js +++ /dev/null @@ -1,30 +0,0 @@ -const PRONOTE = error(-1, ({ title, message }) => title + (title && message ? ' - ' : '') + message); -const UNKNOWN_CAS = error(1, cas => `Unknown CAS '${cas}' (use 'none' for no CAS)`); -const BANNED = error(2, 'Your IP address is temporarily banned because of too many failed authentication attempts'); -const WRONG_CREDENTIALS = error(3, 'Wrong user credentials'); -const UNKNOWN_ACCOUNT = error(4, typeAccount => `Unknown account type '${typeAccount}'`); -const SESSION_EXPIRED = error(5, 'Session has expired due to inactivity or error'); -const RATE_LIMITED = error(6, 'You are being rate limited because of too many failed requests'); -const CLOSED = error(7, 'The instance is closed, try again later'); - -function error(code, message) -{ - return { - code, - drop: (...args) => ({ - code, - message: typeof message === 'string' ? message : message(...args) - }) - } -} - -module.exports = { - PRONOTE, - UNKNOWN_CAS, - BANNED, - WRONG_CREDENTIALS, - UNKNOWN_ACCOUNT, - SESSION_EXPIRED, - RATE_LIMITED, - CLOSED -}; diff --git a/alarm/node_modules/pronote-api/src/fetch/absences.js b/alarm/node_modules/pronote-api/src/fetch/absences.js deleted file mode 100644 index 9c1ac02..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/absences.js +++ /dev/null @@ -1,114 +0,0 @@ -const { getPeriodBy } = require('../data/periods'); -const { withId, checkDuplicates } = require('../data/id'); - -const getAbsences = require('./pronote/absences'); - -// eslint-disable-next-line complexity -async function absences(session, user, period = null, from = null, to = null, type = null) -{ - const result = { - absences: [], - delays: [], - punishments: [], - other: [], - totals: [] - }; - - const p = getPeriodBy(session, !period && !type && from && to ? 'Trimestre 1' : period, type); - const absences = await getAbsences(session, user, p, from || p.from, to || p.to); - if (!absences) { - return null; - } - - for (const event of absences.events) { - // eslint-disable-next-line default-case - switch (event.type) { - case 'absence': - result.absences.push(withId({ - from: event.from, - to: event.to, - justified: event.justified, - solved: event.solved, - hours: event.hours, - reason: event.reasons.length && event.reasons[0].name || '' - }, ['from', 'to'])); - break; - case 'delay': - result.delays.push(withId({ - date: event.date, - justified: event.justified, - solved: event.solved, - justification: event.justification, - minutesMissed: event.duration, - reason: event.reasons.length && event.reasons[0].name || '' - }, ['data', 'minutesMissed'])); - break; - case 'punishment': - // eslint-disable-next-line no-case-declarations - let detention = null; - if (event.nature.type === 1) { - const schedule = event.schedule[0]; - const hour = session.params.firstHour.getHours() + schedule.position / session.params.ticksPerHour; - - const from = new Date(schedule.date.getTime()); - const to = new Date(schedule.date.getTime()); - - from.setHours(from.getHours() + hour); - to.setHours(to.getHours() + hour); - to.setMinutes(to.getMinutes() + schedule.duration); - - detention = { from, to }; - } - - result.punishments.push(withId({ - date: event.date, - isExclusion: event.isExclusion, - isDuringLesson: !event.isNotDuringLesson, - homework: event.homework, - circumstances: event.circumstances, - giver: event.giver.name, - reason: event.reasons.length && event.reasons[0].name || '', - detention - }, ['data'])); - break; - case 'other': - result.other.push(withId({ - kind: event.name, - date: event.date, - giver: event.giver.name, - comment: event.comment, - subject: event.subject && event.subject.name || null - }, ['kind', 'date'])); - break; - } - } - - Object.values(result).forEach(checkDuplicates); - - if (absences.subjects) { - for (const subject of absences.subjects) { - if (subject.inGroup) { - continue; - } - - const res = parseSubject(subject); - if (subject.group) { - res.subs = absences.subjects.filter(s => s.inGroup === subject.group).map(s => parseSubject(s)); - } - - result.totals.push(res); - } - } - - return result; -} - -function parseSubject(subject) { - return { - subject: subject.name, - hoursAssisted: subject.hoursAssisted, - hoursMissed: subject.hoursMissed - }; -} - -module.exports = absences; diff --git a/alarm/node_modules/pronote-api/src/fetch/contents.js b/alarm/node_modules/pronote-api/src/fetch/contents.js deleted file mode 100644 index 62e85df..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/contents.js +++ /dev/null @@ -1,51 +0,0 @@ -const { toPronoteWeek } = require('../data/dates'); -const { getFileURL } = require('../data/files'); -const fromHTML = require('../data/html'); -const { withId, checkDuplicates } = require('../data/id'); - -const getContents = require('./pronote/contents'); - -async function contents(session, user, from = new Date(), to = null) -{ - if (!to || to < from) { - to = new Date(from.getTime()); - to.setDate(to.getDate() + 1); - } - - const fromWeek = toPronoteWeek(session, from); - const toWeek = toPronoteWeek(session, to); - - const contents = await getContents(session, user, fromWeek, toWeek); - if (!contents) { - return null; - } - - const result = []; - - for (const lesson of contents.lessons) { - if (lesson.from < from || lesson.to > to) { - continue; - } - - const content = lesson.content[0]; // Maybe on some instances there will be multiple entries ? Check this - if (typeof content === 'undefined') { - continue; - } - result.push(withId({ - subject: lesson.subject.name, - teachers: lesson.teachers.map(t => t.name), - from: lesson.from, - to: lesson.to, - color: lesson.color, - title: content.name, - description: fromHTML(content.description), - htmlDescription: content.htmlDescription, - files: content.files.map(f => withId({ name: f.name, url: getFileURL(session, f) }, ['name'])), - category: content.category.name - }, ['subject', 'from', 'to'])); - } - - return checkDuplicates(result).sort((a, b) => a.from - b.from); -} - -module.exports = contents; diff --git a/alarm/node_modules/pronote-api/src/fetch/evaluations.js b/alarm/node_modules/pronote-api/src/fetch/evaluations.js deleted file mode 100644 index dca1b9f..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/evaluations.js +++ /dev/null @@ -1,65 +0,0 @@ -const { getPeriodBy } = require('../data/periods'); -const { withId, checkDuplicates } = require('../data/id'); - -const getEvaluations = require('./pronote/evaluations'); - -async function evaluations(session, user, period = null, type = null) -{ - const evaluations = await getEvaluations(session, user, getPeriodBy(session, period, type)); - if (!evaluations) { - return null; - } - - const result = []; - - if (!evaluations) { - return null; - } - - for (const evaluation of evaluations) { - let subject = result.find(s => s.name === evaluation.subject.name); - if (!subject) { - const { position, name, color } = evaluation.subject; - subject = { - position, - name, - teacher: evaluation.teacher.name, - color, - evaluations: [] - }; - - result.push(subject); - } - - subject.evaluations.push(withId({ - name: evaluation.name, - date: evaluation.date, - coefficient: evaluation.coefficient, - levels: evaluation.acquisitionLevels.map(({ name, position, value, item, domain, pillar }) => ({ - name: item && item.name || domain.name, - position, - value: { - short: value, - long: name - }, - prefixes: !pillar.prefixes[0] ? [] : pillar.prefixes - })) - }, ['name', 'date'], subject.name)); - } - - result.forEach(s => checkDuplicates(s.evaluations)); - - result.sort((a, b) => a.position - b.position); - result.forEach(s => { - s.evaluations.forEach(e => { - e.levels.sort((a, b) => a.position - b.position); - e.levels.forEach(l => delete l.position); - }); - - return delete s.position; - }); - - return result; -} - -module.exports = evaluations; diff --git a/alarm/node_modules/pronote-api/src/fetch/files.js b/alarm/node_modules/pronote-api/src/fetch/files.js deleted file mode 100644 index 7703ee4..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/files.js +++ /dev/null @@ -1,32 +0,0 @@ -const { parseDate } = require('../data/dates'); -const { getFileURL } = require('../data/files'); -const { withId, checkDuplicates } = require('../data/id'); - -const getFiles = require('./pronote/files'); - -async function files(session, user) { - const files = await getFiles(session, user); - if (!files) { - return null; - } - - const result = []; - - const subjects = {}; - for (const subject of files.listeMatieres.V) { - subjects[subject.N] = subject.L; - } - - for (const file of files.listeRessources.V) { - result.push(withId({ - time: parseDate(file.date.V), - subject: subjects[file.matiere.V.N], - name: file.ressource.V.L, - url: getFileURL(session, { id: file.ressource.V.N, name: file.ressource.V.L, type: file.ressource.V.G }) - }, 'subject', 'name')); - } - - return checkDuplicates(result); -} - -module.exports = files; diff --git a/alarm/node_modules/pronote-api/src/fetch/homeworks.js b/alarm/node_modules/pronote-api/src/fetch/homeworks.js deleted file mode 100644 index 7f2146b..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/homeworks.js +++ /dev/null @@ -1,45 +0,0 @@ -const { toPronoteWeek } = require('../data/dates'); -const { getFileURL } = require('../data/files'); -const fromHTML = require('../data/html'); -const { withId, checkDuplicates } = require('../data/id'); - -const getHomeworks = require('./pronote/homeworks'); - -async function homeworks(session, user, from = new Date(), to = null) -{ - if (!to || to < from) { - to = new Date(from.getTime()); - to.setDate(to.getDate() + 1); - } - - const fromWeek = toPronoteWeek(session, from); - const toWeek = toPronoteWeek(session, to); - - const homeworks = await getHomeworks(session, user, fromWeek, toWeek); - if (!homeworks) { - return null; - } - - const result = []; - - for (const homework of homeworks) { - if (homework.for < from || homework.for > to) { - continue; - } - - result.push(withId({ - description: fromHTML(homework.description), - htmlDescription: homework.description, - subject: homework.subject.name, - givenAt: homework.givenAt, - for: homework.for, - done: homework.done, - color: homework.color, - files: homework.files.map(f => withId({ name: f.name, url: getFileURL(session, f) }, ['name'])) - }, 'subject', 'givenAt')); - } - - return checkDuplicates(result).sort((a, b) => a.for - b.for); -} - -module.exports = homeworks; diff --git a/alarm/node_modules/pronote-api/src/fetch/infos.js b/alarm/node_modules/pronote-api/src/fetch/infos.js deleted file mode 100644 index 0ec03a7..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/infos.js +++ /dev/null @@ -1,33 +0,0 @@ -const { getFileURL } = require('../data/files'); -const fromHTML = require('../data/html'); -const { withId, checkDuplicates } = require('../data/id'); - -const getInfos = require('./pronote/infos'); - -async function infos(session, user) -{ - const infos = await getInfos(session, user); - if (!infos) { - return null; - } - - const result = []; - - for (const info of infos.infos) - { - result.push(withId({ - date: info.date, - title: info.name, - author: info.author.name, - content: fromHTML(info.content[0].text), - htmlContent: info.content[0].text, - files: info.content[0].files.map(f => withId({ name: f.name, url: getFileURL(session, f) }, ['name'])) - }, ['date', 'title'])); - } - - checkDuplicates(result).sort((a, b) => a.date - b.date); - - return result; -} - -module.exports = infos; diff --git a/alarm/node_modules/pronote-api/src/fetch/marks.js b/alarm/node_modules/pronote-api/src/fetch/marks.js deleted file mode 100644 index 1e57e85..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/marks.js +++ /dev/null @@ -1,73 +0,0 @@ -const { getPeriodBy } = require('../data/periods'); -const { withId, checkDuplicates } = require('../data/id'); - -const getMarks = require('./pronote/marks'); - -async function marks(session, user, period = null, type = null) -{ - const marks = await getMarks(session, user, getPeriodBy(session, period, type)); - if (!marks) { - return null; - } - - const result = { - subjects: [], - averages: {} - }; - - if (marks.studentAverage) { - result.averages.student = Number((marks.studentAverage / marks.studentAverageScale * 20).toFixed(2)); - } - if (marks.studentClassAverage) { - result.averages.studentClass = Number(marks.studentClassAverage.toFixed(2)); - } - - for (const subject of marks.subjects.sort((a, b) => a.order - b.order)) { - result.subjects.push({ - name: subject.name, - averages: { - student: subject.studentAverage / subject.studentAverageScale * 20, - studentClass: subject.studentClassAverage, - max: subject.maxAverage, - min: subject.minAverage - }, - color: subject.color, - marks: [] - }); - } - - for (const mark of marks.marks) { - const subject = result.subjects.find(s => s.name === mark.subject.name); - if (!subject) { - continue; - } - - const res = { - isAway: mark.value < 0 - }; - - if (!res.isAway) { - res.value = mark.value; - } - - if (mark.average >= 0) { - res.min = mark.min; - res.max = mark.max; - res.average = mark.average; - } - - subject.marks.push(withId({ - title: mark.title, - ...res, - scale: mark.scale, - coefficient: mark.coefficient, - date: mark.date - }, ['title', 'date'], subject.name)); - } - - result.subjects.forEach(s => checkDuplicates(s.marks)); - - return result; -} - -module.exports = marks; diff --git a/alarm/node_modules/pronote-api/src/fetch/menu.js b/alarm/node_modules/pronote-api/src/fetch/menu.js deleted file mode 100644 index 6f2872c..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/menu.js +++ /dev/null @@ -1,41 +0,0 @@ -const getMenu = require('./pronote/menu'); - -async function menu(session, user, from = new Date(), to = null) -{ - if (!to || to < from) { - to = new Date(from.getTime()); - to.setDate(to.getDate() + 1); - to.setHours(to.getHours() - 1); - } - - const result = []; - const date = new Date(from.getTime()); - - // eslint-disable-next-line no-unmodified-loop-condition - while (date < to) { - const menus = await getMenu(session, user, date); - if (!menus) { - return null; - } - - for (const menu of menus.menus) { - if (menu.date < from || menu.date > to) { - continue; - } - - result.push({ - date: menu.date, - meals: menu.meals.map(m => m.content.map(c => c.lines.map(({ name, labels }) => ({ - name, - labels: labels.map(({ name, color }) => ({ name, color })) - })))) - }); - } - - date.setDate(date.getDate() + 7); - } - - return result; -} - -module.exports = menu; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/absences.js b/alarm/node_modules/pronote-api/src/fetch/pronote/absences.js deleted file mode 100644 index 19bf2dc..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/absences.js +++ /dev/null @@ -1,164 +0,0 @@ -const parse = require('../../data/types'); -const { toPronote } = require('../../data/objects'); -const { toPronoteDate } = require('../../data/dates'); -const { fromPronoteHours } = require('../../data/dates'); - -const navigate = require('./navigate'); - -const PAGE_NAME = 'PagePresence'; -const TAB_ID = 19; -const ACCOUNTS = ['student', 'parent']; - -async function getAbsences(session, user, period, from, to) -{ - const absences = await navigate(session, user, PAGE_NAME, TAB_ID, ACCOUNTS, { - DateDebut: { - _T: 7, - V: toPronoteDate(from) - }, - DateFin: { - _T: 7, - V: toPronoteDate(to) - }, - periode: period.name ? toPronote(period) : period - }); - - if (!absences) { - return null; - } - - return { - authorizations: (a => ({ - absences: a.absence, - fillAbsenceReason: a.saisieMotifAbsence, - delays: a.retard, - fillDelayReason: a.saisieMotifRetard, - punishments: a.punition, - exclusions: a.exclusion, - sanctions: a.sanction, - conservatoryMesures: a.mesureConservatoire, - infirmary: a.infirmerie, - mealAbsences: a.absenceRepas, - internshipAbsences: a.absenceInternat, - observations: a.observation, - incidents: a.incident, - totalHoursMissed: a.totalHeuresManquees - }))(absences.autorisations), - events: parse(absences.listeAbsences, a => parseEvent(a), false), - subjects: parse(absences.Matieres, ({ - P, regroupement, dansRegroupement, suivi, absence, excluCours, excluEtab - }) => ({ - position: P, - group: regroupement, - inGroup: dansRegroupement, - hoursAssisted: suivi / 3600, - hoursMissed: absence / 3600, - lessonExclusions: excluCours, - establishmentExclusions: excluEtab - })), - recaps: parse(absences.listeRecapitulatifs, ({ NombreTotal, NbrHeures, NombreNonJustifie }) => ({ - count: NombreTotal, - unjustifiedCount: NombreNonJustifie, - hours: fromPronoteHours(NbrHeures) - })), - sanctions: parse(absences.listeSanctionUtilisateur) // TODO: Check values - }; -} - -function parseEvent(a) -{ - switch (a.page.Absence) { - case 13: - return { - type: 'absence', - ...parseAbsence(a) - }; - case 14: - return { - type: 'delay', - ...parseDelay(a) - }; - case 41: - return { - type: 'punishment', - ...parsePunishment(a) - }; - case 45: - return { - type: 'other', - ...parseOther(a) - }; - default: - return { - type: 'unknown', - ...a - }; - } -} - -function parseAbsence(a) -{ - return { - from: parse(a.dateDebut), - to: parse(a.dateFin), - opened: a.ouverte, - solved: a.reglee, - justified: a.justifie, - hours: fromPronoteHours(a.NbrHeures), - days: a.NbrJours, - reasons: parse(a.listeMotifs) - } -} - -function parseDelay(a) -{ - return { - date: parse(a.date), - solved: a.reglee, - justified: a.justifie, - justification: a.justification, - duration: a.duree, - reasons: parse(a.listeMotifs) - }; -} - -function parsePunishment(a) -{ - return { - date: parse(a.dateDemande), - isExclusion: a.estUneExclusion, - isNotDuringLesson: a.horsCours, - homework: a.travailAFaire, - isBoundToIncident: a.estLieAUnIncident, - circumstances: a.circonstances, - duration: a.duree, - giver: parse(a.demandeur), - isSchedulable: a.estProgrammable, - reasons: parse(a.listeMotifs), - schedule: parse(a.programmation, ({ date, placeExecution, duree }) => ({ - date: parse(date), - position: placeExecution, - duration: duree - })), - nature: a.nature && parse(a.nature, ({ estProgrammable, estAvecARParent }) => ({ - isSchedulable: estProgrammable, - requiresParentsMeeting: estAvecARParent - })) - } -} - -function parseOther(a) -{ - return { - date: parse(a.date), - giver: parse(a.demandeur, ({ estProfPrincipal, mail }) => ({ - isHeadTeacher: estProfPrincipal, - mail - })), - comment: a.commentaire, - read: a.estLue, - subject: parse(a.matiere) - }; -} - -module.exports = getAbsences; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/auth.js b/alarm/node_modules/pronote-api/src/fetch/pronote/auth.js deleted file mode 100644 index 9c1d566..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/auth.js +++ /dev/null @@ -1,43 +0,0 @@ -const request = require('../../request'); -const { cipher } = require('../../cipher'); - -async function getId(session, username, fromCas) -{ - const { donnees: id } = await request(session, 'Identification', { - donnees: { - genreConnexion: 0, - genreEspace: session.type.id, - identifiant: username, - pourENT: fromCas, - enConnexionAuto: false, - demandeConnexionAuto: false, - demandeConnexionAppliMobile: false, - demandeConnexionAppliMobileJeton: false, - uuidAppliMobile: '', - loginTokenSAV: '' - } - }); - - return { - scramble: id.alea, - challenge: id.challenge - }; -} - -async function getAuthKey(session, challenge, key) -{ - const { donnees: auth } = await request(session, 'Authentification', { - donnees: { - connexion: 0, - challenge: cipher(session, challenge, { key }), - espace: session.type.id - } - }); - - return auth.cle; -} - -module.exports = { - getId, - getAuthKey -}; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/contents.js b/alarm/node_modules/pronote-api/src/fetch/pronote/contents.js deleted file mode 100644 index 7525e3d..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/contents.js +++ /dev/null @@ -1,60 +0,0 @@ -const parse = require('../../data/types'); -const { fromPronote } = require('../../data/objects'); - -const navigate = require('./navigate'); - -const PAGE_NAME = 'PageCahierDeTexte'; -const TAB_ID = 89; -const ACCOUNTS = ['student', 'parent']; - -async function getContents(session, user, fromWeek = 1, toWeek = null) -{ - if (!toWeek || toWeek < fromWeek) { - toWeek = fromWeek; - } - - const contents = await navigate(session, user, PAGE_NAME, TAB_ID, ACCOUNTS, { - domaine: { - _T: 8, - V: `[${fromWeek}..${toWeek}]` - } - }); - - if (!contents) { - return null; - } - - return { - lessons: parse(contents.ListeCahierDeTextes, ({ - cours, verrouille, listeGroupes, Matiere, CouleurFond, listeProfesseurs, Date, DateFin, - listeContenus, listeElementsProgrammeCDT - }) => ({ - lesson: parse(cours), - locked: verrouille, - groups: parse(listeGroupes), // TODO: Check values - subject: parse(Matiere), - color: CouleurFond, - teachers: parse(listeProfesseurs), - from: parse(Date), - to: parse(DateFin), - content: parse(listeContenus, ({ - descriptif, categorie, parcoursEducatif, ListePieceJointe, training - }) => ({ - description: parse(descriptif), - category: parse(categorie), - path: parcoursEducatif, - files: parse(ListePieceJointe), - training: parse(training).ListeExecutionsQCM.map(o => fromPronote(o)) // TODO: Check values - })), - skills: parse(listeElementsProgrammeCDT) - })), - resources: (({ listeRessources, listeMatieres }) => ({ - resources: parse(listeRessources), // TODO: Check values - subjects: parse(listeMatieres) // TODO: Check values - }))(parse(contents.ListeRessourcesPedagogiques)), - // TODO: Check values - numericalResources: parse(parse(contents.ListeRessourcesNumeriques).listeRessources) - }; -} - -module.exports = getContents; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/evaluations.js b/alarm/node_modules/pronote-api/src/fetch/pronote/evaluations.js deleted file mode 100644 index c9065fd..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/evaluations.js +++ /dev/null @@ -1,49 +0,0 @@ -const parse = require('../../data/types'); -const { toPronote } = require('../../data/objects'); - -const navigate = require('./navigate'); - -const PAGE_NAME = 'DernieresEvaluations'; -const TAB_ID = 201; -const ACCOUNTS = ['student', 'parent']; - -async function getEvaluations(session, user, period) -{ - const evaluations = await navigate(session, user, PAGE_NAME, TAB_ID, ACCOUNTS, { - periode: period.name ? toPronote(period) : period - }); - - if (!evaluations) { - return null; - } - - return parse(evaluations.listeEvaluations, ({ - listeNiveauxDAcquisitions, listePaliers, matiere, individu, coefficient, descriptif, date, periode - }) => ({ - title: descriptif, - acquisitionLevels: parse(listeNiveauxDAcquisitions, ({ - abbreviation, ordre, pilier, coefficient, domaine, item - }) => ({ - position: ordre, - value: abbreviation, - pillar: parse(pilier, ({ strPrefixes }) => ({ - prefixes: strPrefixes.split(', ') - })), - coefficient, - domain: parse(domaine), - item: item && parse(item) || null - })), - levels: parse(listePaliers), - subject: parse(matiere, ({ couleur, ordre, serviceConcerne }) => ({ - position: ordre, - service: parse(serviceConcerne), - color: couleur - })), - teacher: parse(individu), - coefficient, - date: parse(date), - period: parse(periode) - })); -} - -module.exports = getEvaluations; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/files.js b/alarm/node_modules/pronote-api/src/fetch/pronote/files.js deleted file mode 100644 index 2871fbe..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/files.js +++ /dev/null @@ -1,16 +0,0 @@ -const navigate = require('./navigate'); - -const PAGE_NAME = 'RessourcePedagogique'; -const TAB_ID = 99; -const ACCOUNTS = ['student']; - -async function getFiles(session, user) -{ - return await navigate(session, user, PAGE_NAME, TAB_ID, ACCOUNTS, { - avecRessourcesPronote: true, - avecRessourcesEditeur: false - }); -} - - -module.exports = getFiles; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/homeworks.js b/alarm/node_modules/pronote-api/src/fetch/pronote/homeworks.js deleted file mode 100644 index 7d13c48..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/homeworks.js +++ /dev/null @@ -1,43 +0,0 @@ -const parse = require('../../data/types'); - -const navigate = require('./navigate'); - -const PAGE_NAME = 'PageCahierDeTexte'; -const TAB_ID = 88; -const ACCOUNTS = ['student', 'parent']; - -async function getHomeworks(session, user, fromWeek = 1, toWeek = null) -{ - if (!toWeek || toWeek < fromWeek) { - toWeek = fromWeek; - } - - const homeworks = await navigate(session, user, PAGE_NAME, TAB_ID, ACCOUNTS, { - domaine: { - _T: 8, - V: `[${fromWeek}..${toWeek}]` - } - }); - - if (!homeworks) { - return null; - } - - return parse(homeworks.ListeTravauxAFaire, ({ - descriptif, PourLe, TAFFait, niveauDifficulte, duree, cours, DonneLe, - Matiere, CouleurFond, ListePieceJointe - }) => ({ - description: parse(descriptif), - lesson: parse(cours), - subject: parse(Matiere), - givenAt: parse(DonneLe), - for: parse(PourLe), - done: TAFFait, - difficultyLevel: niveauDifficulte, - duration: duree, - color: CouleurFond, - files: parse(ListePieceJointe) - })); -} - -module.exports = getHomeworks; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/infos.js b/alarm/node_modules/pronote-api/src/fetch/pronote/infos.js deleted file mode 100644 index 6e05ce1..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/infos.js +++ /dev/null @@ -1,33 +0,0 @@ -const parse = require('../../data/types'); -const navigate = require('./navigate'); - -const PAGE_NAME = 'PageActualites'; -const TAB_ID = 8; -const ACCOUNTS = ['student', 'parent']; - -async function getInfos(session, user) -{ - const infos = await navigate(session, user, PAGE_NAME, TAB_ID, ACCOUNTS, { - estAuteur: false - }); - - if (!infos) { - return null; - } - - return { - categories: parse(infos.listeCategories, ({ estDefaut }) => ({ - isDefault: estDefaut - })), - infos: parse(infos.listeActualites, ({ dateDebut, elmauteur, listeQuestions }) => ({ - date: parse(dateDebut), - author: parse(elmauteur), - content: parse(listeQuestions, ({ texte, listePiecesJointes }) => ({ - text: parse(texte), - files: parse(listePiecesJointes) - })) - })) - }; -} - -module.exports = getInfos; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/keepAlive.js b/alarm/node_modules/pronote-api/src/fetch/pronote/keepAlive.js deleted file mode 100644 index 89705ec..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/keepAlive.js +++ /dev/null @@ -1,8 +0,0 @@ -const request = require('../../request'); - -async function keepAlive(session) -{ - await request(session, 'Presence'); -} - -module.exports = keepAlive; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/logout.js b/alarm/node_modules/pronote-api/src/fetch/pronote/logout.js deleted file mode 100644 index ede23e7..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/logout.js +++ /dev/null @@ -1,8 +0,0 @@ -const request = require('../../request'); - -async function logout(session) -{ - await request(session, 'SaisieDeconnexion'); -} - -module.exports = logout; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/marks.js b/alarm/node_modules/pronote-api/src/fetch/pronote/marks.js deleted file mode 100644 index dcb7644..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/marks.js +++ /dev/null @@ -1,71 +0,0 @@ -const parse = require('../../data/types'); -const { toPronote } = require('../../data/objects'); - -const navigate = require('./navigate'); - -const PAGE_NAME = 'DernieresNotes'; -const TAB_ID = 198; -const ACCOUNTS = ['student', 'parent']; - -async function getMarks(session, user, period) -{ - const marks = await navigate(session, user, PAGE_NAME, TAB_ID, ACCOUNTS, { - Periode: period.name ? toPronote(period) : period - }); - - if (!marks) { - return null; - } - - const result = {}; - - if (marks.moyGenerale) { - result.studentAverage = parse(marks.moyGenerale); - result.studentAverageScale = parse(marks.baremeMoyGenerale); - result.defaultStudentAverageScale = parse(marks.baremeMoyGeneraleParDefaut); - } - - if (marks.moyGeneraleClasse) { - result.studentClassAverage = parse(marks.moyGeneraleClasse); - } - - return { - ...result, - subjects: marks.avecDetailService && parse(marks.listeServices, ({ - ordre, estServiceEnGroupe, - moyEleve, baremeMoyEleve, baremeMoyEleveParDefaut, moyClasse, moyMax, moyMin, - couleur - }) => ({ - position: ordre, - isGroupSubject: estServiceEnGroupe, - studentAverage: parse(moyEleve), - studentAverageScale: parse(baremeMoyEleve), - defaultStudentAverageScale: parse(baremeMoyEleveParDefaut), - studentClassAverage: parse(moyClasse), - maxAverage: parse(moyMax), - minAverage: parse(moyMin), - color: couleur - })) || [], - marks: marks.avecDetailDevoir && parse(marks.listeDevoirs, ({ - note, bareme, baremeParDefaut, date, service, periode, moyenne, estEnGroupe, noteMax, noteMin, - commentaire, coefficient - }) => ({ - subject: parse(service, ({ couleur }) => ({ - color: couleur - })), - title: commentaire, - value: parse(note), - scale: parse(bareme), - average: parse(moyenne), - defaultScale: parse(baremeParDefaut), - coefficient, - min: parse(noteMin) || -1, - max: parse(noteMax) || -1, - date: parse(date), - period: parse(periode), - isGroupMark: estEnGroupe - })) || [] - }; -} - -module.exports = getMarks; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/menu.js b/alarm/node_modules/pronote-api/src/fetch/pronote/menu.js deleted file mode 100644 index 988c168..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/menu.js +++ /dev/null @@ -1,42 +0,0 @@ -const { toPronoteDate } = require('../../data/dates'); -const parse = require('../../data/types'); - -const navigate = require('./navigate'); - -const PAGE_NAME = 'PageMenus'; -const TAB_ID = 10; -const ACCOUNTS = ['student', 'parent']; - -async function getMenu(session, user, day = new Date()) -{ - const menu = await navigate(session, user, PAGE_NAME, TAB_ID, ACCOUNTS, { - date: { - _T: 7, - V: toPronoteDate(day) - } - }); - - if (!menu) { - return null; - } - - return { - hasLunch: menu.AvecRepasMidi, - hasDiner: menu.AvecRepasSoir, - filledWeeks: parse(menu.DomaineDePresence), - menus: parse(menu.ListeJours, false).map(({ Date, ListeRepas }) => ({ - date: parse(Date), - meals: parse(ListeRepas, ({ ListePlats }) => ({ - content: parse(ListePlats, ({ ListeAliments }) => ({ - lines: parse(ListeAliments, ({ listeLabelsAlimentaires }) => ({ - labels: parse(listeLabelsAlimentaires, ({ couleur }) => ({ - color: couleur - })) - })) - })) - })) - })) - }; -} - -module.exports = getMenu; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/navigate.js b/alarm/node_modules/pronote-api/src/fetch/pronote/navigate.js deleted file mode 100644 index edaa3d4..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/navigate.js +++ /dev/null @@ -1,23 +0,0 @@ -const { toPronote } = require('../../data/objects'); -const request = require('../../request'); - -async function navigate(session, user, page, tab, accounts, data) -{ - if (session.user.hiddenTabs.includes(tab) || !accounts.includes(session.type.name)) { - return null; - } - - const content = { - _Signature_: { - membre: toPronote(user), - onglet: tab - } - }; - if (data) { - content.donnees = data; - } - - return (await request(session, page, content)).donnees; -} - -module.exports = navigate; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/params.js b/alarm/node_modules/pronote-api/src/fetch/pronote/params.js deleted file mode 100644 index 12fc2e9..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/params.js +++ /dev/null @@ -1,141 +0,0 @@ -const parse = require('../../data/types'); -const { fromPronote } = require('../../data/objects'); - -const request = require('../../request'); - -const { getUUID } = require('../../cipher'); - -async function getParams(session) -{ - const { donnees: params } = await request(session, 'FonctionParametres', { - donnees: { Uuid: getUUID(session, session.aesIV) } - }); - - const general = params.General; - if (!general) { - return; - } - return { - navigatorId: params.identifiantNav, - fonts: parse(params.listePolices, false).map(o => o.L), - withMember: params.avecMembre, - forNewCaledonia: params.pourNouvelleCaledonie, - loginImageId: params.genreImageConnexion, - loginImageUrl: params.urlImageConnexion, - cssLogo: params.logoProduitCss, - theme: params.Theme, - serverTime: parse(params.DateServeurHttp), - mobileURL: params.URLMobile, - mobileSupport: params.AvecEspaceMobile, - title: params.Nom, - indexEducationWebsite: parse(general.urlSiteIndexEducation), - version: general.versionPN, - versionFull: general.version, - year: ~~general.millesime, - language: { id: general.langID, name: general.langue }, - supportedLanguages: parse(general.listeLangues, false).map(({ langID, description }) => ({ - id: langID, - name: description - })), - infoPage: general.lienMentions, - hasForum: general.avecForum, - helpURL: parse(general.UrlAide), - videosURL: parse(general.urlAccesVideos), - twitterURL: parse(general.urlAccesTwitter), - withLoginOptions: general.AvecChoixConnexion, - establishment: general.NomEtablissement, - displayWeeks: general.afficherSemainesCalendaires, - schoolYear: general.AnneeScolaire, - firstCycle: parse(general.dateDebutPremierCycle), - firstDay: parse(general.PremiereDate), - firstMonday: parse(general.PremierLundi), - lastDay: parse(general.DerniereDate), - ticksPerDay: general.PlacesParJour, - ticksPerHour: general.PlacesParHeure, - sequenceDuration: general.DureeSequence, - ticksForHalfDayAbsence: general.PlaceDemiJourneeAbsence, - hasLunch: general.activationDemiPension, - lunchStart: general.debutDemiPension, - lunchEnd: general.finDemiPension, - withPlainAfternoonHours: general.AvecHeuresPleinesApresMidi, - firstOrLastWorkingDay: parse(general.JourOuvre), - workingDays: parse(general.JoursOuvres), - lunchDays: parse(general.JoursDemiPension), - parentsChat: general.ActivationMessagerieEntreParents, - workingDaysPerCycle: general.joursOuvresParCycle, - firstDayOfWeek: general.premierJourSemaine, - timetableGridsInCycle: general.grillesEDTEnCycle, - workingDaysCycle: parse(general.setOfJoursCycleOuvre), - halfWorkingDays: general.DemiJourneesOuvrees.map(parse), - frequenciesRanges: general.DomainesFrequences.map(parse), - frequenciesLabels: general.LibellesFrequences, - defaultMarkMax: parse(general.BaremeNotation), - allowedAnnotations: parse(general.listeAnnotationsAutorisees), - acquisitionLevels: parse(general.ListeNiveauxDAcquisitions, ({ - listePositionnements, positionJauge, actifPour, abbreviation, raccourci, - couleur, ponderation, nombrePointsBrevet, estAcqui, estNotantPourTxReussite - }) => ({ - positions: parse(listePositionnements, ({ abbreviation, abbreviationAvecPrefixe }) => ({ - shortName: abbreviation, - shortNameWithPrefix: abbreviationAvecPrefixe - }), 'count'), - triggerPosition: positionJauge, - activeFor: parse(actifPour), - shortName: abbreviation, - shortPath: raccourci, - color: couleur, - weighting: parse(ponderation), - brevetPoints: parse(nombrePointsBrevet), - acquired: estAcqui, - countsForSuccess: estNotantPourTxReussite - }), 'count'), - displayAcquisitionShortLabel: general.AfficherAbbreviationNiveauDAcquisition, - withEvaluationHistory: general.AvecEvaluationHistorique, - withoutIntermediaryLevelAutoValidation: general.SansValidationNivIntermediairesDsValidAuto, - onlySchoolYearEvaluationsInAutoValidation: general.NeComptabiliserQueEvalsAnneeScoDsValidAuto, - CECRLLevelsSupport: general.AvecGestionNiveauxCECRL, - langActivityColor: general.couleurActiviteLangagiere, - minMarkMCQ: general.minBaremeQuestionQCM, - maxMarkMCQ: general.maxBaremeQuestionQCM, - maxPointsMCQ: general.maxNbPointQCM, - skillsGridLabelSize: general.tailleLibelleElementGrilleCompetence, - homeworkCommentSize: general.tailleCommentaireDevoir, - officeEnabled: general.O365_Actif, - officeFederatedMode: general.O365_ModeFederated, - officeTutorial: parse(general.O365_UrlTuto_Office), - oneDriveTutorial: parse(general.O365_UrlTuto_OneDrive), - connexionInfoRetrieval: general.AvecRecuperationInfosConnexion, - font: general.Police, - fontSize: general.TaillePolice, - attachedStudents: general.AvecElevesRattaches, - phoneMask: general.maskTelephone, - maxECTS: general.maxECTS, - maxAppreciationSizes: general.TailleMaxAppreciation, - publicHolidays: parse(general.listeJoursFeries, ({ dateDebut, dateFin }) => ({ - from: parse(dateDebut), - to: parse(dateFin) - })), - displaySequences: general.afficherSequences, - firstHour: parse(general.PremiereHeure), - hours: parse(general.ListeHeures, ({ A }) => ({ - round: A === undefined - }), 'count'), - endHours: parse(general.ListeHeuresFin, ({ A }) => ({ - round: A === undefined - }), 'count'), - sequences: general.sequences, - periods: general.ListePeriodes.map(p => fromPronote(p, ({ G, periodeNotation, dateDebut, dateFin }) => ({ - kind: G === 1 ? 'trimester' : (G === 2 ? 'semester' : (G === 3 ? 'year' : 'other')), - notationPeriod: periodeNotation, - from: parse(dateDebut), - to: parse(dateFin) - }), false)), - logo: parse(general.logo), - breaks: parse(general.recreations, ({ place }) => ({ - position: place - })), - appCookieName: general.nomCookieAppli - }; -} - -module.exports = getParams; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/timetable.js b/alarm/node_modules/pronote-api/src/fetch/pronote/timetable.js deleted file mode 100644 index a98b9ce..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/timetable.js +++ /dev/null @@ -1,81 +0,0 @@ -const parse = require('../../data/types'); -const { toPronote, fromPronote } = require('../../data/objects'); - -const navigate = require('./navigate'); - -const PAGE_NAME = 'PageEmploiDuTemps'; -const TAB_ID = 16; -const ACCOUNTS = ['student', 'parent']; - -async function getTimetable(session, user, week) -{ - const student = toPronote(session.user); - const timetable = await navigate(session, user, PAGE_NAME, TAB_ID, ACCOUNTS, { - avecAbsencesEleve: false, // TODO: Test what those parameters do - avecAbsencesRessource: true, - avecConseilDeClasse: true, - avecDisponibilites: true, - avecInfosPrefsGrille: true, - avecRessourceLibrePiedHoraire: false, - estEDTPermanence: false, - numeroSemaine: week, // *Clown emoji* - NumeroSemaine: week, - ressource: student, - Ressource: student - }); - - if (!timetable || !timetable.ListeCours) { - return null; - } - - let iCalURL = null; - if (timetable.avecExportICal) { - const id = timetable.ParametreExportiCal; - iCalURL = `${session.server}ical/Edt.ics?icalsecurise=${id}&version=${session.params.version}`; - } - - return { - hasCancelledLessons: timetable.avecCoursAnnule, - iCalURL, - lessons: timetable.ListeCours.map(o => fromPronote(o, ({ - place, duree, DateDuCours, CouleurFond, ListeContenus, AvecTafPublie, Statut, estAnnule, estRetenue, - dispenseEleve - }) => ({ - position: place, - duration: duree, - date: parse(DateDuCours), - status: Statut, - color: CouleurFond, - content: parse(ListeContenus), - hasHomework: AvecTafPublie, - isCancelled: !!estAnnule, - isDetention: !!estRetenue, - remoteLesson: !!dispenseEleve && dispenseEleve.V.maison - }))), - // I was unable to witness a filled "absences.joursCycle", so didn't include it - breaks: parse(timetable.recreations, ({ place }) => ({ - position: place - })) - }; -} - -async function getFilledDaysAndWeeks(session, user) -{ - const daysData = await navigate(session, user, PAGE_NAME + '_DomainePresence', TAB_ID, ACCOUNTS, { - Ressource: toPronote(session.user) - }); - - if (!daysData) { - return null; - } - - return { - filledWeeks: parse(daysData.Domaine), - filledDays: parse(daysData.joursPresence) - } -} - -module.exports = { - getTimetable, - getFilledDaysAndWeeks -}; diff --git a/alarm/node_modules/pronote-api/src/fetch/pronote/user.js b/alarm/node_modules/pronote-api/src/fetch/pronote/user.js deleted file mode 100644 index 54f62be..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/pronote/user.js +++ /dev/null @@ -1,183 +0,0 @@ -const request = require('../../request'); - -const parse = require('../../data/types'); -const { getFileURL } = require('../../data/files'); -const { fromPronote } = require('../../data/objects'); - -async function getUser(session) -{ - const { donnees: user } = await request(session, 'ParametresUtilisateur'); - const { data, authorizations } = getSpecificData(session, user); - - const res = user.ressource; - const aut = user.autorisations; - - return { - ...fromPronote(res), - ...data, - establishmentsInfo: parse(user.listeInformationsEtablissements, ({ Logo, Coordonnees }) => ({ - logoID: parse(Logo), - address: [Coordonnees.Adresse1, Coordonnees.Adresse2], - postalCode: Coordonnees.CodePostal, - postalLabel: Coordonnees.LibellePostal, - city: Coordonnees.LibelleVille, - province: Coordonnees.Province, - country: Coordonnees.Pays, - website: Coordonnees.SiteInternet - })), - userSettings: (({ version, EDT, theme, Communication }) => ({ - version, - timetable: { - displayCanceledLessons: EDT.afficherCoursAnnules, - invertAxis: EDT.axeInverseEDT, - invertWeeklyPlanAxis: EDT.axeInversePlanningHebdo, - invertDayPlanAxis: EDT.axeInversePlanningJour, - invertDay2PlanAxis: EDT.axeInversePlanningJour2, - dayCount: EDT.nbJours, - resourceCount: EDT.nbRessources, - daysInTimetable: EDT.nbJoursEDT, - sequenceCount: EDT.nbSequences - }, - theme: theme.theme, - unreadDiscussions: Communication.DiscussionNonLues - }))(user.parametresUtilisateur), - sessionAuthorizations: { - twitterManagement: user.autorisationsSession.fonctionnalites.gestionTwitter, - expandedAttestation: user.autorisationsSession.fonctionnalites.attestationEtendue - }, - authorizations: { - discussions: aut.AvecDiscussion, - teachersDiscussions: aut.AvecDiscussionProfesseurs, - timetableVisibleWeeks: parse(aut.cours.domaineConsultationEDT), - canEditLessons: parse(aut.cours.domaineModificationCours), - hideClassParts: aut.cours.masquerPartiesDeClasse, - maxEstablishmentFileSize: aut.tailleMaxDocJointEtablissement, - editPassword: aut.compte.avecSaisieMotDePasse, - editPersonalInfo: aut.compte.avecInformationsPersonnelles, - canPrint: aut.autoriserImpression, - ...authorizations - }, - minPasswordSize: user.reglesSaisieMDP.min, - maxPasswordSize: user.reglesSaisieMDP.max, - passwordRules: parse(user.reglesSaisieMDP.regles), - kioskAccess: user.autorisationKiosque, - tabs: user.listeOnglets.map(parseTab), - hiddenTabs: user.listeOngletsInvisibles, - notifiedTabs: user.listeOngletsNotification - }; -} - -function parseTab({ G: id, Onglet: subs }) -{ - return { id, subs: (subs || []).map(parseTab) }; -} - -function getSpecificData(session, data) -{ - switch (session.type.name) - { - case 'student': - return getStudentData(session, data); - case 'parent': - return getParentData(session, data); - case 'teacher': - - break; - case 'administration': - - break; - default: - return {}; - } -} - -function getStudentData(session, data) -{ - return { - data: getStudent(session, data.ressource), - authorizations: { - maxUserWorkFileSize: data.autorisations.tailleMaxRenduTafEleve - } - }; -} - -function getStudent(session, res) -{ - const avatar = {}; - if (res.avecPhoto) { - avatar.avatar = getFileURL(session, { - id: res.N, - name: 'photo.jpg' - }); - } - - return { - ...fromPronote(res), - establishment: parse(res.Etablissement), - ...avatar, - studentClass: fromPronote(res.classeDEleve), - classHistory: parse(res.listeClassesHistoriques, ({ AvecNote, AvecFiliere }) => ({ - hadMarks: AvecNote, - hadOptions: AvecFiliere - })), - groups: parse(res.listeGroupes), - tabsPillars: parse(res.listeOngletsPourPiliers, ({ listePaliers }) => ({ - levels: parse(listePaliers, ({ listePiliers }) => ({ - pillars: parse(listePiliers, ({ estPilierLVE, estSocleCommun, Service }) => ({ - isForeignLanguage: estPilierLVE, - isCoreSkill: estSocleCommun, - subject: Service && parse(Service) - })) - })) - }), 'tab'), - tabsPeriods: parse(res.listeOngletsPourPeriodes, ({ listePeriodes, periodeParDefaut }) => ({ - periods: parse(listePeriodes, ({ GenreNotation }) => ({ - isCorePeriod: GenreNotation === 1 - })), - defaultPeriod: parse(periodeParDefaut) - }), 'tab') - }; -} - -function getParentData(session, data) -{ - const res = data.ressource; - const aut = data.autorisations; - - return { - data: { - isDelegate: res.estDelegue, - isBDMember: res.estMembreCA, - canDiscussWithManagers: res.avecDiscussionResponsables, - absencesReasons: parse(data.listeMotifsAbsences), - delaysReasons: parse(data.listeMotifsRetards), - classDelegates: parse(res.listeClassesDelegue), - students: res.listeRessources.map(r => fromPronote(r, ({ listeSessions }) => ({ - ...getStudent(session, r), - sessions: parse(listeSessions, ({ date, strHeureDebut, strHeureFin }) => ({ - from: getDateWithHours(parse(date), strHeureDebut), - to: getDateWithHours(parse(date), strHeureFin) - })) - }))) - }, - authorizations: { - staffDiscussion: aut.AvecDiscussionPersonnels, - parentsDiscussion: aut.AvecDiscussionParents, - editStudentPassword: aut.compte.avecSaisieMotDePasseEleve, - editCoordinates: aut.compte.avecSaisieInfosPersoCoordonnees, - editAuthorizations: aut.compte.avecSaisieInfosPersoAutorisations - } - }; -} - -function getDateWithHours(date, hours) -{ - const h = hours.indexOf('h'); - - date.setHours(date.getHours() + ~~hours.substring(0, h)); - date.setMinutes(date.getMinutes() + ~~hours.substring(h)); - - return date; -} - -module.exports = getUser; diff --git a/alarm/node_modules/pronote-api/src/fetch/timetable.js b/alarm/node_modules/pronote-api/src/fetch/timetable.js deleted file mode 100644 index 059b849..0000000 --- a/alarm/node_modules/pronote-api/src/fetch/timetable.js +++ /dev/null @@ -1,95 +0,0 @@ -const { toPronoteWeek } = require('../data/dates'); -const { withId, checkDuplicates } = require('../data/id'); - -const { getFilledDaysAndWeeks, getTimetable } = require('./pronote/timetable'); - -async function timetable(session, user, from = new Date(), to = null) -{ - if (!to || to < from) { - to = new Date(from.getTime()); - to.setDate(to.getDate() + 1); - } - - const filled = await getFilledDaysAndWeeks(session, user); - if (!filled) { - return null; - } - - const fromWeek = toPronoteWeek(session, from); - const toWeek = toPronoteWeek(session, to); - - const weeks = []; - for (let i = fromWeek; i <= toWeek; i++) { - weeks.push(i); - } - - const result = []; - for (const week of weeks) { - const timetable = await getTimetable(session, user, week); - const lessons = getTimetableWeek(session, timetable); - - if (lessons) { - lessons.filter(l => l.from >= from && l.from <= to).forEach(lesson => { - if (!filled.filledWeeks.includes(week)) { - lesson.isCancelled = true; - } - - result.push(lesson); - }); - } - } - - return result.sort((a, b) => a.from - b.from); -} - -function getTimetableWeek(session, table) { - const result = []; - if (!table || !table.lessons) { - return - } - - for (const lesson of table.lessons) { - const from = lesson.date; - const to = new Date(from.getTime() + (lesson.duration / session.params.ticksPerHour * 3600000)); - - const res = { - from, - to, - isDetention: lesson.isDetention, - remoteLesson: lesson.remoteLesson, - status: lesson.status, - hasDuplicate: !!table.lessons.find(l => l.date.getTime() === from.getTime() && l !== lesson) - }; - - let room, subject, teacher; - if (lesson.isDetention) { - subject = lesson.content[0]; - teacher = lesson.content[1]; - room = lesson.content[2]; - } else { - if (lesson.content) { - subject = lesson.content.find(o => o.type === 16); - teacher = lesson.content.find(o => o.type === 3); - room = lesson.content.find(o => o.type === 17); - } else { - subject = 'Non défini'; - room = 'Non défini'; - teacher = 'Non défini'; - } - - res.isAway = (lesson.status || false) && !!lesson.status.match(/(.+)?prof(.+)?absent(.+)?/giu); - res.isCancelled = !res.isAway && lesson.isCancelled; - res.color = lesson.color; - } - - res.subject = subject && subject.name || null; - res.teacher = teacher && teacher.name || null; - res.room = room && room.name || null; - - result.push(withId(res, ['from', 'to', 'subject'])); - } - - return checkDuplicates(result); -} - -module.exports = timetable; diff --git a/alarm/node_modules/pronote-api/src/geo.js b/alarm/node_modules/pronote-api/src/geo.js deleted file mode 100644 index 6b2909c..0000000 --- a/alarm/node_modules/pronote-api/src/geo.js +++ /dev/null @@ -1,41 +0,0 @@ -const https = require('https'); - -function geo(lat, long) { - return new Promise((resolve, reject) => { - - const data = `data={"nomFonction": "geoLoc","lat": ${lat.toString()},"long": ${long.toString()}}`; - - const options = { - hostname: 'www.index-education.com', - port: 443, - path: '/swie/geoloc.php', - method: 'POST', - headers: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', - // eslint-disable-next-line max-len - 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1', - 'Content-Length': data.length - } - } - - let incomingData = ''; - const request = https.request(options, res => { - res.on('data', data => { - incomingData += data; - }); - res.on('end', () => { - const data = JSON.parse(incomingData); - resolve(Array.isArray(data) ? data : []); - }); - }); - - request.write(data); - request.end(); - - request.on('error', error => { - reject(error); - }); - }) -} - -module.exports = geo; diff --git a/alarm/node_modules/pronote-api/src/http.js b/alarm/node_modules/pronote-api/src/http.js deleted file mode 100644 index e83abf5..0000000 --- a/alarm/node_modules/pronote-api/src/http.js +++ /dev/null @@ -1,36 +0,0 @@ -const axioRequest = require('./axioRequest') - -async function http({ url, body, data, method = 'GET', binary, jar = null, followRedirects = true }) { - const response = await axioRequest({ - url, - body, - data, - method, - binary, - jar - }) - - if (response.headers.location && followRedirects) { - let location = response.headers.location; - if (!location.startsWith('http')) { - location = getOrigin(url) + location; - } - - if (followRedirects === 'get') { - return location; - } - - return await http({ - url: location, - jar - }); - } - return response.data; -} - -function getOrigin(url) { - const noProtocol = url.substring(url.indexOf('/') + 2); - return url.substring(0, url.indexOf('/')) + '//' + noProtocol.substring(0, noProtocol.indexOf('/')); -} - -module.exports = http; diff --git a/alarm/node_modules/pronote-api/src/request.js b/alarm/node_modules/pronote-api/src/request.js deleted file mode 100644 index 06ec411..0000000 --- a/alarm/node_modules/pronote-api/src/request.js +++ /dev/null @@ -1,50 +0,0 @@ -const { cipher, decipher } = require('./cipher'); -const errors = require('./errors'); -const http = require('./http'); - -async function request(session, name, content = {}) -{ - session.request += 2; - - const disableIV = session.request === 1; - - const order = cipher(session, session.request, { disableIV }); - const url = `${session.server}appelfonction/${session.type.id}/${session.id}/${order}`; - - let data = content; - if (!session.disableAES) { - data = cipher(session, JSON.stringify(content), { compress: true, disableIV }); - } - - const result = await http({ - url, - method: 'POST', - body: { - nom: name, - numeroOrdre: order, - session: session.id, - donneesSec: data - } - }); - - if (result.Erreur) { - const { Titre, Message } = result.Erreur; - - if (Titre.startsWith('La page a expiré !')) { - throw errors.SESSION_EXPIRED.drop(); - } - if (Message.startsWith('Vous avez dépassé le nombre')) { - throw errors.RATE_LIMITED.drop(); - } - - throw errors.PRONOTE.drop({ title: Titre, message: Message }); - } - - if (!session.disableAES) { - return JSON.parse(decipher(session, result.donneesSec, { compress: true })); - } - - return result.donneesSec; -} - -module.exports = request; diff --git a/alarm/node_modules/pronote-api/src/server/auth.js b/alarm/node_modules/pronote-api/src/server/auth.js deleted file mode 100644 index 54962a2..0000000 --- a/alarm/node_modules/pronote-api/src/server/auth.js +++ /dev/null @@ -1,49 +0,0 @@ -const { v4: uuid } = require('uuid'); - -const { loginStudent, loginParent } = require('../auth'); - -const sessions = {}; - -async function login({ url, username, password, cas, account = 'student' }) -{ - if (!url || !username || !password) { - throw { - http: 400, - message: 'Missing \'url\', or \'username\', or \'password\', or header \'Content-Type: application/json\'' - }; - } - - let func; - switch (account) { - case 'student': - func = loginStudent; - break; - case 'parent': - func = loginParent; - break; - default: - throw { - http: 400, - message: `Unknown account type '${account}'` - }; - } - - const token = uuid(); - sessions[token] = await func(url, username, password, cas); - - return { token }; -} - -// eslint-disable-next-line no-unused-vars -async function logout(_, token) -{ - delete sessions[token]; - return { success: true }; -} - -function getSession(token) -{ - return sessions[token]; -} - -module.exports = { login, logout, getSession }; diff --git a/alarm/node_modules/pronote-api/src/server/context.js b/alarm/node_modules/pronote-api/src/server/context.js deleted file mode 100644 index 9f34442..0000000 --- a/alarm/node_modules/pronote-api/src/server/context.js +++ /dev/null @@ -1,73 +0,0 @@ -function common(session) { - return { - params: () => session.params, - user: () => session.user, - - keepAlive: async () => { - await session.keepAlive(); - return true; - }, - logout: async () => { - await session.logout(); - return true; - }, - - setKeepAlive: async ({ enabled }) => { - await session.setKeepAlive(enabled); - return enabled; - } - }; -} - -function student(session) { - return { - timetable: ({ from, to }) => session.timetable(from, to), - marks: ({ period }) => session.marks(period), - evaluations: ({ period }) => session.evaluations(period), - absences: ({ period, from, to }) => session.absences(period, from, to), - infos: () => session.infos(), - contents: ({ from, to }) => session.contents(from, to), - homeworks: ({ from, to }) => session.homeworks(from, to), - menu: ({ from, to }) => session.menu(from, to), - files: () => session.files() - }; -} - -function parent(session) { - function getStudent(student) { - for (const s of session.user.students) { - if (s.id === student || s.name === student) { - return s; - } - } - - return null; - } - - return { - timetable: ({ student, from, to }) => session.timetable(getStudent(student), from, to), - marks: ({ student, period }) => session.marks(getStudent(student), period), - evaluations: ({ student, period }) => session.evaluations(getStudent(student), period), - absences: ({ student, period, from, to }) => session.absences(getStudent(student), period, from, to), - infos: ({ student }) => session.infos(getStudent(student)), - contents: ({ student, from, to }) => session.contents(getStudent(student), from, to), - homeworks: ({ student, from, to }) => session.homeworks(getStudent(student), from, to), - menu: ({ student, from, to }) => session.menu(getStudent(student), from, to), - files: ({ student }) => session.files(getStudent(student)) - }; -} - -function getContext(session) { - const result = common(session); - - switch (session.type.name) { - case 'student': - return { ...result, ...student(session) }; - case 'parent': - return { ...result, ...parent(session) }; - default: - return result; - } -} - -module.exports = getContext; diff --git a/alarm/node_modules/pronote-api/src/server/date.js b/alarm/node_modules/pronote-api/src/server/date.js deleted file mode 100644 index a35cd5a..0000000 --- a/alarm/node_modules/pronote-api/src/server/date.js +++ /dev/null @@ -1,20 +0,0 @@ -const { GraphQLScalarType, Kind } = require('graphql'); - -module.exports = new GraphQLScalarType({ - name: 'Date', - description: 'Equivalent of the JS Date type', - - parseValue(value) { - return new Date(value); - }, - serialize(value) { - return value.getTime(); - }, - parseLiteral(ast) { - if (ast.kind === Kind.INT) { - return new Date(parseInt(ast.value)); - } - - return new Date(ast.value); - } -}); diff --git a/alarm/node_modules/pronote-api/src/server/http.js b/alarm/node_modules/pronote-api/src/server/http.js deleted file mode 100644 index 66b07a5..0000000 --- a/alarm/node_modules/pronote-api/src/server/http.js +++ /dev/null @@ -1,57 +0,0 @@ -/* eslint no-console: off */ - -const polka = require('polka'); -const body = require('body-parser'); - -function start(host, port, handlers) -{ - const server = polka(); - server.use(body.json()); - - server.post('/auth/login', (req, res) => handle(req, res, handlers.login)); - server.post('/auth/logout', (req, res) => handle(req, res, handlers.logout)); - server.post('/graphql', (req, res) => handle(req, res, handlers.graphql)); - - return new Promise((resolve, reject) => { - server.listen(port, host, err => { - if (err) { - return reject(err); - } - - return resolve(); - }) - }); -} - -function handle(req, res, handler) -{ - handler(req.body, req.headers.token) - .then(result => respond(res, 200, result)) - .catch(err => { - console.error('Error during request handling :'); - console.error(err); - - if (err.message) { - delete err.http; - respond(res, err.http || 500, err); - } else { - respond(res, 500, { - message: 'Internal error : ' + err - }); - } - }); -} - -function respond(res, code, obj) -{ - const data = JSON.stringify(obj); - const headers = { - 'Content-Type': 'application/json; charset=utf-8', - 'Content-Length': Buffer.byteLength(data) - }; - - res.writeHead(code, headers); - res.end(data); -} - -module.exports = start; diff --git a/alarm/node_modules/pronote-api/src/server/index.js b/alarm/node_modules/pronote-api/src/server/index.js deleted file mode 100644 index 1693e1c..0000000 --- a/alarm/node_modules/pronote-api/src/server/index.js +++ /dev/null @@ -1,47 +0,0 @@ -const { graphql } = require('graphql'); - -const http = require('./http'); -const context = require('./context'); -const getSchemas = require('./schemas'); -const { login, logout, getSession } = require('./auth'); - -async function start(host, port) -{ - const schemas = await getSchemas(); - - await http(host, port, { - graphql: ({ query, variables }, token) => handle(token, schemas, query, context, variables), - login: params => login(params), - logout: (_, token) => logout(token) - }); -} - -async function handle(token, schemas, query, context, variables) -{ - if (!token) { - throw { - http: 401, - message: 'Missing \'Token\' header' - }; - } - - if (!query) { - throw { - http: 400, - message: 'Missing \'query\' field or \'Content-Type: application/json\' header' - }; - } - - const session = getSession(token); - if (!session) { - throw { - http: 401, - message: 'Unknown session token' - }; - } - - const schema = schemas[session.type.name]; - return await graphql(schema, query, context(session), null, variables); -} - -module.exports = start; diff --git a/alarm/node_modules/pronote-api/src/server/schemas/common.graphql b/alarm/node_modules/pronote-api/src/server/schemas/common.graphql deleted file mode 100644 index 0d821ff..0000000 --- a/alarm/node_modules/pronote-api/src/server/schemas/common.graphql +++ /dev/null @@ -1,464 +0,0 @@ -scalar Date - -type Query { - params: PronoteParams! - user: PronoteUser! -} - -type Mutation { - # Please remember to disable this when you don't need it, or else sessions will last forever ! - setKeepAlive(enabled: Boolean!): Boolean! - - # This is in a mutation, because this is a request that send a keep alive to Pronote, not a value - # It will always returns True - keepAlive: Boolean! - - # This is in a mutation, because this is a request that send a keep alive to Pronote, not a value - # It will always returns True - logout: Boolean! -} - -type Lesson { - id: String! - from: Date! - to: Date! - isDetention: Boolean! - hasDuplicate: Boolean! - subject: String - teacher: String - room: String - status: String - isAway: Boolean - isCancelled: Boolean - color: String - remoteLesson: Boolean -} - -type Marks { - subjects: [MarksSubject]! - averages: MarksAverages! -} - -type MarksSubject { - name: String! - averages: MarksSubjectAverages! - color: String! - marks: [Mark!]! -} - -type MarksAverages { - student: Float - studentClass: Float -} - -type MarksSubjectAverages { - student: Float! - studentClass: Float! - min: Float! - max: Float! -} - -type Mark { - id: String!, - title: String!, - value: Float, - scale: Float!, - average: Float, - coefficient: Float! - min: Float - max: Float - date: Date! - isAway: Boolean! -} - -type EvaluationSubject { - name: String! - teacher: String! - color: String! - evaluations: [Evaluation!]! -} - -type Evaluation { - id: String! - name: String! - date: Date! - coefficient: Float! - levels: [EvaluationLevel!]! -} - -type EvaluationLevel { - name: String! - value: EvaluationLevelValue! - prefixes: [String!]! -} - -type EvaluationLevelValue { - short: String! - long: String! -} - -type Absences { - absences: [Absence!]! - delays: [Delay!]! - punishments: [Punishment!]! - other: [OtherEvent!]! - totals: [SubjectAbsences!]! -} - -type Absence { - id: String! - from: Date! - to: Date! - justified: Boolean! - solved: Boolean! - hours: Float! - reason: String -} - -type Delay { - id: String! - date: Date! - justified: Boolean! - solved: Boolean! - justification: String! - minutesMissed: Int! - reason: String -} - -type Punishment { - id: String! - date: Date! - isExclusion: Boolean! - isDuringLesson: Boolean! - homework: String! - circumstances: String! - giver: String! - reason: String - detention: Detention -} - -type Detention { - id: String! - from: Date! - to: Date! -} - -type OtherEvent { - id: String! - kind: String! - date: Date! - giver: String! - comment: String! - subject: String -} - -type SubjectAbsences { - subject: String! - hoursAssisted: Float! - hoursMissed: Float! - subs: [SubjectAbsences!] -} - -type Info { - id: String! - date: Date! - title: String - author: String! - content: String! - htmlContent: String! - files: [File!]! -} - -type LessonContent { - id: String! - subject: String! - teachers: [String!]! - from: Date! - to: Date! - color: String! - title: String - description: String! - htmlDescription: String! - files: [File!]! - category: String! -} - -type Homework { - id: String! - description: String! - htmlDescription: String! - subject: String! - givenAt: Date! - for: Date! - done: Boolean! - color: String! - files: [File!]! -} - -type File { - id: String! - time: String! - subject: String! - name: String! - url: String! -} - -type MenuDay { - date: Date! - meals: [[[MenuMealEntry!]!]!]! -} - -type MenuMealEntry { - name: String! - labels: [MenuMealLabel!]! -} - -type MenuMealLabel { - name: String! - color: String! -} - -type PronoteParams { - navigatorId: String - fonts: [String!]! - withMember: Boolean! - forNewCaledonia: Boolean! - loginImageId: Float! - loginImageUrl: String! - cssLogo: String! - theme: Float! - serverTime: Date! - mobileURL: String! - mobileSupport: Boolean! - title: String! - indexEducationWebsite: String! - version: String! - versionFull: String! - year: Float! - language: PronoteLanguage - supportedLanguages: [PronoteLanguage]! - infoPage: String! - hasForum: Boolean! - helpURL: String! - videosURL: String! - twitterURL: String! - withLoginOptions: Boolean! - establishment: String! - displayWeeks: String! - schoolYear: String! - firstCycle: Date! - firstDay: Date! - firstMonday: Date! - lastDay: Date! - ticksPerDay: Float! - ticksPerHour: Float! - sequenceDuration: Float! - ticksForHalfDayAbsence: Float! - hasLunch: Boolean! - lunchStart: Float! - lunchEnd: Float! - withPlainAfternoonHours: Boolean! - firstOrLastWorkingDay: Date! - workingDays: [Float!]! - lunchDays: [Float!]! - parentsChat: Boolean! - workingDaysPerCycle: Float! - firstDayOfWeek: Float! - timetableGridsInCycle: Float! - workingDaysCycle: [Float!]! - halfWorkingDays: [[Float!]!]! - frequenciesRanges: [[Float!]!]! - frequenciesLabels: [String!]! - defaultMarkMax: Float! - allowedAnnotations: [Float!]! - acquisitionLevels: [PronoteAcquisitionLevel]! - displayAcquisitionShortLabel: Boolean! - withEvaluationHistory: Boolean! - withoutIntermediaryLevelAutoValidation: Boolean! - onlySchoolYearEvaluationsInAutoValidation: Boolean! - CECRLLevelsSupport: Boolean - langActivityColor: String - minMarkMCQ: Float! - maxMarkMCQ: Float! - maxPointsMCQ: Float! - skillsGridLabelSize: Float! - homeworkCommentSize: Float! - officeEnabled: Boolean! - officeFederatedMode: Boolean! - officeTutorial: String! - oneDriveTutorial: String! - connexionInfoRetrieval: Boolean! - font: String! - fontSize: Float! - attachedStudents: Boolean! - phoneMask: String! - maxECTS: Float! - maxAppreciationSizes: [Float!]! - publicHolidays: [PronoteHoliday]! - displaySequences: Boolean! - firstHour: Date! - hours: [PronoteHour]! - endHours: [PronoteHour]! - sequences: [String!]! - periods: [PronotePeriod]! - logo: Float! - breaks: [PronoteBreak]! - appCookieName: String! -} - -type PronoteUser { - name: String! - establishmentsInfo: [PronoteEstablishmentInfo!]! - userSettings: PronoteUserSettings! - sessionAuthorizations: PronoteSessionAuthorizations! - authorizations: PronoteUserAuthorizations - minPasswordSize: Int! - maxPasswordSize: Int! - passwordRules: [Int!]! - kioskAccess: Boolean! - tabs: [PronoteTab!]! - hiddenTabs: [Int!]! - notifiedTabs: [Int!]! -} - -type PronoteLanguage { - id: Int! - name: String! -} - -type PronoteAcquisitionLevel { - count: Int! - positions: [PronoteAcquisitionLevelPositions!]! - triggerPosition: Float! - activeFor: [Int!]! - shortName: String! - shortPath: String! - color: String - weighting: Float - brevetPoints: Float - acquired: Boolean - countsForSuccess: Boolean -} - -type PronoteAcquisitionLevelPositions { - name: String! - count: Int! - shortName: String! - shortNameWithPrefix: String -} - -type PronoteHoliday { - name: String! - from: Date! - to: Date! -} - -type PronoteHour { - name: String! - count: Int! - round: Boolean! -} - -type PronotePeriod { - name: String! - notationPeriod: Int! - from: Date! - to: Date! -} - -type PronoteBreak { - name: String! - position: Int! -} - -type PronoteNamedObject { - name: String! -} - -type PronoteClassHistoryElement { - name: String! - hadMarks: Boolean! - hadOptions: Boolean! -} - -type PronoteTabPillars { - tab: Int! - levels: [PronotePillarLevel!]! -} - -type PronotePillarLevel { - name: String! - pillars: [PronotePillar!]! -} - -type PronotePillar { - name: String! - isForeignLanguage: Boolean! - isCoreSkill: Boolean! - subject: PronoteNamedObject! -} - -type PronoteTabPeriods { - tab: Int! - periods: [PronoteTabPeriod!]! - defaultPeriod: PronoteNamedObject -} - -type PronoteTabPeriod { - name: String! - isCorePeriod: Boolean! -} - -type PronoteEstablishmentInfo { - name: String! - logoID: Int! - address: [String!]! - postalCode: String! - postalLabel: String! - city: String! - province: String! - country: String! - website: String! -} - -type PronoteUserSettings { - version: Float! - timetable: PronoteUserTimetableSettings! - theme: Int! - unreadDiscussions: Boolean! -} - -type PronoteUserTimetableSettings { - displayCanceledLessons: Boolean! - invertAxis: Boolean! - invertWeeklyPlanAxis: Boolean! - invertDayPlanAxis: Boolean! - invertDay2PlanAxis: Boolean! - dayCount: Int! - resourceCount: Int! - daysInTimetable: Int! - sequenceCount: Int! -} - -type PronoteUserAuthorizations { - discussions: Boolean! - teachersDiscussions: Boolean! - timetableVisibleWeeks: [Int!]! - canEditLessons: [Int!]! - hideClassParts: Boolean! - maxEstablishmentFileSize: Int! - maxUserWorkFileSize: Int! - hasPassword: Boolean! - hasPersonalInfo: Boolean! - canPrint: Boolean! -} - -type PronoteSessionAuthorizations { - twitterManagement: Boolean! - expandedAttestation: Boolean! -} - -type PronoteTab { - id: Int! - subs: [PronoteTab!]! -} diff --git a/alarm/node_modules/pronote-api/src/server/schemas/index.js b/alarm/node_modules/pronote-api/src/server/schemas/index.js deleted file mode 100644 index 099d358..0000000 --- a/alarm/node_modules/pronote-api/src/server/schemas/index.js +++ /dev/null @@ -1,40 +0,0 @@ -const path = require('path'); -const fs = require('fs').promises; - -const { buildSchema } = require('graphql'); - -const date = require('../date'); - -const SCHEMAS = ['student', 'parent']; - -async function readFile(name) -{ - const file = path.join(__dirname, name); - const content = await fs.readFile(file); - - return content.toString(); -} - -async function readSchema(common, name) -{ - const content = await readFile(name + '.graphql'); - const schema = buildSchema(common + '\n' + content); - - Object.assign(schema._typeMap.Date, date); - - return schema; -} - -async function getSchemas() -{ - const common = await readFile('common.graphql'); - const result = {}; - - for (const schema of SCHEMAS) { - result[schema] = await readSchema(common, schema); - } - - return result; -} - -module.exports = getSchemas; diff --git a/alarm/node_modules/pronote-api/src/server/schemas/parent.graphql b/alarm/node_modules/pronote-api/src/server/schemas/parent.graphql deleted file mode 100644 index 0f6bf86..0000000 --- a/alarm/node_modules/pronote-api/src/server/schemas/parent.graphql +++ /dev/null @@ -1,40 +0,0 @@ -extend type Query { - timetable(student: String!, from: Date, to: Date): [Lesson!] - marks(student: String!, period: String): Marks - evaluations(student: String!, period: String): [EvaluationSubject!] - absences(student: String!, period: String, from: Date, to: Date): Absences - infos(student: String!): [Info!] - contents(student: String!, from: Date, to: Date): [LessonContent!] - homeworks(student: String!, from: Date, to: Date): [Homework!] - menu(student: String!, from: Date, to: Date): [MenuDay!] - files(student: String!): [File!] -} - -extend type PronoteUser { - isDelegate: Boolean! - isBDMember: Boolean! - canDiscussWithManagers: Boolean! - absencesReasons: [PronoteNamedObject!]! - delaysReasons: [PronoteNamedObject!]! - classDelegates: [PronoteNamedObject!]! - students: [PronoteStudent!]! -} - -extend type PronoteUserAuthorizations { - staffDiscussion: Boolean! - parentsDiscussion: Boolean! - editStudentPassword: Boolean! - editCoordinates: Boolean! - editAuthorizations: Boolean! -} - -type PronoteStudent { - name: String! - establishment: PronoteNamedObject! - avatar: String - studentClass: PronoteNamedObject! - classHistory: [PronoteClassHistoryElement!]! - groups: [PronoteNamedObject!]! - tabsPillars: [PronoteTabPillars!]! - tabsPeriods: [PronoteTabPeriods!]! -} diff --git a/alarm/node_modules/pronote-api/src/server/schemas/student.graphql b/alarm/node_modules/pronote-api/src/server/schemas/student.graphql deleted file mode 100644 index 99dd73f..0000000 --- a/alarm/node_modules/pronote-api/src/server/schemas/student.graphql +++ /dev/null @@ -1,21 +0,0 @@ -extend type Query { - timetable(from: Date, to: Date): [Lesson!] - marks(period: String): Marks - evaluations(period: String): [EvaluationSubject!] - absences(period: String, from: Date, to: Date): Absences - infos: [Info] - contents(from: Date, to: Date): [LessonContent!] - homeworks(from: Date, to: Date): [Homework!] - menu(from: Date, to: Date): [MenuDay!] - files: [File!] -} - -extend type PronoteUser { - establishment: PronoteNamedObject! - avatar: String - studentClass: PronoteNamedObject! - classHistory: [PronoteClassHistoryElement!]! - groups: [PronoteNamedObject!]! - tabsPillars: [PronoteTabPillars!]! - tabsPeriods: [PronoteTabPeriods!]! -} diff --git a/alarm/node_modules/pronote-api/src/session.js b/alarm/node_modules/pronote-api/src/session.js deleted file mode 100644 index 6804d17..0000000 --- a/alarm/node_modules/pronote-api/src/session.js +++ /dev/null @@ -1,84 +0,0 @@ -const { initCipher } = require('./cipher'); -const getAccountType = require('./accounts'); - -const timetable = require('./fetch/timetable'); -const marks = require('./fetch/marks'); -const evaluations = require('./fetch/evaluations'); -const absences = require('./fetch/absences'); -const infos = require('./fetch/infos'); -const contents = require('./fetch/contents'); -const homeworks = require('./fetch/homeworks'); -const menu = require('./fetch/menu'); -const files = require('./fetch/files'); - -const keepAlive = require('./fetch/pronote/keepAlive'); -const logout = require('./fetch/pronote/logout'); - -const DEFAULT_KEEP_ALIVE_RATE = 120; // In seconds. 120 is the Pronote default 'Presence' request rate. -const GENERAL_REQUESTS = { - keepAlive, logout -}; -const REQUESTS = { - timetable, marks, evaluations, absences, contents, - infos, homeworks, menu, files -}; - -class PronoteSession -{ - constructor({ serverURL, sessionID, type, disableAES, disableCompress, keyModulus, keyExponent }) - { - this.id = ~~sessionID; - this.server = serverURL; - this.type = typeof type === 'string' ? getAccountType(type) : type; - - this.disableAES = disableAES; - this.disableCompress = disableCompress; - - initCipher(this, keyModulus, keyExponent); - - this.request = -1; - this.isKeptAlive = false; - - for (const [req, method] of Object.entries(GENERAL_REQUESTS)) { - this[req] = () => method(this); - } - for (const [req, method] of Object.entries(REQUESTS)) { - this[req] = (...args) => callRequest(method, this, args); - } - } - - setKeepAlive(enabled, onError, rate = DEFAULT_KEEP_ALIVE_RATE) - { - if (enabled === this.isKeptAlive) { - return; - } - - if (enabled) { - this.interval = setInterval(() => { - this.keepAlive().catch(err => { - this.setKeepAlive(false); - if (onError) { - onError(err); - } - }); - }, rate * 1000); - } else { - clearInterval(this.interval); - } - - this.isKeptAlive = enabled; - } -} - -function callRequest(method, session, args) -{ - switch (session.type.name) - { - case 'student': - return method(session, session.user, ...args); - default: - return method(session, ...args); - } -} - -module.exports = PronoteSession; |