@iflowgate/cli 0.0.0-stage → 0.1.1
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/LICENSE +202 -0
- package/README.md +156 -3
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +215 -0
- package/dist/index.js.map +1 -0
- package/dist/output.d.ts +24 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +75 -0
- package/dist/output.js.map +1 -0
- package/package.json +40 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,156 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# Flowgate SDK
|
|
2
|
+
|
|
3
|
+
Typed clients for the Flowgate governed execution layer — a TypeScript SDK, a
|
|
4
|
+
command-line interface, and an MCP server for programmatic, shell, and
|
|
5
|
+
LLM-driven access to the Flowgate API.
|
|
6
|
+
|
|
7
|
+
This is a pnpm monorepo containing three packages:
|
|
8
|
+
|
|
9
|
+
| Package | Description |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [`@iflowgate/sdk`](packages/sdk) | Type-safe client generated from the OpenAPI spec |
|
|
12
|
+
| [`@iflowgate/cli`](packages/cli) | The `flowgate` command-line interface |
|
|
13
|
+
| [`@iflowgate/mcp-server`](packages/mcp-server) | Model Context Protocol server (stdio) |
|
|
14
|
+
|
|
15
|
+
## API access
|
|
16
|
+
|
|
17
|
+
Flowgate API access is provisioned per integrator. The demo deployment shown in
|
|
18
|
+
this README requires an API key that is not publicly distributed. To request
|
|
19
|
+
access for evaluation, contact reda.halloub@gmail.com.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @iflowgate/sdk @iflowgate/cli
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
> **Note:** these packages are not yet published to npm. They are currently
|
|
28
|
+
> available via the workspace / private registry. Publishing is a separate
|
|
29
|
+
> milestone. Until then, clone this repository and link the packages locally.
|
|
30
|
+
|
|
31
|
+
## SDK quickstart
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { Flowgate } from '@iflowgate/sdk';
|
|
35
|
+
|
|
36
|
+
const fg = new Flowgate({ apiKey: process.env.FLOWGATE_API_KEY });
|
|
37
|
+
|
|
38
|
+
const issuers = await fg.issuers.list();
|
|
39
|
+
const capTable = await fg.capTable.get('Flowgate Systems Inc.');
|
|
40
|
+
console.log(capTable.total_fully_diluted_shares);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Every request and response type is generated from the committed OpenAPI spec
|
|
44
|
+
(`openapi.json`), so parameters, bodies, and results are checked at compile
|
|
45
|
+
time.
|
|
46
|
+
|
|
47
|
+
### Error handling
|
|
48
|
+
|
|
49
|
+
Non-2xx responses throw a `FlowgateError` carrying the HTTP `status`, the
|
|
50
|
+
parsed `detail` from the API, and the `endpoint` that was called.
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import { Flowgate, FlowgateError } from '@iflowgate/sdk';
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
await fg.capTable.get('Unknown Issuer');
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error instanceof FlowgateError) {
|
|
59
|
+
console.error(error.status, error.detail, error.endpoint);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## CLI quickstart
|
|
65
|
+
|
|
66
|
+
The CLI reads your API key from the `FLOWGATE_API_KEY` environment variable.
|
|
67
|
+
Substitute your own key for `<your-api-key>`:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
export FLOWGATE_API_KEY=<your-api-key>
|
|
71
|
+
|
|
72
|
+
flowgate issuers
|
|
73
|
+
flowgate cap-table get "Flowgate Systems Inc."
|
|
74
|
+
flowgate compliance rules
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Add `--json` to any command for compact single-line JSON on stdout with the
|
|
78
|
+
progress spinner disabled — useful for piping into `jq` or other scripts:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
flowgate issuers --json
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## SDK surface
|
|
85
|
+
|
|
86
|
+
| Group | Methods |
|
|
87
|
+
| --- | --- |
|
|
88
|
+
| `capTable` | `get`, `proposals`, `approveProposal`, `rejectProposal` |
|
|
89
|
+
| `capTableEvents` | `create` |
|
|
90
|
+
| `investors` | `list`, `portfolio` |
|
|
91
|
+
| `capitalCalls` | `list`, `overdue`, `payments` |
|
|
92
|
+
| `compliance` | `rules`, `getRule`, `createRule` |
|
|
93
|
+
| `issuers` | `list` |
|
|
94
|
+
|
|
95
|
+
> **Note:** `approveProposal(id, { reviewer })` and `rejectProposal(id, { reviewer })`
|
|
96
|
+
> accept a `reviewer` string and send it as the `?reviewer=` query parameter,
|
|
97
|
+
> matching the API specification — these endpoints take no request body.
|
|
98
|
+
|
|
99
|
+
## MCP server
|
|
100
|
+
|
|
101
|
+
`@iflowgate/mcp-server` exposes Flowgate as read-only tools over stdio, so an
|
|
102
|
+
LLM client can query the API directly.
|
|
103
|
+
|
|
104
|
+
> **Note:** `@iflowgate/mcp-server` is not yet published to npm. Until it is,
|
|
105
|
+
> run it from a local build (`node packages/mcp-server/dist/index.js`) instead
|
|
106
|
+
> of via npx.
|
|
107
|
+
|
|
108
|
+
Add it to your MCP client configuration:
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"mcpServers": {
|
|
113
|
+
"flowgate": {
|
|
114
|
+
"command": "npx",
|
|
115
|
+
"args": ["-y", "@iflowgate/mcp-server"],
|
|
116
|
+
"env": { "FLOWGATE_API_KEY": "<your-api-key>" }
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Available tools:
|
|
123
|
+
|
|
124
|
+
| Tool | Description |
|
|
125
|
+
| --- | --- |
|
|
126
|
+
| `get_cap_table` | Get the cap table for an issuer |
|
|
127
|
+
| `list_investors` | List all investors |
|
|
128
|
+
| `get_investor_portfolio` | Get the portfolio for an investor |
|
|
129
|
+
| `list_capital_calls` | List all capital calls |
|
|
130
|
+
| `list_compliance_rules` | List all compliance rules |
|
|
131
|
+
| `list_issuers` | List all issuers |
|
|
132
|
+
|
|
133
|
+
The server requires `FLOWGATE_API_KEY` and exits with a stderr message if it is
|
|
134
|
+
not set.
|
|
135
|
+
|
|
136
|
+
## API reference
|
|
137
|
+
|
|
138
|
+
Full API documentation is available at
|
|
139
|
+
<https://flowgate2.onrender.com/redoc>.
|
|
140
|
+
|
|
141
|
+
## Development
|
|
142
|
+
|
|
143
|
+
Requires Node 20+ and pnpm.
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
pnpm install # install workspace dependencies
|
|
147
|
+
pnpm -r regen # regenerate packages/sdk/src/schema.d.ts from openapi.json
|
|
148
|
+
pnpm -r typecheck # type-check every package
|
|
149
|
+
pnpm -r test # run the test suites
|
|
150
|
+
pnpm -r build # build every package
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
Apache License 2.0 — see [LICENSE](LICENSE).
|
|
156
|
+
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
/** Wires the CLI command tree. Exported for tests. */
|
|
4
|
+
export declare function buildProgram(): Command;
|
|
5
|
+
export interface RunCliOptions {
|
|
6
|
+
argv: string[];
|
|
7
|
+
stdout: (line: string) => void;
|
|
8
|
+
stderr: (line: string) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Runs the CLI with the given argv and returns the process exit code.
|
|
12
|
+
* Used by the bin entry and by tests (no `process.exit` inside).
|
|
13
|
+
*/
|
|
14
|
+
export declare function runCli(opts: RunCliOptions): Promise<number>;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC,sDAAsD;AACtD,wBAAgB,YAAY,IAAI,OAAO,CA6KtC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAyBjE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* flowgate — command-line interface for the Flowgate API.
|
|
4
|
+
*
|
|
5
|
+
* Every command reads FLOWGATE_API_KEY from the environment, shows an ora
|
|
6
|
+
* spinner while awaiting (unless `--json` is passed), and prints the result
|
|
7
|
+
* as JSON (2-space indent, or compact with `--json`).
|
|
8
|
+
*/
|
|
9
|
+
import { pathToFileURL } from 'node:url';
|
|
10
|
+
import { Command } from 'commander';
|
|
11
|
+
import { Flowgate } from '@iflowgate/sdk';
|
|
12
|
+
import chalk from 'chalk';
|
|
13
|
+
import { CliError, handleError, printResult, requireClient, withSpinner } from './output.js';
|
|
14
|
+
/** Runs an async command body, converting thrown errors into exit codes. */
|
|
15
|
+
async function runAction(json, action) {
|
|
16
|
+
try {
|
|
17
|
+
await action();
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
const exitCode = handleError(error, json);
|
|
21
|
+
throw new CliError('', exitCode);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** Builds the SDK client for a command invocation, or throws CliError. */
|
|
25
|
+
function makeClient(json) {
|
|
26
|
+
return requireClient(json);
|
|
27
|
+
}
|
|
28
|
+
/** Wires the CLI command tree. Exported for tests. */
|
|
29
|
+
export function buildProgram() {
|
|
30
|
+
const program = new Command();
|
|
31
|
+
program
|
|
32
|
+
.name('flowgate')
|
|
33
|
+
.description('Flowgate CLI — query issuers, cap tables, investors, capital calls, and compliance rules.')
|
|
34
|
+
.version('0.1.0');
|
|
35
|
+
const jsonOption = (cmd) => cmd.option('--json', 'output compact JSON (no spinner)');
|
|
36
|
+
jsonOption(program
|
|
37
|
+
.command('issuers')
|
|
38
|
+
.description('List issuers')
|
|
39
|
+
.action(async (options) => {
|
|
40
|
+
const json = options.json ?? false;
|
|
41
|
+
await runAction(json, async () => {
|
|
42
|
+
const { client } = makeClient(json);
|
|
43
|
+
const data = await withSpinner(json, 'Fetching issuers', () => client.issuers.list());
|
|
44
|
+
printResult(json, data);
|
|
45
|
+
});
|
|
46
|
+
}));
|
|
47
|
+
const capTable = program.command('cap-table').description('Cap table operations');
|
|
48
|
+
jsonOption(capTable.command('get').description('Get the cap table for an issuer').argument('<issuer>', 'issuer name')).action(async (issuer, options) => {
|
|
49
|
+
const json = options.json ?? false;
|
|
50
|
+
await runAction(json, async () => {
|
|
51
|
+
const { client } = makeClient(json);
|
|
52
|
+
const data = await withSpinner(json, `Fetching cap table for ${issuer}`, () => client.capTable.get(issuer));
|
|
53
|
+
printResult(json, data);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
jsonOption(capTable
|
|
57
|
+
.command('history')
|
|
58
|
+
.description('Monthly or weekly snapshots of the cap table')
|
|
59
|
+
.argument('<issuer>', 'issuer name')
|
|
60
|
+
.option('-m, --months <n>', 'Number of months (1-24)', '6')
|
|
61
|
+
.option('-i, --interval <type>', 'monthly or weekly', 'monthly')).action(async (issuer, options) => {
|
|
62
|
+
const json = options.json ?? false;
|
|
63
|
+
await runAction(json, async () => {
|
|
64
|
+
const months = Number.parseInt(options.months, 10);
|
|
65
|
+
if (!Number.isFinite(months) || months < 1 || months > 24) {
|
|
66
|
+
throw new CliError(chalk.red('--months must be an integer between 1 and 24.'));
|
|
67
|
+
}
|
|
68
|
+
const interval = options.interval === 'weekly' ? 'weekly' : 'monthly';
|
|
69
|
+
const { client } = makeClient(json);
|
|
70
|
+
const data = await withSpinner(json, `Fetching cap table history for ${issuer}`, () => client.capTable.history(issuer, { months, interval }));
|
|
71
|
+
printResult(json, data);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
jsonOption(capTable.command('proposals').description('List cap-table proposals').option('--status <status>', 'filter by proposal status')).action(async (options) => {
|
|
75
|
+
const json = options.json ?? false;
|
|
76
|
+
await runAction(json, async () => {
|
|
77
|
+
const { client } = makeClient(json);
|
|
78
|
+
const query = options.status !== undefined ? { status: options.status } : undefined;
|
|
79
|
+
const data = await withSpinner(json, 'Fetching cap-table proposals', () => client.capTable.proposals(query));
|
|
80
|
+
printResult(json, data);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
jsonOption(capTable
|
|
84
|
+
.command('approve')
|
|
85
|
+
.description('Approve a cap-table proposal')
|
|
86
|
+
.argument('<id>', 'proposal id')
|
|
87
|
+
.requiredOption('--reviewer <reviewer>', 'reviewer identity (sent as ?reviewer=)')).action(async (id, options) => {
|
|
88
|
+
const json = options.json ?? false;
|
|
89
|
+
await runAction(json, async () => {
|
|
90
|
+
const { client } = makeClient(json);
|
|
91
|
+
const data = await withSpinner(json, `Approving proposal ${id}`, () => client.capTable.approveProposal(id, { reviewer: options.reviewer }));
|
|
92
|
+
printResult(json, data);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
jsonOption(capTable
|
|
96
|
+
.command('reject')
|
|
97
|
+
.description('Reject a cap-table proposal')
|
|
98
|
+
.argument('<id>', 'proposal id')
|
|
99
|
+
.requiredOption('--reviewer <reviewer>', 'reviewer identity (sent as ?reviewer=)')).action(async (id, options) => {
|
|
100
|
+
const json = options.json ?? false;
|
|
101
|
+
await runAction(json, async () => {
|
|
102
|
+
const { client } = makeClient(json);
|
|
103
|
+
const data = await withSpinner(json, `Rejecting proposal ${id}`, () => client.capTable.rejectProposal(id, { reviewer: options.reviewer }));
|
|
104
|
+
printResult(json, data);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
const investors = program.command('investors').description('Investor operations');
|
|
108
|
+
jsonOption(investors.command('list').description('List investors')).action(async (options) => {
|
|
109
|
+
const json = options.json ?? false;
|
|
110
|
+
await runAction(json, async () => {
|
|
111
|
+
const { client } = makeClient(json);
|
|
112
|
+
const data = await withSpinner(json, 'Fetching investors', () => client.investors.list());
|
|
113
|
+
printResult(json, data);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
jsonOption(investors.command('portfolio').description('Get an investor portfolio').argument('<id>', 'investor id')).action(async (id, options) => {
|
|
117
|
+
const json = options.json ?? false;
|
|
118
|
+
await runAction(json, async () => {
|
|
119
|
+
const { client } = makeClient(json);
|
|
120
|
+
const data = await withSpinner(json, `Fetching portfolio for investor ${id}`, () => client.investors.portfolio(id));
|
|
121
|
+
printResult(json, data);
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
const capitalCalls = program.command('capital-calls').description('Capital call operations');
|
|
125
|
+
jsonOption(capitalCalls.command('list').description('List capital calls')).action(async (options) => {
|
|
126
|
+
const json = options.json ?? false;
|
|
127
|
+
await runAction(json, async () => {
|
|
128
|
+
const { client } = makeClient(json);
|
|
129
|
+
const data = await withSpinner(json, 'Fetching capital calls', () => client.capitalCalls.list());
|
|
130
|
+
printResult(json, data);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
jsonOption(capitalCalls.command('overdue').description('List overdue capital calls')).action(async (options) => {
|
|
134
|
+
const json = options.json ?? false;
|
|
135
|
+
await runAction(json, async () => {
|
|
136
|
+
const { client } = makeClient(json);
|
|
137
|
+
const data = await withSpinner(json, 'Fetching overdue capital calls', () => client.capitalCalls.overdue());
|
|
138
|
+
printResult(json, data);
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
jsonOption(capitalCalls.command('payments').description('List payments for a capital call').argument('<id>', 'capital call id')).action(async (id, options) => {
|
|
142
|
+
const json = options.json ?? false;
|
|
143
|
+
await runAction(json, async () => {
|
|
144
|
+
const { client } = makeClient(json);
|
|
145
|
+
const data = await withSpinner(json, `Fetching payments for capital call ${id}`, () => client.capitalCalls.payments(id));
|
|
146
|
+
printResult(json, data);
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
const compliance = program.command('compliance').description('Compliance operations');
|
|
150
|
+
jsonOption(compliance.command('rules').description('List compliance rules')).action(async (options) => {
|
|
151
|
+
const json = options.json ?? false;
|
|
152
|
+
await runAction(json, async () => {
|
|
153
|
+
const { client } = makeClient(json);
|
|
154
|
+
const data = await withSpinner(json, 'Fetching compliance rules', () => client.compliance.rules());
|
|
155
|
+
printResult(json, data);
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
jsonOption(compliance.command('check').description('Show all compliance rules for review').argument('<issuer>', 'issuer name')).action(async (issuer, options) => {
|
|
159
|
+
const json = options.json ?? false;
|
|
160
|
+
await runAction(json, async () => {
|
|
161
|
+
const { client } = makeClient(json);
|
|
162
|
+
const data = await withSpinner(json, `Fetching compliance rules for ${issuer}`, () => client.compliance.rules());
|
|
163
|
+
printResult(json, data);
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
return program;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Runs the CLI with the given argv and returns the process exit code.
|
|
170
|
+
* Used by the bin entry and by tests (no `process.exit` inside).
|
|
171
|
+
*/
|
|
172
|
+
export async function runCli(opts) {
|
|
173
|
+
const program = buildProgram();
|
|
174
|
+
program.exitOverride();
|
|
175
|
+
program.configureOutput({
|
|
176
|
+
writeOut: opts.stdout,
|
|
177
|
+
writeErr: opts.stderr,
|
|
178
|
+
});
|
|
179
|
+
try {
|
|
180
|
+
await program.parseAsync(opts.argv);
|
|
181
|
+
return 0;
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
const candidate = error;
|
|
185
|
+
if (candidate.code === 'commander.helpDisplayed' || candidate.code === 'commander.help') {
|
|
186
|
+
return 0;
|
|
187
|
+
}
|
|
188
|
+
if (candidate.code === 'commander.version') {
|
|
189
|
+
return 0;
|
|
190
|
+
}
|
|
191
|
+
if (typeof candidate.exitCode === 'number') {
|
|
192
|
+
return candidate.exitCode;
|
|
193
|
+
}
|
|
194
|
+
const message = candidate.message ?? 'unexpected error';
|
|
195
|
+
opts.stderr(message);
|
|
196
|
+
return 1;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const entry = process.argv[1];
|
|
200
|
+
const isDirectRun = entry !== undefined && import.meta.url === pathToFileURL(entry).href;
|
|
201
|
+
if (isDirectRun) {
|
|
202
|
+
runCli({
|
|
203
|
+
argv: process.argv,
|
|
204
|
+
stdout: (line) => process.stdout.write(line),
|
|
205
|
+
stderr: (line) => process.stderr.write(line),
|
|
206
|
+
})
|
|
207
|
+
.then((code) => {
|
|
208
|
+
process.exitCode = code;
|
|
209
|
+
})
|
|
210
|
+
.catch((error) => {
|
|
211
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
212
|
+
process.exitCode = 1;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRo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C,OAAO,CAAC,CAAC;QACrB,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AAED,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC9B,MAAM,WAAW,GAAG,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;AAEzF,IAAI,WAAW,EAAE,CAAC;IAChB,MAAM,CAAC;QACL,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5C,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;KAC7C,CAAC;SACC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;QACb,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC1B,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/output.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Flowgate } from '@iflowgate/sdk';
|
|
2
|
+
/** Exit code used when FLOWGATE_API_KEY is missing. */
|
|
3
|
+
export declare const MISSING_KEY_EXIT = 1;
|
|
4
|
+
/** Error with a message already rendered for the terminal. */
|
|
5
|
+
export declare class CliError extends Error {
|
|
6
|
+
readonly exitCode: number;
|
|
7
|
+
constructor(message: string, exitCode?: number);
|
|
8
|
+
}
|
|
9
|
+
export interface CommandContext {
|
|
10
|
+
client: Flowgate;
|
|
11
|
+
json: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Asserts FLOWGATE_API_KEY is present and builds the SDK client with it.
|
|
15
|
+
* Throws {@link CliError} (red message) when the variable is missing.
|
|
16
|
+
*/
|
|
17
|
+
export declare function requireClient(json: boolean): CommandContext;
|
|
18
|
+
/** Runs `task`, showing a spinner unless `--json` output was requested. */
|
|
19
|
+
export declare function withSpinner<T>(json: boolean, text: string, task: () => Promise<T>): Promise<T>;
|
|
20
|
+
/** Prints a value as pretty JSON (spinner mode) or compact JSON (pipe mode). */
|
|
21
|
+
export declare function printResult(json: boolean, value: unknown): void;
|
|
22
|
+
/** Prints an error in red and returns the exit code to use. */
|
|
23
|
+
export declare function handleError(error: unknown, json: boolean): number;
|
|
24
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAiB,MAAM,gBAAgB,CAAC;AAEzD,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,8DAA8D;AAC9D,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,OAAO,EAAE,MAAM,EAAE,QAAQ,SAAI;CAK1C;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,QAAQ,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAM3D;AAED,2EAA2E;AAC3E,wBAAsB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAapG;AAED,gFAAgF;AAChF,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAM/D;AAED,+DAA+D;AAC/D,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAgBjE"}
|
package/dist/output.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared CLI helpers: environment handling, spinner-wrapped execution,
|
|
3
|
+
* pretty/compact JSON output, and red error rendering.
|
|
4
|
+
*/
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
import ora from 'ora';
|
|
7
|
+
import { Flowgate, FlowgateError } from '@iflowgate/sdk';
|
|
8
|
+
/** Exit code used when FLOWGATE_API_KEY is missing. */
|
|
9
|
+
export const MISSING_KEY_EXIT = 1;
|
|
10
|
+
/** Error with a message already rendered for the terminal. */
|
|
11
|
+
export class CliError extends Error {
|
|
12
|
+
exitCode;
|
|
13
|
+
constructor(message, exitCode = 1) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = 'CliError';
|
|
16
|
+
this.exitCode = exitCode;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Asserts FLOWGATE_API_KEY is present and builds the SDK client with it.
|
|
21
|
+
* Throws {@link CliError} (red message) when the variable is missing.
|
|
22
|
+
*/
|
|
23
|
+
export function requireClient(json) {
|
|
24
|
+
const apiKey = process.env.FLOWGATE_API_KEY;
|
|
25
|
+
if (apiKey === undefined || apiKey === '') {
|
|
26
|
+
throw new CliError(chalk.red('FLOWGATE_API_KEY is not set. Export it before running this command.'));
|
|
27
|
+
}
|
|
28
|
+
return { client: new Flowgate({ apiKey }), json };
|
|
29
|
+
}
|
|
30
|
+
/** Runs `task`, showing a spinner unless `--json` output was requested. */
|
|
31
|
+
export async function withSpinner(json, text, task) {
|
|
32
|
+
if (json) {
|
|
33
|
+
return task();
|
|
34
|
+
}
|
|
35
|
+
const spinner = ora(text).start();
|
|
36
|
+
try {
|
|
37
|
+
const result = await task();
|
|
38
|
+
spinner.succeed();
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
spinner.fail();
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** Prints a value as pretty JSON (spinner mode) or compact JSON (pipe mode). */
|
|
47
|
+
export function printResult(json, value) {
|
|
48
|
+
if (json) {
|
|
49
|
+
process.stdout.write(`${JSON.stringify(value)}\n`);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
|
|
53
|
+
}
|
|
54
|
+
/** Prints an error in red and returns the exit code to use. */
|
|
55
|
+
export function handleError(error, json) {
|
|
56
|
+
let message;
|
|
57
|
+
if (error instanceof FlowgateError) {
|
|
58
|
+
const hint = error.status === 401 ? ' (check FLOWGATE_API_KEY)' : '';
|
|
59
|
+
message = `${error.endpoint} -> ${error.status}: ${error.detail}${hint}`;
|
|
60
|
+
}
|
|
61
|
+
else if (error instanceof CliError) {
|
|
62
|
+
message = error.message;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
message = error instanceof Error ? error.message : String(error);
|
|
66
|
+
}
|
|
67
|
+
if (json) {
|
|
68
|
+
process.stderr.write(`${JSON.stringify({ error: message })}\n`);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
process.stderr.write(`${chalk.red(message)}\n`);
|
|
72
|
+
}
|
|
73
|
+
return error instanceof CliError ? error.exitCode : 1;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,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,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,KAAK,YAAY,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iflowgate/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Flowgate command-line interface.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"flowgate": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/titouhalloub/flowgate-sdk.git"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@iflowgate/sdk": "0.1.1",
|
|
27
|
+
"chalk": "5.6.2",
|
|
28
|
+
"commander": "12.1.0",
|
|
29
|
+
"ora": "8.2.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "20.19.30",
|
|
33
|
+
"typescript": "5.9.3",
|
|
34
|
+
"vitest": "3.2.7"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsc -p tsconfig.json",
|
|
38
|
+
"test": "vitest run",
|
|
39
|
+
"typecheck": "tsc --noEmit",
|
|
40
|
+
"lint": "tsc --noEmit",
|
|
41
|
+
"regen": "echo \"@iflowgate/cli: no schema to regen\""
|
|
42
|
+
}
|
|
6
43
|
}
|