@lunch-money/v2-api-spec 2.8.2 → 2.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lunch-money-api-v2.yaml +429 -218
- package/package.json +1 -1
- package/update-urls.sh +36 -56
- package/version-history.md +24 -3
package/package.json
CHANGED
package/update-urls.sh
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
3
|
# Script to update URLs in the OpenAPI specification file
|
|
4
|
-
# This is useful for switching between local development and production
|
|
4
|
+
# This is useful for switching the docs/mock server URL between local development and production
|
|
5
|
+
# Note: All references to DOCS_DEPLOY_URL throughout the file are toggled; the API server URL remains unchanged
|
|
5
6
|
#
|
|
6
7
|
# Usage:
|
|
7
8
|
# # In git repo:
|
|
@@ -11,25 +12,24 @@
|
|
|
11
12
|
# ./update-urls.sh --local|--production
|
|
12
13
|
#
|
|
13
14
|
# Flags:
|
|
14
|
-
# --local Switch
|
|
15
|
-
# --production Switch
|
|
15
|
+
# --local Switch docs/mock server URL to local development (http://localhost:3000/v2)
|
|
16
|
+
# --production Switch docs/mock server URL to production deployment URL
|
|
16
17
|
#
|
|
17
18
|
# Environment variables (optional, with defaults):
|
|
18
19
|
# LOCAL_URL - Local development URL (default: http://localhost:3000/v2)
|
|
19
|
-
#
|
|
20
|
-
# DOCS_DEPLOY_URL - Docs/mock deployment URL (default: https://alpha.lunchmoney.app/v2)
|
|
20
|
+
# DOCS_DEPLOY_URL - Docs/mock deployment URL (default: https://alpha.lunchmoney.dev/v2)
|
|
21
21
|
#
|
|
22
22
|
# Examples:
|
|
23
|
-
# # Switch to production
|
|
23
|
+
# # Switch to production URL (using defaults)
|
|
24
24
|
# ./update-urls.sh --production
|
|
25
25
|
#
|
|
26
|
-
# # Switch to production
|
|
27
|
-
#
|
|
26
|
+
# # Switch to production URL (with custom URL)
|
|
27
|
+
# DOCS_DEPLOY_URL=https://alpha.lunchmoney.dev/v2 ./update-urls.sh --production
|
|
28
28
|
#
|
|
29
|
-
# # Switch to local
|
|
29
|
+
# # Switch to local URL
|
|
30
30
|
# ./update-urls.sh --local
|
|
31
31
|
#
|
|
32
|
-
# # Switch to local
|
|
32
|
+
# # Switch to local URL (with custom local URL)
|
|
33
33
|
# LOCAL_URL=http://localhost:4000/v2 ./update-urls.sh --local
|
|
34
34
|
|
|
35
35
|
set -e
|
|
@@ -40,7 +40,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
40
40
|
# Determine if we're in the git repo or npm package
|
|
41
41
|
# In git repo: script is in scripts/ subdirectory, spec is in v2/spec/
|
|
42
42
|
# In npm package: script is at root, spec is at root
|
|
43
|
-
if [ -f "$SCRIPT_DIR
|
|
43
|
+
if [ -f "$SCRIPT_DIR/../v2/spec/lunch-money-api-v2.yaml" ]; then
|
|
44
44
|
# In the git repo (script is in scripts/ subdirectory)
|
|
45
45
|
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
46
46
|
SPEC_FILE="$REPO_ROOT/v2/spec/lunch-money-api-v2.yaml"
|
|
@@ -62,91 +62,71 @@ fi
|
|
|
62
62
|
|
|
63
63
|
# Set default values for the URLs if not provided
|
|
64
64
|
LOCAL_URL=${LOCAL_URL:-"http://localhost:3000/v2"}
|
|
65
|
-
|
|
66
|
-
DOCS_DEPLOY_URL=${DOCS_DEPLOY_URL:-"https://alpha.lunchmoney.app/v2"}
|
|
65
|
+
DOCS_DEPLOY_URL=${DOCS_DEPLOY_URL:-"https://alpha.lunchmoney.dev/v2"}
|
|
67
66
|
|
|
68
67
|
# Function to show help and exit
|
|
69
68
|
show_help() {
|
|
70
69
|
echo "Usage: $0 --local|--production"
|
|
71
70
|
echo ""
|
|
72
71
|
echo "Flags (required):"
|
|
73
|
-
echo " --local Switch
|
|
74
|
-
echo " --production Switch
|
|
72
|
+
echo " --local Switch docs/mock server URL to local development"
|
|
73
|
+
echo " --production Switch docs/mock server URL to production deployment"
|
|
75
74
|
echo ""
|
|
76
75
|
echo "Environment variables (optional, with defaults):"
|
|
77
76
|
echo " LOCAL_URL Local development URL (default: http://localhost:3000/v2)"
|
|
78
|
-
echo "
|
|
79
|
-
echo " DOCS_DEPLOY_URL Docs/mock deployment URL (default: https://alpha.lunchmoney.app/v2)"
|
|
77
|
+
echo " DOCS_DEPLOY_URL Docs/mock deployment URL (default: https://alpha.lunchmoney.dev/v2)"
|
|
80
78
|
echo ""
|
|
81
79
|
echo "Examples:"
|
|
82
|
-
echo " # Switch to production
|
|
80
|
+
echo " # Switch to production URL (using defaults)"
|
|
83
81
|
echo " $0 --production"
|
|
84
82
|
echo ""
|
|
85
|
-
echo " # Switch to production
|
|
86
|
-
echo "
|
|
83
|
+
echo " # Switch to production URL (with custom URL)"
|
|
84
|
+
echo " DOCS_DEPLOY_URL=https://alpha.lunchmoney.dev/v2 $0 --production"
|
|
87
85
|
echo ""
|
|
88
|
-
echo " # Switch to local
|
|
86
|
+
echo " # Switch to local URL"
|
|
89
87
|
echo " $0 --local"
|
|
90
88
|
echo ""
|
|
91
|
-
echo " # Switch to local
|
|
89
|
+
echo " # Switch to local URL (with custom local URL)"
|
|
92
90
|
echo " LOCAL_URL=http://localhost:4000/v2 $0 --local"
|
|
93
91
|
echo ""
|
|
94
92
|
echo "Note: Environment variables can also be set in a .env file in the repository root."
|
|
93
|
+
echo "Note: All references to DOCS_DEPLOY_URL throughout the file are updated; the API server URL remains unchanged."
|
|
95
94
|
exit 1
|
|
96
95
|
}
|
|
97
96
|
|
|
98
|
-
# Function to replace
|
|
99
|
-
|
|
97
|
+
# Function to replace all occurrences of the docs/mock server URL in the spec file
|
|
98
|
+
replace_docs_url() {
|
|
100
99
|
local from_url=$1
|
|
101
|
-
local
|
|
102
|
-
local to_url_2=$3
|
|
100
|
+
local to_url=$2
|
|
103
101
|
|
|
104
102
|
if [ ! -f "$SPEC_FILE" ]; then
|
|
105
103
|
echo "Error: Spec file not found at $SPEC_FILE"
|
|
106
104
|
exit 1
|
|
107
105
|
fi
|
|
108
106
|
|
|
109
|
-
echo "Updating
|
|
107
|
+
echo "Updating all references to docs/mock server URL in $SPEC_FILE..."
|
|
110
108
|
echo " From: $from_url"
|
|
111
|
-
echo " To
|
|
112
|
-
echo " To (server 2): $to_url_2"
|
|
109
|
+
echo " To: $to_url"
|
|
113
110
|
|
|
114
|
-
#
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
{
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
if (in_servers && $0 ~ "url:") {
|
|
122
|
-
server_count++
|
|
123
|
-
if (server_count == 1) {
|
|
124
|
-
sub(from_url, to_url_1)
|
|
125
|
-
} else if (server_count == 2) {
|
|
126
|
-
sub(from_url, to_url_2)
|
|
127
|
-
} else {
|
|
128
|
-
sub(from_url, to_url_1)
|
|
129
|
-
}
|
|
130
|
-
} else {
|
|
131
|
-
sub(from_url, to_url_2)
|
|
132
|
-
}
|
|
133
|
-
print
|
|
134
|
-
}' "$SPEC_FILE" > "$SPEC_FILE.tmp" && mv "$SPEC_FILE.tmp" "$SPEC_FILE"
|
|
111
|
+
# Replace all occurrences of the URL throughout the entire file
|
|
112
|
+
# Using sed with proper escaping for URLs
|
|
113
|
+
# Escape special regex characters in from_url
|
|
114
|
+
escaped_from_url=$(echo "$from_url" | sed 's/[[\.*^$()+?{|]/\\&/g')
|
|
115
|
+
# Use a temporary file for cross-platform compatibility
|
|
116
|
+
sed "s|$escaped_from_url|$to_url|g" "$SPEC_FILE" > "$SPEC_FILE.tmp" && mv "$SPEC_FILE.tmp" "$SPEC_FILE"
|
|
135
117
|
|
|
136
118
|
echo "✓ URLs updated successfully"
|
|
137
119
|
}
|
|
138
120
|
|
|
139
121
|
# Check for required flag
|
|
140
122
|
if [ "$1" == "--local" ]; then
|
|
141
|
-
echo "Switching
|
|
123
|
+
echo "Switching docs/mock server URL to local development..."
|
|
142
124
|
echo " Using LOCAL_URL: $LOCAL_URL"
|
|
143
|
-
|
|
144
|
-
replace_urls "$DOCS_DEPLOY_URL" "$LOCAL_URL" "$LOCAL_URL"
|
|
125
|
+
replace_docs_url "$DOCS_DEPLOY_URL" "$LOCAL_URL"
|
|
145
126
|
elif [ "$1" == "--production" ]; then
|
|
146
|
-
echo "Switching
|
|
147
|
-
echo " Using API_DEPLOY_URL: $API_DEPLOY_URL"
|
|
127
|
+
echo "Switching docs/mock server URL to production..."
|
|
148
128
|
echo " Using DOCS_DEPLOY_URL: $DOCS_DEPLOY_URL"
|
|
149
|
-
|
|
129
|
+
replace_docs_url "$LOCAL_URL" "$DOCS_DEPLOY_URL"
|
|
150
130
|
else
|
|
151
131
|
echo "Error: A flag is required (--local or --production)"
|
|
152
132
|
echo ""
|
package/version-history.md
CHANGED
|
@@ -5,13 +5,34 @@ The Lunch Money API spec uses a modified version of SEMVER for its versioning me
|
|
|
5
5
|
- The minor version represents the number of main endpoints the current version of the spec supports. For example, a version of the API that supports the /me, /categories, and /transactions endpoints would have a minor version of 3.
|
|
6
6
|
- The revision number represents the number of updates since the last endpoint was added. For example, each time changes are made to one of the existing three APIs as described above, the revision number will be bumped.
|
|
7
7
|
|
|
8
|
-
## v2.8.
|
|
8
|
+
## v2.8.4 - [TBD]
|
|
9
|
+
- Add new `created_since` and `updated_since` query parameters to the GET /transactions endpoint.
|
|
10
|
+
- Add a new `include_group_children` query parameter to the GET /transactions endpoint.
|
|
11
|
+
- Add new `include_rollover_pool` and `include_past_budget_dates` query params to the GET /summary endpoint.
|
|
12
|
+
- Add `to_base` to the allowed properties in the updateManualAccountObject. This is tolerated but ignored (matches behavior in updateTransactionObject)
|
|
13
|
+
- New `x-updatable` attributes have been added to the properties of the update objects to more clearly describe which system defined properties are tolerated but ignored.
|
|
14
|
+
- **BREAKING CHANGES**
|
|
15
|
+
- Renamed several properties in the transaction object:
|
|
16
|
+
- `is_parent` -> `is_split_parent`
|
|
17
|
+
- `parent_id` -> `split_parent_id`
|
|
18
|
+
- `is_group` -> `is_group_parent`
|
|
19
|
+
- `group_id` -> `group_parent_id`
|
|
20
|
+
- Renamed a query parameter on the GET /transactions endpoint
|
|
21
|
+
- `is_group` -> `is_group_parent`
|
|
22
|
+
- Renamed a property in the occurrences object returned by the GET /summary endpoint
|
|
23
|
+
- `current` -> `in_range`
|
|
24
|
+
|
|
25
|
+
## v2.8.3 - Dec 23, 2025
|
|
26
|
+
- The default for the GET /transactions query parameter `limit` has been changed from 100 to 1000. The max for this parameter is now 2000.
|
|
27
|
+
- Added new guides covering pagination and supported currencies.
|
|
28
|
+
|
|
29
|
+
## v2.8.2 - Nov 26, 2025
|
|
9
30
|
- The category object now includes both an `order` and `collapsed` property. These properties are used by GUIs that display a list of categories.
|
|
10
31
|
- The DELETE /manual_accounts endpoint now supports two optional query parameters:
|
|
11
32
|
- `delete_items` (boolean, default: false): When set to true, also deletes transactions, rules, and recurring items associated with the account
|
|
12
33
|
- `delete_balance_history` (boolean, default: false): When set to true, deletes balance history associated with the account
|
|
13
34
|
|
|
14
|
-
## v2.8.1 -
|
|
35
|
+
## v2.8.1 - Nov 14, 2025
|
|
15
36
|
- Removed `debits_as_negative` from the userObject
|
|
16
37
|
- For api users, positive values always indicate a debit transaction, and negative values indicate a credit transaction.
|
|
17
38
|
- Added `background_color` and `text_color` to the tagObject
|
|
@@ -107,7 +128,7 @@ The Lunch Money API spec uses a modified version of SEMVER for its versioning me
|
|
|
107
128
|
- It is also now permissible to include strings in the `children` property. These will be used as the names of new child categories that will be created.
|
|
108
129
|
- This release also updates the following schemas:
|
|
109
130
|
- Correctly specifies that all properties of the manualAccountObject are required
|
|
110
|
-
- Updates the
|
|
131
|
+
- Updates the updateManualAccountObject and updatePlaidManualAccountObject to allow the `balance` property to be either a string or a number.
|
|
111
132
|
- Updates the userObject to include the `debits_as_negative` property. The documentation for Transaction Objects returned by GET requests have been updated to reflect how/if this setting affects the `amount` property of the transaction.
|
|
112
133
|
- Updates the childCategoryObject to restore the `exclude_from_budget`, `exclude_from_totals` and `is_income` properties. These properties are inherited from the Category Group and not settable but are provided for convenience.
|
|
113
134
|
|