@thecorporation/corp-tools 26.3.25 → 26.3.33
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/browser.d.ts
CHANGED
|
@@ -3172,6 +3172,8 @@ declare class CorpAPIClient {
|
|
|
3172
3172
|
private del;
|
|
3173
3173
|
/** Public generic GET for declarative/registry-driven commands. */
|
|
3174
3174
|
fetchJSON(path: string, params?: Record<string, string>): Promise<unknown>;
|
|
3175
|
+
/** Public generic request for declarative/registry-driven write commands. */
|
|
3176
|
+
submitJSON(method: string, path: string, body?: unknown): Promise<unknown>;
|
|
3175
3177
|
getStatus(): Promise<WorkspaceStatusResponse>;
|
|
3176
3178
|
getObligations(tier?: string): Promise<ApiRecord>;
|
|
3177
3179
|
listDigests(): Promise<DigestSummary[]>;
|
|
@@ -3457,6 +3459,6 @@ declare function normalizedGrantType(grantType: string): string;
|
|
|
3457
3459
|
declare function expectedInstrumentKinds(grantType: string): string[];
|
|
3458
3460
|
declare function grantRequiresCurrent409a(grantType: string, instrumentKind?: string): boolean;
|
|
3459
3461
|
declare function entityHasActiveBoard(client: CorpAPIClient, entityId: string): Promise<boolean>;
|
|
3460
|
-
declare function ensureIssuancePreflight(client: CorpAPIClient, entityId: string, grantType: string, instrument?: CapTableInstrument, meetingId?: string, resolutionId?: string): Promise<void>;
|
|
3462
|
+
declare function ensureIssuancePreflight(client: CorpAPIClient, entityId: string, grantType: string, instrument?: CapTableInstrument, meetingId?: string, resolutionId?: string, operationLabel?: string): Promise<void>;
|
|
3461
3463
|
|
|
3462
3464
|
export { type ApiRecord, CorpAPIClient, type MatchRecord, type NextStepItem, type NextStepsResponse, type NextStepsSummary, RESOURCE_KINDS, type ReferenceMatch, type ReferenceStorage, ReferenceTracker, type ResourceKind, type WorkflowResult, type WorkflowStep, describeReferenceRecord, ensureIssuancePreflight, entityHasActiveBoard, expectedInstrumentKinds, getReferenceAlias, getReferenceId, getReferenceLabel, grantRequiresCurrent409a, isValidResourceKind, issueEquity, issueSafe, matchRank, normalizedGrantType, shortId, slugify, writtenConsent };
|
package/dist/browser.js
CHANGED
|
@@ -327,6 +327,14 @@ var CorpAPIClient = class {
|
|
|
327
327
|
async fetchJSON(path, params) {
|
|
328
328
|
return this.get(path, params);
|
|
329
329
|
}
|
|
330
|
+
/** Public generic request for declarative/registry-driven write commands. */
|
|
331
|
+
async submitJSON(method, path, body) {
|
|
332
|
+
const resp = await this.request(method, path, body);
|
|
333
|
+
await this.throwIfError(resp);
|
|
334
|
+
const text = await resp.text();
|
|
335
|
+
if (!text) return {};
|
|
336
|
+
return JSON.parse(text);
|
|
337
|
+
}
|
|
330
338
|
// --- Workspace ---
|
|
331
339
|
getStatus() {
|
|
332
340
|
return this.get(`/v1/workspaces/${pathSegment(this.workspaceId)}/status`);
|
|
@@ -1221,11 +1229,13 @@ async function entityHasActiveBoard(client, entityId) {
|
|
|
1221
1229
|
(body) => String(body.body_type ?? "").toLowerCase() === "board_of_directors" && String(body.status ?? "active").toLowerCase() === "active"
|
|
1222
1230
|
);
|
|
1223
1231
|
}
|
|
1224
|
-
async function ensureIssuancePreflight(client, entityId, grantType, instrument, meetingId, resolutionId) {
|
|
1232
|
+
async function ensureIssuancePreflight(client, entityId, grantType, instrument, meetingId, resolutionId, operationLabel) {
|
|
1225
1233
|
if (!meetingId || !resolutionId) {
|
|
1226
1234
|
if (await entityHasActiveBoard(client, entityId)) {
|
|
1235
|
+
const label = operationLabel ?? "this issuance";
|
|
1227
1236
|
throw new Error(
|
|
1228
|
-
|
|
1237
|
+
`Board approval is required for ${label}. Pass --meeting-id and --resolution-id from a passed board vote.
|
|
1238
|
+
Tip: Use 'corp governance quick-approve --text "RESOLVED: authorize ${label}"' for one-step approval.`
|
|
1229
1239
|
);
|
|
1230
1240
|
}
|
|
1231
1241
|
}
|
|
@@ -1288,7 +1298,8 @@ async function issueEquity(client, args) {
|
|
|
1288
1298
|
args.grantType,
|
|
1289
1299
|
instrument,
|
|
1290
1300
|
args.meetingId,
|
|
1291
|
-
args.resolutionId
|
|
1301
|
+
args.resolutionId,
|
|
1302
|
+
"equity issuance"
|
|
1292
1303
|
);
|
|
1293
1304
|
steps.push({ name: "preflight", status: "ok" });
|
|
1294
1305
|
const round = await client.startEquityRound({
|
|
@@ -1366,7 +1377,8 @@ async function issueSafe(client, args) {
|
|
|
1366
1377
|
safeType,
|
|
1367
1378
|
void 0,
|
|
1368
1379
|
args.meetingId,
|
|
1369
|
-
args.resolutionId
|
|
1380
|
+
args.resolutionId,
|
|
1381
|
+
"SAFE issuance"
|
|
1370
1382
|
);
|
|
1371
1383
|
steps.push({ name: "preflight", status: "ok" });
|
|
1372
1384
|
const body = {
|