@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 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