| | |
| | | ### Removed |
| | | |
| | | |
| | | ## [2.0.1] - 2019-12-21 |
| | | ### Fixed |
| | | - Fehlerhafte Validierung von Argumenten bei API Aufrufen gegenüber der |
| | | Offline-Implementierung (z.B. `Helpers.enableOfflineUsageIfNecessary`) |
| | | verbessert |
| | | |
| | | |
| | | ## [2.0.0] - 2019-12-18 |
| | |
| | | |
| | | # MathCoach IDE API |
| | | # MathCoach IDE API <small>`Version 2.0.1`</small> |
| | | |
| | | In diesem Paket ([Das Gitblit Repository findet sich hier](https://newton.htwsaar.de/gitblit/summary/mathcoach!mathcoach-ide-api.git)) |
| | | ist die öffentliche Schnittstelle zur MathCoach Entwicklungsumgebung (IDE) definiert. Mithilfe |
| | |
| | | |
| | | #### Release einer neuen Version |
| | | - Version der API in der `package.json` eintragen |
| | | - Version in der Überschrift der `README.md` eintragen |
| | | - Beispiele und Changelog aktualisieren |
| | | - IDE-Projekt prüfen: `package.json`, `ide-lib.js`, ... |
| | | - Final: Release Tag setzen `git tag -a VERSION -m '...'` und pushen |
| | |
| | | { |
| | | "name": "@mathcoach/ide-api", |
| | | "version": "1.1.0", |
| | | "version": "2.0.0", |
| | | "lockfileVersion": 1, |
| | | "requires": true, |
| | | "dependencies": { |
| | |
| | | { |
| | | "name": "@mathcoach/ide-api", |
| | | "version": "2.0.0", |
| | | "version": "2.0.1", |
| | | "description": "API zur MathCoach IDE", |
| | | "main": "./src/index.ts", |
| | | "directories": { |
| | |
| | | "instrument": true, |
| | | "all": true |
| | | } |
| | | } |
| | | } |
| | |
| | | const traceMethod = (method: string, args?: any[]) => console.log(["[MC MOCK API]", " ", method, "(", (args ? args : [""]).join(","), ")"].join("")); |
| | | const runtimeCheck = (errorMessage: string, isInvalid: (param: any) => boolean) => { |
| | | return (paramName: string, value: any, optional: boolean = false) => { |
| | | if (!optional && (value === null || value === undefined)) { |
| | | throw new Error(`parameter '${paramName}' is null or undefined`); |
| | | } else { |
| | | if (isInvalid(value)) { |
| | | throw new Error(`parameter '${paramName}' is invalid: ${errorMessage}`); |
| | | if (value === undefined) { |
| | | if (optional) { |
| | | return; |
| | | } else { |
| | | throw new Error(`missing parameter '${paramName}'`); |
| | | } |
| | | } |
| | | if (isInvalid(value)) { |
| | | throw new Error(`parameter '${paramName}' is invalid: ${errorMessage}`); |
| | | } |
| | | } |
| | | } |
| | | const runtimeCheckString = runtimeCheck("not a string", v => typeof v !== "string"); |
| | |
| | | const contextFile = await MC.ide.getContextFile(); |
| | | const exerciseFile = Helpers.contextFileToExerciseFile(contextFile); |
| | | |
| | | MC.ide.navigator.navigateTo("www.google.de"); |
| | | MC.ide.navigator.navigateToExercise(exerciseFile); |
| | | MC.ide.navigator.navigateTo("www.google.de", true); |
| | | MC.ide.navigator.navigateToExercise(exerciseFile, true); |
| | | MC.ide.navigator.navigateTo("www.google.de", false); |
| | | MC.ide.navigator.navigateToExercise(exerciseFile, false); |
| | | |
| | | expectThrows(t, () => MC.ide.navigator.navigateTo(null as any)); |
| | | expectThrows(t, () => MC.ide.navigator.navigateTo(42 as any)); |