@thecorporation/corp-tools 26.3.25 → 26.3.32
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/dist/browser.d.ts +3 -1
- package/dist/browser.js +16 -4
- package/dist/browser.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -347,6 +347,14 @@ var CorpAPIClient = class {
|
|
|
347
347
|
async fetchJSON(path, params) {
|
|
348
348
|
return this.get(path, params);
|
|
349
349
|
}
|
|
350
|
+
/** Public generic request for declarative/registry-driven write commands. */
|
|
351
|
+
async submitJSON(method, path, body) {
|
|
352
|
+
const resp = await this.request(method, path, body);
|
|
353
|
+
await this.throwIfError(resp);
|
|
354
|
+
const text = await resp.text();
|
|
355
|
+
if (!text) return {};
|
|
356
|
+
return JSON.parse(text);
|
|
357
|
+
}
|
|
350
358
|
// --- Workspace ---
|
|
351
359
|
getStatus() {
|
|
352
360
|
return this.get(`/v1/workspaces/${pathSegment(this.workspaceId)}/status`);
|
|
@@ -2689,11 +2697,13 @@ async function entityHasActiveBoard2(client, entityId) {
|
|
|
2689
2697
|
(body) => String(body.body_type ?? "").toLowerCase() === "board_of_directors" && String(body.status ?? "active").toLowerCase() === "active"
|
|
2690
2698
|
);
|
|
2691
2699
|
}
|
|
2692
|
-
async function ensureIssuancePreflight2(client, entityId, grantType, instrument, meetingId, resolutionId) {
|
|
2700
|
+
async function ensureIssuancePreflight2(client, entityId, grantType, instrument, meetingId, resolutionId, operationLabel) {
|
|
2693
2701
|
if (!meetingId || !resolutionId) {
|
|
2694
2702
|
if (await entityHasActiveBoard2(client, entityId)) {
|
|
2703
|
+
const label = operationLabel ?? "this issuance";
|
|
2695
2704
|
throw new Error(
|
|
2696
|
-
|
|
2705
|
+
`Board approval is required for ${label}. Pass --meeting-id and --resolution-id from a passed board vote.
|
|
2706
|
+
Tip: Use 'corp governance quick-approve --text "RESOLVED: authorize ${label}"' for one-step approval.`
|
|
2697
2707
|
);
|
|
2698
2708
|
}
|
|
2699
2709
|
}
|
|
@@ -2756,7 +2766,8 @@ async function issueEquity(client, args) {
|
|
|
2756
2766
|
args.grantType,
|
|
2757
2767
|
instrument,
|
|
2758
2768
|
args.meetingId,
|
|
2759
|
-
args.resolutionId
|
|
2769
|
+
args.resolutionId,
|
|
2770
|
+
"equity issuance"
|
|
2760
2771
|
);
|
|
2761
2772
|
steps.push({ name: "preflight", status: "ok" });
|
|
2762
2773
|
const round = await client.startEquityRound({
|
|
@@ -2834,7 +2845,8 @@ async function issueSafe(client, args) {
|
|
|
2834
2845
|
safeType,
|
|
2835
2846
|
void 0,
|
|
2836
2847
|
args.meetingId,
|
|
2837
|
-
args.resolutionId
|
|
2848
|
+
args.resolutionId,
|
|
2849
|
+
"SAFE issuance"
|
|
2838
2850
|
);
|
|
2839
2851
|
steps.push({ name: "preflight", status: "ok" });
|
|
2840
2852
|
const body = {
|