@lunch-money/v2-api-spec 2.11.0 → 2.11.1-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 +17 -0
- package/lunch-money-api-v2.yaml +794 -8
- package/oauth-client-logo/index.d.ts +27 -0
- package/oauth-client-logo/index.js +32 -0
- package/oauth-scopes/catalog.d.ts +9 -0
- package/oauth-scopes/catalog.js +528 -0
- package/oauth-scopes/index.d.ts +2 -0
- package/oauth-scopes/index.js +12 -0
- package/oauth-scopes/types.d.ts +50 -0
- package/oauth-scopes/types.js +2 -0
- package/package.json +29 -3
- package/version-history.md +10 -0
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ After installation, the package provides:
|
|
|
14
14
|
|
|
15
15
|
- **OpenAPI Specification**: `node_modules/@lunch-money/v2-api-spec/lunch-money-api-v2.yaml`
|
|
16
16
|
- **Version History**: `node_modules/@lunch-money/v2-api-spec/version-history.md`
|
|
17
|
+
- **OAuth scope catalog**: `@lunch-money/v2-api-spec/oauth-scopes`
|
|
17
18
|
|
|
18
19
|
## Usage
|
|
19
20
|
|
|
@@ -26,6 +27,22 @@ const specPath = require.resolve('@lunch-money/v2-api-spec/lunch-money-api-v2.ya
|
|
|
26
27
|
const spec = fs.readFileSync(specPath, 'utf8');
|
|
27
28
|
```
|
|
28
29
|
|
|
30
|
+
### Using the OAuth scope catalog
|
|
31
|
+
|
|
32
|
+
The package also provides immutable OAuth scope and scope-group definitions.
|
|
33
|
+
API scopes identify the V2 operations they authorize by `operationId`.
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
36
|
+
const {
|
|
37
|
+
getOAuthScopeDefinition,
|
|
38
|
+
matchOAuthScopeGroup,
|
|
39
|
+
oauthScopeGroups,
|
|
40
|
+
oauthScopes,
|
|
41
|
+
} = require('@lunch-money/v2-api-spec/oauth-scopes');
|
|
42
|
+
|
|
43
|
+
const transactionRead = getOAuthScopeDefinition('transactions:read');
|
|
44
|
+
```
|
|
45
|
+
|
|
29
46
|
### Using with OpenAPI Tools
|
|
30
47
|
|
|
31
48
|
```bash
|