-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 206af10
Showing
8 changed files
with
773 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/luarocks | ||
/lua | ||
/lua_modules | ||
/.luarocks | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
dist/out.lua: src/Main.hx src/JsonHelper.hx src/RequestHelper.hx src/Storage.hx src/Moneytree.hx | ||
mkdir -p dist | ||
cd src/ && haxe --lua ../dist/out.lua --main Main -D lua-vanilla -D lua-return | ||
cp dist/out.lua /Users/david/Library/Containers/com.moneymoney-app.retail/Data/Library/Application\ Support/MoneyMoney/Extensions/moneytree.lua | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Moneytree extension for MoneyMoney | ||
|
||
Adds support for accounts linked to https://getmoneytree.com/jp/home to MoneyMoney | ||
|
||
## Authentication + Setup | ||
|
||
You'll need the moneytree API key. Find it in dev tools when using the moneytree web version. Enter this key in `Moneytree.hx` at the very top, then do a `make` to build the .lua extension. | ||
|
||
Login with your normal username + password | ||
|
||
## License | ||
|
||
MIT, commercial used excluded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class JsonHelper { | ||
public static function parse(jsonString:String):Dynamic { | ||
#if lua | ||
// Use MoneyMoney's JSON object if available | ||
if (untyped __lua__("JSON")) { | ||
return untyped __lua__("JSON(jsonString):dictionary()"); | ||
} else { | ||
// Fallback to haxe.Json if JSON is not available | ||
return haxe.Json.parse(jsonString); | ||
} | ||
#else | ||
return haxe.Json.parse(jsonString); | ||
#end | ||
} | ||
|
||
public static function stringify(data:Dynamic, ?args:Dynamic):String { | ||
#if lua | ||
// Use MoneyMoney's JSON object if available | ||
if (untyped __lua__("JSON")) { | ||
return untyped __lua__("JSON():set(data):json()"); | ||
} else { | ||
// Fallback to haxe.Json if JSON is not available | ||
return haxe.Json.stringify(data, args); | ||
} | ||
#else | ||
return haxe.Json.stringify(data, args); | ||
#end | ||
} | ||
} |
Oops, something went wrong.