@lunch-money/v2-api-spec 2.11.0-preview.1 → 2.11.0-preview.10

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/README.md CHANGED
@@ -21,12 +21,8 @@ After installation, the package provides:
21
21
 
22
22
  ```javascript
23
23
  const fs = require('fs');
24
- const path = require('path');
25
24
 
26
- const specPath = path.join(
27
- __dirname,
28
- 'node_modules/@lunch-money/v2-api-spec/lunch-money-api-v2.yaml'
29
- );
25
+ const specPath = require.resolve('@lunch-money/v2-api-spec/lunch-money-api-v2.yaml');
30
26
  const spec = fs.readFileSync(specPath, 'utf8');
31
27
  ```
32
28
 
@@ -43,73 +39,11 @@ npx @openapitools/openapi-generator-cli generate \
43
39
  npx swagger-cli validate node_modules/@lunch-money/v2-api-spec/lunch-money-api-v2.yaml
44
40
  ```
45
41
 
46
- ### Updating URLs for Local Development
42
+ ### Spec URLs
47
43
 
48
- The package includes a script to help switch between local and production URLs in the OpenAPI specification. This is useful when developing against a local server.
49
-
50
- #### Using the Script
51
-
52
- The script is located at `node_modules/@lunch-money/v2-api-spec/update-urls.sh`.
53
-
54
- **Required flags:**
55
- - `--local` - Switch URLs to local development (default: `http://localhost:3000/v2`)
56
- - `--production` - Switch URLs to production deployment URLs
57
-
58
- **Switch to production URLs (using defaults):**
59
- ```bash
60
- cd node_modules/@lunch-money/v2-api-spec
61
- ./update-urls.sh --production
62
- ```
63
-
64
- **Switch to production URLs (with custom URLs):**
65
- ```bash
66
- cd node_modules/@lunch-money/v2-api-spec
67
- API_DEPLOY_URL=https://api.lunchmoney.app/v2 \
68
- DOCS_DEPLOY_URL=https://alpha.lunchmoney.app/v2 \
69
- ./update-urls.sh --production
70
- ```
71
-
72
- **Switch to local URLs:**
73
- ```bash
74
- cd node_modules/@lunch-money/v2-api-spec
75
- ./update-urls.sh --local
76
- ```
77
-
78
- **Switch to local URLs (with custom local URL):**
79
- ```bash
80
- cd node_modules/@lunch-money/v2-api-spec
81
- LOCAL_URL=http://localhost:4000/v2 ./update-urls.sh --local
82
- ```
83
-
84
- **Using environment variables:**
85
- Create a `.env` file in the package directory:
86
- ```bash
87
- LOCAL_URL=http://localhost:3000/v2
88
- API_DEPLOY_URL=https://api.lunchmoney.app/v2
89
- DOCS_DEPLOY_URL=https://alpha.lunchmoney.app/v2
90
- ```
91
-
92
- Then run:
93
- ```bash
94
- ./update-urls.sh --production
95
- # or
96
- ./update-urls.sh --local
97
- ```
98
-
99
- #### How It Works
100
-
101
- The script updates the `servers` section in the OpenAPI specification:
102
- - **Server 1**: Typically the production API server
103
- - **Server 2**: Typically a mock or staging server
104
-
105
- It also updates any references to these URLs throughout the specification file.
106
-
107
- #### Important Notes
108
-
109
- - The script modifies the spec file in place
110
- - Changes are not persisted across `npm install` - the package will be restored to its original state
111
- - For persistent changes, consider copying the spec to your project directory first
112
- - The script works in both the npm package and the git repository
44
+ The published YAML uses public production docs/API URLs. Do not rewrite them in this
45
+ package for local or deploy environments — consuming apps (for example the Lunch Money
46
+ docs/mock server) should rewrite an installed copy when needed.
113
47
 
114
48
  ## Versioning
115
49
 
@@ -123,14 +57,17 @@ For example, version `2.8.2` means:
123
57
  - 8 main endpoint groups
124
58
  - 2 updates since the 8th endpoint was added
125
59
 
60
+ ## Related Packages
61
+
62
+ This package is the canonical v2 OpenAPI specification artifact. The `@lunch-money/developer-docs` package ships the public documentation content and may include a convenience copy of the spec under `v2/spec/`, but API tooling should consume the YAML from `@lunch-money/v2-api-spec`.
63
+
126
64
  ## Resources
127
65
 
128
66
  - [Lunch Money Website](https://lunchmoney.app)
129
67
  - [Interactive API Documentation](https://alpha.lunchmoney.dev/v2/docs)
130
- - [GitHub Repository](https://github.com/lunch-money/api-specs)
68
+ - [GitHub Repository](https://github.com/lunch-money/developer-docs)
131
69
  - [API Status](https://status.lunchmoney.app)
132
70
 
133
71
  ## License
134
72
 
135
73
  ISC
136
-