@capxul/cli 4.20.0-beta.12 → 4.20.0-beta.14
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/main.mjs +184 -78
- package/dist/main.mjs.map +1 -1
- package/package.json +3 -3
package/dist/main.mjs
CHANGED
|
@@ -16127,7 +16127,7 @@ function signerFailure(source, operation, cause) {
|
|
|
16127
16127
|
}
|
|
16128
16128
|
//#endregion
|
|
16129
16129
|
//#region ../../packages/sdk/package.json
|
|
16130
|
-
var version$3 = "4.20.0-beta.
|
|
16130
|
+
var version$3 = "4.20.0-beta.14";
|
|
16131
16131
|
//#endregion
|
|
16132
16132
|
//#region ../../packages/sdk/src/telemetry/exception-projection.ts
|
|
16133
16133
|
/** Fixed fallback for failures that have no safe message. */
|
|
@@ -68879,8 +68879,8 @@ function captureException(telemetry, error, context) {
|
|
|
68879
68879
|
}
|
|
68880
68880
|
//#endregion
|
|
68881
68881
|
//#region src/runtime/version.ts
|
|
68882
|
-
const cliVersion = "4.20.0-beta.
|
|
68883
|
-
const sdkVersion = "4.20.0-beta.
|
|
68882
|
+
const cliVersion = "4.20.0-beta.14";
|
|
68883
|
+
const sdkVersion = "4.20.0-beta.14";
|
|
68884
68884
|
const ReleaseVersion = Schema.String.check(Schema.isMaxLength(256), Schema.isPattern(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/u)).pipe(Schema.brand("CliReleaseVersion"));
|
|
68885
68885
|
const parts = (version) => {
|
|
68886
68886
|
const [core = "", ...prerelease] = version.split("+")[0].split("-");
|
|
@@ -69971,10 +69971,21 @@ function observeInvocation(input, work) {
|
|
|
69971
69971
|
dropped += 1;
|
|
69972
69972
|
return;
|
|
69973
69973
|
}
|
|
69974
|
-
const props =
|
|
69975
|
-
|
|
69976
|
-
|
|
69977
|
-
|
|
69974
|
+
const props = {};
|
|
69975
|
+
const shape = catalog.fields.props;
|
|
69976
|
+
const members = "fields" in shape ? [shape] : shape.members;
|
|
69977
|
+
for (const member of members) for (const key of Object.keys(member.fields)) {
|
|
69978
|
+
if ([
|
|
69979
|
+
"actor_id",
|
|
69980
|
+
"actor_kind",
|
|
69981
|
+
"auth_user_id",
|
|
69982
|
+
"anonymous_id",
|
|
69983
|
+
"cli_identity_kind",
|
|
69984
|
+
"distinct_id",
|
|
69985
|
+
"$groups"
|
|
69986
|
+
].includes(key)) continue;
|
|
69987
|
+
const value = own(properties, key);
|
|
69988
|
+
if (value !== void 0) props[key] = value;
|
|
69978
69989
|
}
|
|
69979
69990
|
const decoded = Schema.decodeUnknownOption(catalog)({
|
|
69980
69991
|
name: event,
|
|
@@ -71669,7 +71680,11 @@ const restoreVerifiedClient = (config, opened, options) => Effect.gen(function*
|
|
|
71669
71680
|
}).pipe(Effect.mapError((error) => authenticationFailure(error, opened.email)));
|
|
71670
71681
|
const restoreAuthenticatedClient = (config, suppliedEmail, options) => Effect.gen(function* () {
|
|
71671
71682
|
const opened = yield* openAuthenticatedSession(config, suppliedEmail);
|
|
71672
|
-
|
|
71683
|
+
const runtime = yield* CliRuntime;
|
|
71684
|
+
return yield* withWaiting(restoreVerifiedClient(config, opened, options), {
|
|
71685
|
+
...runtime,
|
|
71686
|
+
label: "Session restoration"
|
|
71687
|
+
});
|
|
71673
71688
|
});
|
|
71674
71689
|
const profileReport = (client, session, readProfile) => Effect.gen(function* () {
|
|
71675
71690
|
const profile = yield* call((signal) => readProfile === void 0 ? client.identity.loadCurrent({ signal }) : readProfile(signal));
|
|
@@ -71851,7 +71866,11 @@ const completeAccountSetup = (config, store, client, session, suppliedProfile, c
|
|
|
71851
71866
|
//#region src/commands/account/subcommands/status/execute.ts
|
|
71852
71867
|
const execute$77 = (config, email) => Effect.gen(function* () {
|
|
71853
71868
|
const { client, session } = yield* restoreAuthenticatedClient(config, email);
|
|
71854
|
-
|
|
71869
|
+
const runtime = yield* CliRuntime;
|
|
71870
|
+
return yield* withWaiting(Effect.promise(() => client.account.getLifecycle()).pipe(Effect.flatMap(resultValue), Effect.map((lifecycle) => lifecycleResult(lifecycle, session.email)), Effect.mapError((error) => accountReadFailure(error, session.email))), {
|
|
71871
|
+
...runtime,
|
|
71872
|
+
label: "Account status"
|
|
71873
|
+
});
|
|
71855
71874
|
});
|
|
71856
71875
|
//#endregion
|
|
71857
71876
|
//#region src/commands/account/subcommands/status/command.ts
|
|
@@ -71860,10 +71879,14 @@ const command$79 = Command.make("status", { email: emailFlag$10 }, ({ email }) =
|
|
|
71860
71879
|
//#region src/commands/account/subcommands/balance/execute.ts
|
|
71861
71880
|
const execute$76 = (config, email) => Effect.gen(function* () {
|
|
71862
71881
|
const { client, session } = yield* restoreAuthenticatedClient(config, email);
|
|
71863
|
-
|
|
71882
|
+
const runtime = yield* CliRuntime;
|
|
71883
|
+
return yield* withWaiting(Effect.promise((signal) => client.accounts.read({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((account) => ({
|
|
71864
71884
|
data: { account },
|
|
71865
71885
|
lines: balanceLines(account)
|
|
71866
|
-
})), Effect.mapError((error) => accountReadFailure(error, session.email)))
|
|
71886
|
+
})), Effect.mapError((error) => accountReadFailure(error, session.email))), {
|
|
71887
|
+
...runtime,
|
|
71888
|
+
label: "Account balance"
|
|
71889
|
+
});
|
|
71867
71890
|
});
|
|
71868
71891
|
//#endregion
|
|
71869
71892
|
//#region src/commands/account/subcommands/balance/command.ts
|
|
@@ -71872,10 +71895,14 @@ const command$78 = Command.make("balance", { email: emailFlag$10 }, ({ email })
|
|
|
71872
71895
|
//#region src/commands/account/subcommands/deposit/execute.ts
|
|
71873
71896
|
const execute$75 = (config, email) => Effect.gen(function* () {
|
|
71874
71897
|
const { client, session } = yield* restoreAuthenticatedClient(config, email);
|
|
71875
|
-
|
|
71898
|
+
const runtime = yield* CliRuntime;
|
|
71899
|
+
return yield* withWaiting(Effect.promise((signal) => client.account.profile.depositInstructions({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((depositInstructions) => ({
|
|
71876
71900
|
data: { depositInstructions },
|
|
71877
71901
|
lines: depositLines(depositInstructions)
|
|
71878
|
-
})), Effect.mapError((error) => accountReadFailure(error, session.email)))
|
|
71902
|
+
})), Effect.mapError((error) => accountReadFailure(error, session.email))), {
|
|
71903
|
+
...runtime,
|
|
71904
|
+
label: "Account deposit instructions"
|
|
71905
|
+
});
|
|
71879
71906
|
});
|
|
71880
71907
|
//#endregion
|
|
71881
71908
|
//#region src/commands/account/subcommands/deposit/command.ts
|
|
@@ -72299,7 +72326,10 @@ const readOrganization = (config, command, input, handler) => Effect.gen(functio
|
|
|
72299
72326
|
const local = command === "list" || command === "use" ? organizationId : yield* readResolvedOrganization(config, session.authUserId, organizationId);
|
|
72300
72327
|
const setupRead = command === "status" || command === "wait";
|
|
72301
72328
|
let unfinished = [];
|
|
72302
|
-
if (setupRead && local === null) unfinished = yield* listUnfinishedSetups(client)
|
|
72329
|
+
if (setupRead && local === null) unfinished = yield* withWaiting(listUnfinishedSetups(client), {
|
|
72330
|
+
...runtime,
|
|
72331
|
+
label: "Organization setup discovery"
|
|
72332
|
+
});
|
|
72303
72333
|
let resolved = setupRead && local === null && unfinished.length === 1 ? unfinished[0].orgId : local;
|
|
72304
72334
|
if (setupRead && unfinished.length > 1) {
|
|
72305
72335
|
if (!interactive) return yield* Effect.fail(inputRequired("Provide --org to select one unfinished Organization setup."));
|
|
@@ -72312,8 +72342,14 @@ const readOrganization = (config, command, input, handler) => Effect.gen(functio
|
|
|
72312
72342
|
});
|
|
72313
72343
|
}
|
|
72314
72344
|
const exactSetupRead = setupRead && resolved !== null;
|
|
72315
|
-
const organizations = exactSetupRead ? [] : yield* Effect.promise((signal) => handler.kind === "list" ? handler.listOrganizations(client, signal) : client.orgs({ signal })).pipe(Effect.flatMap(resultValue))
|
|
72316
|
-
|
|
72345
|
+
const organizations = exactSetupRead ? [] : yield* withWaiting(Effect.promise((signal) => handler.kind === "list" ? handler.listOrganizations(client, signal) : client.orgs({ signal })).pipe(Effect.flatMap(resultValue)), {
|
|
72346
|
+
...runtime,
|
|
72347
|
+
label: "Organization access"
|
|
72348
|
+
});
|
|
72349
|
+
if (command === "list") unfinished = yield* withWaiting(listUnfinishedSetups(client, handler.kind === "list" ? handler.readSetupPage : void 0), {
|
|
72350
|
+
...runtime,
|
|
72351
|
+
label: "Organization setup discovery"
|
|
72352
|
+
});
|
|
72317
72353
|
if (command === "list") {
|
|
72318
72354
|
if (handler.kind !== "list") return yield* Effect.die("Expected Organization list handler");
|
|
72319
72355
|
return yield* handler.run(organizations, unfinished);
|
|
@@ -73312,6 +73348,16 @@ const contactLines = (entry) => [
|
|
|
73312
73348
|
];
|
|
73313
73349
|
//#endregion
|
|
73314
73350
|
//#region src/commands/contact/internal/recovery.ts
|
|
73351
|
+
/** Only an exact selected Organization can normalize the backend's masked denial. */
|
|
73352
|
+
const normalizeContactScopeFailure = (error, orgs) => {
|
|
73353
|
+
const selected = [...new Set(orgs)];
|
|
73354
|
+
if (selected.length !== 1 || selected[0] === void 0) return error;
|
|
73355
|
+
try {
|
|
73356
|
+
return normalizeOrganizationReadFailure(error, toOrgId(selected[0]));
|
|
73357
|
+
} catch {
|
|
73358
|
+
return error;
|
|
73359
|
+
}
|
|
73360
|
+
};
|
|
73315
73361
|
/** A lost write response needs readback in the same actor scope. */
|
|
73316
73362
|
const uncertainContactFailure = (error, email, orgs, entryId) => {
|
|
73317
73363
|
const failure = classifyFailure(Cause.fail(error));
|
|
@@ -73357,6 +73403,12 @@ const unhideCommand = (email, orgs, entryId) => {
|
|
|
73357
73403
|
return `capxul ${orgs[0] === void 0 ? "" : "org "}contact unhide${orgs[0] === void 0 ? "" : ` --org ${shellArgument(orgs[0])}`} --entry-id ${shellArgument(entryId)} --email ${shellArgument(email)} --confirm`;
|
|
73358
73404
|
};
|
|
73359
73405
|
//#endregion
|
|
73406
|
+
//#region src/commands/contact/internal/client.ts
|
|
73407
|
+
const contactWaiting = (work, label) => Effect.flatMap(CliRuntime, (runtime) => withWaiting(work, {
|
|
73408
|
+
...runtime,
|
|
73409
|
+
label
|
|
73410
|
+
}));
|
|
73411
|
+
//#endregion
|
|
73360
73412
|
//#region src/commands/contact/internal/selection.ts
|
|
73361
73413
|
const selectedBook = (client, actor, orgs) => Effect.gen(function* () {
|
|
73362
73414
|
const ids = [...new Set(orgs)];
|
|
@@ -73373,9 +73425,9 @@ const selectedBook = (client, actor, orgs) => Effect.gen(function* () {
|
|
|
73373
73425
|
return client.org(organizationId).addressBook;
|
|
73374
73426
|
});
|
|
73375
73427
|
/** Preserve supplied IDs; otherwise select an exact Party in this book, including hidden entries. */
|
|
73376
|
-
const selectContactParty = (book, supplied) => Effect.gen(function* () {
|
|
73428
|
+
const selectContactParty = (book, supplied, orgs) => Effect.gen(function* () {
|
|
73377
73429
|
if (supplied !== null) return supplied;
|
|
73378
|
-
const entries = yield* Effect.promise((signal) => book.list({ includeHidden: true }, { signal })).pipe(Effect.flatMap(resultValue));
|
|
73430
|
+
const entries = yield* contactWaiting(Effect.promise((signal) => book.list({ includeHidden: true }, { signal })).pipe(Effect.flatMap(resultValue)), "Contact selection").pipe(Effect.mapError((error) => normalizeContactScopeFailure(error, orgs)));
|
|
73379
73431
|
if (entries.length === 0) return yield* inputRequired("No contacts are available to select.");
|
|
73380
73432
|
return yield* Prompt.select({
|
|
73381
73433
|
message: "Contact",
|
|
@@ -73411,7 +73463,10 @@ const perform$15 = (book, prepared, orgs, email) => Effect.gen(function* () {
|
|
|
73411
73463
|
],
|
|
73412
73464
|
question: "Add this contact?"
|
|
73413
73465
|
});
|
|
73414
|
-
const entry = yield* Effect.promise((signal) => book.add(prepared.value, { signal })).pipe(Effect.flatMap(resultValue), Effect.mapError((error) =>
|
|
73466
|
+
const entry = yield* contactWaiting(Effect.promise((signal) => book.add(prepared.value, { signal })).pipe(Effect.flatMap(resultValue)), "Contact add").pipe(Effect.mapError((error) => {
|
|
73467
|
+
const scoped = normalizeContactScopeFailure(error, orgs);
|
|
73468
|
+
return email === void 0 || !isCapxulError(scoped) ? scoped : uncertainContactFailure(scoped, email, orgs);
|
|
73469
|
+
}));
|
|
73415
73470
|
return {
|
|
73416
73471
|
data: entry,
|
|
73417
73472
|
lines: [
|
|
@@ -73446,8 +73501,8 @@ const command$65 = (context) => Command.make("add", {
|
|
|
73446
73501
|
//#region src/commands/contact/subcommands/get/execute.ts
|
|
73447
73502
|
const prepare$3 = (input) => optionalPartyId(input.entryId);
|
|
73448
73503
|
const perform$14 = (book, entryId, orgs) => Effect.gen(function* () {
|
|
73449
|
-
const selected = yield* selectContactParty(book, entryId);
|
|
73450
|
-
const entry = yield* Effect.promise((signal) => book.get(selected, { signal })).pipe(Effect.flatMap(resultValue));
|
|
73504
|
+
const selected = yield* selectContactParty(book, entryId, orgs);
|
|
73505
|
+
const entry = yield* contactWaiting(Effect.promise((signal) => book.get(selected, { signal })).pipe(Effect.flatMap(resultValue)), "Contact get").pipe(Effect.mapError((error) => normalizeContactScopeFailure(error, orgs)));
|
|
73451
73506
|
return {
|
|
73452
73507
|
data: entry,
|
|
73453
73508
|
lines: [actorLine(orgs), ...entry === null ? ["No contact found."] : contactLines(entry)]
|
|
@@ -73475,9 +73530,9 @@ const command$64 = (context) => Command.make("get", {
|
|
|
73475
73530
|
//#endregion
|
|
73476
73531
|
//#region src/commands/contact/internal/visibility.ts
|
|
73477
73532
|
const performVisibility = (book, prepared, orgs, email, kind, mutate) => Effect.gen(function* () {
|
|
73478
|
-
const entryId = yield* selectContactParty(book, prepared.entryId);
|
|
73533
|
+
const entryId = yield* selectContactParty(book, prepared.entryId, orgs);
|
|
73479
73534
|
if (prepared.interactive) {
|
|
73480
|
-
const current = yield* Effect.promise((signal) => book.get(entryId, { signal })).pipe(Effect.flatMap(resultValue));
|
|
73535
|
+
const current = yield* contactWaiting(Effect.promise((signal) => book.get(entryId, { signal })).pipe(Effect.flatMap(resultValue)), "Contact preview").pipe(Effect.mapError((error) => normalizeContactScopeFailure(error, orgs)));
|
|
73481
73536
|
if (current === null) return yield* inputRequired("No contact has that --entry-id.");
|
|
73482
73537
|
yield* confirmWrite({
|
|
73483
73538
|
lines: [
|
|
@@ -73488,7 +73543,10 @@ const performVisibility = (book, prepared, orgs, email, kind, mutate) => Effect.
|
|
|
73488
73543
|
question: kind === "hide" ? "Hide this contact?" : "Show this contact again?"
|
|
73489
73544
|
});
|
|
73490
73545
|
}
|
|
73491
|
-
const entry = yield* Effect.promise((signal) => mutate(entryId, signal)).pipe(Effect.flatMap(resultValue),
|
|
73546
|
+
const entry = yield* contactWaiting(Effect.promise((signal) => mutate(entryId, signal)).pipe(Effect.flatMap(resultValue)), kind === "hide" ? "Contact hide" : "Contact unhide").pipe(Effect.mapError((error) => {
|
|
73547
|
+
const scoped = normalizeContactScopeFailure(error, orgs);
|
|
73548
|
+
return email === void 0 || !isCapxulError(scoped) ? scoped : uncertainContactFailure(scoped, email, orgs, entryId);
|
|
73549
|
+
}));
|
|
73492
73550
|
const undo = kind !== "hide" || email === void 0 ? null : unhideCommand(email, orgs, entry.id);
|
|
73493
73551
|
return {
|
|
73494
73552
|
data: entry,
|
|
@@ -73540,9 +73598,9 @@ const prepare$1 = (input) => Effect.gen(function* () {
|
|
|
73540
73598
|
};
|
|
73541
73599
|
});
|
|
73542
73600
|
const perform$12 = (book, prepared, orgs, email) => Effect.gen(function* () {
|
|
73543
|
-
const entryId = yield* selectContactParty(book, prepared.entryId);
|
|
73601
|
+
const entryId = yield* selectContactParty(book, prepared.entryId, orgs);
|
|
73544
73602
|
if (prepared.interactive) {
|
|
73545
|
-
const current = yield* Effect.promise((signal) => book.get(entryId, { signal })).pipe(Effect.flatMap(resultValue));
|
|
73603
|
+
const current = yield* contactWaiting(Effect.promise((signal) => book.get(entryId, { signal })).pipe(Effect.flatMap(resultValue)), "Contact preview").pipe(Effect.mapError((error) => normalizeContactScopeFailure(error, orgs)));
|
|
73546
73604
|
if (current === null) return yield* inputRequired("No contact has that --entry-id.");
|
|
73547
73605
|
yield* confirmWrite({
|
|
73548
73606
|
lines: [
|
|
@@ -73553,10 +73611,13 @@ const perform$12 = (book, prepared, orgs, email) => Effect.gen(function* () {
|
|
|
73553
73611
|
question: "Change this contact's label?"
|
|
73554
73612
|
});
|
|
73555
73613
|
}
|
|
73556
|
-
const entry = yield* Effect.promise((signal) => book.label({
|
|
73614
|
+
const entry = yield* contactWaiting(Effect.promise((signal) => book.label({
|
|
73557
73615
|
entryId,
|
|
73558
73616
|
label: prepared.label
|
|
73559
|
-
}, { signal })).pipe(Effect.flatMap(resultValue), Effect.mapError((error) =>
|
|
73617
|
+
}, { signal })).pipe(Effect.flatMap(resultValue)), "Contact label").pipe(Effect.mapError((error) => {
|
|
73618
|
+
const scoped = normalizeContactScopeFailure(error, orgs);
|
|
73619
|
+
return email === void 0 || !isCapxulError(scoped) ? scoped : uncertainContactFailure(scoped, email, orgs, entryId);
|
|
73620
|
+
}));
|
|
73560
73621
|
return {
|
|
73561
73622
|
data: entry,
|
|
73562
73623
|
lines: [
|
|
@@ -73591,7 +73652,7 @@ const command$62 = (context) => Command.make("label", {
|
|
|
73591
73652
|
}, execute$59)).pipe(context.annotate("label"), Command.withDescription("Change one contact label by stable PartyId"));
|
|
73592
73653
|
//#endregion
|
|
73593
73654
|
//#region src/commands/contact/subcommands/list/execute.ts
|
|
73594
|
-
const perform$11 = (book, input, orgs) => Effect.promise((signal) => book.list(input.includeHidden ? { includeHidden: true } : void 0, { signal })).pipe(Effect.flatMap(resultValue), Effect.map((entries) => ({
|
|
73655
|
+
const perform$11 = (book, input, orgs) => contactWaiting(Effect.promise((signal) => book.list(input.includeHidden ? { includeHidden: true } : void 0, { signal })).pipe(Effect.flatMap(resultValue)), "Contact list").pipe(Effect.mapError((error) => normalizeContactScopeFailure(error, orgs)), Effect.map((entries) => ({
|
|
73595
73656
|
data: entries,
|
|
73596
73657
|
lines: [actorLine(orgs), ...entries.length === 0 ? ["No contacts found."] : entries.flatMap(contactLines)]
|
|
73597
73658
|
})));
|
|
@@ -74498,7 +74559,7 @@ const resolveOwningOrganization = (client, invitationId) => Effect.gen(function*
|
|
|
74498
74559
|
}, { signal })).pipe(Effect.flatMap(resultValue));
|
|
74499
74560
|
const match = page.items.find((invitation) => invitation.id === invitationId);
|
|
74500
74561
|
if (match !== void 0) return match.orgId;
|
|
74501
|
-
if (page.nextCursor === null) return yield* Effect.fail(
|
|
74562
|
+
if (page.nextCursor === null) return yield* Effect.fail(invitationAccessFailure(new CapxulError("ROLE_PERMISSION_DENIED", "The invitation is unavailable.")));
|
|
74502
74563
|
cursor = page.nextCursor;
|
|
74503
74564
|
}
|
|
74504
74565
|
});
|
|
@@ -74805,13 +74866,19 @@ const invite = Command.make("invite").pipe(annotate$6(CAPXUL_OPERATIONS.org.invi
|
|
|
74805
74866
|
]));
|
|
74806
74867
|
//#endregion
|
|
74807
74868
|
//#region src/commands/org/subcommands/balance/execute.ts
|
|
74808
|
-
const perform$9 = (scoped, organizationId, organization) => Effect.
|
|
74809
|
-
|
|
74810
|
-
|
|
74811
|
-
|
|
74812
|
-
|
|
74813
|
-
|
|
74814
|
-
}
|
|
74869
|
+
const perform$9 = (scoped, organizationId, organization) => Effect.gen(function* () {
|
|
74870
|
+
const runtime = yield* CliRuntime;
|
|
74871
|
+
return yield* withWaiting(Effect.promise((signal) => scoped.treasury({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((account) => ({
|
|
74872
|
+
data: {
|
|
74873
|
+
organizationId,
|
|
74874
|
+
account
|
|
74875
|
+
},
|
|
74876
|
+
lines: [...organizationIdentityLines(organization), ...balanceLines(account)]
|
|
74877
|
+
}))), {
|
|
74878
|
+
...runtime,
|
|
74879
|
+
label: "Organization balance"
|
|
74880
|
+
});
|
|
74881
|
+
});
|
|
74815
74882
|
const execute$46 = (config, input) => readOrganization(config, "balance", input, {
|
|
74816
74883
|
kind: "scoped",
|
|
74817
74884
|
run: ({ scoped, organizationId, organization }) => perform$9(scoped(), organizationId, organization)
|
|
@@ -74821,13 +74888,19 @@ const execute$46 = (config, input) => readOrganization(config, "balance", input,
|
|
|
74821
74888
|
const command$49 = Command.make("balance", scoped, (flags) => read("org.balance", flags, execute$46)).pipe(Command.annotate(CliCommandMetadata, metadata$12("org.balance")), Command.withDescription("Read exact Organization treasury balances"));
|
|
74822
74889
|
//#endregion
|
|
74823
74890
|
//#region src/commands/org/subcommands/deposit/execute.ts
|
|
74824
|
-
const perform$8 = (scoped, organizationId, organization) => Effect.
|
|
74825
|
-
|
|
74826
|
-
|
|
74827
|
-
|
|
74828
|
-
|
|
74829
|
-
|
|
74830
|
-
}
|
|
74891
|
+
const perform$8 = (scoped, organizationId, organization) => Effect.gen(function* () {
|
|
74892
|
+
const runtime = yield* CliRuntime;
|
|
74893
|
+
return yield* withWaiting(Effect.promise((signal) => scoped.profile.depositInstructions({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((depositInstructions) => ({
|
|
74894
|
+
data: {
|
|
74895
|
+
organizationId,
|
|
74896
|
+
depositInstructions
|
|
74897
|
+
},
|
|
74898
|
+
lines: [...organizationIdentityLines(organization), ...depositLines(depositInstructions)]
|
|
74899
|
+
}))), {
|
|
74900
|
+
...runtime,
|
|
74901
|
+
label: "Organization deposit instructions"
|
|
74902
|
+
});
|
|
74903
|
+
});
|
|
74831
74904
|
const execute$45 = (config, input) => readOrganization(config, "deposit", input, {
|
|
74832
74905
|
kind: "scoped",
|
|
74833
74906
|
run: ({ scoped, organizationId, organization }) => perform$8(scoped(), organizationId, organization)
|
|
@@ -74947,10 +75020,13 @@ const accessDenied = (orgId) => new CliFailure({
|
|
|
74947
75020
|
});
|
|
74948
75021
|
const resolvePermissionScope = (config, email, explicit) => Effect.gen(function* () {
|
|
74949
75022
|
const { client, session } = yield* restoreAuthenticatedClient(config, email);
|
|
74950
|
-
const
|
|
75023
|
+
const runtime = yield* CliRuntime;
|
|
75024
|
+
const organizations = yield* withWaiting(Effect.promise((signal) => client.orgs({ signal })).pipe(Effect.flatMap(resultValue)), {
|
|
75025
|
+
...runtime,
|
|
75026
|
+
label: "Organization access"
|
|
75027
|
+
});
|
|
74951
75028
|
let orgId = explicit ?? (yield* readOrganizationSelection(config, session.authUserId));
|
|
74952
75029
|
if (orgId === null) {
|
|
74953
|
-
const runtime = yield* CliRuntime;
|
|
74954
75030
|
if (!runtime.tty || runtime.ci || runtime.mode === "json" || organizations.length === 0) return yield* inputRequired("Provide --org or select a read default with org use.");
|
|
74955
75031
|
orgId = yield* Prompt.select({
|
|
74956
75032
|
message: "Organization",
|
|
@@ -74973,7 +75049,11 @@ const resolvePermissionScope = (config, email, explicit) => Effect.gen(function*
|
|
|
74973
75049
|
const execute$44 = (config, input) => Effect.gen(function* () {
|
|
74974
75050
|
const explicit = yield* explicitOrganization$1(input.orgs);
|
|
74975
75051
|
const { orgId, organization, permissions } = yield* resolvePermissionScope(config, input.email, explicit);
|
|
74976
|
-
const
|
|
75052
|
+
const runtime = yield* CliRuntime;
|
|
75053
|
+
const result = yield* withWaiting(Effect.promise((signal) => permissions.list({ signal })).pipe(Effect.flatMap(resultValue)), {
|
|
75054
|
+
...runtime,
|
|
75055
|
+
label: "Permission list"
|
|
75056
|
+
});
|
|
74977
75057
|
return {
|
|
74978
75058
|
data: { permissions: result },
|
|
74979
75059
|
lines: permissionListLines(orgId, result, organization.name)
|
|
@@ -75006,7 +75086,11 @@ const execute$43 = (config, input) => Effect.gen(function* () {
|
|
|
75006
75086
|
const explicit = yield* explicitOrganization$1(input.orgs);
|
|
75007
75087
|
const permissionId = yield* readPermissionId(input.permissionId);
|
|
75008
75088
|
const { orgId, permissions } = yield* resolvePermissionScope(config, input.email, explicit);
|
|
75009
|
-
const
|
|
75089
|
+
const runtime = yield* CliRuntime;
|
|
75090
|
+
const permission = yield* withWaiting(Effect.promise((signal) => permissions.get(permissionId, { signal })).pipe(Effect.flatMap(resultValue)), {
|
|
75091
|
+
...runtime,
|
|
75092
|
+
label: "Permission read"
|
|
75093
|
+
});
|
|
75010
75094
|
if (permission === null) return yield* notFound();
|
|
75011
75095
|
if (permission.permissionId !== permissionId || permission.orgId !== orgId) return yield* new CliFailure({
|
|
75012
75096
|
code: "INVALID_INPUT",
|
|
@@ -78745,13 +78829,19 @@ const command$23 = Command.make("list", { email: emailFlag$9 }, ({ email }) => r
|
|
|
78745
78829
|
}, execute$21)).pipe(Command.annotate(CliCommandMetadata, metadata$12(CAPXUL_OPERATIONS.org.list)), Command.withDescription("List current Organization access"));
|
|
78746
78830
|
//#endregion
|
|
78747
78831
|
//#region src/commands/org/subcommands/me/execute.ts
|
|
78748
|
-
const perform$6 = (scoped, organizationId, organization) => Effect.
|
|
78749
|
-
|
|
78750
|
-
|
|
78751
|
-
|
|
78752
|
-
|
|
78753
|
-
|
|
78754
|
-
}
|
|
78832
|
+
const perform$6 = (scoped, organizationId, organization) => Effect.gen(function* () {
|
|
78833
|
+
const runtime = yield* CliRuntime;
|
|
78834
|
+
return yield* withWaiting(Effect.promise((signal) => scoped.me({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((member) => ({
|
|
78835
|
+
data: {
|
|
78836
|
+
organizationId,
|
|
78837
|
+
member
|
|
78838
|
+
},
|
|
78839
|
+
lines: [...organizationIdentityLines(organization), ...organizationMeLines(member)]
|
|
78840
|
+
}))), {
|
|
78841
|
+
...runtime,
|
|
78842
|
+
label: "Organization membership"
|
|
78843
|
+
});
|
|
78844
|
+
});
|
|
78755
78845
|
const execute$20 = (config, input) => readOrganization(config, "me", input, {
|
|
78756
78846
|
kind: "scoped",
|
|
78757
78847
|
run: ({ scoped, organizationId, organization }) => perform$6(scoped(), organizationId, organization)
|
|
@@ -78765,7 +78855,11 @@ const command$22 = Command.make("me", scoped, ({ email, orgs }) => read(CAPXUL_O
|
|
|
78765
78855
|
//#endregion
|
|
78766
78856
|
//#region src/commands/org/subcommands/member/get/execute.ts
|
|
78767
78857
|
const perform$5 = (scoped, organizationId, organization, selectedAccountId) => Effect.gen(function* () {
|
|
78768
|
-
const
|
|
78858
|
+
const runtime = yield* CliRuntime;
|
|
78859
|
+
const members = yield* withWaiting(Effect.promise((signal) => scoped.members({ signal })).pipe(Effect.flatMap(resultValue)), {
|
|
78860
|
+
...runtime,
|
|
78861
|
+
label: "Organization members"
|
|
78862
|
+
});
|
|
78769
78863
|
let accountId = selectedAccountId;
|
|
78770
78864
|
if (accountId === null) {
|
|
78771
78865
|
const choices = members.flatMap((member) => member.accountId === null ? [] : [{
|
|
@@ -78813,17 +78907,23 @@ const command$21 = Command.make("get", {
|
|
|
78813
78907
|
}, execute$19, Option.isSome(accountId) ? { accountId: accountId.value } : {})).pipe(Command.annotate(CliCommandMetadata, metadata$12("org.member.get")), Command.withDescription("Read one member by exact Account ID"));
|
|
78814
78908
|
//#endregion
|
|
78815
78909
|
//#region src/commands/org/subcommands/member/list/execute.ts
|
|
78816
|
-
const perform$4 = (scoped, organizationId, organization) => Effect.
|
|
78817
|
-
|
|
78818
|
-
|
|
78819
|
-
|
|
78820
|
-
|
|
78821
|
-
|
|
78822
|
-
|
|
78823
|
-
|
|
78824
|
-
|
|
78825
|
-
|
|
78826
|
-
|
|
78910
|
+
const perform$4 = (scoped, organizationId, organization) => Effect.gen(function* () {
|
|
78911
|
+
const runtime = yield* CliRuntime;
|
|
78912
|
+
return yield* withWaiting(Effect.promise((signal) => scoped.members({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((members) => ({
|
|
78913
|
+
data: {
|
|
78914
|
+
organizationId,
|
|
78915
|
+
members
|
|
78916
|
+
},
|
|
78917
|
+
lines: [
|
|
78918
|
+
...organizationIdentityLines(organization),
|
|
78919
|
+
"Members",
|
|
78920
|
+
...members.length === 0 ? ["No members found."] : members.flatMap((member) => [...organizationMemberLines(member), ""])
|
|
78921
|
+
]
|
|
78922
|
+
}))), {
|
|
78923
|
+
...runtime,
|
|
78924
|
+
label: "Organization members"
|
|
78925
|
+
});
|
|
78926
|
+
});
|
|
78827
78927
|
const execute$18 = (config, input) => readOrganization(config, "member.list", input, {
|
|
78828
78928
|
kind: "scoped",
|
|
78829
78929
|
run: ({ scoped, organizationId, organization }) => perform$4(scoped(), organizationId, organization)
|
|
@@ -78843,17 +78943,23 @@ const command$19 = Command.make("member").pipe(Command.annotate(CliCommandMetada
|
|
|
78843
78943
|
]));
|
|
78844
78944
|
//#endregion
|
|
78845
78945
|
//#region src/commands/org/subcommands/members/execute.ts
|
|
78846
|
-
const perform$3 = (scoped, organizationId, organization) => Effect.
|
|
78847
|
-
|
|
78848
|
-
|
|
78849
|
-
|
|
78850
|
-
|
|
78851
|
-
|
|
78852
|
-
|
|
78853
|
-
|
|
78854
|
-
|
|
78855
|
-
|
|
78856
|
-
|
|
78946
|
+
const perform$3 = (scoped, organizationId, organization) => Effect.gen(function* () {
|
|
78947
|
+
const runtime = yield* CliRuntime;
|
|
78948
|
+
return yield* withWaiting(Effect.promise((signal) => scoped.members({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((members) => ({
|
|
78949
|
+
data: {
|
|
78950
|
+
organizationId,
|
|
78951
|
+
members
|
|
78952
|
+
},
|
|
78953
|
+
lines: [
|
|
78954
|
+
...organizationIdentityLines(organization),
|
|
78955
|
+
"Members",
|
|
78956
|
+
...members.length === 0 ? ["No members found."] : members.flatMap((member) => [...organizationMemberLines(member), ""])
|
|
78957
|
+
]
|
|
78958
|
+
}))), {
|
|
78959
|
+
...runtime,
|
|
78960
|
+
label: "Organization members"
|
|
78961
|
+
});
|
|
78962
|
+
});
|
|
78857
78963
|
const execute$17 = (config, input) => readOrganization(config, "members", input, {
|
|
78858
78964
|
kind: "scoped",
|
|
78859
78965
|
run: ({ scoped, organizationId, organization }) => perform$3(scoped(), organizationId, organization)
|